- Gruppi (3) - lista degli utenti del gruppo
This commit is contained in:
@@ -42,6 +42,7 @@ export const shared_consts = {
|
|||||||
FILTER_MYSKILL_SKILL: 1,
|
FILTER_MYSKILL_SKILL: 1,
|
||||||
|
|
||||||
OPTIONS_SEARCH_ONLY_FULL_WORDS: 1,
|
OPTIONS_SEARCH_ONLY_FULL_WORDS: 1,
|
||||||
|
OPTIONS_SEARCH_USER_ONLY_FULL_WORDS: 2,
|
||||||
|
|
||||||
FRIENDSCMD: {
|
FRIENDSCMD: {
|
||||||
SETTRUST: 121,
|
SETTRUST: 121,
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
:prop_mycolumns="colmySkills"
|
:prop_mycolumns="colmySkills"
|
||||||
prop_colkey="idSkill"
|
prop_colkey="idSkill"
|
||||||
col_title="subTitle"
|
col_title="subTitle"
|
||||||
:vertical="true"
|
:vertical="-1"
|
||||||
:nodataLabel="idSector > 0 ? 'Nessuna Competenza trovata': 'Selezionare un Settore'"
|
:nodataLabel="idSector > 0 ? 'Nessuna Competenza trovata': 'Selezionare un Settore'"
|
||||||
:prop_search="true"
|
:prop_search="true"
|
||||||
:finder="true"
|
:finder="true"
|
||||||
|
|||||||
@@ -90,9 +90,9 @@ export default defineComponent({
|
|||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
vertical: {
|
vertical: {
|
||||||
type: Boolean,
|
type: Number,
|
||||||
required: false,
|
required: false,
|
||||||
default: false,
|
default: 0,
|
||||||
},
|
},
|
||||||
prop_codeId: {
|
prop_codeId: {
|
||||||
type: String,
|
type: String,
|
||||||
@@ -181,7 +181,17 @@ export default defineComponent({
|
|||||||
type: Boolean,
|
type: Boolean,
|
||||||
required: false,
|
required: false,
|
||||||
default: false
|
default: false
|
||||||
}
|
},
|
||||||
|
visufind: {
|
||||||
|
type: Number,
|
||||||
|
required: false,
|
||||||
|
default: costanti.FIND_PEOPLE,
|
||||||
|
},
|
||||||
|
extrafield: {
|
||||||
|
type: String,
|
||||||
|
required: false,
|
||||||
|
default: '',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
components: { CMyPopupEdit, CTitleBanner, CMyFieldDb, CMySelect, CMyFriends, CMyGroups },
|
components: { CMyPopupEdit, CTitleBanner, CMyFieldDb, CMySelect, CMyFriends, CMyGroups },
|
||||||
setup(props, { emit }) {
|
setup(props, { emit }) {
|
||||||
@@ -242,7 +252,7 @@ export default defineComponent({
|
|||||||
|
|
||||||
const mycodeid = toRef(props, 'prop_codeId')
|
const mycodeid = toRef(props, 'prop_codeId')
|
||||||
|
|
||||||
const myvertical = ref(0)
|
const myvertical = ref(props.vertical)
|
||||||
|
|
||||||
const valoriopt = computed(() => (item: any, addall: boolean) => {
|
const valoriopt = computed(() => (item: any, addall: boolean) => {
|
||||||
// console.log('valoriopt', item.table)
|
// console.log('valoriopt', item.table)
|
||||||
@@ -318,9 +328,11 @@ export default defineComponent({
|
|||||||
|
|
||||||
if (tablesel.value === 'mygroups') {
|
if (tablesel.value === 'mygroups') {
|
||||||
// is Admin ?
|
// is Admin ?
|
||||||
const trovato = rec.admins.find((myuser: any) => myuser.username === userStore.my.username)
|
if (rec.admins) {
|
||||||
if (trovato) {
|
const trovato = rec.admins.find((myuser: any) => myuser.username === userStore.my.username)
|
||||||
return !!trovato
|
if (trovato) {
|
||||||
|
return !!trovato
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -859,7 +871,7 @@ export default defineComponent({
|
|||||||
colkey.value = props.prop_colkey
|
colkey.value = props.prop_colkey
|
||||||
pagination.value = props.prop_pagination
|
pagination.value = props.prop_pagination
|
||||||
|
|
||||||
myvertical.value = props.vertical ? -1 : 0
|
myvertical.value = props.vertical
|
||||||
if (props.finder) {
|
if (props.finder) {
|
||||||
myvertical.value = tools.getCookie('myv', 0)
|
myvertical.value = tools.getCookie('myv', 0)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -297,7 +297,6 @@
|
|||||||
<br>
|
<br>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
||||||
<template v-slot:item="props">
|
<template v-slot:item="props">
|
||||||
<div v-if="((showType === costanti.SHOW_USERINFO) && myvertical !== costanti.VISUTABLE_SCHEDA_USER) || ((myvertical === 2) && (tablesel === 'users' || tablesel === 'myskills'))" class="fill-all-width">
|
<div v-if="((showType === costanti.SHOW_USERINFO) && myvertical !== costanti.VISUTABLE_SCHEDA_USER) || ((myvertical === 2) && (tablesel === 'users' || tablesel === 'myskills'))" class="fill-all-width">
|
||||||
<div>
|
<div>
|
||||||
@@ -305,7 +304,8 @@
|
|||||||
v-model="filter"
|
v-model="filter"
|
||||||
:finder="false"
|
:finder="false"
|
||||||
:mycontact="props.row"
|
:mycontact="props.row"
|
||||||
:visu="costanti.FIND_PEOPLE"
|
:visu="visufind"
|
||||||
|
:groupname="extrafield"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { defineComponent, PropType, ref, watch } from 'vue'
|
import { defineComponent, onMounted, PropType, ref, watch } from 'vue'
|
||||||
import { useQuasar } from 'quasar'
|
import { useQuasar } from 'quasar'
|
||||||
import { useI18n } from '@/boot/i18n'
|
import { useI18n } from '@/boot/i18n'
|
||||||
import { useGlobalStore } from '@store/globalStore'
|
import { useGlobalStore } from '@store/globalStore'
|
||||||
@@ -75,6 +75,18 @@ export default defineComponent({
|
|||||||
required: false,
|
required: false,
|
||||||
default: '',
|
default: '',
|
||||||
},
|
},
|
||||||
|
rec: {
|
||||||
|
type: Object,
|
||||||
|
required: false,
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
|
mycol: {
|
||||||
|
type: Object as PropType<IColGridTable>,
|
||||||
|
required: false,
|
||||||
|
default: () => {
|
||||||
|
return { name: '' }
|
||||||
|
},
|
||||||
|
},
|
||||||
id: {
|
id: {
|
||||||
type: String,
|
type: String,
|
||||||
required: false,
|
required: false,
|
||||||
@@ -118,6 +130,17 @@ export default defineComponent({
|
|||||||
return col.value.fieldtype !== costanti.FieldType.onlydate && col.value.fieldtype !== costanti.FieldType.date
|
return col.value.fieldtype !== costanti.FieldType.onlydate && col.value.fieldtype !== costanti.FieldType.date
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function mounted() {
|
||||||
|
if (props.rec) {
|
||||||
|
row.value = props.rec
|
||||||
|
}
|
||||||
|
if (props.mycol.name !== '') {
|
||||||
|
col.value = props.mycol
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(mounted)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
tools,
|
tools,
|
||||||
costanti,
|
costanti,
|
||||||
|
|||||||
0
src/components/CMyFieldRec/CMyFieldRec.scss
Executable file
0
src/components/CMyFieldRec/CMyFieldRec.scss
Executable file
185
src/components/CMyFieldRec/CMyFieldRec.ts
Executable file
185
src/components/CMyFieldRec/CMyFieldRec.ts
Executable file
@@ -0,0 +1,185 @@
|
|||||||
|
import { defineComponent, onMounted, PropType, ref, watch } from 'vue'
|
||||||
|
import { useQuasar } from 'quasar'
|
||||||
|
import { useI18n } from '@/boot/i18n'
|
||||||
|
import { useGlobalStore } from '@store/globalStore'
|
||||||
|
import { fieldsTable } from '@store/Modules/fieldsTable'
|
||||||
|
import { tools } from '@store/Modules/tools'
|
||||||
|
import { costanti } from '@costanti'
|
||||||
|
import { CMyPopupEdit } from '@/components/CMyPopupEdit'
|
||||||
|
import { IColGridTable } from 'model'
|
||||||
|
import MixinBase from '@/mixins/mixin-base'
|
||||||
|
|
||||||
|
|
||||||
|
export default defineComponent({
|
||||||
|
name: 'CMyFieldRec',
|
||||||
|
props: {
|
||||||
|
table: {
|
||||||
|
type: String,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
title: {
|
||||||
|
type: String,
|
||||||
|
required: false,
|
||||||
|
default: '',
|
||||||
|
},
|
||||||
|
rec: {
|
||||||
|
type: Object,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
field: {
|
||||||
|
type: String,
|
||||||
|
required: false,
|
||||||
|
default: '',
|
||||||
|
},
|
||||||
|
myimg: {
|
||||||
|
type: String,
|
||||||
|
required: false,
|
||||||
|
default: '',
|
||||||
|
},
|
||||||
|
canModify: {
|
||||||
|
type: Boolean,
|
||||||
|
required: false,
|
||||||
|
default: true,
|
||||||
|
},
|
||||||
|
canEdit: {
|
||||||
|
type: Boolean,
|
||||||
|
required: false,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
columns: {
|
||||||
|
type: Object,
|
||||||
|
required: false,
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
|
disable: {
|
||||||
|
type: Boolean,
|
||||||
|
required: false,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
id: {
|
||||||
|
type: String,
|
||||||
|
required: false,
|
||||||
|
default: '',
|
||||||
|
},
|
||||||
|
idmain: {
|
||||||
|
type: String,
|
||||||
|
required: false,
|
||||||
|
default: '',
|
||||||
|
},
|
||||||
|
indrec: {
|
||||||
|
type: Number,
|
||||||
|
required: false,
|
||||||
|
default: -1,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
components: { CMyPopupEdit },
|
||||||
|
setup(props, { emit }) {
|
||||||
|
const $q = useQuasar()
|
||||||
|
const { t } = useI18n()
|
||||||
|
const globalStore = useGlobalStore()
|
||||||
|
|
||||||
|
const mytitle = ref('')
|
||||||
|
const col = ref(<any>{})
|
||||||
|
const keytab = ref(<any>'')
|
||||||
|
const optlab = ref('')
|
||||||
|
|
||||||
|
const pickup = ref(false)
|
||||||
|
const tablesel = ref('')
|
||||||
|
const jointable = ref('')
|
||||||
|
const recordCol = ref(<any>{})
|
||||||
|
|
||||||
|
const mykey = ref('')
|
||||||
|
const mysubkey = ref('')
|
||||||
|
const mysubsubkey = ref('')
|
||||||
|
|
||||||
|
const { setValDb, getValDb } = MixinBase()
|
||||||
|
|
||||||
|
function mounted() {
|
||||||
|
mytitle.value = props.title
|
||||||
|
keytab.value = fieldsTable.getKeyByTable(props.table)
|
||||||
|
optlab.value = fieldsTable.getLabelByTable(props.table)
|
||||||
|
// recordCol.value = fieldsTable.getrecTableList(props.table)
|
||||||
|
if (props.columns) {
|
||||||
|
col.value = props.columns.find((col: any) => col.name === props.field)
|
||||||
|
} else {
|
||||||
|
col.value = fieldsTable.getColByTable(props.table, props.field)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (col.value) {
|
||||||
|
jointable.value = col.value.jointable!
|
||||||
|
}
|
||||||
|
|
||||||
|
const arrk = props.field.split('.')
|
||||||
|
if (arrk) {
|
||||||
|
if (arrk.length >= 0)
|
||||||
|
mykey.value = arrk[0]
|
||||||
|
if (arrk.length > 1)
|
||||||
|
mysubkey.value = arrk[1]
|
||||||
|
if (arrk.length > 2)
|
||||||
|
mysubsubkey.value = arrk[2]
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function showandsel(row: any, col: any, newval: any, valinitial: any) {
|
||||||
|
console.log('showandsel CMyFieldDb', row, col, newval)
|
||||||
|
|
||||||
|
if (newval !== valinitial)
|
||||||
|
setValDb($q, mykey.value, newval, col.value.fieldtype, false, props.table, mysubkey.value, props.id, props.indrec, mysubsubkey.value)
|
||||||
|
}
|
||||||
|
|
||||||
|
function withBorder() {
|
||||||
|
return col.value.fieldtype !== costanti.FieldType.onlydate && col.value.fieldtype !== costanti.FieldType.date
|
||||||
|
}
|
||||||
|
|
||||||
|
function getValue() {
|
||||||
|
let myvalue = ''
|
||||||
|
|
||||||
|
if (mysubkey.value !== '') {
|
||||||
|
if (props.rec[mykey.value] === undefined) {
|
||||||
|
myvalue = ''
|
||||||
|
} else {
|
||||||
|
myvalue = props.rec[mykey.value][mysubkey.value]
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (mykey.value !== '') {
|
||||||
|
myvalue = props.rec[mykey.value]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Array.isArray(myvalue)) {
|
||||||
|
if (myvalue.length === 0)
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
return myvalue
|
||||||
|
}
|
||||||
|
|
||||||
|
function visuElem() {
|
||||||
|
return !!col.value.name && (props.canEdit || (!props.canEdit && getValue()))
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(mounted)
|
||||||
|
|
||||||
|
return {
|
||||||
|
tools,
|
||||||
|
withBorder,
|
||||||
|
costanti,
|
||||||
|
fieldsTable,
|
||||||
|
globalStore,
|
||||||
|
mytitle,
|
||||||
|
col,
|
||||||
|
keytab,
|
||||||
|
optlab,
|
||||||
|
recordCol,
|
||||||
|
pickup,
|
||||||
|
tablesel,
|
||||||
|
jointable,
|
||||||
|
showandsel,
|
||||||
|
mykey,
|
||||||
|
mysubkey,
|
||||||
|
mysubsubkey,
|
||||||
|
visuElem,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
59
src/components/CMyFieldRec/CMyFieldRec.vue
Executable file
59
src/components/CMyFieldRec/CMyFieldRec.vue
Executable file
@@ -0,0 +1,59 @@
|
|||||||
|
<template>
|
||||||
|
<div class="text-center">
|
||||||
|
<div v-if="visuElem()" class="row items-center justify-center q-gutter-md q-ma-xs">
|
||||||
|
|
||||||
|
<div class="q-ma-xs">
|
||||||
|
<q-field rounded outlined bg-color="blue-1" dense style="min-width:110px;">
|
||||||
|
<template v-slot:control>
|
||||||
|
<div class="centermydiv">
|
||||||
|
<div v-if="myimg" class="text-center">
|
||||||
|
<q-img
|
||||||
|
:src="myimg"
|
||||||
|
class="text-center"
|
||||||
|
style="height: 50px; width: 50px;"
|
||||||
|
:alt="mytitle">
|
||||||
|
</q-img>
|
||||||
|
</div>
|
||||||
|
<div v-if="mytitle" class="self-center full-width no-outline text-center" tabindex="0">{{ mytitle }}</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</q-field>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div :class="` q-ma-sm q-pa-sm col-grow rounded-borders `" :style="withBorder() ? `border: 1px solid #bbb` : ``">
|
||||||
|
<CMyPopupEdit
|
||||||
|
v-bind="$attrs"
|
||||||
|
:isrec="true"
|
||||||
|
:table="table"
|
||||||
|
:title="mytitle"
|
||||||
|
:field="mykey"
|
||||||
|
:subfield="mysubkey"
|
||||||
|
:mysubsubkey="mysubsubkey"
|
||||||
|
:type="col.fieldtype"
|
||||||
|
:serv="false"
|
||||||
|
:disable="disable"
|
||||||
|
:jointable="jointable"
|
||||||
|
:myimg="myimg"
|
||||||
|
:canModify="canModify"
|
||||||
|
:canEdit="canEdit"
|
||||||
|
:visulabel="true"
|
||||||
|
:mycol="col"
|
||||||
|
:tablesel="tablesel"
|
||||||
|
:pickup="pickup"
|
||||||
|
v-model:row="rec"
|
||||||
|
minuteinterval="1"
|
||||||
|
@showandsave="showandsel"
|
||||||
|
>
|
||||||
|
|
||||||
|
</CMyPopupEdit>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" src="./CMyFieldRec.ts">
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
@import './CMyFieldRec.scss';
|
||||||
|
</style>
|
||||||
1
src/components/CMyFieldRec/index.ts
Executable file
1
src/components/CMyFieldRec/index.ts
Executable file
@@ -0,0 +1 @@
|
|||||||
|
export {default as CMyFieldRec} from './CMyFieldRec.vue'
|
||||||
@@ -38,6 +38,11 @@ export default defineComponent({
|
|||||||
required: false,
|
required: false,
|
||||||
default: 0,
|
default: 0,
|
||||||
},
|
},
|
||||||
|
groupname: {
|
||||||
|
type: String,
|
||||||
|
required: false,
|
||||||
|
default: '',
|
||||||
|
}
|
||||||
},
|
},
|
||||||
setup(props, { emit }) {
|
setup(props, { emit }) {
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
@@ -218,7 +223,7 @@ export default defineComponent({
|
|||||||
|
|
||||||
function refuseReqFriends(usernameDest: string) {
|
function refuseReqFriends(usernameDest: string) {
|
||||||
$q.dialog({
|
$q.dialog({
|
||||||
message: t('db.domanda_removefriend', { username: usernameDest }),
|
message: t('db.domanda_revoke_friend', { username: usernameDest }),
|
||||||
ok: { label: t('dialog.yes'), push: true },
|
ok: { label: t('dialog.yes'), push: true },
|
||||||
cancel: { label: t('dialog.cancel') },
|
cancel: { label: t('dialog.cancel') },
|
||||||
title: t('db.domanda')
|
title: t('db.domanda')
|
||||||
|
|||||||
@@ -37,7 +37,8 @@
|
|||||||
<CMyUser
|
<CMyUser
|
||||||
:mycontact="mycontact"
|
:mycontact="mycontact"
|
||||||
@setCmd="setCmd"
|
@setCmd="setCmd"
|
||||||
:visu="visu">
|
:visu="visu"
|
||||||
|
:groupname="groupname">
|
||||||
</CMyUser>
|
</CMyUser>
|
||||||
</span>
|
</span>
|
||||||
</q-list>
|
</q-list>
|
||||||
|
|||||||
@@ -36,11 +36,6 @@
|
|||||||
<q-item-label>
|
<q-item-label>
|
||||||
<q-btn rounded icon="fas fa-ellipsis-h">
|
<q-btn rounded icon="fas fa-ellipsis-h">
|
||||||
<q-menu>
|
<q-menu>
|
||||||
<q-list v-if="true" style="min-width: 150px">
|
|
||||||
<q-item clickable v-close-popup @click="setCmd(shared_consts.GROUPSCMD.SETGROUP, grp.groupname)">
|
|
||||||
<q-item-section>{{ $t('groups.accept_group') }}</q-item-section>
|
|
||||||
</q-item>
|
|
||||||
</q-list>
|
|
||||||
<q-list style="min-width: 150px">
|
<q-list style="min-width: 150px">
|
||||||
<q-item clickable icon="fas fa-user-minus" v-close-popup
|
<q-item clickable icon="fas fa-user-minus" v-close-popup
|
||||||
@click="setCmd(shared_consts.GROUPSCMD.REQGROUP, grp.groupname, false)">
|
@click="setCmd(shared_consts.GROUPSCMD.REQGROUP, grp.groupname, false)">
|
||||||
@@ -67,37 +62,14 @@
|
|||||||
</q-item-section>
|
</q-item-section>
|
||||||
<q-item-section side v-if="visu === costanti.FIND_GROUP">
|
<q-item-section side v-if="visu === costanti.FIND_GROUP">
|
||||||
<q-item-label>
|
<q-item-label>
|
||||||
<q-btn v-if="grp.admins && grp.admins.includes(userStore.my.username)" rounded :icon="userStore.IsMyGroupByGroupname(grp.groupname) ? `fas fa-ellipsis-h` : `fas fa-user`">
|
<q-btn rounded :icon="userStore.IsMyGroupByGroupname(grp.groupname) ? `fas fa-ellipsis-h` : `fas fa-user`">
|
||||||
<q-menu>
|
<q-menu>
|
||||||
<q-list v-if="(!userStore.IsMyGroupByGroupname(grp.groupname) && !userStore.IsAskedGroupByGroupname(grp.groupname))" style="min-width: 200px">
|
<q-list v-if="(!userStore.IsMyGroupByGroupname(grp.groupname) && !userStore.IsAskedGroupByGroupname(grp.groupname))" style="min-width: 200px">
|
||||||
<q-item clickable v-close-popup @click="setCmd(shared_consts.GROUPSCMD.REQGROUP, grp.groupname, true)">
|
<q-item clickable v-close-popup @click="setCmd(shared_consts.GROUPSCMD.REQGROUP, grp.groupname, true)">
|
||||||
<q-item-section>{{ $t('groups.ask_group') }}</q-item-section>
|
<q-item-section>{{ $t('groups.ask_group') }}</q-item-section>
|
||||||
</q-item>
|
</q-item>
|
||||||
</q-list>
|
</q-list>
|
||||||
<q-list v-else-if="(!userStore.IsMyGroupByGroupname(grp.groupname) && userStore.IsAskedGroupByUsername(grp.groupname))" style="min-width: 200px">
|
<q-list v-else-if="(!userStore.IsMyGroupByGroupname(grp.groupname) && userStore.IsAskedGroupByGroupname(grp.groupname))" style="min-width: 200px">
|
||||||
<q-item clickable v-close-popup @click="setCmd(shared_consts.GROUPSCMD.REQGROUP, grp.groupname, false)">
|
|
||||||
<q-item-section>{{ $t('groups.cancel_ask_group') }}</q-item-section>
|
|
||||||
</q-item>
|
|
||||||
</q-list>
|
|
||||||
<q-list v-else-if="userStore.IsMyGroupByGroupname(grp.groupname)" style="min-width: 200px">
|
|
||||||
<q-item clickable v-close-popup @click="setCmd(shared_consts.GROUPSCMD.REMOVE_FROM_MYGROUPS, grp.groupname)">
|
|
||||||
<q-item-section>{{ $t('groups.remove_from_mygroups') }}</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.FIND_GROUP">
|
|
||||||
<q-item-label>
|
|
||||||
<q-btn v-if="grp.admins && grp.admins.includes(userStore.my.username)" rounded :icon="userStore.IsMyGroupByGroupname(grp.groupname) ? `fas fa-ellipsis-h` : `fas fa-user`">
|
|
||||||
<q-menu>
|
|
||||||
<q-list v-if="(!userStore.IsMyGroupByGroupname(grp.groupname) && !userStore.IsAskedGroupByGroupname(grp.groupname))" style="min-width: 200px">
|
|
||||||
<q-item clickable v-close-popup @click="setCmd(shared_consts.GROUPSCMD.REQGROUP, grp.groupname, true)">
|
|
||||||
<q-item-section>{{ $t('groups.ask_group') }}</q-item-section>
|
|
||||||
</q-item>
|
|
||||||
</q-list>
|
|
||||||
<q-list v-else-if="(!userStore.IsMyGroupByGroupname(grp.groupname) && userStore.IsAskedGroupByUsername(grp.groupname))" style="min-width: 200px">
|
|
||||||
<q-item clickable v-close-popup @click="setCmd(shared_consts.GROUPSCMD.REQGROUP, grp.groupname, false)">
|
<q-item clickable v-close-popup @click="setCmd(shared_consts.GROUPSCMD.REQGROUP, grp.groupname, false)">
|
||||||
<q-item-section>{{ $t('groups.cancel_ask_group') }}</q-item-section>
|
<q-item-section>{{ $t('groups.cancel_ask_group') }}</q-item-section>
|
||||||
</q-item>
|
</q-item>
|
||||||
|
|||||||
@@ -55,8 +55,8 @@ export default defineComponent({
|
|||||||
arr = userStore.my.profile.mygroups
|
arr = userStore.my.profile.mygroups
|
||||||
} else if (props.modelValue === costanti.MY_GROUPS) {
|
} else if (props.modelValue === costanti.MY_GROUPS) {
|
||||||
arr = userStore.my.profile.mygroups
|
arr = userStore.my.profile.mygroups
|
||||||
// } else if (props.modelValue === costanti.REQ_GROUP) {
|
} else if (props.modelValue === costanti.MANAGE_GROUPS) {
|
||||||
// arr = userStore.my.profile.req_groups
|
arr = userStore.my.profile.manage_mygroups
|
||||||
} else if (props.modelValue === costanti.ASK_SENT_GROUP) {
|
} else if (props.modelValue === costanti.ASK_SENT_GROUP) {
|
||||||
arr = userStore.my.profile.asked_groups
|
arr = userStore.my.profile.asked_groups
|
||||||
}
|
}
|
||||||
@@ -70,7 +70,8 @@ export default defineComponent({
|
|||||||
const myoptions = computed(() => {
|
const myoptions = computed(() => {
|
||||||
const mybutt = []
|
const mybutt = []
|
||||||
mybutt.push({ label: t('mypages.find_group'), value: costanti.FIND_GROUP })
|
mybutt.push({ label: t('mypages.find_group'), value: costanti.FIND_GROUP })
|
||||||
mybutt.push({ label: t('mypages.my_groups') + ' (' + numGroups.value + ')', value: costanti.MY_GROUPS })
|
mybutt.push({ label: t('mypages.manage_my_groups') + ' (' + numManageGroups.value + ')', value: costanti.MANAGE_GROUPS })
|
||||||
|
mybutt.push({ label: t('mypages.follow_groups') + ' (' + numMyGroups.value + ')', value: costanti.MY_GROUPS })
|
||||||
|
|
||||||
if (numAskSentGroups.value > 0 || props.modelValue === costanti.ASK_SENT_GROUP)
|
if (numAskSentGroups.value > 0 || props.modelValue === costanti.ASK_SENT_GROUP)
|
||||||
mybutt.push({
|
mybutt.push({
|
||||||
@@ -81,7 +82,12 @@ export default defineComponent({
|
|||||||
return mybutt
|
return mybutt
|
||||||
})
|
})
|
||||||
|
|
||||||
const numGroups = computed(() => {
|
const numManageGroups = computed(() => {
|
||||||
|
const arr = userStore.my.profile.manage_mygroups
|
||||||
|
return (arr) ? arr.length : 0
|
||||||
|
})
|
||||||
|
|
||||||
|
const numMyGroups = computed(() => {
|
||||||
const arr = userStore.my.profile.mygroups
|
const arr = userStore.my.profile.mygroups
|
||||||
return (arr) ? arr.length : 0
|
return (arr) ? arr.length : 0
|
||||||
})
|
})
|
||||||
@@ -107,23 +113,6 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function removeFromMyGroups(groupnameDest: string) {
|
|
||||||
$q.dialog({
|
|
||||||
message: t('db.domanda_removegroup', { username: groupnameDest }),
|
|
||||||
ok: { label: t('dialog.yes'), push: true },
|
|
||||||
cancel: { label: t('dialog.cancel') },
|
|
||||||
title: t('db.domanda')
|
|
||||||
}).onOk(() => {
|
|
||||||
|
|
||||||
userStore.setGroupsCmd($q, t, username.value, groupnameDest, shared_consts.GROUPSCMD.REMOVE_FROM_MYGROUP, null).then((res) => {
|
|
||||||
if (res) {
|
|
||||||
userStore.my.profile.mygroups = userStore.my.profile.mygroups.filter((rec: IMyGroup) => rec.groupname !== groupnameDest)
|
|
||||||
tools.showPositiveNotif($q, t('db.removedgroup'))
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
function blockGroup(usernameDest: string) {
|
function blockGroup(usernameDest: string) {
|
||||||
$q.dialog({
|
$q.dialog({
|
||||||
message: t('db.domanda_blockgroup', { groupname: usernameDest }),
|
message: t('db.domanda_blockgroup', { groupname: usernameDest }),
|
||||||
@@ -142,7 +131,7 @@ export default defineComponent({
|
|||||||
|
|
||||||
function setCmd(cmd: number, groupnameDest: string, value: any = '') {
|
function setCmd(cmd: number, groupnameDest: string, value: any = '') {
|
||||||
if (cmd === shared_consts.GROUPSCMD.REMOVE_FROM_MYGROUP) {
|
if (cmd === shared_consts.GROUPSCMD.REMOVE_FROM_MYGROUP) {
|
||||||
removeFromMyGroups(groupnameDest)
|
tools.removeFromMyGroups($q, username.value, groupnameDest)
|
||||||
} else if (cmd === shared_consts.GROUPSCMD.BLOCK_GROUP) {
|
} else if (cmd === shared_consts.GROUPSCMD.BLOCK_GROUP) {
|
||||||
blockGroup(groupnameDest)
|
blockGroup(groupnameDest)
|
||||||
} else if (cmd === shared_consts.GROUPSCMD.SETGROUP) {
|
} else if (cmd === shared_consts.GROUPSCMD.SETGROUP) {
|
||||||
|
|||||||
@@ -36,6 +36,11 @@ export default defineComponent({
|
|||||||
type: Object,
|
type: Object,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
isrec: {
|
||||||
|
type: Boolean,
|
||||||
|
required: false,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
mycol: {
|
mycol: {
|
||||||
type: Object as PropType<IColGridTable>,
|
type: Object as PropType<IColGridTable>,
|
||||||
required: true,
|
required: true,
|
||||||
@@ -191,36 +196,43 @@ export default defineComponent({
|
|||||||
function crea() {
|
function crea() {
|
||||||
// console.log('crea', isFieldDb())
|
// console.log('crea', isFieldDb())
|
||||||
|
|
||||||
if (isFieldDb()) {
|
if (props.isrec) {
|
||||||
// mykey -> field
|
col.value = props.mycol
|
||||||
// mysubkey -> subfield
|
|
||||||
// table -> table
|
|
||||||
// serv -> serv
|
|
||||||
// id -> id
|
|
||||||
// idmain -> idmain
|
|
||||||
|
|
||||||
// console.table(props)
|
|
||||||
|
|
||||||
myvalue.value = getValDb(props.field, props.serv, '', props.table, props.subfield, props.id, props.idmain)
|
|
||||||
// console.log('myvalue.value', myvalue.value)
|
|
||||||
col.value.jointable = props.jointable
|
|
||||||
col.value.fieldtype = props.type
|
|
||||||
col.value.label = props.title
|
|
||||||
|
|
||||||
if (props.type === costanti.FieldType.image) {
|
|
||||||
myImgGall.value = [{
|
|
||||||
_id: '',
|
|
||||||
imagefile: myvalue.value,
|
|
||||||
// order: 1,
|
|
||||||
alt: 'img',
|
|
||||||
}]
|
|
||||||
}
|
|
||||||
|
|
||||||
// console.log('col', col.value);
|
|
||||||
} else {
|
} else {
|
||||||
col.value = {...props.mycol}
|
if (isFieldDb()) {
|
||||||
|
// mykey -> field
|
||||||
|
// mysubkey -> subfield
|
||||||
|
// table -> table
|
||||||
|
// serv -> serv
|
||||||
|
// id -> id
|
||||||
|
// idmain -> idmain
|
||||||
|
|
||||||
|
// console.table(props)
|
||||||
|
|
||||||
|
myvalue.value = getValDb(props.field, props.serv, '', props.table, props.subfield, props.id, props.idmain)
|
||||||
|
// console.log('myvalue.value', myvalue.value)
|
||||||
|
col.value.jointable = props.jointable
|
||||||
|
col.value.fieldtype = props.type
|
||||||
|
col.value.label = props.title
|
||||||
|
|
||||||
|
if (props.type === costanti.FieldType.image) {
|
||||||
|
myImgGall.value = [{
|
||||||
|
_id: '',
|
||||||
|
imagefile: myvalue.value,
|
||||||
|
// order: 1,
|
||||||
|
alt: 'img',
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
|
||||||
|
// console.log('col', col.value);
|
||||||
|
} else {
|
||||||
|
col.value = { ...props.mycol }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log('col.value', col.value)
|
||||||
|
|
||||||
// console.log('CMyFieldDb crea', myvalue)
|
// console.log('CMyFieldDb crea', myvalue)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -307,7 +319,7 @@ export default defineComponent({
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
// console.log('mounted', 'isFieldDb()', isFieldDb())
|
// console.log('mounted', 'isFieldDb()', isFieldDb())
|
||||||
if (isFieldDb()) {
|
if (isFieldDb() && !props.isrec) {
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if (props.subfield !== '') {
|
if (props.subfield !== '') {
|
||||||
|
|||||||
@@ -25,6 +25,11 @@ export default defineComponent({
|
|||||||
visu: {
|
visu: {
|
||||||
type: Number,
|
type: Number,
|
||||||
required: true,
|
required: true,
|
||||||
|
},
|
||||||
|
groupname: {
|
||||||
|
type: String,
|
||||||
|
required: false,
|
||||||
|
default: '',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -82,6 +87,7 @@ export default defineComponent({
|
|||||||
setCmd,
|
setCmd,
|
||||||
shared_consts,
|
shared_consts,
|
||||||
userStore,
|
userStore,
|
||||||
|
tools,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -51,6 +51,50 @@
|
|||||||
</q-btn>
|
</q-btn>
|
||||||
</q-item-label>
|
</q-item-label>
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
|
<q-item-section side v-if="visu === costanti.REQ_ADD_USER_TO_GROUP">
|
||||||
|
<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.addToMyGroups($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_group') }}</q-item-section>
|
||||||
|
</q-item>
|
||||||
|
</q-list>
|
||||||
|
<q-list style="min-width: 200px">
|
||||||
|
<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('groups.refuse_ask_group_short') }}</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_REMOVE_USER_TO_GROUP">
|
||||||
|
<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.removeFromMyGroups($q, contact.username, groupname)">
|
||||||
|
<q-item-section avatar>
|
||||||
|
<q-icon color="negative" name="fas fa-user-minus" />
|
||||||
|
</q-item-section>
|
||||||
|
<q-item-section>{{ $t('groups.remove_from_mygroups') }}</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.ASK_SENT_FRIENDS">
|
<q-item-section side v-if="visu === costanti.ASK_SENT_FRIENDS">
|
||||||
<q-item-label>
|
<q-item-label>
|
||||||
<q-btn rounded icon="fas fa-ellipsis-h">
|
<q-btn rounded icon="fas fa-ellipsis-h">
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
:prop_mycolumns="colmySkills"
|
:prop_mycolumns="colmySkills"
|
||||||
prop_colkey="idSkill"
|
prop_colkey="idSkill"
|
||||||
col_title="subTitle"
|
col_title="subTitle"
|
||||||
:vertical="true"
|
:vertical="-1"
|
||||||
:choose_visutype="!visuinpage"
|
:choose_visutype="!visuinpage"
|
||||||
:butt_modif_new="!visuinpage"
|
:butt_modif_new="!visuinpage"
|
||||||
nodataLabel="Nessuna Competenza inserita"
|
nodataLabel="Nessuna Competenza inserita"
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ export * from './CImgTitle'
|
|||||||
export * from './CMyAvatar'
|
export * from './CMyAvatar'
|
||||||
export * from './CMyCart'
|
export * from './CMyCart'
|
||||||
export * from './CMyFieldDb'
|
export * from './CMyFieldDb'
|
||||||
|
export * from './CMyFieldRec'
|
||||||
export * from './CMyPage'
|
export * from './CMyPage'
|
||||||
export * from './CMyTeacher'
|
export * from './CMyTeacher'
|
||||||
export * from './CProfile'
|
export * from './CProfile'
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ export interface IUserProfile {
|
|||||||
friends: IFriends[]
|
friends: IFriends[]
|
||||||
req_friends: IFriends[]
|
req_friends: IFriends[]
|
||||||
mygroups: IMyGroup[]
|
mygroups: IMyGroup[]
|
||||||
|
manage_mygroups: IMyGroup[]
|
||||||
|
|
||||||
// in memory
|
// in memory
|
||||||
asked_friends: any[]
|
asked_friends: any[]
|
||||||
|
|||||||
@@ -182,6 +182,7 @@ const msg_it = {
|
|||||||
recdupfailed: 'Errore durante la duplicazione del Record',
|
recdupfailed: 'Errore durante la duplicazione del Record',
|
||||||
friendsadded: 'Aggiunto alla lista di Amici',
|
friendsadded: 'Aggiunto alla lista di Amici',
|
||||||
domanda_removefriend: 'Rimuovi dagli Amici {username}?',
|
domanda_removefriend: 'Rimuovi dagli Amici {username}?',
|
||||||
|
domanda_removegroup: 'Rimuovere dal Gruppo {username} ?',
|
||||||
removedfriend: 'Rimosso dalla lista di Amici',
|
removedfriend: 'Rimosso dalla lista di Amici',
|
||||||
removedgroup: 'Rimosso dal Gruppo',
|
removedgroup: 'Rimosso dal Gruppo',
|
||||||
domanda_addtofriend: 'Aggiungere agli amici {username}?',
|
domanda_addtofriend: 'Aggiungere agli amici {username}?',
|
||||||
@@ -199,7 +200,7 @@ const msg_it = {
|
|||||||
revoketofriend: 'Revocato la richiesta di Amicizia a {username}',
|
revoketofriend: 'Revocato la richiesta di Amicizia a {username}',
|
||||||
revoketogroup: 'Revocato la richiesta d\'invito al gruppo {groupname}',
|
revoketogroup: 'Revocato la richiesta d\'invito al gruppo {groupname}',
|
||||||
domanda_cancel_req_friend: 'Annullare la richiesta di Amicizia a {username}?',
|
domanda_cancel_req_friend: 'Annullare la richiesta di Amicizia a {username}?',
|
||||||
domanda_cancel_req_group: 'Annullare la richiesta d\'invito al gruppo {groupname}?',
|
domanda_cancel_req_group: 'Annullare la richiesta d\'invito di {username} al gruppo {groupname}?',
|
||||||
cancel_req_friend: 'Annullata la richiesta di Amicizia a {username}',
|
cancel_req_friend: 'Annullata la richiesta di Amicizia a {username}',
|
||||||
cancel_req_group: 'Annullata la richiesta al gruppo {groupname}',
|
cancel_req_group: 'Annullata la richiesta al gruppo {groupname}',
|
||||||
domanda_rejectedtrust: 'Rifiutare la Fiducia a {username}?',
|
domanda_rejectedtrust: 'Rifiutare la Fiducia a {username}?',
|
||||||
@@ -864,12 +865,14 @@ const msg_it = {
|
|||||||
mypages: {
|
mypages: {
|
||||||
find_people: 'Cerca Persone',
|
find_people: 'Cerca Persone',
|
||||||
find_group: 'Cerca Gruppo',
|
find_group: 'Cerca Gruppo',
|
||||||
my_groups: 'Miei Gruppi',
|
manage_my_groups: 'Gruppi che Gestisco',
|
||||||
|
follow_groups: 'Gruppi che Seguo',
|
||||||
create_group: 'Crea Gruppo',
|
create_group: 'Crea Gruppo',
|
||||||
friends: 'Amici',
|
friends: 'Amici',
|
||||||
groups: 'Gruppi',
|
groups: 'Gruppi',
|
||||||
request_friends: 'Rich. Amicizia',
|
request_friends: 'Rich. Amicizia',
|
||||||
request_sent_friends: 'Rich. Inviate',
|
request_sent_friends: 'Rich. Inviate',
|
||||||
|
request_sent_groups: 'Rich. Inviate',
|
||||||
request_trust: 'Rich. Fiducia',
|
request_trust: 'Rich. Fiducia',
|
||||||
trusted: 'Fiducia Accettata',
|
trusted: 'Fiducia Accettata',
|
||||||
rejected: 'Rifiutati',
|
rejected: 'Rifiutati',
|
||||||
@@ -889,11 +892,12 @@ const msg_it = {
|
|||||||
groups: {
|
groups: {
|
||||||
admins: 'Amministratori',
|
admins: 'Amministratori',
|
||||||
ask_group: 'Chiedi di entrare nel Gruppo',
|
ask_group: 'Chiedi di entrare nel Gruppo',
|
||||||
accept_group: 'Accetta la richiesta per entrare',
|
accept_group: 'Accetta la richiesta',
|
||||||
remove_from_mygroups: 'Rimuovi dai tuoi Gruppi',
|
remove_from_mygroups: 'Rimuovi dal Gruppo',
|
||||||
block_group: 'Blocca Gruppo',
|
block_group: 'Blocca Gruppo',
|
||||||
cancel_ask_group: 'Annulla la richiesta',
|
cancel_ask_group: 'Annulla la richiesta',
|
||||||
cancel_ask_group_short: 'Annulla richiesta',
|
cancel_ask_group_short: 'Annulla richiesta',
|
||||||
|
refuse_ask_group_short: 'Rifiuta la richiesta',
|
||||||
pwd: 'Password per accedere',
|
pwd: 'Password per accedere',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ export const costanti = {
|
|||||||
RISERVATO_PASSWORD: 1,
|
RISERVATO_PASSWORD: 1,
|
||||||
NASCOSTO_CERCA: 2,
|
NASCOSTO_CERCA: 2,
|
||||||
|
|
||||||
|
VISUTABLE_LISTA: 2,
|
||||||
VISUTABLE_SCHEDA_USER: -1,
|
VISUTABLE_SCHEDA_USER: -1,
|
||||||
VISUTABLE_SCHEDA_GROUP: -3,
|
VISUTABLE_SCHEDA_GROUP: -3,
|
||||||
|
|
||||||
@@ -36,10 +37,15 @@ export const costanti = {
|
|||||||
FIND_GROUP: 20,
|
FIND_GROUP: 20,
|
||||||
MY_GROUPS: 21,
|
MY_GROUPS: 21,
|
||||||
CREATE_GROUP: 30,
|
CREATE_GROUP: 30,
|
||||||
|
MANAGE_GROUPS: 31,
|
||||||
|
|
||||||
|
REQ_ADD_USER_TO_GROUP: 40,
|
||||||
|
REQ_REMOVE_USER_TO_GROUP: 41,
|
||||||
|
|
||||||
FILTER_TUTTI: -100,
|
FILTER_TUTTI: -100,
|
||||||
TABLES_ARRAY: ['mygroups'],
|
TABLES_ARRAY: ['mygroups'],
|
||||||
TABLES_USERNAME_DATE: ['friends', 'friendsandme'],
|
TABLES_USERNAME_DATE: ['friends', 'friendsandme'],
|
||||||
|
TABLES_IMG_USERNAME: ['friends', 'friendsandme'],
|
||||||
|
|
||||||
FuncDialog: {
|
FuncDialog: {
|
||||||
CANCEL_BOOKING: 1,
|
CANCEL_BOOKING: 1,
|
||||||
|
|||||||
@@ -446,7 +446,7 @@ export const colmyUserPeople = [
|
|||||||
AddCol({ name: 'name', label_trans: 'reg.name' }),
|
AddCol({ name: 'name', label_trans: 'reg.name' }),
|
||||||
AddCol({
|
AddCol({
|
||||||
name: 'profile.img', field: 'profile', subfield: 'img', label_trans: 'reg.img', sortable: false,
|
name: 'profile.img', field: 'profile', subfield: 'img', label_trans: 'reg.img', sortable: false,
|
||||||
showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit + costanti.showWhen.InView_OnlyifExist,
|
showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit,
|
||||||
}),
|
}),
|
||||||
// AddCol({ name: 'sospeso', label_trans: 'reg.sospeso', fieldtype: costanti.FieldType.boolean }),
|
// AddCol({ name: 'sospeso', label_trans: 'reg.sospeso', fieldtype: costanti.FieldType.boolean }),
|
||||||
// AddCol({ name: 'deleted', label_trans: 'reg.deleted', fieldtype: costanti.FieldType.boolean }),
|
// AddCol({ name: 'deleted', label_trans: 'reg.deleted', fieldtype: costanti.FieldType.boolean }),
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import {
|
|||||||
ITodo,
|
ITodo,
|
||||||
IUserFields,
|
IUserFields,
|
||||||
Privacy,
|
Privacy,
|
||||||
TipoVisu,
|
TipoVisu, IGroup,
|
||||||
} from '@model'
|
} from '@model'
|
||||||
|
|
||||||
import { lists } from '@store/Modules/lists'
|
import { lists } from '@store/Modules/lists'
|
||||||
@@ -4437,12 +4437,37 @@ export const tools = {
|
|||||||
userStore.setGroupsCmd($q, t, username, groupnameDest, shared_consts.GROUPSCMD.SETGROUP, null)
|
userStore.setGroupsCmd($q, t, username, groupnameDest, shared_consts.GROUPSCMD.SETGROUP, null)
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
if (res) {
|
if (res) {
|
||||||
userStore.my.profile.mygroups = [...userStore.my.profile.mygroups, res]
|
if (userStore.my.profile.mygroups)
|
||||||
|
userStore.my.profile.mygroups = [...userStore.my.profile.mygroups, res]
|
||||||
|
else
|
||||||
|
userStore.my.profile.mygroups = [res]
|
||||||
tools.showPositiveNotif($q, t('db.addedgroup'))
|
tools.showPositiveNotif($q, t('db.addedgroup'))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
removeFromMyGroups($q: any, username: string, groupnameDest: string) {
|
||||||
|
const userStore = useUserStore()
|
||||||
|
|
||||||
|
$q.dialog({
|
||||||
|
message: t('db.domanda_removegroup', { username }),
|
||||||
|
ok: { label: t('dialog.yes'), push: true },
|
||||||
|
cancel: { label: t('dialog.cancel') },
|
||||||
|
title: t('db.domanda')
|
||||||
|
}).onOk(() => {
|
||||||
|
|
||||||
|
userStore.setGroupsCmd($q, t, username, groupnameDest, shared_consts.GROUPSCMD.REMOVE_FROM_MYGROUP, null).then((res) => {
|
||||||
|
if (res) {
|
||||||
|
if (userStore.my.profile.mygroups) {
|
||||||
|
userStore.my.profile.mygroups = userStore.my.profile.mygroups.filter((rec: IMyGroup) => rec.groupname !== groupnameDest)
|
||||||
|
tools.showPositiveNotif($q, t('db.removedgroup'))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
setRequestFriendship($q: any, username: string, usernameDest: string, value: boolean) {
|
setRequestFriendship($q: any, username: string, usernameDest: string, value: boolean) {
|
||||||
|
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
@@ -4544,10 +4569,10 @@ export const tools = {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
cancelReqGroups($q: any, username: string, groupnameDest: string) {
|
cancelReqGroups($q: any, username: string, groupnameDest: string) {
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
$q.dialog({
|
$q.dialog({
|
||||||
message: t('db.domanda_cancel_req_group', { groupname: groupnameDest }),
|
message: t('db.domanda_cancel_req_group', { username, groupname: groupnameDest }),
|
||||||
ok: { label: t('dialog.yes'), push: true },
|
ok: { label: t('dialog.yes'), push: true },
|
||||||
cancel: { label: t('dialog.cancel') },
|
cancel: { label: t('dialog.cancel') },
|
||||||
title: t('db.domanda')
|
title: t('db.domanda')
|
||||||
@@ -4695,6 +4720,29 @@ export const tools = {
|
|||||||
// (!visulabel && !col.showOnlyNewRec && !col.noShowView)
|
// (!visulabel && !col.showOnlyNewRec && !col.noShowView)
|
||||||
},
|
},
|
||||||
|
|
||||||
|
iAmAdminGroup(groupname: string) {
|
||||||
|
const userStore = useUserStore()
|
||||||
|
|
||||||
|
let risultato = false
|
||||||
|
|
||||||
|
if (userStore.my.profile.manage_mygroups) {
|
||||||
|
const ris = userStore.my.profile.manage_mygroups.find((grp: IMyGroup) => {
|
||||||
|
if (grp.groupname === groupname) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
// console.log('ris', ris)
|
||||||
|
if (ris && ris.admins) {
|
||||||
|
const isadmin = ris.admins.find((user: IFriends) => user.username === userStore.my.username)
|
||||||
|
risultato = !!isadmin
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return risultato
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
// getLocale() {
|
// getLocale() {
|
||||||
// if (navigator.languages && navigator.languages.length > 0) {
|
// if (navigator.languages && navigator.languages.length > 0) {
|
||||||
// return navigator.languages[0]
|
// return navigator.languages[0]
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ export const DefaultUser: IUserFields = {
|
|||||||
friends: [],
|
friends: [],
|
||||||
req_friends: [],
|
req_friends: [],
|
||||||
mygroups: [],
|
mygroups: [],
|
||||||
|
manage_mygroups: [],
|
||||||
asked_friends: [],
|
asked_friends: [],
|
||||||
asked_groups: [],
|
asked_groups: [],
|
||||||
},
|
},
|
||||||
@@ -95,6 +96,7 @@ export const DefaultProfile: IUserProfile = {
|
|||||||
friends: [],
|
friends: [],
|
||||||
req_friends: [],
|
req_friends: [],
|
||||||
mygroups: [],
|
mygroups: [],
|
||||||
|
manage_mygroups: [],
|
||||||
asked_friends: [],
|
asked_friends: [],
|
||||||
asked_groups: [],
|
asked_groups: [],
|
||||||
}
|
}
|
||||||
@@ -177,7 +179,7 @@ export const useUserStore = defineStore('UserStore', {
|
|||||||
},
|
},
|
||||||
|
|
||||||
IsMyGroupByGroupname(groupname: string): boolean {
|
IsMyGroupByGroupname(groupname: string): boolean {
|
||||||
if (this.my.profile.friends)
|
if (this.my.profile.mygroups)
|
||||||
return this.my.profile.mygroups.findIndex((rec) => rec.groupname === groupname) >= 0
|
return this.my.profile.mygroups.findIndex((rec) => rec.groupname === groupname) >= 0
|
||||||
else
|
else
|
||||||
return false
|
return false
|
||||||
@@ -475,6 +477,7 @@ export const useUserStore = defineStore('UserStore', {
|
|||||||
this.my.profile = DefaultProfile
|
this.my.profile = DefaultProfile
|
||||||
|
|
||||||
// Memory
|
// Memory
|
||||||
|
this.my.profile.manage_mygroups = []
|
||||||
this.my.profile.asked_friends = []
|
this.my.profile.asked_friends = []
|
||||||
this.my.profile.asked_groups = []
|
this.my.profile.asked_groups = []
|
||||||
}
|
}
|
||||||
@@ -856,7 +859,7 @@ export const useUserStore = defineStore('UserStore', {
|
|||||||
verified_by_aportador,
|
verified_by_aportador,
|
||||||
made_gift,
|
made_gift,
|
||||||
perm,
|
perm,
|
||||||
profile: { img, teleg_id, myshares: [], friends: [], req_friends: [], asked_friends: [], mygroups: [], asked_groups: [] },
|
profile: { img, teleg_id, myshares: [], friends: [], req_friends: [], asked_friends: [], mygroups: [], asked_groups: [], manage_mygroups: [] },
|
||||||
})
|
})
|
||||||
|
|
||||||
isLogged = true
|
isLogged = true
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
:prop_mycolumns="colmyUserPeople"
|
:prop_mycolumns="colmyUserPeople"
|
||||||
prop_colkey="_id"
|
prop_colkey="_id"
|
||||||
col_title="username"
|
col_title="username"
|
||||||
:vertical="true"
|
:vertical="-1"
|
||||||
nodataLabel=" "
|
nodataLabel=" "
|
||||||
:prop_search="true"
|
:prop_search="true"
|
||||||
hint="Username da trovare"
|
hint="Username da trovare"
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
import { CMyFieldDb } from '@/components/CMyFieldDb'
|
import { CGridTableRec } from '@/components/CGridTableRec'
|
||||||
|
import { CMyFriends } from '@/components/CMyFriends'
|
||||||
import { CTitleBanner } from '@/components/CTitleBanner'
|
import { CTitleBanner } from '@/components/CTitleBanner'
|
||||||
import { CProfile } from '@/components/CProfile'
|
import { CProfile } from '@/components/CProfile'
|
||||||
|
import { CMyFieldRec } from '@/components/CMyFieldRec'
|
||||||
import { CSkill } from '@/components/CSkill'
|
import { CSkill } from '@/components/CSkill'
|
||||||
import { CDateTime } from '@/components/CDateTime'
|
import { CDateTime } from '@/components/CDateTime'
|
||||||
import { tools } from '@store/Modules/tools'
|
import { tools } from '@store/Modules/tools'
|
||||||
@@ -12,13 +14,14 @@ import { useI18n } from '@/boot/i18n'
|
|||||||
import { toolsext } from '@store/Modules/toolsext'
|
import { toolsext } from '@store/Modules/toolsext'
|
||||||
import { useQuasar } from 'quasar'
|
import { useQuasar } from 'quasar'
|
||||||
import { costanti } from '@costanti'
|
import { costanti } from '@costanti'
|
||||||
import { IMyGroup, IUserFields } from 'model'
|
import { IFriends, IMyGroup, ISearchList, IUserFields } from 'model'
|
||||||
import { shared_consts } from '@/common/shared_vuejs'
|
import { shared_consts } from '@/common/shared_vuejs'
|
||||||
|
import { colmyUserPeople, colmyUserGroup } from '@store/Modules/fieldsTable'
|
||||||
|
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'mygroup',
|
name: 'mygroup',
|
||||||
components: { CProfile, CTitleBanner, CMyFieldDb, CSkill, CDateTime },
|
components: { CProfile, CTitleBanner, CMyFieldRec, CSkill, CDateTime, CMyFriends, CGridTableRec },
|
||||||
props: {},
|
props: {},
|
||||||
setup() {
|
setup() {
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
@@ -33,7 +36,15 @@ export default defineComponent({
|
|||||||
const filtroutente = ref(<any[]>[])
|
const filtroutente = ref(<any[]>[])
|
||||||
const showPic = ref(false)
|
const showPic = ref(false)
|
||||||
|
|
||||||
const mygrp = ref(<IMyGroup>{})
|
const mygrp = ref(<IMyGroup|null>{})
|
||||||
|
const users_in_group = ref(<IFriends[]>[])
|
||||||
|
|
||||||
|
const tab = ref('membri')
|
||||||
|
|
||||||
|
const arrfilterand: any = ref([])
|
||||||
|
const filtercustom: any = ref([])
|
||||||
|
const filtercustom_rich: any = ref([])
|
||||||
|
const searchList = ref(<ISearchList[]>[])
|
||||||
|
|
||||||
function profile() {
|
function profile() {
|
||||||
return userStore.my.profile
|
return userStore.my.profile
|
||||||
@@ -47,7 +58,13 @@ export default defineComponent({
|
|||||||
// Carica il profilo di quest'utente
|
// Carica il profilo di quest'utente
|
||||||
if (groupname.value) {
|
if (groupname.value) {
|
||||||
userStore.loadGroup(groupname.value).then((ris) => {
|
userStore.loadGroup(groupname.value).then((ris) => {
|
||||||
mygrp.value = ris
|
if (ris) {
|
||||||
|
mygrp.value = ris.mygroup
|
||||||
|
users_in_group.value = ris.users_in_group
|
||||||
|
} else {
|
||||||
|
mygrp.value = null
|
||||||
|
users_in_group.value = []
|
||||||
|
}
|
||||||
// filtroutente.value = [{ userId: userStore.my._id }]
|
// filtroutente.value = [{ userId: userStore.my._id }]
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -60,10 +77,19 @@ export default defineComponent({
|
|||||||
|
|
||||||
function mounted() {
|
function mounted() {
|
||||||
loadGroup()
|
loadGroup()
|
||||||
|
|
||||||
|
searchList.value = []
|
||||||
|
filtercustom.value = [{ 'profile.mygroups': { $elemMatch: {groupname: {$eq: groupname.value }} } } ]
|
||||||
|
filtercustom_rich.value = [{ req_users: { $elemMatch: {username: {$eq: userStore.my.username }} } } ]
|
||||||
|
arrfilterand.value = []
|
||||||
|
//++TODO: sistemare la filtercustom ... richieste...
|
||||||
}
|
}
|
||||||
|
|
||||||
function getImgGrp() {
|
function getImgGrp() {
|
||||||
return userStore.getImgByGroup(mygrp.value)
|
if (mygrp.value)
|
||||||
|
return userStore.getImgByGroup(mygrp.value)
|
||||||
|
else
|
||||||
|
return ''
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkifShow(col: string) {
|
function checkifShow(col: string) {
|
||||||
@@ -73,12 +99,20 @@ export default defineComponent({
|
|||||||
|
|
||||||
function getLinkGrpTelegram() {
|
function getLinkGrpTelegram() {
|
||||||
|
|
||||||
if (!!mygrp.value.link_telegram) {
|
if (mygrp.value) {
|
||||||
return 'https://t.me/' + mygrp.value.link_telegram
|
if (!!mygrp.value.link_telegram) {
|
||||||
|
return 'https://t.me/' + mygrp.value.link_telegram
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return ''
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function getLinkWebSite() {
|
function getLinkWebSite() {
|
||||||
|
if (!mygrp.value) {
|
||||||
|
return ''
|
||||||
|
}
|
||||||
|
|
||||||
let site = mygrp.value.website!
|
let site = mygrp.value.website!
|
||||||
if (site) {
|
if (site) {
|
||||||
@@ -89,6 +123,31 @@ export default defineComponent({
|
|||||||
return site
|
return site
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function extraparams() {
|
||||||
|
let lk_tab = 'users'
|
||||||
|
let lk_LF = 'userId'
|
||||||
|
let lk_FF = '_id'
|
||||||
|
let lk_as = 'user'
|
||||||
|
let af_objId_tab = 'myId'
|
||||||
|
|
||||||
|
return {
|
||||||
|
lookup1: {
|
||||||
|
lk_tab,
|
||||||
|
lk_LF,
|
||||||
|
lk_FF,
|
||||||
|
lk_as,
|
||||||
|
af_objId_tab,
|
||||||
|
lk_proj: {
|
||||||
|
username: 1,
|
||||||
|
name: 1,
|
||||||
|
'profile.img': 1,
|
||||||
|
'profile.qualifica': 1,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
onMounted(mounted)
|
onMounted(mounted)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@@ -108,6 +167,15 @@ export default defineComponent({
|
|||||||
userStore,
|
userStore,
|
||||||
t,
|
t,
|
||||||
animation,
|
animation,
|
||||||
|
arrfilterand,
|
||||||
|
filtercustom,
|
||||||
|
filtercustom_rich,
|
||||||
|
searchList,
|
||||||
|
colmyUserPeople,
|
||||||
|
colmyUserGroup,
|
||||||
|
extraparams,
|
||||||
|
tab,
|
||||||
|
users_in_group,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
|
|
||||||
<div class="q-gutter-sm q-pa-sm q-pb-md">
|
<div class="q-gutter-sm q-pa-sm q-pb-md">
|
||||||
<div v-if="mygrp.descr" class="fit column no-wrap justify-evenly items-center content-start">
|
<div v-if="mygrp.descr" class="fit column no-wrap justify-evenly items-center content-start">
|
||||||
|
|
||||||
@@ -14,11 +15,21 @@
|
|||||||
<div class="col-12 text-h7 text-blue text-shadow-2">
|
<div class="col-12 text-h7 text-blue text-shadow-2">
|
||||||
{{ mygrp.groupname }}
|
{{ mygrp.groupname }}
|
||||||
</div>
|
</div>
|
||||||
|
<div>
|
||||||
|
<CMyFieldRec
|
||||||
|
title="Visibilità"
|
||||||
|
table="mygroups"
|
||||||
|
:columns="colmyUserGroup"
|
||||||
|
:rec="mygrp"
|
||||||
|
field="visibility"
|
||||||
|
:canModify="false">
|
||||||
|
</CMyFieldRec>
|
||||||
|
</div>
|
||||||
<div class="col-12 text-h7">
|
<div class="col-12 text-h7">
|
||||||
<span v-if="checkifShow('descr')">{{ mygrp.descr }}</span>
|
<span v-if="checkifShow('descr')">{{ mygrp.descr }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="mygrp.admins && !mygrp.admins.includes(userStore.my.username)">
|
<div>
|
||||||
<q-btn
|
<q-btn
|
||||||
v-if="!userStore.IsMyGroupByGroupname(mygrp.groupname) && !userStore.IsAskedGroupByGroupname(mygrp.groupname)"
|
v-if="!userStore.IsMyGroupByGroupname(mygrp.groupname) && !userStore.IsAskedGroupByGroupname(mygrp.groupname)"
|
||||||
icon="fas fa-user-plus"
|
icon="fas fa-user-plus"
|
||||||
@@ -73,7 +84,80 @@
|
|||||||
:href="getLinkWebSite()" target="__blank">
|
:href="getLinkWebSite()" target="__blank">
|
||||||
</q-btn>
|
</q-btn>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
<div v-if="tools.iAmAdminGroup(groupname)">
|
||||||
|
<q-tabs v-model="tab" class="text-blue">
|
||||||
|
<q-tab label="Membri" name="membri" icon="fas fa-users"></q-tab>
|
||||||
|
<q-tab label="Richieste" name="rich" icon="fas fa-user-plus"></q-tab>
|
||||||
|
</q-tabs>
|
||||||
|
|
||||||
|
<q-tab-panels v-model="tab" animated>
|
||||||
|
<q-tab-panel name="membri">
|
||||||
|
<CGridTableRec
|
||||||
|
ref="tabMembri"
|
||||||
|
prop_mytable="users"
|
||||||
|
prop_mytitle=""
|
||||||
|
:prop_mycolumns="colmyUserPeople"
|
||||||
|
prop_colkey="_id"
|
||||||
|
col_title="username"
|
||||||
|
:vertical="costanti.VISUTABLE_LISTA"
|
||||||
|
nodataLabel="Nessun Membro"
|
||||||
|
:prop_search="true"
|
||||||
|
hint="Username da trovare"
|
||||||
|
:finder="false"
|
||||||
|
:choose_visutype="true"
|
||||||
|
:finder_noNull="false"
|
||||||
|
:options="shared_consts.OPTIONS_SEARCH_USER_ONLY_FULL_WORDS"
|
||||||
|
:butt_modif_new="false"
|
||||||
|
noresultLabel="Username non trovato"
|
||||||
|
:arrfilters="arrfilterand"
|
||||||
|
:filtercustom="filtercustom"
|
||||||
|
:prop_searchList="searchList"
|
||||||
|
:showType="costanti.SHOW_USERINFO"
|
||||||
|
keyMain=""
|
||||||
|
:showCol="false"
|
||||||
|
:extrafield="groupname"
|
||||||
|
:extraparams="extraparams()"
|
||||||
|
:visufind="costanti.REQ_REMOVE_USER_TO_GROUP"
|
||||||
|
>
|
||||||
|
|
||||||
|
</CGridTableRec>
|
||||||
|
</q-tab-panel>
|
||||||
|
<q-tab-panel name="rich">
|
||||||
|
<CGridTableRec
|
||||||
|
prop_mytable="mygroups"
|
||||||
|
prop_mytitle=""
|
||||||
|
:prop_mycolumns="colmyUserPeople"
|
||||||
|
prop_colkey="_id"
|
||||||
|
col_title="username"
|
||||||
|
:vertical="costanti.VISUTABLE_LISTA"
|
||||||
|
nodataLabel=" "
|
||||||
|
:prop_search="false"
|
||||||
|
hint="Username da trovare"
|
||||||
|
:finder="false"
|
||||||
|
:choose_visutype="false"
|
||||||
|
:finder_noNull="false"
|
||||||
|
:options="shared_consts.OPTIONS_SEARCH_USER_ONLY_FULL_WORDS"
|
||||||
|
:butt_modif_new="false"
|
||||||
|
noresultLabel="Username non trovato"
|
||||||
|
:arrfilters="arrfilterand"
|
||||||
|
:filtercustom="filtercustom_rich"
|
||||||
|
:prop_searchList="searchList"
|
||||||
|
:showType="costanti.SHOW_USERINFO"
|
||||||
|
keyMain=""
|
||||||
|
:showCol="false"
|
||||||
|
:extraparams="extraparams()"
|
||||||
|
:extrafield="groupname"
|
||||||
|
:visufind="costanti.REQ_ADD_USER_TO_GROUP"
|
||||||
|
>
|
||||||
|
|
||||||
|
</CGridTableRec>
|
||||||
|
</q-tab-panel>
|
||||||
|
</q-tab-panels>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div v-else class="fit column no-wrap justify-evenly items-center content-start">
|
<div v-else class="fit column no-wrap justify-evenly items-center content-start">
|
||||||
<q-skeleton type="QAvatar" size="140px" height="140px" animation="fade"/>
|
<q-skeleton type="QAvatar" size="140px" height="140px" animation="fade"/>
|
||||||
|
|||||||
@@ -10,8 +10,8 @@
|
|||||||
:prop_mycolumns="colmyUserGroup"
|
:prop_mycolumns="colmyUserGroup"
|
||||||
prop_colkey="_id"
|
prop_colkey="_id"
|
||||||
col_title="groupname"
|
col_title="groupname"
|
||||||
:vertical="true"
|
:vertical="costanti.VISUTABLE_LISTA"
|
||||||
nodataLabel=" "
|
nodataLabel="Nessuna Richiesta in sospeso"
|
||||||
:prop_search="true"
|
:prop_search="true"
|
||||||
hint="nome del gruppo da trovare"
|
hint="nome del gruppo da trovare"
|
||||||
:finder="true"
|
:finder="true"
|
||||||
|
|||||||
Reference in New Issue
Block a user