Notifiche - Tutti - non letti

This commit is contained in:
Paolo Arena
2022-07-21 00:20:48 +02:00
parent 7006d62cae
commit 6ae82f14cc
41 changed files with 640 additions and 135 deletions

View File

@@ -78,6 +78,8 @@ export default defineComponent({
const myrec = msgchat(username)
// Get msg for this chat
const lastdata: any = (myrec) ? myrec.lastdataread : tools.getLastDateReadReset()
if (!lastdata)
return null
console.table(myrec)
let mydate = ''
if (!tools.isIsoDate(lastdata))

View File

@@ -80,7 +80,7 @@ export default defineComponent({
function loadProfile() {
// Carica il profilo di quest'utente
userStore.loadUserProfile(userStore.my.username).then((ris) => {
userStore.loadUserProfile({username: userStore.my.username}).then((ris) => {
myuser.value = ris
})
}

View File

@@ -21,6 +21,7 @@ import { IMyGroup, IUserFields } from 'model'
import { shared_consts } from '@/common/shared_vuejs'
import { static_data } from '@/db/static_data'
import { fieldsTable } from '@store/Modules/fieldsTable'
import { useNotifStore } from '@store/NotifStore'
import MixinUsers from '@/mixins/mixin-users'
@@ -43,6 +44,7 @@ export default defineComponent({
const animation = ref('fade')
const username = computed(() => $route.params.username ? $route.params.username.toString() : userStore.my.username)
const idnotif = computed(() => $route.query.idnotif ? $route.query.idnotif.toString() : '')
const filtroutente = ref(<any[]>[])
const showPic = ref(false)
@@ -52,6 +54,8 @@ export default defineComponent({
const actualcard = ref('mygoods')
const notifStore = useNotifStore()
const mycards = computed(() => {
return costanti.MAINCARDS.filter((rec: any) => rec.table)
})
@@ -70,10 +74,11 @@ export default defineComponent({
async function loadProfile() {
// Carica il profilo di quest'utente
if (username.value) {
await userStore.loadUserProfile(username.value).then((ris) => {
await userStore.loadUserProfile({ username: username.value, idnotif: idnotif.value }).then((ris) => {
myuser.value = ris
if (myuser.value) {
filtroutente.value = [{ userId: myuser.value._id }]
notifStore.setAsRead(idnotif.value)
try {
listgroupsfiltered.value = globalStore.mygroups.filter((grp: IMyGroup) => myuser.value!.profile.mygroups.findIndex((rec: IMyGroup) => rec.groupname === grp.groupname) >= 0)
@@ -97,6 +102,7 @@ export default defineComponent({
})
function mounted() {
console.log('idnotif', idnotif)
loadProfile()
}
@@ -168,6 +174,7 @@ export default defineComponent({
actualcard,
caricato,
listgroupsfiltered,
idnotif,
}
}
})

View File

View File

@@ -0,0 +1,30 @@
import { computed, defineComponent, onMounted, ref, watch } from 'vue'
import { useUserStore } from '@store/UserStore'
import { useRoute, useRouter } from 'vue-router'
import { useI18n } from '@/boot/i18n'
import { useQuasar } from 'quasar'
import { CMyCardPopup } from '@/components/CMyCardPopup'
import { CMyPage } from '@/components/CMyPage'
import { CNotifSettings } from '@/components/CNotifSettings'
import { toolsext } from '@store/Modules/toolsext'
import { tools } from '@store/Modules/tools'
import { shared_consts } from '@src/common/shared_vuejs'
export default defineComponent({
name: 'usernotifs',
components: { CMyCardPopup, CNotifSettings, CMyPage },
props: {},
setup() {
const userStore = useUserStore()
const $route = useRoute()
const $q = useQuasar()
const { t } = useI18n()
return {
t,
toolsext,
tools,
shared_consts,
}
}
})

View File

@@ -0,0 +1,21 @@
<template>
<CMyPage :title="$t('pages.notifs')"
imgbackground="images/calendario_eventi.jpg"
sizes="max-height: 120px" styleadd="bottom: -20px !important;">
<CNotifSettings>
</CNotifSettings>
<br>
</CMyPage>
</template>
<script lang="ts" src="./usernotifs.ts">
</script>
<style lang="scss" scoped>
@import './usernotifs.scss';
</style>