diff --git a/.env.development b/.env.development index 4327e51b..28a682ab 100755 --- a/.env.development +++ b/.env.development @@ -1,4 +1,4 @@ -APP_VERSION="0.5.62" +APP_VERSION="0.5.63" SERVICE_WORKER_FILE="service-worker.js" APP_ID="13" DIRECTORY_LOCAL="newfreeplanet" diff --git a/.env.example.production b/.env.example.production index 09b41ead..eee59181 100755 --- a/.env.example.production +++ b/.env.example.production @@ -1,4 +1,4 @@ -APP_VERSION="0.5.62" +APP_VERSION="0.5.63" SERVICE_WORKER_FILE="service-worker.js" APP_ID="13" DIRECTORY_LOCAL=newfreeplanet diff --git a/_ALL_SITES/riso.app/.env.development b/_ALL_SITES/riso.app/.env.development index 4327e51b..28a682ab 100755 --- a/_ALL_SITES/riso.app/.env.development +++ b/_ALL_SITES/riso.app/.env.development @@ -1,4 +1,4 @@ -APP_VERSION="0.5.62" +APP_VERSION="0.5.63" SERVICE_WORKER_FILE="service-worker.js" APP_ID="13" DIRECTORY_LOCAL="newfreeplanet" diff --git a/_ALL_SITES/riso.app/.env.production b/_ALL_SITES/riso.app/.env.production index 4cc04575..656a21ee 100644 --- a/_ALL_SITES/riso.app/.env.production +++ b/_ALL_SITES/riso.app/.env.production @@ -1,4 +1,4 @@ -APP_VERSION="0.5.62" +APP_VERSION="0.5.63" SERVICE_WORKER_FILE="service-worker.js" APP_ID="13" DIRECTORY_LOCAL=newfreeplanet diff --git a/_ALL_SITES/terradellavisione.app/.env.development b/_ALL_SITES/terradellavisione.app/.env.development index 1e07bbe1..9bfb4a7a 100755 --- a/_ALL_SITES/terradellavisione.app/.env.development +++ b/_ALL_SITES/terradellavisione.app/.env.development @@ -1,4 +1,4 @@ -APP_VERSION="0.5.62" +APP_VERSION="0.5.63" SERVICE_WORKER_FILE="service-worker.js" APP_ID="14" DIRECTORY_LOCAL="newfreeplanet" diff --git a/src/components/CContactUser/CContactUser.vue b/src/components/CContactUser/CContactUser.vue index 0f3b08db..7d03a8da 100755 --- a/src/components/CContactUser/CContactUser.vue +++ b/src/components/CContactUser/CContactUser.vue @@ -43,7 +43,7 @@ + + + + + + {{ + $t('circuit.exit_circuit') + }} + diff --git a/src/components/CMyUserOnlyView/CMyUserOnlyView.vue b/src/components/CMyUserOnlyView/CMyUserOnlyView.vue index 6287903a..c04757f4 100755 --- a/src/components/CMyUserOnlyView/CMyUserOnlyView.vue +++ b/src/components/CMyUserOnlyView/CMyUserOnlyView.vue @@ -181,7 +181,7 @@ {{ $t('circuit.remove_as_admin') }} - + diff --git a/src/components/CSendCoins/CSendCoins.ts b/src/components/CSendCoins/CSendCoins.ts index c5e75d09..22b9922b 100755 --- a/src/components/CSendCoins/CSendCoins.ts +++ b/src/components/CSendCoins/CSendCoins.ts @@ -148,7 +148,7 @@ export default defineComponent({ accountloaded.value = circuitloaded.value ? circuitloaded.value.account : null } - groupsListAdmin.value = userStore.GroupsListWhereIAmAdmin(circuitloaded.value.name) + groupsListAdmin.value = userStore.GroupsListWhereIAmAdminInTheCircuit(circuitloaded.value.name) console.log('groupsListAdmin.value', groupsListAdmin.value) arrGroupsList.value = [] diff --git a/src/components/CSendCoins/CSendCoins.vue b/src/components/CSendCoins/CSendCoins.vue index 9f264654..11b0c639 100755 --- a/src/components/CSendCoins/CSendCoins.vue +++ b/src/components/CSendCoins/CSendCoins.vue @@ -36,7 +36,7 @@
{ - userStore.setCircuitCmd($q, t, username, circuitname, shared_consts.CIRCUITCMD.REMOVE_FROM_MYLIST, null).then((res) => { + userStore.setCircuitCmd($q, t, username, circuitname, shared_consts.CIRCUITCMD.REMOVE_FROM_MYLIST, null, {groupname}).then((res) => { if (res && res.result) { if (userStore.my.profile.mycircuits && username === userStore.my.username) { userStore.my.profile.mycircuits = userStore.my.profile.mycircuits.filter((rec: IMyCircuit) => rec.circuitname !== circuitname) @@ -6428,7 +6428,6 @@ export const tools = { return true } }) - // console.log('ris', ris) if (ris && ris.admins) { const isadmin = ris.admins.find((user: IFriends) => user.username === userStore.my.username) risultato = !!isadmin diff --git a/src/store/UserStore.ts b/src/store/UserStore.ts index 6efc25d6..2f4b4dde 100755 --- a/src/store/UserStore.ts +++ b/src/store/UserStore.ts @@ -254,8 +254,15 @@ export const useUserStore = defineStore('UserStore', { } }, - GroupsListWhereIAmAdmin(circuitname: string): any { - console.log('GL', circuitname) + GroupsListWhereIAmAdmin(): any { + try { + return this.my.profile.manage_mygroups + } catch (e) { + return [] + } + }, + + GroupsListWhereIAmAdminInTheCircuit(circuitname: string): any { try { const arr: any = this.my.profile.manage_mygroups.filter((group: IMyGroup) => (group.mycircuits!.findIndex((circ: IMyCircuit) => circ.circuitname === circuitname) >= 0)) console.log('arr', arr) @@ -265,6 +272,15 @@ export const useUserStore = defineStore('UserStore', { } }, + hoContiComunitariDaAmministrare(): boolean { + try { + const arr: any = this.my.profile.manage_mygroups.filter((group: IMyGroup) => (group.mycircuits!.length > 0)) + return !!arr + } catch (e) { + return false + } + }, + hoContiCollettiviDaAmministrare(): boolean { const arr = this.my.profile.manage_mygroups.find((group: IMyGroup) => group.account) return arr ? true : false diff --git a/src/views/user/mycircuit/mycircuit.ts b/src/views/user/mycircuit/mycircuit.ts index 3e405d89..00d558c1 100755 --- a/src/views/user/mycircuit/mycircuit.ts +++ b/src/views/user/mycircuit/mycircuit.ts @@ -125,77 +125,77 @@ export default defineComponent({ ]; - filterextra.value = [ { - $match: { - idapp: process.env.APP_ID, - 'profile.mycircuits': { - $elemMatch: { circuitname: { $eq: circuit.value.name } }, + filterextra.value = [{ + $match: { + idapp: process.env.APP_ID, + 'profile.mycircuits': { + $elemMatch: { circuitname: { $eq: circuit.value.name } }, + }, + }, + }, + + { + $lookup: { + from: 'circuits', + as: 'circuit', + let: { circuitname: circuit.value.name, idapp: '$idapp' }, + pipeline: [ + { + $match: + { + $expr: + { + $and: + [ + { $eq: ['$name', '$$circuitname'] }, + { $eq: ['$idapp', '$$idapp'] }, + + ], + }, + }, }, - }, + ], }, - { - $lookup: { - from: 'circuits', - as: 'circuit', - let: { circuitname: circuit.value.name, idapp: '$idapp' }, - pipeline: [ - { - $match: - { - $expr: - { - $and: - [ - { $eq: ['$name', '$$circuitname'] }, - { $eq: ['$idapp', '$$idapp'] }, + }, + { $unwind: '$circuit' }, + { + $project: { + username: 1, + name: 1, + surname: 1, + profile: 1, idapp: 1, 'circuit.name': 1, 'circuit._id': 1 + } - ], - }, + }, + + { + $lookup: { + from: 'accounts', + as: 'account', + let: { username: '$username', idapp: '$idapp', circuitId: '$circuit._id' }, + pipeline: [ + { + $match: + { + $expr: + { + $and: + [ + { $eq: ['$$username', '$username'] }, + { $eq: ['$$idapp', '$idapp'] }, + { $eq: ['$$circuitId', '$circuitId'] }, + ], }, }, - ], - }, - + }, + ], }, - { $unwind: '$circuit' }, - { - $project: { - username: 1, - name: 1, - surname: 1, - profile: 1, idapp: 1, 'circuit.name': 1, 'circuit._id': 1 - } - - }, - - { - $lookup: { - from: 'accounts', - as: 'account', - let: { username: '$username', idapp: '$idapp', circuitId: '$circuit._id' }, - pipeline: [ - { - $match: - { - $expr: - { - $and: - [ - { $eq: ['$$username', '$username'] }, - { $eq: ['$$idapp', '$idapp'] }, - { $eq: ['$$circuitId', '$circuitId'] }, - ], - }, - }, - }, - ], - }, - }, - { $unwind: '$account' }, + }, + { $unwind: '$account' }, ] - filterextra_group.value = [ { + filterextra_group.value = [{ $match: { idapp: process.env.APP_ID, 'mycircuits': { @@ -245,7 +245,7 @@ export default defineComponent({ $lookup: { from: 'accounts', as: 'account', - let: { groupname: '$groupname', idapp: '$idapp', circuitId: '$circuit._id' }, + let: { groupname: '$groupname', idapp: '$idapp', circuitId: '$circuit._id' }, pipeline: [ { $match: @@ -269,12 +269,17 @@ export default defineComponent({ { $unwind: '$account', }, - { $match: { 'account.groupname': { $exists: true, $ne: '' } } + { + $match: { 'account.groupname': { $exists: true, $ne: '' } } }, - ] + ] } arrfilterand.value = [] filtercustom_rich.value = [] + + if (userStore.my.username && circuit.value) + groupsListAdmin.value = userStore.GroupsListWhereIAmAdmin() + // filtroutente.value = [{ userId: userStore.my._id }] }) @@ -287,9 +292,6 @@ export default defineComponent({ await loadCircuit() - if (userStore.my.username && circuit.value) - groupsListAdmin.value = userStore.GroupsListWhereIAmAdmin(circuit.value.name) - } function getImgCircuit() { diff --git a/src/views/user/mycircuit/mycircuit.vue b/src/views/user/mycircuit/mycircuit.vue index 795109fa..b22b91dc 100755 --- a/src/views/user/mycircuit/mycircuit.vue +++ b/src/views/user/mycircuit/mycircuit.vue @@ -141,6 +141,7 @@ $q, userStore.my.username, circuit.name, + '', $t('circuit.domanda_exit_fromcircuit', { circuitname: circuit.name, }) @@ -252,7 +253,10 @@ :key="ind" class="q-pa-sm" > - +
-
{{circuit.name}}:
+
{{ circuit.name }}: