Notification New Group
This commit is contained in:
@@ -866,6 +866,12 @@ export const shared_consts = {
|
||||
STATUS_GROUPS_REFUSED: 4,
|
||||
},
|
||||
|
||||
GroupsNotifs: {
|
||||
STATUS_GROUPS_NEW: 1,
|
||||
STATUS_GROUPS_ACCEPTED: 2,
|
||||
STATUS_GROUPS_REFUSED: 4,
|
||||
},
|
||||
|
||||
TypeNotifs: {
|
||||
TYPEDIR_BACHECA: 1,
|
||||
ID_BACHECA_NEW_GOOD: 1,
|
||||
@@ -1007,7 +1013,7 @@ export const shared_consts = {
|
||||
directory: 3,
|
||||
},
|
||||
{
|
||||
value: 1, //
|
||||
value: 1, // STATUS_GROUPS_NEW
|
||||
labeltrans: 'notifsid.groups_new',
|
||||
directory: 4,
|
||||
},
|
||||
|
||||
@@ -30,6 +30,13 @@ export default defineComponent({
|
||||
//
|
||||
}
|
||||
|
||||
function getnotifbydir(dir: string) {
|
||||
const myrec = profile.value.notifs.find((rec: any) => rec.dir === dir)
|
||||
if (myrec) {
|
||||
return myrec.value
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(mounted)
|
||||
|
||||
return {
|
||||
@@ -41,6 +48,7 @@ export default defineComponent({
|
||||
globalStore,
|
||||
toolsext,
|
||||
profile,
|
||||
getnotifbydir,
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
:label="t(rec.labeltrans)"
|
||||
>
|
||||
<q-card>
|
||||
<q-card-section>
|
||||
<q-card-section v-if="!!rec">
|
||||
<div>{{ t(rec.descr) }}</div>
|
||||
|
||||
<CMyFieldDb
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
<div v-if="rec.value === shared_consts.TypeNotifs.TYPEDIR_BACHECA">
|
||||
<div
|
||||
v-if="tools.isBitActive(profile.notifs.find((rec) => rec.dir === shared_consts.TypeNotifs.TYPEDIR_BACHECA).value, shared_consts.UsersNotif.NEW_ADV_SECTOR)">
|
||||
v-if="tools.isBitActive(getnotifbydir(shared_consts.TypeNotifs.TYPEDIR_BACHECA), shared_consts.UsersNotif.NEW_ADV_SECTOR)">
|
||||
<CMyFieldDb
|
||||
:title="$t('sectors.sector_general')"
|
||||
table="users"
|
||||
@@ -51,7 +51,7 @@
|
||||
</CMyFieldDb>
|
||||
</div>
|
||||
<div
|
||||
v-if="tools.isBitActive(profile.notifs.find((rec) => rec.dir === shared_consts.TypeNotifs.TYPEDIR_BACHECA).value, shared_consts.UsersNotif.NEW_ADV_REGION)">
|
||||
v-if="tools.isBitActive(getnotifbydir(shared_consts.TypeNotifs.TYPEDIR_BACHECA), shared_consts.UsersNotif.NEW_ADV_REGION)">
|
||||
<CMyFieldDb
|
||||
:title="$t('notifs.select_regions')"
|
||||
table="users"
|
||||
@@ -62,7 +62,7 @@
|
||||
</CMyFieldDb>
|
||||
</div>
|
||||
<div
|
||||
v-if="tools.isBitActive(profile.notifs.find((rec) => rec.dir === shared_consts.TypeNotifs.TYPEDIR_BACHECA).value, shared_consts.UsersNotif.NEW_ADV_PROVINCE)">
|
||||
v-if="tools.isBitActive(getnotifbydir(shared_consts.TypeNotifs.TYPEDIR_BACHECA), shared_consts.UsersNotif.NEW_ADV_PROVINCE)">
|
||||
<CMyFieldDb
|
||||
:title="$t('notifs.select_provinces')"
|
||||
table="users"
|
||||
|
||||
@@ -1034,9 +1034,10 @@ export const useUserStore = defineStore('UserStore', {
|
||||
|
||||
},
|
||||
|
||||
async loadGroup(groupname: string) {
|
||||
async loadGroup(groupname: string, idnotif: string) {
|
||||
const data = {
|
||||
groupname
|
||||
groupname,
|
||||
idnotif,
|
||||
}
|
||||
|
||||
return Api.SendReq('/mygroup/load', 'POST', data)
|
||||
|
||||
@@ -19,6 +19,7 @@ import { costanti } from '@costanti'
|
||||
import { IFriends, IMyGroup, ISearchList, IUserFields } from 'model'
|
||||
import { shared_consts } from '@/common/shared_vuejs'
|
||||
import { colmyUserPeople, colmyUserGroup } from '@store/Modules/fieldsTable'
|
||||
import { useNotifStore } from '@store/NotifStore'
|
||||
|
||||
|
||||
export default defineComponent({
|
||||
@@ -27,6 +28,7 @@ export default defineComponent({
|
||||
props: {},
|
||||
setup() {
|
||||
const userStore = useUserStore()
|
||||
const notifStore = useNotifStore()
|
||||
const $route = useRoute()
|
||||
const $q = useQuasar()
|
||||
const { t } = useI18n()
|
||||
@@ -34,6 +36,7 @@ export default defineComponent({
|
||||
const animation = ref('fade')
|
||||
|
||||
const groupname = computed(() => $route.params.groupname ? $route.params.groupname.toString() : '')
|
||||
const idnotif = computed(() => $route.query.idnotif ? $route.query.idnotif.toString() : '')
|
||||
|
||||
const filtroutente = ref(<any[]>[])
|
||||
const showPic = ref(false)
|
||||
@@ -62,9 +65,10 @@ export default defineComponent({
|
||||
async function loadGroup() {
|
||||
// Carica il profilo di quest'utente
|
||||
if (groupname.value) {
|
||||
await userStore.loadGroup(groupname.value).then((ris) => {
|
||||
await userStore.loadGroup(groupname.value, idnotif.value).then((ris) => {
|
||||
if (ris) {
|
||||
mygrp.value = ris.mygroup
|
||||
notifStore.setAsRead(idnotif.value)
|
||||
users_in_group.value = ris.users_in_group
|
||||
} else {
|
||||
mygrp.value = null
|
||||
|
||||
Reference in New Issue
Block a user