+
username cercato: "{{ search }}"
@@ -92,6 +92,19 @@
+
+
+ {{ $t('db.reporteduser') }}
+ da: {{ myuser.username_who_report }}
+ in Data: {{ tools.getstrshortDateTime(myuser.date_report) }}
+
+
+
+
@@ -117,6 +130,7 @@
+
diff --git a/src/router/permission.ts b/src/router/permission.ts
index ceaf04de..dfb53f84 100644
--- a/src/router/permission.ts
+++ b/src/router/permission.ts
@@ -4,6 +4,7 @@ import { useProgressBar } from '@store/Modules/ProgressBar'
import { tools } from '@store/Modules/tools'
import { useUserStore } from '@store/UserStore'
import { useRouter } from 'vue-router'
+import { useNotifStore } from '@store/NotifStore'
const progressBar = useProgressBar()
@@ -17,141 +18,6 @@ const getRouteData = async (to: any) => {
const $router = useRouter()
// router().beforeEach(async (to: IMyRoute, from: IMyRoute, next) => {
-$router.beforeEach(async (to, from, next) => {
- const userStore = useUserStore()
- const globalStore = useGlobalStore()
-
- try {
- if (globalStore) {
- if (!globalStore.finishLoading) {
- let eseguicheck = true
-
- // Controlla se c'è nella lista allora non eseguire il controllo:
- for (const route of static_data.routes) {
- if (route.path === to.path) {
- eseguicheck = false
- break
- }
- }
-
- if (eseguicheck) {
- // Qui arrivano gli URL che non sono della lista ROUTE.
- // quindi ad esempio http://localhost:8085/signup/paoloar77
-
- if (!globalStore.TIMER && to.path !== '/') {
- // console.log('TIMER')
- globalStore.TIMER = setInterval(() => {
- // console.log('SETINTERVAL')
- if (globalStore.finishLoading) {
- if (globalStore.TIMER) {
- // console.log('TIMER_STATE', TIMER_STATE, 'URL_RITORNA', URL_RITORNA)
- if (globalStore.TIMER_STATE === 2) {
- clearInterval(globalStore.TIMER)
- globalStore.TIMER = null
- // console.log('TERMINA INTERVALLO')
- // next('/prova')
- // return
- }
- // se mi ero salvato un url per doverci ritornare, allora puntalo a questo:
- if (globalStore.URL_RITORNA !== '') {
- // next(URL_RITORNA)
- globalStore.TIMER_STATE = 2
- } else if (globalStore.TIMER_STATE === 0) {
- globalStore.URL_RESTORE = to.path
- // next('/')
- globalStore.TIMER_STATE = 1
- }
- }
- }
- }, 200)
- }
- }
- }
- if (globalStore.finishLoading) {
- if (globalStore.TIMER) {
- // console.log('TIMER_STATE', TIMER_STATE, 'to.path', to.path)
- if (globalStore.URL_RITORNA === '' && globalStore.URL_RESTORE !== '') {
- globalStore.URL_RITORNA = globalStore.URL_RESTORE
- // onsole.log('URL_RITORNA', URL_RITORNA)
- }
- }
- }
-
- // await tools.aspettansec(4000)
- }
-
- if (from.name && from.matched[0].name === to.name && from.meta.isModal) {
- next()
- console.log('Route interceptor log: <1>')
- return
- }
- // else if (from.name === to.name && isEqual(from.params, to.params)) {
- if (from.name === to.name) {
- console.log('Route interceptor log: <2>')
- console.log('from e to: ', from, to)
- next()
- } else {
- if (!to.meta.transparent && !to.meta.isModal) {
- // console.log('Route interceptor log: <4>')
- progressBar.start()
- } else if (to.meta.transparent && !from.name) {
- console.log('Route interceptor log: <5>')
- progressBar.start()
- } else if (to.meta.transparent && !to.matched.some((m) => m.name === from.name)) {
- console.log('Route interceptor log: <6>')
- progressBar.start()
- }
-
- // Check requires auth
- if (to.matched.some((m) => m.meta.requiresAuth)) {
- // await LoginStore.actions.refreshUserInfos()
- if (tools.isLoggedToSystem()) {
- if (to.meta.asyncData) {
- await getRouteData(to)
- }
- } else {
- // LoginStore.mutations.showLoginRoute(to.fullPath)
- if (from.name) {
- progressBar.hide()
- } else {
- // next('/')
- }
-
- $router.push({ name: 'pages.SignIn' })
- return
- }
- } else if (to.matched.some((m) => m.meta.noAuth) && userStore.isLogged) {
- next('/')
- } else if (to.meta.asyncData) {
- await getRouteData(to)
- return
- }
- }
-
- // if (to.meta.middleware) {
- // const middleware = Array.isArray(to.meta.middleware)
- // ? to.meta.middleware
- // : [to.meta.middleware]
- //
- // const context = {
- // from,
- // next,
- // Router,
- // to
- // }
- //
- // const nextMiddleware = nextFactory(context, middleware, 1)
- //
- // return middleware[0]({ ...context, next: nextMiddleware })
- // }
- //
- return next()
- } catch
- (err) {
- console.log('Route error:', err)
- progressBar.fail()
- }
-})
// const getRouteData = async (to: IMyRoute | IMyRouteRecord) => {
diff --git a/src/statics/lang/enUs.js b/src/statics/lang/enUs.js
index 1410e762..a967c961 100755
--- a/src/statics/lang/enUs.js
+++ b/src/statics/lang/enUs.js
@@ -209,6 +209,7 @@ const msg_enUs = {
domanda_rejectedtrust: 'Rifiutare la Fiducia a {username}?',
rejected: 'Rifiutato la Fiducia',
domanda_blockuser: 'Bloccare {username}?',
+ domanda_reportuser: 'Segnalare l\'utente {username}?',
domanda_blockgroup: 'Bloccare il gruppo {groupname}?',
blockedfriend: 'Utente Bloccato',
domanda: 'Domanda',
@@ -389,6 +390,10 @@ const msg_enUs = {
trust_modified: 'Fiducia Modificata',
blocked: 'Bloccato',
username_who_block: 'Bloccato da',
+ date_blocked: 'Data Blocco',
+ reported: 'Segnalato',
+ username_who_reported: 'Segnalato da',
+ date_reported: 'Data Segnalaz.',
username_regala_invitato: 'Username del Destinatario del regalo',
aportador_solidario_nome_completo: 'A.S. Name',
aportador_solidario_nome_completo_orig: 'Invitante Originario',
@@ -896,6 +901,7 @@ const msg_enUs = {
cancel_ask_friend: 'Annulla la richiesta di Amicizia',
cancel_ask_friend_short: 'Annulla richiesta',
reject_ask_friend: 'Rifiuta la richiesta di Amicizia',
+ report_user: 'Segnala Utente',
},
groups: {
member: 'membro',
diff --git a/src/statics/lang/es.js b/src/statics/lang/es.js
index 4e760fe2..5f9599a4 100755
--- a/src/statics/lang/es.js
+++ b/src/statics/lang/es.js
@@ -180,6 +180,7 @@ const msg_es = {
rejected: 'Rifiutato la Fiducia',
domanda_blockuser: 'Bloccare {username}?',
domanda_blockgroup: 'Bloccare il gruppo {groupname}?',
+ reporteduser: 'Utente Segnalato',
blockedfriend: 'Utente Bloccato',
domanda: 'Domanda',
},
diff --git a/src/statics/lang/it.js b/src/statics/lang/it.js
index 77e1ade9..20a5f92d 100755
--- a/src/statics/lang/it.js
+++ b/src/statics/lang/it.js
@@ -200,6 +200,7 @@ 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',
deletedgroup: 'Gruppo Eliminato',
domanda_addtofriend: 'Aggiungere agli amici {username}?',
domanda_addtogroup: 'Aggiungi {username} al gruppo {groupname}?',
@@ -222,7 +223,9 @@ const msg_it = {
domanda_rejectedtrust: 'Rifiutare la Fiducia a {username}?',
rejected: 'Rifiutato la Fiducia',
domanda_blockuser: 'Bloccare {username}?',
+ domanda_reportuser: 'Segnalare l\'utente {username}?',
domanda_blockgroup: 'Bloccare il gruppo {groupname}?',
+ reporteduser: 'Utente Segnalato',
blockedfriend: 'Utente Bloccato',
domanda: 'Domanda',
},
@@ -992,10 +995,16 @@ const msg_it = {
cancel_ask_friend: 'Annulla la richiesta di Amicizia',
cancel_ask_friend_short: 'Annulla richiesta',
reject_ask_friend: 'Rifiuta l\'Amicizia',
+ report_user: 'Segnala Utente',
},
groups: {
member: 'membro',
members: 'membri',
+ accepted: 'Ingresso Accettato',
+ refused: 'Ingresso Rifiutato',
+ deleted: 'Cancellato',
+ blocked: 'Bloccato',
+ removed: 'Rimosso',
admin: 'amministratore',
admins: 'Amministratori',
ask_group: 'Chiedi di entrare nel Gruppo',
diff --git a/src/store/Modules/fieldsTable.ts b/src/store/Modules/fieldsTable.ts
index 1066bf98..3c75fc86 100755
--- a/src/store/Modules/fieldsTable.ts
+++ b/src/store/Modules/fieldsTable.ts
@@ -525,6 +525,7 @@ export const colmyUserPeople = [
name: 'profile.img', field: 'profile', subfield: 'img', label_trans: 'reg.img', sortable: false,
showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit,
}),
+ AddCol({ name: 'reported', label_trans: 'reg.reported', fieldtype: costanti.FieldType.boolean }),
AddCol({
name: 'profile.born_city_id', label_trans: 'reg.born_city', fieldtype: costanti.FieldType.select_by_server,
jointable: 'cities',
@@ -2153,6 +2154,10 @@ export const colTableUsersISP = [
AddCol({ name: 'trust_modified', label_trans: 'reg.trust_modified', fieldtype: costanti.FieldType.date }),
AddCol({ name: 'blocked', label_trans: 'reg.blocked', fieldtype: costanti.FieldType.boolean }),
AddCol({ name: 'username_who_block', label_trans: 'reg.username_who_block' }),
+ AddCol({ name: 'date_blocked', label_trans: 'reg.date_blocked', fieldtype: costanti.FieldType.date }),
+ AddCol({ name: 'reported', label_trans: 'reg.reported', fieldtype: costanti.FieldType.boolean }),
+ AddCol({ name: 'username_who_reported', label_trans: 'reg.username_who_reported' }),
+ AddCol({ name: 'date_reported', label_trans: 'reg.date_reported', fieldtype: costanti.FieldType.date }),
AddCol({
name: 'profile.resplist',
field: 'profile',
diff --git a/src/store/Modules/tools.ts b/src/store/Modules/tools.ts
index 99ba0314..1fc75e8b 100644
--- a/src/store/Modules/tools.ts
+++ b/src/store/Modules/tools.ts
@@ -4671,6 +4671,22 @@ export const tools = {
})
},
+ reportUser($q: any, username: string, usernameDest: string) { // Segnala Profilo
+ const userStore = useUserStore()
+ $q.dialog({
+ message: t('db.domanda_reportuser', { 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.REPORT_USER, null).then((res: any) => {
+ if (res) {
+ tools.showPositiveNotif($q, t('db.reporteduser'))
+ }
+ })
+ })
+ },
+
refuseReqFriends($q: any, username: string, usernameDest: string) {
const userStore = useUserStore()
@@ -4696,6 +4712,7 @@ export const tools = {
addToMyGroups($q: any, username: string, groupnameDest: string) {
const userStore = useUserStore()
+ const notifStore = useNotifStore()
$q.dialog({
message: t('db.domanda_addtogroup', { username, groupname: groupnameDest }),
ok: { label: t('dialog.yes'), push: true },
@@ -4703,9 +4720,10 @@ export const tools = {
title: t('db.domanda')
}).onOk(() => {
- userStore.setGroupsCmd($q, t, username, groupnameDest, shared_consts.GROUPSCMD.SETGROUP, null)
+ userStore.setGroupsCmd($q, t, username, groupnameDest, shared_consts.GROUPSCMD.SETGROUP, true)
.then((res: any) => {
if (res) {
+ notifStore.updateNotification = true
if (userStore.my.profile.mygroups)
userStore.my.profile.mygroups = [...userStore.my.profile.mygroups, res]
else
@@ -4716,6 +4734,27 @@ export const tools = {
})
},
+ refuseReqGroup($q: any, username: string, groupnameDest: string) {
+
+ const userStore = useUserStore()
+ const notifStore = useNotifStore()
+ $q.dialog({
+ message: t('db.domanda_revoke_group', { groupname: groupnameDest }),
+ ok: { label: t('dialog.yes'), push: true },
+ cancel: { label: t('dialog.cancel') },
+ title: t('db.domanda')
+ }).onOk(() => {
+
+ userStore.setGroupsCmd($q, t, username, groupnameDest, shared_consts.GROUPSCMD.REFUSE_REQ_GROUP, null).then((res) => {
+ 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'))
+ }
+ })
+ })
+ },
+
blockGroup($q: any, username: string, usernameDest: string) {
const userStore = useUserStore()
@@ -5063,6 +5102,8 @@ export const tools = {
tools.addToMyGroups($q, username, dest)
} else if (cmd === shared_consts.GROUPSCMD.REQGROUP) {
tools.setRequestGroup($q, username, dest, value)
+ } else if (cmd === shared_consts.GROUPSCMD.REFUSE_REQ_GROUP) {
+ tools.refuseReqGroup($q, username, dest)
} else if (cmd === shared_consts.GROUPSCMD.CANCEL_REQ_GROUP) {
tools.cancelReqGroups($q, username, dest)
} else if (cmd === shared_consts.FRIENDSCMD.REMOVE_FROM_MYFRIENDS) {
diff --git a/src/views/user/myfriends/myfriends.ts b/src/views/user/myfriends/myfriends.ts
index 0cc72d5a..505af11f 100755
--- a/src/views/user/myfriends/myfriends.ts
+++ b/src/views/user/myfriends/myfriends.ts
@@ -116,6 +116,7 @@ export default defineComponent({
'profile.img': 1,
'profile.born_city_id': 1,
'profile.qualifica': 1,
+ reported: 1,
}
},
lookup2: {
@@ -135,6 +136,7 @@ export default defineComponent({
mycities: 1,
'profile.img': 1,
'profile.qualifica': 1,
+ reported: 1,
'profile.born_city_id': 1,
}
},
diff --git a/src/views/user/mygroup/mygroup.ts b/src/views/user/mygroup/mygroup.ts
index 0f7017f5..87ed7020 100755
--- a/src/views/user/mygroup/mygroup.ts
+++ b/src/views/user/mygroup/mygroup.ts
@@ -155,6 +155,7 @@ export default defineComponent({
'profile.img': 1,
'profile.mygroups': 1,
'profile.qualifica': 1,
+ reported: 1,
}
},
}
diff --git a/src/views/user/myprofile/myprofile.vue b/src/views/user/myprofile/myprofile.vue
index 94c0f969..69997d55 100755
--- a/src/views/user/myprofile/myprofile.vue
+++ b/src/views/user/myprofile/myprofile.vue
@@ -31,6 +31,11 @@
+
{{ myuser.name }} {{
@@ -105,6 +110,13 @@
v-close-popup @click="tools.blockUser($q, userStore.my.username, myuser.username)">
{{ $t('friends.block_user') }}
+
+
+
+
+ {{ $t('friends.report_user') }}
+
+