fix Conti Collettivi + messaggi
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
APP_VERSION="0.5.62"
|
APP_VERSION="0.5.63"
|
||||||
SERVICE_WORKER_FILE="service-worker.js"
|
SERVICE_WORKER_FILE="service-worker.js"
|
||||||
APP_ID="13"
|
APP_ID="13"
|
||||||
DIRECTORY_LOCAL="newfreeplanet"
|
DIRECTORY_LOCAL="newfreeplanet"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
APP_VERSION="0.5.62"
|
APP_VERSION="0.5.63"
|
||||||
SERVICE_WORKER_FILE="service-worker.js"
|
SERVICE_WORKER_FILE="service-worker.js"
|
||||||
APP_ID="13"
|
APP_ID="13"
|
||||||
DIRECTORY_LOCAL=newfreeplanet
|
DIRECTORY_LOCAL=newfreeplanet
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
APP_VERSION="0.5.62"
|
APP_VERSION="0.5.63"
|
||||||
SERVICE_WORKER_FILE="service-worker.js"
|
SERVICE_WORKER_FILE="service-worker.js"
|
||||||
APP_ID="13"
|
APP_ID="13"
|
||||||
DIRECTORY_LOCAL="newfreeplanet"
|
DIRECTORY_LOCAL="newfreeplanet"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
APP_VERSION="0.5.62"
|
APP_VERSION="0.5.63"
|
||||||
SERVICE_WORKER_FILE="service-worker.js"
|
SERVICE_WORKER_FILE="service-worker.js"
|
||||||
APP_ID="13"
|
APP_ID="13"
|
||||||
DIRECTORY_LOCAL=newfreeplanet
|
DIRECTORY_LOCAL=newfreeplanet
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
APP_VERSION="0.5.62"
|
APP_VERSION="0.5.63"
|
||||||
SERVICE_WORKER_FILE="service-worker.js"
|
SERVICE_WORKER_FILE="service-worker.js"
|
||||||
APP_ID="14"
|
APP_ID="14"
|
||||||
DIRECTORY_LOCAL="newfreeplanet"
|
DIRECTORY_LOCAL="newfreeplanet"
|
||||||
|
|||||||
@@ -43,7 +43,7 @@
|
|||||||
<q-btn
|
<q-btn
|
||||||
v-if="
|
v-if="
|
||||||
userStore.getMyCircuitsInCommonByUser(myuser).length > 0 &&
|
userStore.getMyCircuitsInCommonByUser(myuser).length > 0 &&
|
||||||
((myuser.username !== userStore.my.username) || userStore.hoContiCollettiviDaAmministrare())
|
((myuser.username !== userStore.my.username) || userStore.hoContiCollettiviDaAmministrare() || userStore.hoContiComunitariDaAmministrare())
|
||||||
"
|
"
|
||||||
icon="fas fa-coins"
|
icon="fas fa-coins"
|
||||||
color="green"
|
color="green"
|
||||||
|
|||||||
@@ -37,7 +37,9 @@
|
|||||||
|
|
||||||
<q-item-label>
|
<q-item-label>
|
||||||
<q-btn
|
<q-btn
|
||||||
v-if="userStore.my.profile.calc.numGoodsAndServices > 0 && circuitname"
|
v-if="
|
||||||
|
userStore.my.profile.calc.numGoodsAndServices > 0 && circuitname
|
||||||
|
"
|
||||||
icon="fas fa-coins"
|
icon="fas fa-coins"
|
||||||
color="green"
|
color="green"
|
||||||
size="md"
|
size="md"
|
||||||
@@ -410,6 +412,29 @@
|
|||||||
$t('groups.exit_group')
|
$t('groups.exit_group')
|
||||||
}}</q-item-section>
|
}}</q-item-section>
|
||||||
</q-item>
|
</q-item>
|
||||||
|
|
||||||
|
<q-item
|
||||||
|
clickable
|
||||||
|
v-close-popup
|
||||||
|
@click="
|
||||||
|
tools.removeFromMyCircuits(
|
||||||
|
$q,
|
||||||
|
userStore.my.username,
|
||||||
|
circuitname,
|
||||||
|
grp.groupname,
|
||||||
|
$t('circuit.domanda_exit_fromcircuit', {
|
||||||
|
circuitname,
|
||||||
|
})
|
||||||
|
)
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<q-item-section avatar>
|
||||||
|
<q-icon color="negative" name="fas fa-user-minus" />
|
||||||
|
</q-item-section>
|
||||||
|
<q-item-section>{{
|
||||||
|
$t('circuit.exit_circuit')
|
||||||
|
}}</q-item-section>
|
||||||
|
</q-item>
|
||||||
</q-list>
|
</q-list>
|
||||||
<q-list
|
<q-list
|
||||||
v-if="tools.iAmAdminGroup(grp.groupname)"
|
v-if="tools.iAmAdminGroup(grp.groupname)"
|
||||||
|
|||||||
@@ -59,7 +59,7 @@
|
|||||||
<q-btn
|
<q-btn
|
||||||
v-if="
|
v-if="
|
||||||
userStore.getMyCircuitsInCommonByUser(contact).length > 0 &&
|
userStore.getMyCircuitsInCommonByUser(contact).length > 0 &&
|
||||||
((contact.username !== userStore.my.username) || userStore.hoContiCollettiviDaAmministrare())
|
((contact.username !== userStore.my.username) || userStore.hoContiCollettiviDaAmministrare() || userStore.hoContiComunitariDaAmministrare())
|
||||||
"
|
"
|
||||||
icon="fas fa-coins"
|
icon="fas fa-coins"
|
||||||
color="green"
|
color="green"
|
||||||
@@ -492,7 +492,8 @@
|
|||||||
tools.removeFromMyCircuits(
|
tools.removeFromMyCircuits(
|
||||||
$q,
|
$q,
|
||||||
contact.username,
|
contact.username,
|
||||||
circuitname
|
circuitname,
|
||||||
|
'',
|
||||||
)
|
)
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -181,7 +181,7 @@
|
|||||||
</q-item-section>
|
</q-item-section>
|
||||||
<q-item-section>{{ $t('circuit.remove_as_admin') }}</q-item-section>
|
<q-item-section>{{ $t('circuit.remove_as_admin') }}</q-item-section>
|
||||||
</q-item>
|
</q-item>
|
||||||
<q-item clickable v-if="!tools.isUserTheCreatorOfTheCircuit(circuitname, contact.username)" v-close-popup @click="tools.removeFromMyCircuits($q, contact.username, circuitname)">
|
<q-item clickable v-if="!tools.isUserTheCreatorOfTheCircuit(circuitname, contact.username)" v-close-popup @click="tools.removeFromMyCircuits($q, contact.username, circuitname, '')">
|
||||||
<q-item-section avatar>
|
<q-item-section avatar>
|
||||||
<q-icon color="negative" name="fas fa-user-minus"/>
|
<q-icon color="negative" name="fas fa-user-minus"/>
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
|
|||||||
@@ -148,7 +148,7 @@ export default defineComponent({
|
|||||||
accountloaded.value = circuitloaded.value ? circuitloaded.value.account : null
|
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)
|
console.log('groupsListAdmin.value', groupsListAdmin.value)
|
||||||
|
|
||||||
arrGroupsList.value = []
|
arrGroupsList.value = []
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<q-btn-toggle
|
<q-btn-toggle
|
||||||
v-if="arrGroupsList.length > 0"
|
v-if="arrTypesAccounts.length > 0"
|
||||||
v-model="tipoConto"
|
v-model="tipoConto"
|
||||||
class="my-custom-toggle"
|
class="my-custom-toggle"
|
||||||
no-caps
|
no-caps
|
||||||
|
|||||||
@@ -6287,7 +6287,7 @@ export const tools = {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
removeFromMyCircuits($q: any, username: string, circuitname: string, domanda: any = '') {
|
removeFromMyCircuits($q: any, username: string, circuitname: string, groupname?: string, domanda: any = '') {
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
|
|
||||||
$q.dialog({
|
$q.dialog({
|
||||||
@@ -6297,7 +6297,7 @@ export const tools = {
|
|||||||
title: t('db.domanda')
|
title: t('db.domanda')
|
||||||
}).onOk(() => {
|
}).onOk(() => {
|
||||||
|
|
||||||
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 (res && res.result) {
|
||||||
if (userStore.my.profile.mycircuits && username === userStore.my.username) {
|
if (userStore.my.profile.mycircuits && username === userStore.my.username) {
|
||||||
userStore.my.profile.mycircuits = userStore.my.profile.mycircuits.filter((rec: IMyCircuit) => rec.circuitname !== circuitname)
|
userStore.my.profile.mycircuits = userStore.my.profile.mycircuits.filter((rec: IMyCircuit) => rec.circuitname !== circuitname)
|
||||||
@@ -6428,7 +6428,6 @@ export const tools = {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
// console.log('ris', ris)
|
|
||||||
if (ris && ris.admins) {
|
if (ris && ris.admins) {
|
||||||
const isadmin = ris.admins.find((user: IFriends) => user.username === userStore.my.username)
|
const isadmin = ris.admins.find((user: IFriends) => user.username === userStore.my.username)
|
||||||
risultato = !!isadmin
|
risultato = !!isadmin
|
||||||
|
|||||||
@@ -254,8 +254,15 @@ export const useUserStore = defineStore('UserStore', {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
GroupsListWhereIAmAdmin(circuitname: string): any {
|
GroupsListWhereIAmAdmin(): any {
|
||||||
console.log('GL', circuitname)
|
try {
|
||||||
|
return this.my.profile.manage_mygroups
|
||||||
|
} catch (e) {
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
GroupsListWhereIAmAdminInTheCircuit(circuitname: string): any {
|
||||||
try {
|
try {
|
||||||
const arr: any = this.my.profile.manage_mygroups.filter((group: IMyGroup) => (group.mycircuits!.findIndex((circ: IMyCircuit) => circ.circuitname === circuitname) >= 0))
|
const arr: any = this.my.profile.manage_mygroups.filter((group: IMyGroup) => (group.mycircuits!.findIndex((circ: IMyCircuit) => circ.circuitname === circuitname) >= 0))
|
||||||
console.log('arr', arr)
|
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 {
|
hoContiCollettiviDaAmministrare(): boolean {
|
||||||
const arr = this.my.profile.manage_mygroups.find((group: IMyGroup) => group.account)
|
const arr = this.my.profile.manage_mygroups.find((group: IMyGroup) => group.account)
|
||||||
return arr ? true : false
|
return arr ? true : false
|
||||||
|
|||||||
@@ -269,12 +269,17 @@ export default defineComponent({
|
|||||||
{
|
{
|
||||||
$unwind: '$account',
|
$unwind: '$account',
|
||||||
},
|
},
|
||||||
{ $match: { 'account.groupname': { $exists: true, $ne: '' } }
|
{
|
||||||
|
$match: { 'account.groupname': { $exists: true, $ne: '' } }
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
arrfilterand.value = []
|
arrfilterand.value = []
|
||||||
filtercustom_rich.value = []
|
filtercustom_rich.value = []
|
||||||
|
|
||||||
|
if (userStore.my.username && circuit.value)
|
||||||
|
groupsListAdmin.value = userStore.GroupsListWhereIAmAdmin()
|
||||||
|
|
||||||
// filtroutente.value = [{ userId: userStore.my._id }]
|
// filtroutente.value = [{ userId: userStore.my._id }]
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -287,9 +292,6 @@ export default defineComponent({
|
|||||||
|
|
||||||
await loadCircuit()
|
await loadCircuit()
|
||||||
|
|
||||||
if (userStore.my.username && circuit.value)
|
|
||||||
groupsListAdmin.value = userStore.GroupsListWhereIAmAdmin(circuit.value.name)
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function getImgCircuit() {
|
function getImgCircuit() {
|
||||||
|
|||||||
@@ -141,6 +141,7 @@
|
|||||||
$q,
|
$q,
|
||||||
userStore.my.username,
|
userStore.my.username,
|
||||||
circuit.name,
|
circuit.name,
|
||||||
|
'',
|
||||||
$t('circuit.domanda_exit_fromcircuit', {
|
$t('circuit.domanda_exit_fromcircuit', {
|
||||||
circuitname: circuit.name,
|
circuitname: circuit.name,
|
||||||
})
|
})
|
||||||
@@ -252,7 +253,10 @@
|
|||||||
:key="ind"
|
:key="ind"
|
||||||
class="q-pa-sm"
|
class="q-pa-sm"
|
||||||
>
|
>
|
||||||
<q-item>
|
<q-item v-if="!userStore.IsMyCircuitByNameAndGroup(
|
||||||
|
circuit.name,
|
||||||
|
group.groupname
|
||||||
|
)">
|
||||||
<q-item-section>
|
<q-item-section>
|
||||||
<q-btn
|
<q-btn
|
||||||
v-if="
|
v-if="
|
||||||
|
|||||||
@@ -101,6 +101,7 @@
|
|||||||
}}</q-item-section>
|
}}</q-item-section>
|
||||||
</q-item>
|
</q-item>
|
||||||
|
|
||||||
|
|
||||||
<q-list
|
<q-list
|
||||||
v-if="tools.iAmAdminGroup(mygrp.groupname)"
|
v-if="tools.iAmAdminGroup(mygrp.groupname)"
|
||||||
style="min-width: 200px"
|
style="min-width: 200px"
|
||||||
@@ -489,7 +490,11 @@
|
|||||||
:symbol="circuit.symbol"
|
:symbol="circuit.symbol"
|
||||||
:color="circuit.color"
|
:color="circuit.color"
|
||||||
:saldo="circuit.account.saldo"
|
:saldo="circuit.account.saldo"
|
||||||
:qtarem="circuit.account ? circuitStore.getRemainingCoinsToSend(circuit.account) : 0"
|
:qtarem="
|
||||||
|
circuit.account
|
||||||
|
? circuitStore.getRemainingCoinsToSend(circuit.account)
|
||||||
|
: 0
|
||||||
|
"
|
||||||
>
|
>
|
||||||
</CSaldo>
|
</CSaldo>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user