Add to the Circuit
Remove to the Circuit Revoke request Users Admins
This commit is contained in:
@@ -80,7 +80,11 @@ export const shared_consts = {
|
||||
REQ: 2000,
|
||||
SET: 2001,
|
||||
REMOVE_FROM_MYLIST: 2144,
|
||||
REFUSE_REQ: 2145,
|
||||
CANCEL_REQ: 1146,
|
||||
DELETE: 2170,
|
||||
ADDADMIN: 2180,
|
||||
REMOVEADMIN: 2185,
|
||||
},
|
||||
|
||||
PUBTOSHARE: {
|
||||
@@ -921,8 +925,19 @@ export const shared_consts = {
|
||||
ID_GROUP_BLOCK_USER: 16,
|
||||
ID_GROUP_DELETE_USER: 32,
|
||||
ID_GROUP_REMOVED: 64,
|
||||
ID_GROUP_ADDED_ADMIN_OFMYGROUP: 128,
|
||||
ID_GROUP_REMOVED_ADMIN_OFMYGROUP: 256,
|
||||
|
||||
TYPEDIR_CIRCUITS: 5,
|
||||
ID_CIRCUIT_NEW_REC: 1,
|
||||
ID_CIRCUIT_ACCEPTED: 2,
|
||||
ID_CIRCUIT_REFUSED: 4,
|
||||
ID_CIRCUIT_REQUEST_TO_ENTER: 8,
|
||||
ID_CIRCUIT_BLOCK_USER: 16,
|
||||
ID_CIRCUIT_DELETE_USER: 32,
|
||||
ID_CIRCUIT_REMOVED: 64,
|
||||
ID_CIRCUIT_ADDED_ADMIN: 128,
|
||||
ID_CIRCUIT_REMOVED_ADMIN: 256,
|
||||
|
||||
TYPEDIR_BOOKING: 6,
|
||||
|
||||
|
||||
@@ -218,6 +218,13 @@ export default defineComponent({
|
||||
// {label: 'Seguo', value: tools.FILTER_MYFOLLOW},
|
||||
]
|
||||
|
||||
} else if (props.table === toolsext.TABCIRCUITS) {
|
||||
myoptions.value = [
|
||||
{ label: '🌎 Tutti', value: tools.FILTER_ALL },
|
||||
{ label: '👤 Circuiti che Gestisci', value: tools.FILTER_MYREC },
|
||||
// {label: 'Seguo', value: tools.FILTER_MYFOLLOW},
|
||||
]
|
||||
|
||||
} else {
|
||||
myoptions.value = [
|
||||
{ label: '🌎 Tutti', value: tools.FILTER_ALL },
|
||||
@@ -1022,7 +1029,8 @@ export default defineComponent({
|
||||
let lk_as = 'circuit'
|
||||
let af_objId_tab = 'myId'
|
||||
|
||||
return {}
|
||||
return {
|
||||
}
|
||||
|
||||
} else if (props.table === toolsext.TABMYGOODS) {
|
||||
return {
|
||||
|
||||
@@ -217,6 +217,11 @@ export default defineComponent({
|
||||
required: false,
|
||||
default: '',
|
||||
},
|
||||
circuitname: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: '',
|
||||
},
|
||||
},
|
||||
components: { CMyPopupEdit, CTitleBanner, CMyFieldDb, CMySelect, CMyFriends, CMyGroups,
|
||||
CMyUser, CMyRecCard, CMyCardPopup, CMyRecGrpCard, CMyCardGrpPopup, CMyCardCircuitPopup,
|
||||
|
||||
@@ -254,6 +254,7 @@
|
||||
:mycontact="row"
|
||||
:visu="visufind"
|
||||
:groupname="extrafield"
|
||||
:circuitname="circuitname"
|
||||
:labelextra="col_title ? row[col_title] : ''"
|
||||
:labelFooter="col_footer ? getLabelFooterByRow(row) : ''"
|
||||
>
|
||||
@@ -686,7 +687,7 @@
|
||||
|
||||
</CMyCardGrpPopup>
|
||||
<CMyCardCircuitPopup
|
||||
v-if="mytable === toolsext.TABCIRCUITS"
|
||||
v-else-if="mytable === toolsext.TABCIRCUITS"
|
||||
:table="mytable"
|
||||
:prop_myrec="myrecdialog">
|
||||
|
||||
|
||||
@@ -20,63 +20,58 @@
|
||||
<q-menu>
|
||||
<q-list style="min-width: 150px">
|
||||
<q-item clickable icon="fas fa-user-minus" v-close-popup
|
||||
@click="tools.setCmd($q, shared_consts.GROUPSCMD.REMOVE_FROM_MYGROUP, myusername(), '', circuit.groupnameId)">
|
||||
<q-item-section>{{ $t('groups.remove_from_mygroups') }}</q-item-section>
|
||||
@click="tools.setCmd($q, shared_consts.CIRCUITCMD.REMOVE_FROM_MYLIST, myusername(), '', circuit.NAME)">
|
||||
<q-item-section>{{ $t('circuit.remove_from_mylist') }}</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
<q-list v-if="tools.iAmAdminGroup(circuit.groupnameId)" style="min-width: 200px">
|
||||
<q-item clickable v-close-popup @click="tools.setCmd($q, shared_consts.GROUPSCMD.DELETE_GROUP, myusername(), '', circuit.groupnameId)">
|
||||
<q-item-section>{{ $t('groups.delete_group') }}</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
<q-list style="min-width: 150px">
|
||||
<q-item v-if="!tools.iAmAdminGroup(circuit.groupnameId)" clickable icon="fas fa-ban" v-close-popup @click="tools.setCmd($q, shared_consts.GROUPSCMD.BLOCK_GROUP, myusername(), '', circuit.groupnameId)">
|
||||
<q-item-section>{{ $t('groups.block_group') }}</q-item-section>
|
||||
<q-list v-if="tools.iAmAdminCircuit(circuit.name)" style="min-width: 200px">
|
||||
<q-item clickable v-close-popup @click="tools.setCmd($q, shared_consts.CIRCUITCMD.DELETE, myusername(), '', circuit.name)">
|
||||
<q-item-section>{{ $t('circuit.delete') }}</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
</q-btn>
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
<q-item-section side v-if="visu === costanti.USER_GROUPS">
|
||||
<q-item-section side v-if="visu === costanti.USER_CIRCUITS">
|
||||
<q-item-label>
|
||||
<q-btn rounded :icon="userStore.IsMyGroupByGroupname(circuit.groupnameId) ? `fas fa-ellipsis-h` : `fas fa-user`">
|
||||
<q-btn rounded :icon="userStore.IsMyCircuitByName(circuit.name) ? `fas fa-ellipsis-h` : `fas fa-user`">
|
||||
<q-menu>
|
||||
<q-list v-if="(!userStore.IsMyGroupByGroupname(circuit.groupnameId) && !userStore.IsAskedGroupByGroupname(circuit.groupnameId) && !userStore.IsRefusedGroupByGroupname(circuit.groupnameId))" style="min-width: 200px">
|
||||
<q-item clickable v-close-popup @click="tools.setCmd($q, shared_consts.GROUPSCMD.REQGROUP, myusername(), true, circuitgroupnameId)">
|
||||
<q-item-section>{{ $t('groups.ask_group') }}</q-item-section>
|
||||
<q-list v-if="(!userStore.IsMyCircuitByName(circuit.name) && !userStore.IsAskedCircuitByName(circuit.name) && !userStore.IsRefusedCircuitByName(circuit.name))" style="min-width: 200px">
|
||||
<q-item clickable v-close-popup @click="tools.setCmd($q, shared_consts.CIRCUITCMD.REQ, myusername(), true, circuitname)">
|
||||
<q-item-section>{{ $t('circuit.ask') }}</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
<q-list v-else-if="(!userStore.IsMyGroupByGroupname(circuit.groupnameId) && userStore.IsAskedGroupByGroupname(circuit.groupnameId) && !userStore.IsRefusedGroupByGroupname(circuit.groupnameId))" style="min-width: 200px">
|
||||
<q-item clickable v-close-popup @click="tools.setCmd($q, shared_consts.GROUPSCMD.REQGROUP, myusername(), false, circuit.groupnameId)">
|
||||
<q-list v-else-if="(!userStore.IsMyCircuitByName(circuit.name) && userStore.IsAskedCircuitByName(circuit.name) && !userStore.IsRefusedCircuitByName(circuit.name))" style="min-width: 200px">
|
||||
<q-item clickable v-close-popup @click="tools.setCmd($q, shared_consts.CIRCUITCMD.REQ, myusername(), false, circuit.name)">
|
||||
<q-item-section>{{ $t('shared.refuse_ask') }}</q-item-section>
|
||||
</q-item>
|
||||
<q-item clickable v-close-popup @click="tools.setCmd($q, shared_consts.GROUPSCMD.REQGROUP, myusername(), false, circuit.groupnameId)">
|
||||
<q-item clickable v-close-popup @click="tools.setCmd($q, shared_consts.CIRCUITCMD.REQ, myusername(), false, circuit.name)">
|
||||
<q-item-section>{{ $t('shared.cancel_ask') }}</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
<q-list v-else-if="userStore.IsMyGroupByGroupname(circuit.groupnameId)" style="min-width: 200px">
|
||||
<q-item clickable v-close-popup @click="tools.setCmd($q, shared_consts.GROUPSCMD.REMOVE_FROM_MYGROUP, myusername(), '', circuit.groupnameId)">
|
||||
<q-item-section>{{ $t('groups.exit_group') }}</q-item-section>
|
||||
<q-list v-else-if="userStore.IsMyCircuitByName(circuit.name)" style="min-width: 200px">
|
||||
<q-item clickable v-close-popup @click="tools.setCmd($q, shared_consts.CIRCUITCMD.REMOVE_FROM_MYLIST, myusername(), '', circuit.name)">
|
||||
<q-item-section>{{ $t('circuit.exit') }}</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
<q-list v-if="tools.iAmAdminGroup(circuit.groupnameId)" style="min-width: 200px">
|
||||
<q-item clickable v-close-popup @click="tools.setCmd($q, shared_consts.GROUPSCMD.DELETE_GROUP, myusername(), '', circuit.groupnameId)">
|
||||
<q-item-section>{{ $t('groups.delete_group') }}</q-item-section>
|
||||
<q-list v-if="tools.iAmAdminCircuit(circuit.name)" style="min-width: 200px">
|
||||
<q-item clickable v-close-popup @click="tools.setCmd($q, shared_consts.CIRCUITCMD.DELETE, myusername(), '', circuit.name)">
|
||||
<q-item-section>{{ $t('circuit.delete') }}</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
</q-btn>
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
<q-item-section side v-if="visu === costanti.REQ_GROUP">
|
||||
<q-item-section side v-if="visu === costanti.REQ_CIRCUIT">
|
||||
<q-item-label>
|
||||
<q-btn rounded icon="fas fa-ellipsis-h">
|
||||
<q-menu>
|
||||
<q-list style="min-width: 150px">
|
||||
<q-item clickable icon="fas fa-user-minus" v-close-popup
|
||||
@click="tools.setCmd($q, shared_consts.GROUPSCMD.REQGROUP, myusername(), false, circuit.groupnameId)">
|
||||
<q-item-section>{{ $t('groups.reject_ask_group') }}</q-item-section>
|
||||
@click="tools.setCmd($q, shared_consts.CIRCUITCMD.REFUSE_REQ, myusername(), false, circuit.name)">
|
||||
<q-item-section>{{ $t('circuit.reject_ask') }}</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
@@ -89,11 +84,11 @@
|
||||
<q-menu>
|
||||
<q-list style="min-width: 150px">
|
||||
<q-item clickable icon="fas fa-user-minus" v-close-popup
|
||||
@click="tools.setCmd($q, shared_consts.GROUPSCMD.REFUSE_REQ_GROUP, myusername(), '', circuit.groupnameId)">
|
||||
@click="tools.setCmd($q, shared_consts.CIRCUITCMD.REFUSE_REQ, myusername(), '', circuit.name)">
|
||||
<q-item-section>{{ $t('shared.refuse_ask') }}</q-item-section>
|
||||
</q-item>
|
||||
<q-item clickable icon="fas fa-user-minus" v-close-popup
|
||||
@click="tools.setCmd($q, shared_consts.GROUPSCMD.CANCEL_REQ_GROUP, myusername(), '', circuit.groupnameId)">
|
||||
@click="tools.setCmd($q, shared_consts.CIRCUITCMD.CANCEL_REQ, myusername(), '', circuit.name)">
|
||||
<q-item-section>{{ $t('shared.cancel_ask') }}</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
|
||||
@@ -56,8 +56,8 @@ export default defineComponent({
|
||||
try {
|
||||
if (props.modelValue === costanti.CIRCUITS) {
|
||||
arr = circuitStore.listcircuits
|
||||
} else if (props.modelValue === costanti.MY_USERACCOUNTS ) {
|
||||
arr = userStore.my.profile.listUserAccounts
|
||||
} else if (props.modelValue === costanti.MY_CIRCUITS ) {
|
||||
arr = userStore.my.profile.mycircuits
|
||||
} else if (props.modelValue === costanti.MANAGE_CIRCUITS) {
|
||||
// arr = userStore.my.profile.manage_mycircuits
|
||||
} else if (props.modelValue === costanti.ASK_SENT_CIRCUIT) {
|
||||
@@ -73,13 +73,13 @@ export default defineComponent({
|
||||
const myoptions = computed(() => {
|
||||
const mybutt = []
|
||||
mybutt.push({ label: t('mypages.find_circuit'), value: costanti.FIND_CIRCUIT })
|
||||
mybutt.push({ label: t('mypages.follow_circuits') + ' (' + numMyCircuits.value + ')', value: costanti.MY_USERACCOUNTS })
|
||||
mybutt.push({ label: t('mypages.follow_circuits') + ' (' + numMyCircuits.value + ')', value: costanti.MY_CIRCUITS })
|
||||
// mybutt.push({ label: t('mypages.manage_my_circuits') + ' (' + numManageCircuits.value + ')', value: costanti.MANAGE_CIRCUITS })
|
||||
|
||||
|
||||
if (numAskSentCircuits.value > 0 || props.modelValue === costanti.ASK_SENT_CIRCUIT)
|
||||
mybutt.push({
|
||||
label: t('mypages.request_sent_circuits') + ' (' + numAskSentCircuits.value + ')',
|
||||
label: t('mypages.request_sent') + ' (' + numAskSentCircuits.value + ')',
|
||||
value: costanti.ASK_SENT_CIRCUIT
|
||||
})
|
||||
|
||||
@@ -89,7 +89,7 @@ export default defineComponent({
|
||||
|
||||
|
||||
const numMyCircuits = computed(() => {
|
||||
const arr = userStore.my.profile.listUserAccounts
|
||||
const arr = userStore.my.profile.mycircuits
|
||||
return (arr) ? arr.length : 0
|
||||
})
|
||||
|
||||
|
||||
@@ -44,6 +44,11 @@ export default defineComponent({
|
||||
required: false,
|
||||
default: '',
|
||||
},
|
||||
circuitname: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: '',
|
||||
},
|
||||
labelextra: {
|
||||
type: String,
|
||||
required: false,
|
||||
@@ -98,7 +103,7 @@ export default defineComponent({
|
||||
})
|
||||
if (numAskSentFriends.value > 0 || props.modelValue === costanti.ASK_SENT_FRIENDS)
|
||||
mybutt.push({
|
||||
label: t('mypages.request_sent_friends') + ' (' + numAskSentFriends.value + ')',
|
||||
label: t('mypages.request_sent') + ' (' + numAskSentFriends.value + ')',
|
||||
value: costanti.ASK_SENT_FRIENDS
|
||||
})
|
||||
if (numAskTrust.value > 0 || props.modelValue === costanti.ASK_TRUST)
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
@setCmd="setCmd"
|
||||
:visu="visu"
|
||||
:groupname="groupname"
|
||||
:circuitname="circuitname"
|
||||
:labelextra="labelextra">
|
||||
</CMyUser>
|
||||
</span>
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
</q-item>
|
||||
</q-list>
|
||||
<q-list v-else-if="(!userStore.IsMyGroupByGroupname(grp.groupname) && userStore.IsAskedGroupByGroupname(grp.groupname) && !userStore.IsRefusedGroupByGroupname(grp.groupname))" style="min-width: 200px">
|
||||
<q-item clickable v-close-popup @click="tools.setCmd($q, shared_consts.GROUPSCMD.REQGROUP, myusername(), false, grp.groupname)">
|
||||
<q-item clickable v-close-popup @click="tools.setCmd($q, shared_consts.GROUPSCMD.REFUSE_REQ_GROUP, myusername(), false, grp.groupname)">
|
||||
<q-item-section>{{ $t('shared.refuse_ask') }}</q-item-section>
|
||||
</q-item>
|
||||
<q-item clickable v-close-popup @click="tools.setCmd($q, shared_consts.GROUPSCMD.REQGROUP, myusername(), false, grp.groupname)">
|
||||
|
||||
@@ -76,7 +76,7 @@ export default defineComponent({
|
||||
|
||||
if (numAskSentGroups.value > 0 || props.modelValue === costanti.ASK_SENT_GROUP)
|
||||
mybutt.push({
|
||||
label: t('mypages.request_sent_groups') + ' (' + numAskSentGroups.value + ')',
|
||||
label: t('mypages.request_sent') + ' (' + numAskSentGroups.value + ')',
|
||||
value: costanti.ASK_SENT_GROUP
|
||||
})
|
||||
|
||||
|
||||
@@ -31,6 +31,16 @@ export default defineComponent({
|
||||
required: false,
|
||||
default: '',
|
||||
},
|
||||
circuitname: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: '',
|
||||
},
|
||||
name: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: '',
|
||||
},
|
||||
labelextra: {
|
||||
type: String,
|
||||
required: false,
|
||||
|
||||
@@ -93,43 +93,6 @@
|
||||
</q-btn>
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
<q-item-section side v-else-if="visu === costanti.REQ_ADD_USER_TO_CIRCUIT">
|
||||
<q-item-label>
|
||||
<q-btn rounded icon="fas fa-ellipsis-h">
|
||||
<q-menu>
|
||||
<q-list v-if="true" style="min-width: 150px">
|
||||
|
||||
<q-item clickable v-close-popup @click="tools.addToMyCircuits($q, contact.username, groupname)">
|
||||
<q-item-section avatar>
|
||||
<q-icon color="positive" name="fas fa-user-plus"/>
|
||||
</q-item-section>
|
||||
<q-item-section>
|
||||
{{ $t('groups.accept_circuit') }}
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
<q-list style="min-width: 200px">
|
||||
<q-item clickable v-close-popup
|
||||
@click="tools.refuseReqGroup($q, contact.username, groupname)">
|
||||
<q-item-section avatar>
|
||||
<q-icon color="negative" name="fas fa-user-minus"/>
|
||||
</q-item-section>
|
||||
|
||||
<q-item-section>{{ $t('shared.refuse_ask') }}</q-item-section>
|
||||
</q-item>
|
||||
<q-item clickable v-close-popup
|
||||
@click="tools.cancelReqGroups($q, contact.username, groupname)">
|
||||
<q-item-section avatar>
|
||||
<q-icon color="negative" name="fas fa-user-minus"/>
|
||||
</q-item-section>
|
||||
|
||||
<q-item-section>{{ $t('shared.cancel_ask_short') }}</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
</q-btn>
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
<q-item-section side v-else-if="visu === costanti.REQ_REMOVE_USER_TO_GROUP">
|
||||
<q-item-label v-if="contact.username !== userStore.my.username">
|
||||
<q-btn rounded icon="fas fa-ellipsis-h">
|
||||
@@ -164,6 +127,77 @@
|
||||
</q-btn>
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
<q-item-section side v-else-if="visu === costanti.REQ_ADD_USER_TO_CIRCUIT">
|
||||
<q-item-label>
|
||||
<q-btn rounded icon="fas fa-ellipsis-h">
|
||||
<q-menu>
|
||||
<q-list v-if="true" style="min-width: 150px">
|
||||
|
||||
<q-item clickable v-close-popup @click="tools.addToMyCircuits($q, contact.username, circuitname)">
|
||||
<q-item-section avatar>
|
||||
<q-icon color="positive" name="fas fa-user-plus"/>
|
||||
</q-item-section>
|
||||
<q-item-section>
|
||||
{{ $t('circuit.accept') }}
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
<q-list style="min-width: 200px">
|
||||
<q-item clickable v-close-popup
|
||||
@click="tools.refuseReqCircuit($q, contact.username, circuitname)">
|
||||
<q-item-section avatar>
|
||||
<q-icon color="negative" name="fas fa-user-minus"/>
|
||||
</q-item-section>
|
||||
|
||||
<q-item-section>{{ $t('shared.refuse_ask') }}</q-item-section>
|
||||
</q-item>
|
||||
<q-item clickable v-close-popup
|
||||
@click="tools.cancelReqCircuit($q, contact.username, circuitname)">
|
||||
<q-item-section avatar>
|
||||
<q-icon color="negative" name="fas fa-user-minus"/>
|
||||
</q-item-section>
|
||||
|
||||
<q-item-section>{{ $t('shared.cancel_ask_short') }}</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
</q-btn>
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
<q-item-section side v-else-if="visu === costanti.REQ_REMOVE_USER_TO_CIRCUIT">
|
||||
<q-item-label v-if="contact.username !== userStore.my.username">
|
||||
<q-btn rounded icon="fas fa-ellipsis-h">
|
||||
<q-menu>
|
||||
<q-list style="min-width: 150px">
|
||||
<q-item clickable v-if="!tools.isUserAdminCircuit(circuitname, contact.username)" v-close-popup @click="tools.addtoAdminOfCircuit($q, contact.username, circuitname)">
|
||||
<q-item-section avatar>
|
||||
<q-icon color="positive" name="fas fa-user-shield"/>
|
||||
</q-item-section>
|
||||
<q-item-section>{{ $t('circuit.addasadmin') }}</q-item-section>
|
||||
</q-item>
|
||||
<q-item clickable v-if="tools.isUserAdminCircuit(circuitname, contact.username) && tools.iAmTheCreatorOfTheCircuit(circuitname)" v-close-popup @click="tools.removeAdminOfCircuit($q, contact.username, circuitname)">
|
||||
<q-item-section avatar>
|
||||
<q-icon color="negative" name="fas fa-user-times"/>
|
||||
</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-section avatar>
|
||||
<q-icon color="negative" name="fas fa-user-minus"/>
|
||||
</q-item-section>
|
||||
<q-item-section>{{ $t('circuit.remove_from_mycircuit') }}</q-item-section>
|
||||
</q-item>
|
||||
<q-item clickable v-close-popup @click="tools.reportUser($q, userStore.my.username, contact.username)">
|
||||
<q-item-section avatar>
|
||||
<q-icon color="negative" name="fas fa-flag"/>
|
||||
</q-item-section>
|
||||
<q-item-section>{{ $t('friends.report_user') }}</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
</q-btn>
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
<q-item-section side v-else-if="visu === costanti.ASK_SENT_FRIENDS">
|
||||
<q-item-label>
|
||||
<q-btn rounded icon="fas fa-ellipsis-h">
|
||||
|
||||
@@ -86,6 +86,7 @@
|
||||
</q-avatar>
|
||||
</q-item-section>
|
||||
|
||||
|
||||
<q-item-section v-ripple>
|
||||
<q-item-label lines="5" :class="(!notif.read) ? 'unread' : 'read'" @click="clickNotif(notif)">
|
||||
<div v-html="getNotifText($t, notif, false)"></div>
|
||||
@@ -110,8 +111,7 @@
|
||||
/>
|
||||
</div>
|
||||
</q-item-label>
|
||||
|
||||
<q-item-label caption lines="2" v-if="notif.typedir === shared_consts.TypeNotifs.TYPEDIR_GROUPS && notif.status === 0 && notif.typeid === shared_consts.TypeNotifs.ID_GROUP_REQUEST_TO_ENTER" v-ripple>
|
||||
<q-item-label caption lines="2" v-else-if="notif.typedir === shared_consts.TypeNotifs.TYPEDIR_GROUPS && notif.status === 0 && notif.typeid === shared_consts.TypeNotifs.ID_GROUP_REQUEST_TO_ENTER" v-ripple>
|
||||
<div class="row no-wrap justify-evenly" v-if="tools.iAmAdminGroup(notif.extrafield)">
|
||||
<q-btn
|
||||
dense
|
||||
@@ -131,6 +131,27 @@
|
||||
/>
|
||||
</div>
|
||||
</q-item-label>
|
||||
<q-item-label caption lines="2" v-else-if="notif.typedir === shared_consts.TypeNotifs.TYPEDIR_CIRCUITS && notif.status === 0 && notif.typeid === shared_consts.TypeNotifs.ID_CIRCUIT_REQUEST_TO_ENTER" v-ripple>
|
||||
|
||||
<div class="row no-wrap justify-evenly" v-if="tools.iAmAdminCircuit(notif.extrafield)">
|
||||
<q-btn
|
||||
dense
|
||||
rounded
|
||||
size="sm"
|
||||
icon="fas fa-user-plus"
|
||||
color="positive" :label="$t('circuit.accept')"
|
||||
@click="tools.addToMyCircuits($q, notif.sender, notif.extrafield)"
|
||||
/>
|
||||
<q-btn
|
||||
dense
|
||||
rounded
|
||||
size="sm"
|
||||
icon="fas fa-user-minus"
|
||||
color="negative" :label="$t('shared.refuse_ask')"
|
||||
@click="tools.refuseReqCircuit($q, notif.sender, notif.extrafield)"
|
||||
/>
|
||||
</div>
|
||||
</q-item-label>
|
||||
|
||||
<q-item-label caption lines="1" :class="(!notif.read) ? 'unread-date' : 'read-date'" @click="clickNotif(notif)">
|
||||
{{ tools.timeAgo(notif.datenotif) }}
|
||||
|
||||
@@ -889,6 +889,11 @@ export interface ICircuitList {
|
||||
inscription_date?: Date
|
||||
}
|
||||
|
||||
export interface IMyCircuit {
|
||||
_id: number
|
||||
circuitname: string
|
||||
date: Date
|
||||
}
|
||||
|
||||
export interface ICircuit {
|
||||
_id: number
|
||||
@@ -899,7 +904,6 @@ export interface ICircuit {
|
||||
longdescr: string
|
||||
systemUserDescr: string
|
||||
systemUserId: string
|
||||
founderUserId: string
|
||||
totCircolante?: number
|
||||
totTransato?: number
|
||||
nome_valuta: string
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { IToken } from '@model/other'
|
||||
import { ICart, IOrderCart, IShareWithUs } from '@src/model/Products'
|
||||
import { IAccount, ICircuit, ICircuitList, IGallery, IImgGallery } from '@model/GlobalStore'
|
||||
import { IAccount, ICircuit, ICircuitList, IGallery, IImgGallery, IMyCircuit } from '@model/GlobalStore'
|
||||
|
||||
const enum ESexType {
|
||||
None = 0,
|
||||
@@ -87,6 +87,7 @@ export interface IUserProfile {
|
||||
friends: IFriends[]
|
||||
req_friends: IFriends[]
|
||||
mygroups: IMyGroup[]
|
||||
mycircuits: IMyCircuit[]
|
||||
manage_mygroups: IMyGroup[]
|
||||
notifs: IUserNotifType[]
|
||||
notif_idCities: number[]
|
||||
@@ -103,8 +104,7 @@ export interface IUserProfile {
|
||||
|
||||
asked_circuits: any[]
|
||||
refused_circuits: any[]
|
||||
listUserAccounts: IAccount[]
|
||||
manage_mycircuits?: ICircuit[]
|
||||
manage_mycircuits: ICircuit[]
|
||||
}
|
||||
|
||||
export interface IPaymentType {
|
||||
|
||||
@@ -882,8 +882,7 @@ const msg_enUs = {
|
||||
test: 'Test',
|
||||
groups: 'Gruppi',
|
||||
request_friends: 'Richieste Amicizia',
|
||||
request_sent_friends: 'Richieste Inviate',
|
||||
request_sent_groups: 'Richieste Inviate',
|
||||
request_sent: 'Richieste Inviate',
|
||||
request_trust: 'Richieste Fiducia',
|
||||
trusted: 'Fiducia Accettata',
|
||||
rejected: 'Rifiutati',
|
||||
|
||||
@@ -808,8 +808,7 @@ const msg_es = {
|
||||
test: 'Test',
|
||||
groups: 'Gruppi',
|
||||
request_friends: 'Rich. Amicizia',
|
||||
request_sent_friends: 'Rich. Inviate',
|
||||
request_sent_groups: 'Rich. Inviate',
|
||||
request_sent: 'Rich. Inviate',
|
||||
request_trust: 'Rich. Fiducia',
|
||||
trusted: 'Fiducia Accettata',
|
||||
rejected: 'Rifiutati',
|
||||
|
||||
@@ -212,10 +212,10 @@ const msg_it = {
|
||||
deletedgroup: 'Gruppo Eliminato',
|
||||
domanda_addtofriend: 'Aggiungere agli amici {username}?',
|
||||
domanda_addtogroup: 'Aggiungi {username} al gruppo {groupname}?',
|
||||
domanda_addtocircuit: 'Aggiungi {username} al Circuito {name}?',
|
||||
domanda_addtocircuit: 'Aggiungi {username} al Circuito {circuitname}?',
|
||||
addedfriend: 'Aggiunto alla lista di Amici',
|
||||
addedgroup: 'Aggiunto al Gruppo',
|
||||
addedcircuit: 'Aggiunto al Circuito {name}',
|
||||
addedcircuit: 'Aggiunto al Circuito {circuitname}',
|
||||
domanda_trusted: 'Accettare la Fiducia a {username}?',
|
||||
trusted: 'Accettato la Fiducia',
|
||||
domanda_ask_friend: 'Chiedere l\'Amicizia a {username}?',
|
||||
@@ -994,8 +994,7 @@ const msg_it = {
|
||||
test: 'Test',
|
||||
groups: 'Gruppi',
|
||||
request_friends: 'Richieste Amicizia',
|
||||
request_sent_friends: 'Richieste Inviate',
|
||||
request_sent_groups: 'Richieste Inviate',
|
||||
request_sent: 'Richieste Inviate',
|
||||
request_trust: 'Richieste Fiducia',
|
||||
trusted: 'Fiducia Accettata',
|
||||
rejected: 'Rifiutati',
|
||||
@@ -1025,23 +1024,23 @@ const msg_it = {
|
||||
info1: 'Info',
|
||||
subscribes: 'Membri',
|
||||
cancel_ask: 'Annulla la richiesta',
|
||||
refuse_ask: 'Rifiuta la richiesta (con avviso)',
|
||||
refuse_ask: 'Rifiuta la richiesta',
|
||||
cancel_ask_short: 'Annulla richiesta',
|
||||
refuse_ask_short: 'Rifiuta la richiesta',
|
||||
member: 'membro',
|
||||
members: 'membri',
|
||||
admin: 'amministratore',
|
||||
admins: 'Amministratori',
|
||||
createdby: 'Creato da {username} in data {date}',
|
||||
lastmodify: 'Ultima modifica {date}',
|
||||
},
|
||||
groups: {
|
||||
info: 'Informazioni su questo gruppo',
|
||||
member: 'membro',
|
||||
accepted: 'Ingresso Accettato',
|
||||
refused: 'Ingresso Rifiutato',
|
||||
deleted: 'Cancellato',
|
||||
blocked: 'Bloccato',
|
||||
removed: 'Rimosso',
|
||||
createdby: 'Creato da {username} in data {date}',
|
||||
lastmodify: 'Ultima modifica {date}',
|
||||
ask_group: 'Chiedi di entrare nel Gruppo',
|
||||
exit_group: 'Esci dal Gruppo',
|
||||
delete_group: 'Elimina il Gruppo',
|
||||
@@ -1094,13 +1093,14 @@ const msg_it = {
|
||||
preferences: 'Preferenze',
|
||||
},
|
||||
circuit: {
|
||||
info: 'Informazioni su questo Circuito',
|
||||
name: 'Nome Circuito',
|
||||
path: 'Nome Pagina',
|
||||
subname: 'SottoNome',
|
||||
descr: 'Descrizione',
|
||||
systemUserDescr: 'Descr Utente di Sistema',
|
||||
systemUserId: 'ID Utente di Sistema',
|
||||
founderUserId: 'ID Fondatore',
|
||||
founder: 'Fondatore',
|
||||
totCircolante: 'Totale Circolante',
|
||||
totTransato: 'Totale Transato',
|
||||
nome_valuta: 'Nome Valuta',
|
||||
@@ -1122,18 +1122,31 @@ const msg_it = {
|
||||
img_logo: 'NomeFile Logo',
|
||||
regulation: 'Regolamento',
|
||||
|
||||
domanda_ask: 'Chiedere l\'invito al Circuito {name}?',
|
||||
domanda_revoke: 'Revocare la richiesta al Circuito {name}?',
|
||||
askedto: 'Chiesto l\'invito al Circuito {name}',
|
||||
revoketo: 'Revocato la richiesta d\'invito al Circuito {name}',
|
||||
domanda_ask: 'Chiedere l\'invito al Circuito {circuitname}?',
|
||||
domanda_revoke: 'Revocare la richiesta al Circuito {circuitname}?',
|
||||
askedto: 'Chiesto l\'invito al Circuito {circuitname}',
|
||||
revoketo: 'Revocato la richiesta d\'invito al Circuito {circuitname}',
|
||||
domanda_remove: 'Rimuovere dal Circuito {username} ?',
|
||||
removed: 'Rimosso dal Circuito',
|
||||
domanda_removerecord: 'Sicuro di voler Eliminare il Circuito {name} ?',
|
||||
deleted: 'Circuito {name} Eliminato',
|
||||
domanda_removerecord: 'Sicuro di voler Eliminare il Circuito {circuitname} ?',
|
||||
deleted: 'Circuito {circuitname} Eliminato',
|
||||
delete: 'Elimina il Circuito',
|
||||
addasadmin: 'Aggiungi come Admin del Circuito',
|
||||
remove_as_admin: 'Rimuovi come Admin del Circuito',
|
||||
remove_from_mycircuit: 'Rimuovi dal Circuito',
|
||||
ask: 'Chiedi di entrare nel Circuito',
|
||||
exit: 'Esci dal Circuito',
|
||||
accept: 'Accetta la richiesta',
|
||||
exit_circuit: 'Esci dal Circuito',
|
||||
domanda_cancel_req: 'Annullare la richiesta d\'invito di {username} al Circuito {circuitname}?',
|
||||
cancel_req: 'Annullata la richiesta al Circuito {circuitname}',
|
||||
remove_from_mylist: 'Rimuovi dal Circuito',
|
||||
reject_ask: 'Rifiuta l\'ingresso dal Circuito',
|
||||
domanda_exit_fromcircuit: 'Uscire dal CIrcuito {groupname} ?',
|
||||
domanda_addadminofcircuit: 'Aggiungere {username} come Amministratore del CIrcuito {circuitname} ?',
|
||||
domanda_removeadminofcircuit: 'Rimuovere {username} dall\' incarico di Amministratore del CIrcuito {circuitname} ?',
|
||||
domanda_refuse_circuit: 'Rifiutare la richiesta di {username} per entrare nel Circuito {circuitname}?',
|
||||
refusedcircuit: 'Rifiutato a {username} la richiesta di entrare nel Circuito',
|
||||
},
|
||||
|
||||
account: {
|
||||
|
||||
@@ -192,7 +192,7 @@ export const costanti = {
|
||||
MANAGE_GROUPS: 31,
|
||||
ADMIN_GROUPS: 40,
|
||||
FIND_CIRCUIT: 50,
|
||||
MY_USERACCOUNTS: 51,
|
||||
MY_CIRCUITS: 51,
|
||||
CREATE_CIRCUIT: 52,
|
||||
MANAGE_CIRCUITS: 53,
|
||||
ADMIN_CIRCUITS: 54,
|
||||
@@ -207,10 +207,11 @@ export const costanti = {
|
||||
REQ_ADD_USER_TO_GROUP: 100,
|
||||
REQ_REMOVE_USER_TO_GROUP: 101,
|
||||
REQ_ADD_USER_TO_CIRCUIT: 110,
|
||||
REQ_REMOVE_USER_TO_CIRCUIT: 111,
|
||||
|
||||
FILTER_NESSUNO: 0,
|
||||
FILTER_TUTTI: -100,
|
||||
TABLES_ARRAY: ['mygroups'],
|
||||
TABLES_ARRAY: ['mygroups', 'circuits'],
|
||||
TABLES_USERNAME_DATE: ['friends', 'friendsandme'],
|
||||
TABLES_IMG_USERNAME: ['friends', 'friendsandme'],
|
||||
|
||||
|
||||
@@ -594,7 +594,7 @@ export const colmyUserGroup = [
|
||||
}),*/
|
||||
AddCol({
|
||||
name: 'admins',
|
||||
label_trans: 'groups.admins',
|
||||
label_trans: 'shared.admins',
|
||||
fieldtype: costanti.FieldType.multiselect,
|
||||
jointable: 'friendsandme',
|
||||
field_outtype: costanti.FieldType.object,
|
||||
@@ -2382,15 +2382,17 @@ export const colTableSubCashCategory = [
|
||||
|
||||
export const colTableCircuitComplete = [
|
||||
AddCol({ name: 'Num', label_trans: 'circuit.num', fieldtype: costanti.FieldType.number }),
|
||||
AddCol({ name: 'groupnameId', label_trans: 'circuit.groupnameId' }), // da togliere poi
|
||||
AddCol({ name: 'name', label_trans: 'circuit.name' }),
|
||||
AddCol({ name: 'groupnameId', label_trans: 'circuit.groupnameId', fieldtype: costanti.FieldType.select, jointable: 'mygroups' }), // da togliere poi
|
||||
AddCol({ name: 'name', label_trans: 'circuit.name',
|
||||
maxlength: 40,
|
||||
showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage }),
|
||||
AddCol({ name: 'path', label_trans: 'circuit.path' }),
|
||||
AddCol({ name: 'subname', label_trans: 'circuit.subname' }),
|
||||
AddCol({ name: 'longdescr', label_trans: 'circuit.descr', fieldtype: costanti.FieldType.html }),
|
||||
AddCol({ name: 'regulation', label_trans: 'circuit.regulation', fieldtype: costanti.FieldType.html }),
|
||||
AddCol({ name: 'systemUserDescr', label_trans: 'circuit.systemUserDescr' }),
|
||||
AddCol({ name: 'systemUserId', label_trans: 'circuit.systemUserId', fieldtype: costanti.FieldType.select, jointable: 'users', }),
|
||||
AddCol({ name: 'founderUserId', label_trans: 'circuit.founderUserId', fieldtype: costanti.FieldType.select, jointable: 'users', }),
|
||||
AddCol({ name: 'createdBy', label_trans: 'circuit.founder', fieldtype: costanti.FieldType.select, jointable: 'users', }),
|
||||
AddCol({ name: 'totCircolante', label_trans: 'circuit.totCircolante', fieldtype: costanti.FieldType.number }),
|
||||
AddCol({ name: 'totTransato', label_trans: 'circuit.totTransato', fieldtype: costanti.FieldType.number }),
|
||||
AddCol({ name: 'nome_valuta', label_trans: 'circuit.nome_valuta' }),
|
||||
@@ -2412,7 +2414,7 @@ export const colTableCircuitComplete = [
|
||||
AddCol({ name: 'img_logo', label_trans: 'circuit.img_logo' }),
|
||||
AddCol({
|
||||
name: 'admins',
|
||||
label_trans: 'groups.admins',
|
||||
label_trans: 'shared.admins',
|
||||
fieldtype: costanti.FieldType.multiselect,
|
||||
jointable: 'friendsandme',
|
||||
field_outtype: costanti.FieldType.object,
|
||||
@@ -2437,13 +2439,29 @@ export const colTableCircuitComplete = [
|
||||
]
|
||||
|
||||
export const colTableCircuit = [
|
||||
AddCol({ name: 'groupnameId', label_trans: 'circuit.groupnameId' }), // da togliere poi
|
||||
AddCol({ name: 'name', label_trans: 'circuit.name' }),
|
||||
AddCol({ name: 'groupnameId', label_trans: 'circuit.groupnameId', fieldtype: costanti.FieldType.select, jointable: 'mygroups' }), // da togliere poi
|
||||
AddCol({ name: 'name', label_trans: 'circuit.name',
|
||||
maxlength: 40,
|
||||
showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage }),
|
||||
AddCol({ name: 'path', label_trans: 'circuit.path' }),
|
||||
AddCol({ name: 'subname', label_trans: 'circuit.subname' }),
|
||||
AddCol({ name: 'longdescr', label_trans: 'circuit.descr', fieldtype: costanti.FieldType.html }),
|
||||
AddCol({ name: 'systemUserId', label_trans: 'circuit.systemUserId', fieldtype: costanti.FieldType.select, jointable: 'users', }),
|
||||
AddCol({ name: 'founderUserId', label_trans: 'circuit.founderUserId', fieldtype: costanti.FieldType.select, jointable: 'users', }),
|
||||
AddCol({ name: 'createdBy', label_trans: 'circuit.founder', fieldtype: costanti.FieldType.select, jointable: 'users', }),
|
||||
AddCol({
|
||||
name: 'date_created', label_trans: 'reg.pub_created', fieldtype: costanti.FieldType.onlydate,
|
||||
required: false,
|
||||
visible: false,
|
||||
sortable: true,
|
||||
showWhen: 0
|
||||
}),
|
||||
AddCol({
|
||||
name: 'date_updated', label_trans: 'reg.pub_updated', fieldtype: costanti.FieldType.onlydate,
|
||||
required: false,
|
||||
visible: false,
|
||||
sortable: true,
|
||||
showWhen: 0
|
||||
}),
|
||||
AddCol({ name: 'nome_valuta', label_trans: 'circuit.nome_valuta' }),
|
||||
AddCol({ name: 'symbol', label_trans: 'circuit.symbol' }),
|
||||
AddCol({ name: 'data_costituz', label_trans: 'circuit.data_costituz', fieldtype: costanti.FieldType.date }),
|
||||
@@ -2459,6 +2477,7 @@ export const colmyUserCircuit = [
|
||||
AddCol({ name: 'deperibile', label_trans: 'account.deperibile', fieldtype: costanti.FieldType.boolean }),
|
||||
AddCol({ name: 'importo_iniziale', label_trans: 'account.importo_iniziale', fieldtype: costanti.FieldType.number }),
|
||||
AddCol({ name: 'saldo', label_trans: 'account.saldo', fieldtype: costanti.FieldType.number }),
|
||||
AddCol({ name: 'deleted', label_trans: 'reg.deleted', fieldtype: costanti.FieldType.boolean }),
|
||||
AddCol(DeleteRec),
|
||||
AddCol(DuplicateRec),
|
||||
]
|
||||
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
ITodo,
|
||||
IUserFields,
|
||||
Privacy,
|
||||
TipoVisu, IGroup, IMySkill, IMyBacheca, IImgGallery, IMsgGlobParam, IUserExport, ISpecialField, IAccount,
|
||||
TipoVisu, IGroup, IMySkill, IMyBacheca, IImgGallery, IMsgGlobParam, IUserExport, ISpecialField, IAccount, IMyCircuit,
|
||||
} from '@model'
|
||||
|
||||
import { addToDate } from '@quasar/quasar-ui-qcalendar'
|
||||
@@ -4734,26 +4734,26 @@ export const tools = {
|
||||
},
|
||||
|
||||
|
||||
addToMyCircuits($q: any, username: string, name: string) {
|
||||
addToMyCircuits($q: any, username: string, circuitname: string) {
|
||||
|
||||
const userStore = useUserStore()
|
||||
const notifStore = useNotifStore()
|
||||
$q.dialog({
|
||||
message: t('db.domanda_addtocircuit', { username, name }),
|
||||
message: t('db.domanda_addtocircuit', { username, circuitname }),
|
||||
ok: { label: t('dialog.yes'), push: true },
|
||||
cancel: { label: t('dialog.cancel') },
|
||||
title: t('db.domanda')
|
||||
}).onOk(() => {
|
||||
|
||||
userStore.setCircuitCmd($q, t, username, name, shared_consts.CIRCUITCMD.SET, true)
|
||||
userStore.setCircuitCmd($q, t, username, circuitname, shared_consts.CIRCUITCMD.SET, true)
|
||||
.then((res: any) => {
|
||||
if (res) {
|
||||
notifStore.updateNotification = true
|
||||
if (userStore.my.profile.listUserAccounts)
|
||||
userStore.my.profile.listUserAccounts = [...userStore.my.profile.listUserAccounts, res]
|
||||
if (userStore.my.profile.mycircuits)
|
||||
userStore.my.profile.mycircuits = [...userStore.my.profile.mycircuits, res]
|
||||
else
|
||||
userStore.my.profile.listUserAccounts = [res]
|
||||
tools.showPositiveNotif($q, t('db.addedcircuit', { name }))
|
||||
userStore.my.profile.mycircuits = [res]
|
||||
tools.showPositiveNotif($q, t('db.addedcircuit', { circuitname }))
|
||||
}
|
||||
})
|
||||
})
|
||||
@@ -4798,7 +4798,9 @@ export const tools = {
|
||||
userStore.setGroupsCmd($q, t, username, groupnameDest, shared_consts.GROUPSCMD.REFUSE_REQ_GROUP, null).then((res) => {
|
||||
if (res) {
|
||||
notifStore.updateNotification = true
|
||||
if (username === userStore.my.username) {
|
||||
userStore.my.profile.asked_groups = userStore.my.profile.asked_groups.filter((rec: IMyGroup) => rec.groupname !== groupnameDest)
|
||||
}
|
||||
tools.showPositiveNotif($q, t('db.refusedgroup', { username }))
|
||||
}
|
||||
})
|
||||
@@ -4836,10 +4838,12 @@ export const tools = {
|
||||
userStore.setGroupsCmd($q, t, username, groupnameDest, shared_consts.GROUPSCMD.REMOVE_FROM_MYGROUP, null).then((res) => {
|
||||
if (res) {
|
||||
if (userStore.my.profile.mygroups) {
|
||||
if (username === userStore.my.username) {
|
||||
userStore.my.profile.mygroups = userStore.my.profile.mygroups.filter((rec: IMyGroup) => rec.groupname !== groupnameDest)
|
||||
tools.showPositiveNotif($q, t('db.removedgroup'))
|
||||
}
|
||||
}
|
||||
tools.showPositiveNotif($q, t('db.removedgroup'))
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
@@ -5025,7 +5029,9 @@ export const tools = {
|
||||
|
||||
userStore.setGroupsCmd($q, t, username, groupnameDest, shared_consts.GROUPSCMD.CANCEL_REQ_GROUP, null).then((res) => {
|
||||
if (res) {
|
||||
if (username === userStore.my.username) {
|
||||
userStore.my.profile.asked_groups = userStore.my.profile.asked_groups.filter((rec: IMyGroup) => rec.groupname !== groupnameDest)
|
||||
}
|
||||
tools.showPositiveNotif($q, t('db.cancel_req_group'))
|
||||
}
|
||||
})
|
||||
@@ -5187,15 +5193,15 @@ export const tools = {
|
||||
return risultato
|
||||
|
||||
},
|
||||
setRequestCircuit($q: any, username: string, name: string, value: boolean) {
|
||||
setRequestCircuit($q: any, username: string, circuitname: string, value: boolean) {
|
||||
|
||||
const userStore = useUserStore()
|
||||
|
||||
let msg = ''
|
||||
if (value) {
|
||||
msg = t('circuit.domanda_ask', { name })
|
||||
msg = t('circuit.domanda_ask', { circuitname })
|
||||
} else {
|
||||
msg = t('circuit.domanda_revoke', { name })
|
||||
msg = t('circuit.domanda_revoke', { circuitname })
|
||||
}
|
||||
|
||||
$q.dialog({
|
||||
@@ -5210,17 +5216,17 @@ export const tools = {
|
||||
title: t('db.domanda')
|
||||
}).onOk(() => {
|
||||
|
||||
userStore.setCircuitCmd($q, t, username, name, shared_consts.CIRCUITCMD.REQ, value)
|
||||
userStore.setCircuitCmd($q, t, username, circuitname, shared_consts.CIRCUITCMD.REQ, value)
|
||||
.then((res: any) => {
|
||||
if (res) {
|
||||
if (value) {
|
||||
// ADD to req
|
||||
userStore.my.profile.asked_circuits.push(res)
|
||||
tools.showPositiveNotif($q, t('circuit.askedto', { name }))
|
||||
tools.showPositiveNotif($q, t('circuit.askedto', { circuitname }))
|
||||
} else {
|
||||
// REMOVE to req
|
||||
userStore.my.profile.asked_circuits = userStore.my.profile.asked_circuits.filter((rec: ICircuit) => rec.name !== name)
|
||||
tools.showPositiveNotif($q, t('circuit.revoketo', { name }))
|
||||
userStore.my.profile.asked_circuits = userStore.my.profile.asked_circuits.filter((rec: ICircuit) => rec.name !== circuitname)
|
||||
tools.showPositiveNotif($q, t('circuit.revoketo', { circuitname }))
|
||||
}
|
||||
|
||||
} else {
|
||||
@@ -5230,7 +5236,50 @@ export const tools = {
|
||||
})
|
||||
},
|
||||
|
||||
removeFromMyCircuits($q: any, username: string, name: string, domanda: any = '') {
|
||||
cancelReqCircuit($q: any, username: string, circuitname: string) {
|
||||
const userStore = useUserStore()
|
||||
$q.dialog({
|
||||
message: t('circuit.domanda_cancel_req', { username, circuitname }),
|
||||
ok: { label: t('dialog.yes'), push: true },
|
||||
cancel: { label: t('dialog.cancel') },
|
||||
title: t('db.domanda')
|
||||
}).onOk(() => {
|
||||
|
||||
userStore.setCircuitCmd($q, t, username, circuitname, shared_consts.CIRCUITCMD.CANCEL_REQ, null).then((res) => {
|
||||
if (res) {
|
||||
if (username === userStore.my.username) {
|
||||
userStore.my.profile.asked_circuits = userStore.my.profile.asked_circuits.filter((rec: ICircuit) => rec.name !== circuitname)
|
||||
}
|
||||
tools.showPositiveNotif($q, t('db.cancel_req_group'))
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
refuseReqCircuit($q: any, username: string, circuitname: string) {
|
||||
|
||||
const userStore = useUserStore()
|
||||
const notifStore = useNotifStore()
|
||||
$q.dialog({
|
||||
message: t('circuit.domanda_refuse_circuit', { username, circuitname }),
|
||||
ok: { label: t('dialog.yes'), push: true },
|
||||
cancel: { label: t('dialog.cancel') },
|
||||
title: t('db.domanda')
|
||||
}).onOk(() => {
|
||||
|
||||
userStore.setCircuitCmd($q, t, username, circuitname, shared_consts.CIRCUITCMD.REFUSE_REQ, null).then((res) => {
|
||||
if (res) {
|
||||
notifStore.updateNotification = true
|
||||
if (username === userStore.my.username) {
|
||||
userStore.my.profile.asked_circuits = userStore.my.profile.asked_circuits.filter((rec: ICircuit) => rec.name !== circuitname)
|
||||
}
|
||||
tools.showPositiveNotif($q, t('db.refusedcircuit', { username }))
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
removeFromMyCircuits($q: any, username: string, circuitname: string, domanda: any = '') {
|
||||
const userStore = useUserStore()
|
||||
|
||||
$q.dialog({
|
||||
@@ -5240,32 +5289,80 @@ export const tools = {
|
||||
title: t('db.domanda')
|
||||
}).onOk(() => {
|
||||
|
||||
userStore.setCircuitCmd($q, t, username, name, shared_consts.CIRCUITCMD.REMOVE_FROM_MYLIST, null).then((res) => {
|
||||
userStore.setCircuitCmd($q, t, username, circuitname, shared_consts.CIRCUITCMD.REMOVE_FROM_MYLIST, null).then((res) => {
|
||||
if (res) {
|
||||
if (userStore.my.profile.listUserAccounts) {
|
||||
userStore.my.profile.listUserAccounts = userStore.my.profile.listUserAccounts.filter((rec: IAccount) => rec.name !== name)
|
||||
if (userStore.my.profile.mycircuits && username === userStore.my.username) {
|
||||
userStore.my.profile.mycircuits = userStore.my.profile.mycircuits.filter((rec: IMyCircuit) => rec.circuitname !== circuitname)
|
||||
}
|
||||
tools.showPositiveNotif($q, t('circuit.removed'))
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
addtoAdminOfCircuit($q: any, username: string, circuitname: string, domanda: any = '') {
|
||||
const userStore = useUserStore()
|
||||
|
||||
$q.dialog({
|
||||
message: domanda ? domanda : t('db.domanda_addadminofcircuit', { username, circuitname }),
|
||||
ok: { label: t('dialog.yes'), push: true },
|
||||
cancel: { label: t('dialog.cancel') },
|
||||
title: t('db.domanda')
|
||||
}).onOk(() => {
|
||||
|
||||
userStore.setCircuitCmd($q, t, username, circuitname, shared_consts.CIRCUITCMD.ADDADMIN, null).then((res) => {
|
||||
if (res) {
|
||||
const mycircuit = userStore.my.profile.manage_mycircuits.find((rec: ICircuit) => rec.name === circuitname)
|
||||
console.log('mycircuit', mycircuit)
|
||||
if (mycircuit && mycircuit.admins) {
|
||||
mycircuit.admins = [...mycircuit.admins, {username, date: new Date}]
|
||||
console.log('mycircuit.admins', mycircuit.admins)
|
||||
tools.showPositiveNotif($q, t('db.addedtoadmin', { username }))
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
DeleteCircuit($q: any, username: string, name: string, domanda: any = '') {
|
||||
removeAdminOfCircuit($q: any, username: string, circuitname: string, domanda: any = '') {
|
||||
const userStore = useUserStore()
|
||||
|
||||
$q.dialog({
|
||||
message: domanda ? domanda : t('db.domanda_removerecord', { name }),
|
||||
message: domanda ? domanda : t('db.domanda_removeadminofcircuit', { username, circuitname }),
|
||||
ok: { label: t('dialog.yes'), push: true },
|
||||
cancel: { label: t('dialog.cancel') },
|
||||
title: t('db.domanda')
|
||||
}).onOk(() => {
|
||||
|
||||
userStore.setCircuitCmd($q, t, username, name, shared_consts.CIRCUITCMD.DELETE, null).then((res) => {
|
||||
userStore.setCircuitCmd($q, t, username, circuitname, shared_consts.CIRCUITCMD.REMOVEADMIN, null).then((res) => {
|
||||
if (res) {
|
||||
const mygrp = userStore.my.profile.manage_mycircuits.find((rec: ICircuit) => rec.name === circuitname)
|
||||
console.log('mygrp', mygrp)
|
||||
if (mygrp && mygrp.admins) {
|
||||
mygrp.admins = mygrp.admins.filter((rec: any) => rec.username !== username)
|
||||
console.log('mygrp.admins', mygrp.admins)
|
||||
tools.showPositiveNotif($q, t('db.removedtoadmin', { username }))
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
DeleteCircuit($q: any, username: string, circuitname: string, domanda: any = '') {
|
||||
const userStore = useUserStore()
|
||||
|
||||
$q.dialog({
|
||||
message: domanda ? domanda : t('db.domanda_removerecord', { circuitname }),
|
||||
ok: { label: t('dialog.yes'), push: true },
|
||||
cancel: { label: t('dialog.cancel') },
|
||||
title: t('db.domanda')
|
||||
}).onOk(() => {
|
||||
|
||||
userStore.setCircuitCmd($q, t, username, circuitname, shared_consts.CIRCUITCMD.DELETE, null).then((res) => {
|
||||
if (res) {
|
||||
if (userStore.my.profile.manage_mycircuits) {
|
||||
userStore.my.profile.manage_mycircuits = userStore.my.profile.manage_mycircuits.filter((rec: ICircuit) => rec.name !== name)
|
||||
tools.showPositiveNotif($q, t('circuit.deleted', { name } ))
|
||||
userStore.my.profile.manage_mycircuits = userStore.my.profile.manage_mycircuits.filter((rec: ICircuit) => rec.name !== circuitname)
|
||||
tools.showPositiveNotif($q, t('circuit.deleted', { circuitname } ))
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -5274,6 +5371,7 @@ export const tools = {
|
||||
|
||||
|
||||
iCanShowCircuitsMember(circuit: ICircuit) {
|
||||
// ++Todo: Posso vedere i membri dei Circuiti ???
|
||||
|
||||
/* if (grp && grp.visibility!.includes(shared_consts.Visibility_Group.PRIVATE)) {
|
||||
// Only if I am part of this group
|
||||
@@ -5284,14 +5382,14 @@ export const tools = {
|
||||
|
||||
},
|
||||
|
||||
iAmAdminCircuit(name: string) {
|
||||
iAmAdminCircuit(circuitname: string) {
|
||||
const userStore = useUserStore()
|
||||
|
||||
let risultato = false
|
||||
|
||||
if (userStore.my.profile.manage_mycircuits) {
|
||||
const ris = userStore.my.profile.manage_mycircuits.find((circuit: ICircuit) => {
|
||||
if (circuit.name === name) {
|
||||
if (circuit.name === circuitname) {
|
||||
return true
|
||||
}
|
||||
})
|
||||
@@ -5405,7 +5503,7 @@ export const tools = {
|
||||
|
||||
},
|
||||
|
||||
isUserTheCreatorOfThCircuit(name: string, username: string) {
|
||||
isUserTheCreatorOfTheCircuit(name: string, username: string) {
|
||||
const userStore = useUserStore()
|
||||
|
||||
let risultato = false
|
||||
@@ -5941,11 +6039,12 @@ export const tools = {
|
||||
circuitStore.listcircuits = ris.listcircuits ? ris.listcircuits : []
|
||||
|
||||
// to Refresh Data User Accounts:
|
||||
userStore.my.profile.listUserAccounts = ris.listUserAccounts ? ris.listUserAccounts : []
|
||||
userStore.my.profile.mycircuits = ris.mycircuits ? ris.mycircuits : []
|
||||
|
||||
// Others not loaded at the beginning:
|
||||
userStore.my.profile.asked_circuits = ris.listSentRequestCircuits ? ris.listSentRequestCircuits : []
|
||||
userStore.my.profile.refused_circuits = ris.listRefusedCircuits ? ris.listRefusedCircuits : []
|
||||
|
||||
userStore.my.profile.asked_circuits = ris.asked_circuits ? ris.asked_circuits : []
|
||||
userStore.my.profile.refused_circuits = ris.refused_circuits ? ris.refused_circuits : []
|
||||
return [{ userId: userStore.my._id }]
|
||||
}
|
||||
})
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { defineStore } from 'pinia'
|
||||
|
||||
import {
|
||||
ICircuit,
|
||||
ICircuit, IMyCircuit,
|
||||
IFriends, IMsgGlobParam,
|
||||
ISigninOptions,
|
||||
ISignupOptions, IUserFields, IUserNotifType, IUserProfile, IUserState,
|
||||
@@ -54,6 +54,7 @@ export const DefaultUser: IUserFields = {
|
||||
friends: [],
|
||||
req_friends: [],
|
||||
mygroups: [],
|
||||
mycircuits: [],
|
||||
manage_mygroups: [],
|
||||
asked_friends: [],
|
||||
asked_groups: [],
|
||||
@@ -66,7 +67,6 @@ export const DefaultUser: IUserFields = {
|
||||
notif_sector_goods: [],
|
||||
asked_circuits: [],
|
||||
refused_circuits: [],
|
||||
listUserAccounts: [],
|
||||
manage_mycircuits: [],
|
||||
},
|
||||
cart: {
|
||||
@@ -110,6 +110,7 @@ export const DefaultProfile: IUserProfile = {
|
||||
friends: [],
|
||||
req_friends: [],
|
||||
mygroups: [],
|
||||
mycircuits: [],
|
||||
manage_mygroups: [],
|
||||
asked_friends: [],
|
||||
asked_groups: [],
|
||||
@@ -123,7 +124,6 @@ export const DefaultProfile: IUserProfile = {
|
||||
|
||||
asked_circuits: [],
|
||||
refused_circuits: [],
|
||||
listUserAccounts: [],
|
||||
manage_mycircuits: [],
|
||||
}
|
||||
|
||||
@@ -288,26 +288,26 @@ export const useUserStore = defineStore('UserStore', {
|
||||
},
|
||||
|
||||
|
||||
IsAskedCircuitByName(groupname: string): boolean {
|
||||
IsAskedCircuitByName(name: string): boolean {
|
||||
if (this.my.profile.asked_circuits)
|
||||
return this.my.profile.asked_circuits.findIndex((rec: IMyGroup) => rec.groupname === groupname) >= 0
|
||||
return this.my.profile.asked_circuits.findIndex((rec: ICircuit) => rec.name === name) >= 0
|
||||
else
|
||||
return false
|
||||
},
|
||||
|
||||
|
||||
IsMyCircuitByName(name: string): boolean {
|
||||
IsMyCircuitByName(circuitname: string): boolean {
|
||||
|
||||
if (this.my.profile.manage_mycircuits)
|
||||
return this.my.profile.manage_mycircuits.findIndex((rec: ICircuit) => rec.name === name) >= 0
|
||||
if (this.my.profile.mycircuits)
|
||||
return this.my.profile.mycircuits.findIndex((rec: IMyCircuit) => rec.circuitname === circuitname) >= 0
|
||||
else
|
||||
return false
|
||||
|
||||
},
|
||||
|
||||
IsRefusedCircuitByName(name: string): boolean {
|
||||
IsRefusedCircuitByName(circuitname: string): boolean {
|
||||
if (this.my.profile.refused_circuits)
|
||||
return this.my.profile.refused_circuits.findIndex((rec: ICircuit) => rec.name === name) >= 0
|
||||
return this.my.profile.refused_circuits.findIndex((rec: ICircuit) => rec.name === circuitname) >= 0
|
||||
else
|
||||
return false
|
||||
},
|
||||
@@ -1108,7 +1108,7 @@ export const useUserStore = defineStore('UserStore', {
|
||||
|
||||
},
|
||||
|
||||
async loadCIrcuit(path: string, idnotif: string) {
|
||||
async loadCircuit(path: string, idnotif: string) {
|
||||
const data = {
|
||||
path,
|
||||
idnotif,
|
||||
@@ -1210,8 +1210,8 @@ export const useUserStore = defineStore('UserStore', {
|
||||
|
||||
},
|
||||
|
||||
async setCircuitCmd($q: any, t: any, usernameOrig: string, name: string, cmd: number, value: any) {
|
||||
return Api.SendReq('/users/circuits/cmd', 'POST', { usernameOrig, name, cmd, value })
|
||||
async setCircuitCmd($q: any, t: any, usernameOrig: string, circuitname: string, cmd: number, value: any) {
|
||||
return Api.SendReq('/users/circuits/cmd', 'POST', { usernameOrig, circuitname, cmd, value })
|
||||
.then((res) => {
|
||||
this.updateTables = true
|
||||
return res.data
|
||||
|
||||
@@ -67,14 +67,10 @@ export default defineComponent({
|
||||
return userStore.my.profile
|
||||
}
|
||||
|
||||
function circuitname() {
|
||||
return userStore.my.username
|
||||
}
|
||||
|
||||
async function loadCircuit() {
|
||||
// Carica il profilo di quest'utente
|
||||
if (path.value) {
|
||||
await userStore.loadCIrcuit(path.value, idnotif.value).then(({ data, status }: {data: any, status: number}) => {
|
||||
await userStore.loadCircuit(path.value, idnotif.value).then(({ data, status }: {data: any, status: number}) => {
|
||||
console.log('data', data)
|
||||
if (data) {
|
||||
circuit.value = data.circuit
|
||||
@@ -99,7 +95,9 @@ export default defineComponent({
|
||||
await loadCircuit()
|
||||
|
||||
searchList.value = []
|
||||
filtercustom.value = [{ 'profile.listUserAccounts': { $elemMatch: {circuitId: {$eq: path.value }} } } ]
|
||||
if (circuit.value) {
|
||||
filtercustom.value = [{ 'profile.mycircuits': { $elemMatch: { circuitname: { $eq: circuit.value.name } } } }]
|
||||
}
|
||||
|
||||
arrfilterand.value = []
|
||||
filtercustom_rich.value = []
|
||||
@@ -118,8 +116,6 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function extraparams() {
|
||||
let lk_tab = 'users'
|
||||
let lk_LF = 'userId'
|
||||
@@ -175,7 +171,6 @@ export default defineComponent({
|
||||
onMounted(mounted)
|
||||
|
||||
return {
|
||||
name,
|
||||
profile,
|
||||
tools,
|
||||
costanti,
|
||||
@@ -186,7 +181,6 @@ export default defineComponent({
|
||||
|
||||
filtroutente,
|
||||
showPic,
|
||||
circuitname,
|
||||
userStore,
|
||||
t,
|
||||
animation,
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
<q-menu>
|
||||
<q-list v-if="true" style="min-width: 150px">
|
||||
<q-item clickable v-close-popup
|
||||
@click="tools.removeFromMyCircuits($q, userStore.my.username, circuit.name, $t('db.domanda_exit_fromcircuit', {name: circuit.name }))">
|
||||
@click="tools.removeFromMyCircuits($q, userStore.my.username, circuit.name, $t('circuit.domanda_exit_fromcircuit', {name: circuit.name }))">
|
||||
<q-item-section avatar>
|
||||
<q-icon color="negative" name="fas fa-user-minus"/>
|
||||
</q-item-section>
|
||||
@@ -78,28 +78,17 @@
|
||||
v-if="userStore.IsAskedCircuitByName(circuit.name) && !userStore.IsMyCircuitByName(circuit.name)"
|
||||
icon="fas fa-user-minus"
|
||||
flat :label="$t('shared.cancel_ask_short')"
|
||||
@click="tools.cancelReqCircuits($q, userStore.my.username, circuit.name)"
|
||||
@click="tools.cancelReqCircuit($q, userStore.my.username, circuit.name)"
|
||||
/>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div v-if="circuit.name" class="no-wrap justify-evenly items-center content-start">
|
||||
|
||||
|
||||
<!--
|
||||
<q-btn
|
||||
v-if="tools.iAmAdminCircuit(name)" icon="fas fa-pencil-alt"
|
||||
color="blue"
|
||||
size="md"
|
||||
:label="$t('otherpages.modifgrp')"
|
||||
to="/editgrp">
|
||||
</q-btn>
|
||||
-->
|
||||
|
||||
<q-tabs v-model="tabgrp" class="text-blue">
|
||||
<q-tab :label="t('shared.info1')" name="info" icon="fas fa-info"></q-tab>
|
||||
<q-tab v-if="!!circuit.note" :label="t('circuit.page')" name="page" icon="fas fa-file-word"></q-tab>
|
||||
<q-tab v-if="tools.iCanShowCircuitsMember(circuit) || tools.iAmAdminCircuit(name)"
|
||||
<q-tab v-if="tools.iCanShowCircuitsMember(circuit) || tools.iAmAdminCircuit(circuit.name)"
|
||||
:label="t('shared.subscribes')" name="members" icon="fas fa-users"></q-tab>
|
||||
</q-tabs>
|
||||
|
||||
@@ -116,25 +105,25 @@
|
||||
<q-card-section>
|
||||
<div v-if="circuit.createdBy" class="element">
|
||||
<q-icon name="fas fa-lightbulb"></q-icon>
|
||||
{{ $t('circuit.createdby', {
|
||||
{{ $t('shared.createdby', {
|
||||
username: circuit.createdBy,
|
||||
date: tools.getstrDateYY(circuit.date_created), })
|
||||
}}
|
||||
</div>
|
||||
<div v-if="!!circuit.date_updated && circuit.date_updated !== circuit.createdBy" class="element">
|
||||
<div v-if="!!circuit.date_updated && tools.getstrDate(circuit.date_updated) !== tools.getstrDate(circuit.date_created)" class="element">
|
||||
<q-icon name="fas fa-pencil-alt"></q-icon>
|
||||
{{ $t('circuit.lastmodify', {
|
||||
{{ $t('shared.lastmodify', {
|
||||
date: tools.getstrDateYY(circuit.date_updated), })
|
||||
}}
|
||||
</div>
|
||||
|
||||
<div class="members">
|
||||
<q-icon name="fas fa-users"></q-icon>
|
||||
{{ numUsers() }} {{ numUsers() === 1 ? t('circuit.member') : t('shared.members') }}
|
||||
{{ numUsers() }} {{ numUsers() === 1 ? t('shared.member') : t('shared.members') }}
|
||||
</div>
|
||||
<div class="admins">
|
||||
<q-icon name="fas fa-user-cog"></q-icon>
|
||||
{{ numAdmins() }} {{ numAdmins() === 1 ? t('circuit.admin') : t('shared.admins') }}
|
||||
{{ numAdmins() }} {{ numAdmins() === 1 ? t('shared.admin') : t('shared.admins') }}
|
||||
</div>
|
||||
<div v-for="(user, index) of circuit.admins" :key="index">
|
||||
<CMyUser
|
||||
@@ -177,11 +166,11 @@
|
||||
<q-tab-panel name="members" style="max-width: 400px;" v-if="tools.iCanShowCircuitsMember(circuit)">
|
||||
|
||||
<q-tabs
|
||||
v-show="tools.iAmAdminCircuit(name)"
|
||||
v-show="tools.iAmAdminCircuit(circuit.name)"
|
||||
v-model="tabmembers" class="text-blue">
|
||||
<q-tab label="Tutti" name="all" icon="fas fa-users"></q-tab>
|
||||
<q-tab v-if="tools.iAmAdminCircuit(name)" label="Richieste" name="rich" icon="fas fa-user-plus"></q-tab>
|
||||
<q-tab v-if="tools.iAmAdminCircuit(name)" label="Rifiutati" name="refused" icon="fas fa-user-minus"></q-tab>
|
||||
<q-tab v-if="tools.iAmAdminCircuit(circuit.name)" label="Richieste" name="rich" icon="fas fa-user-plus"></q-tab>
|
||||
<q-tab v-if="tools.iAmAdminCircuit(circuit.name)" label="Rifiutati" name="refused" icon="fas fa-user-minus"></q-tab>
|
||||
</q-tabs>
|
||||
|
||||
<q-tab-panels v-model="tabmembers" animated>
|
||||
@@ -209,9 +198,9 @@
|
||||
:prop_searchList="searchList"
|
||||
:showType="costanti.SHOW_USERINFO"
|
||||
:showCol="false"
|
||||
:extrafield="name"
|
||||
:circuitname="circuit.name"
|
||||
:extraparams="extraparams()"
|
||||
:visufind="tools.iAmAdminCircuit(name) ? costanti.REQ_REMOVE_USER_TO_CIRCUIT : costanti.FIND_PEOPLE"
|
||||
:visufind="tools.iAmAdminCircuit(circuit.name) ? costanti.REQ_REMOVE_USER_TO_CIRCUIT : costanti.FIND_PEOPLE"
|
||||
>
|
||||
|
||||
</CGridTableRec>
|
||||
@@ -219,7 +208,7 @@
|
||||
<q-tab-panel name="rich">
|
||||
|
||||
<CGridTableRec
|
||||
prop_mytable="mycircuits"
|
||||
prop_mytable="circuits"
|
||||
prop_mytitle=""
|
||||
:prop_mycolumns="colmyUserPeople"
|
||||
prop_colkey="_id"
|
||||
@@ -241,7 +230,7 @@
|
||||
keyMain=""
|
||||
:showCol="false"
|
||||
:extraparams="extraparams_rich()"
|
||||
:extrafield="name"
|
||||
:circuitname="circuit.name"
|
||||
:visufind="costanti.REQ_ADD_USER_TO_CIRCUIT"
|
||||
>
|
||||
|
||||
@@ -250,7 +239,7 @@
|
||||
<q-tab-panel name="refused">
|
||||
|
||||
<CGridTableRec
|
||||
prop_mytable="mycircuits"
|
||||
prop_mytable="circuits"
|
||||
prop_mytitle=""
|
||||
:prop_mycolumns="colmyUserPeople"
|
||||
prop_colkey="_id"
|
||||
@@ -272,7 +261,7 @@
|
||||
keyMain=""
|
||||
:showCol="false"
|
||||
:extraparams="extraparams_refused()"
|
||||
:extrafield="name"
|
||||
:circuitname="circuit.name"
|
||||
:visufind="costanti.REQ_ADD_USER_TO_CIRCUIT"
|
||||
>
|
||||
|
||||
@@ -291,7 +280,7 @@
|
||||
<q-skeleton :animation="animation"/>
|
||||
</div>
|
||||
<div class="col-12 text-h7 text-grey text-center">
|
||||
{{ name }}
|
||||
{{ circuit.path }}
|
||||
</div>
|
||||
<div class="col-12 text-h7">
|
||||
<q-skeleton :animation="animation"/>
|
||||
@@ -312,7 +301,7 @@
|
||||
full-height full-width
|
||||
>
|
||||
|
||||
<img :src="getImgGrp()" :alt="name" class="full-width">
|
||||
<img :src="getImgCircuit()" :alt="circuit.name" class="full-width">
|
||||
|
||||
</q-dialog>
|
||||
</div>
|
||||
|
||||
@@ -120,14 +120,14 @@
|
||||
<q-card-section>
|
||||
<div class="element">
|
||||
<q-icon name="fas fa-lightbulb"></q-icon>
|
||||
{{ $t('groups.createdby', {
|
||||
{{ $t('shared.createdby', {
|
||||
username: mygrp.createdBy,
|
||||
date: tools.getstrDateYY(mygrp.date_created), })
|
||||
}}
|
||||
</div>
|
||||
<div v-if="!!mygrp.date_updated && mygrp.date_updated !== mygrp.createdBy" class="element">
|
||||
<div v-if="!!mygrp.date_updated && tools.getstrshortDate(mygrp.date_updated) !== tools.getstrshortDate(mygrp.createdBy)" class="element">
|
||||
<q-icon name="fas fa-pencil-alt"></q-icon>
|
||||
{{ $t('groups.lastmodify', {
|
||||
{{ $t('shared.lastmodify', {
|
||||
date: tools.getstrDateYY(mygrp.date_updated), })
|
||||
}}
|
||||
</div>
|
||||
@@ -167,11 +167,11 @@
|
||||
|
||||
<div class="members">
|
||||
<q-icon name="fas fa-users"></q-icon>
|
||||
{{ numUsers() }} {{ numUsers() === 1 ? t('groups.member') : t('shared.members') }}
|
||||
{{ numUsers() }} {{ numUsers() === 1 ? t('shared.member') : t('shared.members') }}
|
||||
</div>
|
||||
<div class="admins">
|
||||
<q-icon name="fas fa-user-cog"></q-icon>
|
||||
{{ numAdmins() }} {{ numAdmins() === 1 ? t('groups.admin') : t('shared.admins') }}
|
||||
{{ numAdmins() }} {{ numAdmins() === 1 ? t('shared.admin') : t('shared.admins') }}
|
||||
</div>
|
||||
<div v-for="(user, index) of mygrp.admins" :key="index">
|
||||
<CMyUser
|
||||
|
||||
@@ -7,6 +7,7 @@ import { CCopyBtn } from '@/components/CCopyBtn'
|
||||
import { CSkill } from '@/components/CSkill'
|
||||
import { CDateTime } from '@/components/CDateTime'
|
||||
import { CMyGroup } from '@/components/CMyGroup'
|
||||
import { CMyCircuit } from '@/components/CMyCircuit'
|
||||
import { CMyUser } from '@/components/CMyUser'
|
||||
import { CUserNonVerif } from '@/components/CUserNonVerif'
|
||||
import { tools } from '@store/Modules/tools'
|
||||
@@ -18,7 +19,7 @@ import { useI18n } from '@/boot/i18n'
|
||||
import { toolsext } from '@store/Modules/toolsext'
|
||||
import { useQuasar } from 'quasar'
|
||||
import { costanti } from '@costanti'
|
||||
import { IMyGroup, IUserFields } from 'model'
|
||||
import { ICircuit, IMyCircuit, IMyGroup, IUserFields } from 'model'
|
||||
import { shared_consts } from '@/common/shared_vuejs'
|
||||
import { static_data } from '@/db/static_data'
|
||||
import { fieldsTable } from '@store/Modules/fieldsTable'
|
||||
@@ -30,7 +31,7 @@ export default defineComponent({
|
||||
name: 'myprofile',
|
||||
components: {
|
||||
CProfile, CTitleBanner, CMyFieldDb, CSkill, CDateTime, CCopyBtn, CUserNonVerif, CMyFieldRec, CMyUser,
|
||||
CMyGroup, CLabel
|
||||
CMyGroup, CLabel, CMyCircuit
|
||||
},
|
||||
props: {},
|
||||
setup() {
|
||||
@@ -62,6 +63,7 @@ export default defineComponent({
|
||||
})
|
||||
|
||||
const listgroupsfiltered = ref(<IMyGroup[]>[])
|
||||
const listcircuitsfiltered = ref(<IMyCircuit[]>[])
|
||||
|
||||
|
||||
function profile() {
|
||||
@@ -87,6 +89,12 @@ export default defineComponent({
|
||||
listgroupsfiltered.value = []
|
||||
}
|
||||
|
||||
try {
|
||||
listcircuitsfiltered.value = myuser.value.profile.mycircuits
|
||||
} catch (e) {
|
||||
listcircuitsfiltered.value = []
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@@ -203,6 +203,18 @@
|
||||
</span>
|
||||
</q-list>
|
||||
|
||||
</div>
|
||||
<div v-else-if="card.table === 'circuits'">
|
||||
<q-list>
|
||||
<span v-for="(circuit, index) in listcircuitsfiltered" :key="index" class="q-my-sm q-mx-none" clickable>
|
||||
<CMyCircuit
|
||||
:mycircuit="circuit"
|
||||
:visu="costanti.USER_CIRCUITS"
|
||||
>
|
||||
</CMyCircuit>
|
||||
</span>
|
||||
</q-list>
|
||||
|
||||
</div>
|
||||
<div v-else>
|
||||
<CSkill
|
||||
|
||||
Reference in New Issue
Block a user