Merge stable version before large change #16

Merged
xeovalyte merged 28 commits from dev into main 2023-02-14 15:37:45 +01:00
4 changed files with 168 additions and 131 deletions
Showing only changes of commit a18491a1a2 - Show all commits

View File

@ -48,61 +48,61 @@ const users = ref([])
const messaging = ref(null) const messaging = ref(null)
onMounted(() => { onMounted(() => {
auth.value = getAuth() auth.value = getAuth()
if (process.client) { if (process.client) {
if ('serviceWorker' in navigator && window.isSecureContext) { if ('serviceWorker' in navigator && window.isSecureContext) {
Device.getInfo().then(info => { Device.getInfo().then(info => {
if (info.platform === 'web') registerSW() if (info.platform === 'web') registerSW()
}); });
}
}
onAuthStateChanged(auth.value, async (usr) => {
if (usr) {
user.value = usr
let docRef = doc(db, "users", user.value.uid);
let docSnap = await getDoc(docRef);
if (docSnap.exists()) {
const data = docSnap.data()
userData.value = data
getPersons(userData.value.relatiecodes)
} else {
setTimeout(() => window.location.reload(true), 1000)
} }
if (!userData.value.sendNews && route.path === '/news/newmessage') navigateTo('/')
if (!userData.value.admin && route.path.startsWith('/settings/admin')) navigateTo('/')
isAuthenticated.value = true
logDeviceInfo()
} else {
isAuthenticated.value = false
user.value = null
userData.value = null
userPersons.value = []
} }
onAuthStateChanged(auth.value, async (usr) => { userLoaded.value = true
if (usr) { })
user.value = usr
let docRef = doc(db, "users", user.value.uid);
let docSnap = await getDoc(docRef);
if (docSnap.exists()) {
const data = docSnap.data()
userData.value = data
getPersons(userData.value.relatiecodes)
} else {
setTimeout(() => window.location.reload(true), 1000)
}
if (!userData.value.sendNews && route.path === '/news/newmessage') navigateTo('/')
if (!userData.value.admin && route.path.startsWith('/settings/admin')) navigateTo('/')
isAuthenticated.value = true
logDeviceInfo()
} else {
isAuthenticated.value = false
user.value = null
userData.value = null
userPersons.value = []
}
userLoaded.value = true
})
}) })
const getPersons = async (persons) => { const getPersons = async (persons) => {
userPersons.value = []; userPersons.value = [];
for (let i = 0; i < persons.length; i++) { for (let i = 0; i < persons.length; i++) {
const docRef = doc(db, "ledenlijst", persons[i]); const docRef = doc(db, "ledenlijst", persons[i]);
const docSnap = await getDoc(docRef); const docSnap = await getDoc(docRef);
if (docSnap.exists()) { if (docSnap.exists()) {
userPersons.value.push(docSnap.data()) userPersons.value.push(docSnap.data())
}
} }
}
} }
const setupNotifications = () => { const setupNotifications = () => {
@ -173,7 +173,7 @@ const registerFCM = () => {
if (currentToken) { if (currentToken) {
console.log(currentToken) console.log(currentToken)
await useFetch('/api/subscribetotopic', { const { error} = await useFetch('/api/subscribetotopic', {
method: 'post', method: 'post',
body: { topic: 'all', registrationToken: currentToken } body: { topic: 'all', registrationToken: currentToken }
}) })
@ -183,6 +183,7 @@ const registerFCM = () => {
return toast.error('Error tijdens het registreren van push notifications') return toast.error('Error tijdens het registreren van push notifications')
} }
registrationToken.value = currentToken
console.log('Subscribed to topic!') console.log('Subscribed to topic!')
} else { } else {
// Show permission request UI // Show permission request UI
@ -220,7 +221,7 @@ const logDeviceInfo = async () => {
const ledenlijst = ref([]) const ledenlijst = ref([])
provide('firebase', { db, ledenlijst, isAuthenticated, user, userData, userPersons, auth, users, userAllPersons, getPersons, calEvents, news, registrationToken, contestTimes, competitors }) provide('firebase', { db, ledenlijst, isAuthenticated, user, userData, userPersons, auth, users, userAllPersons, getPersons, calEvents, news, registrationToken, contestTimes, competitors, registrationToken })
</script> </script>
<style scoped> <style scoped>

View File

@ -1,90 +1,90 @@
<template> <template>
<div class="flex flex-col gap-5 mx-auto p-2 w-full max-w-md"> <div class="flex flex-col gap-5 mx-auto p-2 w-full max-w-md">
<div> <div>
<h1 class="text-xl ml-2 font-bold">Info</h1> <h1 class="text-xl ml-2 font-bold">Info</h1>
<div class="container"> <div class="container">
<div class="item"> <div class="item">
Email: <b>{{ user.email }}</b> Email: <b>{{ user.email }}</b>
</div>
<div class="divider" />
<div class="item">
Personen: <b>{{ userPersons.map(a => a.fullName).join(', ')}}</b>
</div>
<div class="divider" />
<div class="item">
Groepen: <b>{{ groups.join(', ') }}</b>
</div>
<div v-if="userPersons.map(a => a.diploma).filter(n => n !== '').join('')" class="divider" />
<div v-if="userPersons.map(a => a.diploma).filter(n => n !== '').join('')" class="item">
Diploma: <b>{{ userPersons.map(a => a.diploma).filter(n => n !== '').join(', ')}}</b>
</div>
<div class="divider" />
<NuxtLink to="/settings/privacypolicy" class="item-hover py-2 rounded-t flex items-center">
<span>Privacybeleid</span>
<Icon class="ml-auto" size="2em" name="ion:arrow-forward"/>
</NuxtLink>
</div>
</div> </div>
<div> <div class="divider" />
<h1 class="text-xl ml-2 font-bold">Account</h1> <div class="item">
<div class="container"> Personen: <b>{{ userPersons.map(a => a.fullName).join(', ')}}</b>
<NuxtLink to="/settings/config/managerelatiecodes" class="item-hover py-2 rounded-t flex items-center">
<span>Beheer Personen</span>
<Icon class="ml-auto" size="2em" name="ion:arrow-forward"/>
</NuxtLink>
<div class="divider" />
<NuxtLink to="/settings/config/changepassword" class="item-hover py-2 flex items-center">
<span>Wachtwoord Wijzigen</span>
<Icon class="ml-auto" size="2em" name="ion:arrow-forward"/>
</NuxtLink>
<div class="divider" />
<NuxtLink to="/settings/config/changeemail" class="item-hover py-2 flex items-center">
<span>Email Wijzigen</span>
<Icon class="ml-auto" size="2em" name="ion:arrow-forward"/>
</NuxtLink>
<div class="divider" />
<div @click="logout" class="item-hover rounded-b flex items-center">
Uitloggen
</div>
</div>
</div> </div>
<div v-if="userData.admin"> <div class="divider" />
<h1 class="text-xl ml-2 font-bold">Admin</h1> <div class="item">
<div class="container"> Groepen: <b>{{ groups.join(', ') }}</b>
<NuxtLink to="/settings/admin/users" class="rounded-t item-hover py-2 flex items-center">
<span>Beheer gebruikers</span>
<Icon class="ml-auto" size="2em" name="ion:arrow-forward"/>
</NuxtLink>
<div class="divider" />
<NuxtLink to="/settings/admin/ledenlijst" class="rounded-b item-hover py-2 flex items-center">
<span>Ledenlijst</span>
<Icon class="ml-auto" size="2em" name="ion:arrow-forward"/>
</NuxtLink>
</div>
</div> </div>
<div> <div v-if="userPersons.map(a => a.diploma).filter(n => n !== '').join('')" class="divider" />
<h2 class="text-center font-bold">Gemaakt door <u><a href="https://xeovalyte.com/">Timo Boomers</a></u></h2> <div v-if="userPersons.map(a => a.diploma).filter(n => n !== '').join('')" class="item">
Diploma: <b>{{ userPersons.map(a => a.diploma).filter(n => n !== '').join(', ')}}</b>
</div> </div>
<div class="divider" />
<NuxtLink to="/settings/moreinfo" class="item-hover py-2 rounded-t flex items-center">
<span>Meer Informatie</span>
<Icon class="ml-auto" size="2em" name="ion:arrow-forward"/>
</NuxtLink>
</div>
</div> </div>
<div>
<h1 class="text-xl ml-2 font-bold">Account</h1>
<div class="container">
<NuxtLink to="/settings/config/managerelatiecodes" class="item-hover py-2 rounded-t flex items-center">
<span>Beheer Personen</span>
<Icon class="ml-auto" size="2em" name="ion:arrow-forward"/>
</NuxtLink>
<div class="divider" />
<NuxtLink to="/settings/config/changepassword" class="item-hover py-2 flex items-center">
<span>Wachtwoord Wijzigen</span>
<Icon class="ml-auto" size="2em" name="ion:arrow-forward"/>
</NuxtLink>
<div class="divider" />
<NuxtLink to="/settings/config/changeemail" class="item-hover py-2 flex items-center">
<span>Email Wijzigen</span>
<Icon class="ml-auto" size="2em" name="ion:arrow-forward"/>
</NuxtLink>
<div class="divider" />
<div @click="logout" class="item-hover rounded-b flex items-center">
Uitloggen
</div>
</div>
</div>
<div v-if="userData.admin">
<h1 class="text-xl ml-2 font-bold">Admin</h1>
<div class="container">
<NuxtLink to="/settings/admin/users" class="rounded-t item-hover py-2 flex items-center">
<span>Beheer gebruikers</span>
<Icon class="ml-auto" size="2em" name="ion:arrow-forward"/>
</NuxtLink>
<div class="divider" />
<NuxtLink to="/settings/admin/ledenlijst" class="rounded-b item-hover py-2 flex items-center">
<span>Ledenlijst</span>
<Icon class="ml-auto" size="2em" name="ion:arrow-forward"/>
</NuxtLink>
</div>
</div>
<div>
<h2 class="text-center font-bold">Gemaakt door <u><a href="https://xeovalyte.com/">Timo Boomers</a></u></h2>
</div>
</div>
</template> </template>
<script setup> <script setup>
import { signOut } from "firebase/auth"; import { signOut } from "firebase/auth";
definePageMeta({ definePageMeta({
title: 'Settings' title: 'Settings'
}) })
const { auth, userData, userPersons, user } = inject('firebase') const { auth, userData, userPersons, user } = inject('firebase')
const groups = computed(() => { const groups = computed(() => {
return [...new Set(userPersons.value.map(a => a.groups.join()).join().split(','))] return [...new Set(userPersons.value.map(a => a.groups.join()).join().split(','))]
}) })
const logout = () => { const logout = () => {
signOut(auth.value) signOut(auth.value)
.catch((error) => { .catch((error) => {
console.log(error) console.log(error)
}) })
} }
</script> </script>

View File

@ -0,0 +1,36 @@
<template>
<div class="flex flex-col gap-5 mx-auto p-2 w-full max-w-md text-default text-sm">
<div>
<h1 class="text-xl ml-2 font-bold">Privacybeleid</h1>
<div class="container">
<div class="item">
<h2 class="font-bold">Privacy</h2>
Gegevens binnen deze app worden gebruikt voor de interne organisatie. Via Google analytics wordt bijgehouden welke schermen het meest worden gebruikt. Daarnaast maken wij gebruik van Firebase voor het anoniem verzamelen van gegevens omtrent crashes, bugs en het gebruik van de app.
<h2 class="font-bold mt-5">AVG</h2>
Sinds 25 mei 2018 is de Algemene verordening gegevensbescherming (AVG) van toepassing waardoor elke vereniging helder moet maken wat zij doen om de privacy van persoonsgegevens te waarborgen. U kunt <a href="https://www.reddingsbrigadewaddinxveen.nl/Doc/201809%20-%20Privacyverklaring%20WRB.pdf" class="underline">hier</a> onze privacy verklaring vinden.
</div>
</div>
</div>
<div>
<h1 class="text-xl ml-2 font-bold"></h1>
<div class="container">
<div class="item break-words ">
Registration Token: <b>{{ registrationToken }}</b>
</div>
<div class="divider" />
<div class="item break-words ">
User ID: <b>{{ userData.id }}</b>
</div>
</div>
</div>
</div>
</template>
<script setup>
definePageMeta({
title: 'Meer Informatie',
key: 'back'
})
const { registrationToken, userData } = inject('firebase')
</script>

View File

@ -1,23 +1,23 @@
<template> <template>
<div class="flex flex-col gap-5 mx-auto p-2 w-full max-w-md text-default text-sm"> <div class="flex flex-col gap-5 mx-auto p-2 w-full max-w-md text-default text-sm">
<h2 class="text-xl font-bold"> <h2 class="text-xl font-bold">
Privacy Privacy
</h2> </h2>
<p> <p>
Gegevens binnen deze app worden gebruikt voor de interne organisatie. Via Google analytics wordt bijgehouden welke schermen het meest worden gebruikt. Daarnaast maken wij gebruik van Firebase voor het anoniem verzamelen van gegevens omtrent crashes, bugs en het gebruik van de app. Gegevens binnen deze app worden gebruikt voor de interne organisatie. Via Google analytics wordt bijgehouden welke schermen het meest worden gebruikt. Daarnaast maken wij gebruik van Firebase voor het anoniem verzamelen van gegevens omtrent crashes, bugs en het gebruik van de app.
</p> </p>
<h2 class="text-xl font-bold"> <h2 class="text-xl font-bold">
AVG AVG
</h2> </h2>
<p> <p>
Sinds 25 mei 2018 is de Algemene verordening gegevensbescherming (AVG) van toepassing waardoor elke vereniging helder moet maken wat zij doen om de privacy van persoonsgegevens te waarborgen. U kunt <a href="https://www.reddingsbrigadewaddinxveen.nl/Doc/201809%20-%20Privacyverklaring%20WRB.pdf" class="underline">hier</a> onze privacy verklaring vinden. Sinds 25 mei 2018 is de Algemene verordening gegevensbescherming (AVG) van toepassing waardoor elke vereniging helder moet maken wat zij doen om de privacy van persoonsgegevens te waarborgen. U kunt <a href="https://www.reddingsbrigadewaddinxveen.nl/Doc/201809%20-%20Privacyverklaring%20WRB.pdf" class="underline">hier</a> onze privacy verklaring vinden.
</p> </p>
</div> </div>
</template> </template>
<script setup> <script setup>
definePageMeta({ definePageMeta({
title: 'Privacybeleid', title: 'Privacybeleid',
key: 'back' key: 'back'
}) })
</script> </script>