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"
|
||||
APP_ID="13"
|
||||
DIRECTORY_LOCAL="newfreeplanet"
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
<q-btn
|
||||
v-if="
|
||||
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"
|
||||
color="green"
|
||||
|
||||
@@ -37,7 +37,9 @@
|
||||
|
||||
<q-item-label>
|
||||
<q-btn
|
||||
v-if="userStore.my.profile.calc.numGoodsAndServices > 0 && circuitname"
|
||||
v-if="
|
||||
userStore.my.profile.calc.numGoodsAndServices > 0 && circuitname
|
||||
"
|
||||
icon="fas fa-coins"
|
||||
color="green"
|
||||
size="md"
|
||||
@@ -410,6 +412,29 @@
|
||||
$t('groups.exit_group')
|
||||
}}</q-item-section>
|
||||
</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
|
||||
v-if="tools.iAmAdminGroup(grp.groupname)"
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
<q-btn
|
||||
v-if="
|
||||
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"
|
||||
color="green"
|
||||
@@ -492,7 +492,8 @@
|
||||
tools.removeFromMyCircuits(
|
||||
$q,
|
||||
contact.username,
|
||||
circuitname
|
||||
circuitname,
|
||||
'',
|
||||
)
|
||||
"
|
||||
>
|
||||
|
||||
@@ -181,7 +181,7 @@
|
||||
</q-item-section>
|
||||
<q-item-section>{{ $t('circuit.remove_as_admin') }}</q-item-section>
|
||||
</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-icon color="negative" name="fas fa-user-minus"/>
|
||||
</q-item-section>
|
||||
|
||||
@@ -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 = []
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
</div>
|
||||
<div>
|
||||
<q-btn-toggle
|
||||
v-if="arrGroupsList.length > 0"
|
||||
v-if="arrTypesAccounts.length > 0"
|
||||
v-model="tipoConto"
|
||||
class="my-custom-toggle"
|
||||
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()
|
||||
|
||||
$q.dialog({
|
||||
@@ -6297,7 +6297,7 @@ export const tools = {
|
||||
title: t('db.domanda')
|
||||
}).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 (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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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"
|
||||
>
|
||||
<q-item>
|
||||
<q-item v-if="!userStore.IsMyCircuitByNameAndGroup(
|
||||
circuit.name,
|
||||
group.groupname
|
||||
)">
|
||||
<q-item-section>
|
||||
<q-btn
|
||||
v-if="
|
||||
|
||||
@@ -101,6 +101,7 @@
|
||||
}}</q-item-section>
|
||||
</q-item>
|
||||
|
||||
|
||||
<q-list
|
||||
v-if="tools.iAmAdminGroup(mygrp.groupname)"
|
||||
style="min-width: 200px"
|
||||
@@ -483,13 +484,17 @@
|
||||
</q-tab-panel>
|
||||
<q-tab-panel name="circuits">
|
||||
<div v-for="(circuit, ind) of circuitslist" :key="ind">
|
||||
<div class="circuit_name">{{circuit.name}}: </div>
|
||||
<div class="circuit_name">{{ circuit.name }}:</div>
|
||||
<CSaldo
|
||||
:account="circuit.account"
|
||||
:symbol="circuit.symbol"
|
||||
:color="circuit.color"
|
||||
:saldo="circuit.account.saldo"
|
||||
:qtarem="circuit.account ? circuitStore.getRemainingCoinsToSend(circuit.account) : 0"
|
||||
:qtarem="
|
||||
circuit.account
|
||||
? circuitStore.getRemainingCoinsToSend(circuit.account)
|
||||
: 0
|
||||
"
|
||||
>
|
||||
</CSaldo>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user