diff --git a/src/model/UserStore.ts b/src/model/UserStore.ts
index ccedcf45..dec6ac3d 100755
--- a/src/model/UserStore.ts
+++ b/src/model/UserStore.ts
@@ -95,6 +95,7 @@ export interface IUserProfile {
// in memory
asked_friends: any[]
asked_groups: any[]
+ refused_groups: any[]
list_usersgroup?: IFriends[]
}
@@ -179,4 +180,5 @@ export interface IUserState {
usersList?: IUserFields[]
countusers?: number
lastparamquery?: any
+ updateTables?: boolean
}
diff --git a/src/rootgen/admin/userPanel/userPanel.ts b/src/rootgen/admin/userPanel/userPanel.ts
index f75b022c..1d909c64 100755
--- a/src/rootgen/admin/userPanel/userPanel.ts
+++ b/src/rootgen/admin/userPanel/userPanel.ts
@@ -17,6 +17,7 @@ import { useNotifStore } from '@store/NotifStore'
import { INotif } from 'model'
import { IUserFields } from '@model/UserStore'
import { useI18n } from '@/boot/i18n'
+import MixinUsers from '@/mixins/mixin-users'
export default defineComponent({
name: 'userPanel',
@@ -57,6 +58,8 @@ export default defineComponent({
const userStore = useUserStore()
const notifStore = useNotifStore()
+ const { getMyUsername } = MixinUsers()
+
async function mounted() {
//
search.value = tools.getCookie(tools.COOK_SEARCH + 'searchpanel')
@@ -141,6 +144,7 @@ export default defineComponent({
listnotif,
listnotiftype,
listnotifid,
+ getMyUsername,
}
}
})
diff --git a/src/rootgen/admin/userPanel/userPanel.vue b/src/rootgen/admin/userPanel/userPanel.vue
index 5fd64d2c..40b06849 100755
--- a/src/rootgen/admin/userPanel/userPanel.vue
+++ b/src/rootgen/admin/userPanel/userPanel.vue
@@ -104,6 +104,11 @@
da: {{ myuser.username_who_report }}
in Data: {{ tools.getstrshortDateTime(myuser.date_report) }}
+
+
+
+
+
diff --git a/src/statics/lang/it.js b/src/statics/lang/it.js
index 4fa634d9..dd6690e5 100755
--- a/src/statics/lang/it.js
+++ b/src/statics/lang/it.js
@@ -200,7 +200,8 @@ const msg_it = {
domanda_removegroup: 'Rimuovere dal Gruppo {username} ?',
removedfriend: 'Rimosso dalla lista di Amici',
removedgroup: 'Rimosso dal Gruppo',
- refusedgroup: 'Rifiutato richiesta di entrare nel Gruppo',
+ refusedgroup: 'Rifiutato a {username} la richiesta di entrare nel Gruppo',
+ youarerefusedgroup: 'Ti รจ stato rifiutata la richiesta di entrare in questo Gruppo (per info chiedi all\'amministratore del gruppo)',
deletedgroup: 'Gruppo Eliminato',
domanda_addtofriend: 'Aggiungere agli amici {username}?',
domanda_addtogroup: 'Aggiungi {username} al gruppo {groupname}?',
@@ -214,6 +215,7 @@ const msg_it = {
askedtogroup: 'Chiesto l\'invito al Gruppo {groupname}',
domanda_revoke_friend: 'Revocare la richiesta di Amicizia a {username}?',
domanda_revoke_group: 'Revocare la richiesta al gruppo {groupname}?',
+ domanda_refuse_group: 'Rifiutare la richiesta di {username} per entrare nel gruppo {groupname}?',
revoketofriend: 'Revocato la richiesta di Amicizia a {username}',
revoketogroup: 'Revocato la richiesta d\'invito al gruppo {groupname}',
domanda_cancel_req_friend: 'Annullare la richiesta di Amicizia a {username}?',
@@ -223,10 +225,12 @@ const msg_it = {
domanda_rejectedtrust: 'Rifiutare la Fiducia a {username}?',
rejected: 'Rifiutato la Fiducia',
domanda_blockuser: 'Bloccare {username}?',
+ domanda_unblockuser: 'Sbloccare {username}?',
domanda_reportuser: 'Segnalare l\'utente {username}?',
domanda_blockgroup: 'Bloccare il gruppo {groupname}?',
reporteduser: 'Utente Segnalato',
blockedfriend: 'Utente Bloccato',
+ unblockedfriend: 'Utente Sbloccato',
domanda: 'Domanda',
},
components: {
@@ -1017,6 +1021,7 @@ const msg_it = {
remove_from_mygroups: 'Rimuovi dal Gruppo',
block_group: 'Blocca Gruppo',
cancel_ask_group: 'Annulla la richiesta',
+ refuse_ask_group: 'Rifiuta la richiesta (con avviso)',
cancel_ask_group_short: 'Annulla richiesta',
refuse_ask_group_short: 'Rifiuta la richiesta',
pwd: 'Password per accedere',
diff --git a/src/store/Modules/tools.ts b/src/store/Modules/tools.ts
index 6643ca15..a38d4976 100644
--- a/src/store/Modules/tools.ts
+++ b/src/store/Modules/tools.ts
@@ -4672,6 +4672,22 @@ export const tools = {
})
},
+ unblockUser($q: any, username: string, usernameDest: string) {
+ const userStore = useUserStore()
+ $q.dialog({
+ message: t('db.domanda_unblockuser', { username: usernameDest }),
+ ok: { label: t('dialog.yes'), push: true },
+ cancel: { label: t('dialog.cancel') },
+ title: t('db.domanda')
+ }).onOk(() => {
+ userStore.setFriendsCmd($q, t, username, usernameDest, shared_consts.FRIENDSCMD.UNBLOCK_USER, null).then((res: any) => {
+ if (res) {
+ tools.showPositiveNotif($q, t('db.unblockedfriend'))
+ }
+ })
+ })
+ },
+
reportUser($q: any, username: string, usernameDest: string) { // Segnala Profilo
const userStore = useUserStore()
$q.dialog({
@@ -4740,7 +4756,7 @@ export const tools = {
const userStore = useUserStore()
const notifStore = useNotifStore()
$q.dialog({
- message: t('db.domanda_revoke_group', { groupname: groupnameDest }),
+ message: t('db.domanda_refuse_group', { username, groupname: groupnameDest }),
ok: { label: t('dialog.yes'), push: true },
cancel: { label: t('dialog.cancel') },
title: t('db.domanda')
@@ -4750,7 +4766,7 @@ export const tools = {
if (res) {
notifStore.updateNotification = true
userStore.my.profile.asked_groups = userStore.my.profile.asked_groups.filter((rec: IMyGroup) => rec.groupname !== groupnameDest)
- tools.showPositiveNotif($q, t('db.refusedgroup'))
+ tools.showPositiveNotif($q, t('db.refusedgroup', { username }))
}
})
})
@@ -5526,6 +5542,7 @@ export const tools = {
userStore.my.profile.list_usersgroup = ris.listUsersGroup ? ris.listUsersGroup : []
userStore.groups = ris.listgroups ? ris.listgroups : []
userStore.my.profile.asked_groups = ris.listSentRequestGroups ? ris.listSentRequestGroups : []
+ userStore.my.profile.refused_groups = ris.listRefusedGroups ? ris.listRefusedGroups : []
return [{ userId: userStore.my._id }]
}
})
diff --git a/src/store/NotifStore.ts b/src/store/NotifStore.ts
index fa677b98..dc6f2ec7 100755
--- a/src/store/NotifStore.ts
+++ b/src/store/NotifStore.ts
@@ -60,9 +60,14 @@ export const useNotifStore = defineStore('NotifStore', {
// just to give more context for this demo.
const countNow = this.getnumNotifUnread()
- // @ts-ignore
- await navigator.setAppBadge(countNow)
- .catch((error: any) => { /* ... */ });
+ try {
+ // @ts-ignore
+ await navigator.setAppBadge(countNow)
+ .catch((error: any) => { /* ... */
+ });
+ }catch (e) {
+
+ }
},
setAllRead(username: string) {
diff --git a/src/store/UserStore.ts b/src/store/UserStore.ts
index 850bdd38..8ef041ef 100755
--- a/src/store/UserStore.ts
+++ b/src/store/UserStore.ts
@@ -56,6 +56,7 @@ export const DefaultUser: IUserFields = {
manage_mygroups: [],
asked_friends: [],
asked_groups: [],
+ refused_groups: [],
notifs: [],
notif_idCities: [],
notif_provinces: [],
@@ -107,6 +108,7 @@ export const DefaultProfile: IUserProfile = {
manage_mygroups: [],
asked_friends: [],
asked_groups: [],
+ refused_groups: [],
notifs: [],
notif_idCities: [],
notif_provinces: [],
@@ -137,6 +139,7 @@ export const useUserStore = defineStore('UserStore', {
usersList: [],
countusers: 0,
lastparamquery: {},
+ updateTables: false,
}),
getters: {
@@ -220,6 +223,13 @@ export const useUserStore = defineStore('UserStore', {
return false
},
+ IsRefusedGroupByGroupname(groupname: string): boolean {
+ if (this.my.profile.refused_groups)
+ return this.my.profile.refused_groups.findIndex((rec: IMyGroup) => rec.groupname === groupname) >= 0
+ else
+ return false
+ },
+
getUserByUsername(username: string): IUserFields | null {
// Check if is this User!
if (this.my.username === username) return this.my
@@ -538,6 +548,7 @@ export const useUserStore = defineStore('UserStore', {
this.my.profile.manage_mygroups = []
this.my.profile.asked_friends = []
this.my.profile.asked_groups = []
+ this.my.profile.refused_groups = []
}
this.isAdmin = tools.isBitActive(this.my.perm, shared_consts.Permissions.Admin.value)
@@ -765,7 +776,7 @@ export const useUserStore = defineStore('UserStore', {
this.updateLocalStorage(myuser)
- globalStore.loadSite()
+ // globalStore.loadSite()
}
}
@@ -1108,6 +1119,7 @@ export const useUserStore = defineStore('UserStore', {
async setFriendsCmd($q: any, t: any, usernameOrig: string, usernameDest: string, cmd: number, value: any) {
return Api.SendReq('/users/friends/cmd', 'POST', { usernameOrig, usernameDest, cmd, value })
.then((res) => {
+ this.updateTables = true
return res.data
}).catch((error) => {
tools.showNegativeNotif($q, t('db.recfailed'))
@@ -1119,6 +1131,7 @@ export const useUserStore = defineStore('UserStore', {
async setGroupsCmd($q: any, t: any, usernameOrig: string, groupnameDest: string, cmd: number, value: any) {
return Api.SendReq('/users/groups/cmd', 'POST', { usernameOrig, groupnameDest, cmd, value })
.then((res) => {
+ this.updateTables = true
return res.data
}).catch((error) => {
tools.showNegativeNotif($q, t('db.recfailed'))
diff --git a/src/store/globalStore.ts b/src/store/globalStore.ts
index 97d1ab8c..89f45e43 100644
--- a/src/store/globalStore.ts
+++ b/src/store/globalStore.ts
@@ -724,7 +724,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
},
async loadAfterLogin() {
- // console.log('loadAfterLogin')
+ console.log('loadAfterLogin')
this.clearDataAfterLoginOnlyIfActiveConnection()
let isok = false
diff --git a/src/views/user/mygroup/mygroup.ts b/src/views/user/mygroup/mygroup.ts
index 87ed7020..c1e26f2c 100755
--- a/src/views/user/mygroup/mygroup.ts
+++ b/src/views/user/mygroup/mygroup.ts
@@ -168,6 +168,13 @@ export default defineComponent({
}
}
+ function extraparams_refused() {
+ return {
+ querytype: shared_consts.QUERYTYPE_REFUSED_USER_GRP,
+ myid: mygrp.value ? mygrp.value._id : '',
+ }
+ }
+
function numUsers() {
return users_in_group.value ? users_in_group.value.length : 0
}
@@ -206,6 +213,7 @@ export default defineComponent({
colmyUserGroup,
extraparams,
extraparams_rich,
+ extraparams_refused,
tab,
tabgrp,
numUsers,
diff --git a/src/views/user/mygroup/mygroup.vue b/src/views/user/mygroup/mygroup.vue
index 42dfdccf..6784531f 100755
--- a/src/views/user/mygroup/mygroup.vue
+++ b/src/views/user/mygroup/mygroup.vue
@@ -26,9 +26,20 @@
{{ mygrp.groupname }}
+
+ {{ $t('db.youarerefusedgroup') }}
+
+
+
+
+
@@ -227,6 +239,37 @@
:visufind="costanti.REQ_ADD_USER_TO_GROUP"
>
+
+
+
+
+
+