diff --git a/src/common/shared_vuejs.ts b/src/common/shared_vuejs.ts index 148f17dd..a6f229ab 100755 --- a/src/common/shared_vuejs.ts +++ b/src/common/shared_vuejs.ts @@ -81,9 +81,10 @@ export const shared_consts = { PARAM_SHOW_PROVINCE: 1, - TABLES_ID_NUMBER: ['permissions', 'levels', 'statusSkills', 'sectors', 'skills', 'subskills', 'cities', 'provinces', 'myskills'], + TABLES_ID_NUMBER: ['permissions', 'levels', 'statusSkills', 'sectors', 'catgrps', 'skills', 'subskills', 'cities', 'provinces', 'myskills', 'mygroups'], TABLES_USER_ID: ['myskills'], TABLES_UPDATE_LASTMODIFIED: ['myskills', 'mybots'], + TABLES_FINDER: ['myskills', 'mygroups'], TABLES_PERM_CHANGE_FOR_USERS: ['myskills'], @@ -687,15 +688,13 @@ export const shared_consts = { VisibilGroup: [ { value: 1, - label: 'Pubblico', + label: 'Riservato', + hint: 'Per accedere al gruppo, verrà richiesto la password' }, { value: 2, - label: 'Privato', - }, - { - value: 4, label: 'Nascosto', + hint: 'il Gruppo non sarà visibile nella ricerca' }, ], diff --git a/src/components/CGridTableRec/CGridTableRec.ts b/src/components/CGridTableRec/CGridTableRec.ts index 6df741a8..5d8a2c16 100755 --- a/src/components/CGridTableRec/CGridTableRec.ts +++ b/src/components/CGridTableRec/CGridTableRec.ts @@ -5,6 +5,8 @@ import { tools } from '../../store/Modules/tools' import { fieldsTable } from '@store/Modules/fieldsTable' +import { shared_consts } from '@/common/shared_vuejs' + import { IColGridTable, IFilter, @@ -313,6 +315,15 @@ export default defineComponent({ function canModifyThisRec(rec: any) { // console.log('rec', rec) + + if (tablesel.value === 'mygroups') { + // is Admin ? + const trovato = rec.admins.find((myuser: any) => myuser.username === userStore.my.username) + if (trovato) { + return !!trovato + } + } + if (rec.hasOwnProperty('userId')) { let userId = rec.userId if (userId === userStore.my._id) { @@ -819,6 +830,8 @@ export default defineComponent({ await createNewRecordDialog() + console.log('newRecord.value', newRecord.value) + serverData.value.push(newRecord.value) pagination.value.rowsNumber++ @@ -882,6 +895,7 @@ export default defineComponent({ function exec_func_table(table: string, func: number, par: IParamDialog) { + if (func === lists.MenuAction.DELETE_RECTABLE) { globalStore.DeleteRec({ table, id: par.param1 }).then((ris) => { if (ris) { @@ -1149,10 +1163,29 @@ export default defineComponent({ return ok } + function getColMissing() { + + let col: IColGridTable + + for (col of mycolumns.value) { + if (col.required) { + // console.log('newRecord.value', newRecord.value, newRecord.value[col.name]) + if (!newRecord.value[col.name]) { + // console.log('col.name', col.name) + return translate(col.label_trans) + } + } + } + + return '' + } + async function saveNewRecord() { // check if the field are setted if (!enableSaveNewRec()) { + tools.showNeutralNotif($q, 'Si prega di compilare il campo \'' + getColMissing() + '\'', 5000) + return false } @@ -1243,10 +1276,21 @@ export default defineComponent({ return ((rec._id > 0 && typeof rec._id === 'number') || rec._id !== 'number') && rec !== -100 } - function showColCheck(col: IColGridTable, tipovis: number, visulabel:boolean, value: any = ''){ + function showColCheck(col: IColGridTable, tipovis: number, visulabel:boolean, value: any = '', record: any = null){ const check = tools.checkIfShowField(col, tipovis, visulabel, value) - const valuePresent = (colVisib.value.includes(col.field! + col.subfield) || colVisib.value.includes(col.field + '.' + col.subfield)) + let valuePresent = (colVisib.value.includes(col.field! + col.subfield) || colVisib.value.includes(col.field + '.' + col.subfield)) + + if (valuePresent && col.visibleif! > 0 && record) { + if (col.visib_field) { + if (col.visibleif === costanti.BINARY_CHECK) { + if (!tools.isBitActive(record[col.visib_field], col.visib_value)) + valuePresent = false + } + + } + + } return check && valuePresent } @@ -1337,6 +1381,7 @@ export default defineComponent({ myvertical, showColCheck, getValueExtra, + shared_consts, } } }) diff --git a/src/components/CGridTableRec/CGridTableRec.vue b/src/components/CGridTableRec/CGridTableRec.vue index af96a0b2..85e9eb92 100755 --- a/src/components/CGridTableRec/CGridTableRec.vue +++ b/src/components/CGridTableRec/CGridTableRec.vue @@ -13,7 +13,7 @@
+ v-if="showColCheck(col, tools.TIPOVIS_SHOW_RECORD, true, 1, props.row)" class="tdclass">
{{ props.row[col_title] }} +
+ v-if="showColCheck(col, tools.TIPOVIS_NEW_RECORD, true, 0, newRecord) && col.foredit">
recout[props.optval] === rec[props.optval]) + } else { + // @ts-ignore + trovato = myval.value.includes(rec[props.optval]) + } + + if (trovato) { const mydata: any = { label: null, value: rec[props.optval], diff --git a/src/components/CMyEditor/CMyEditor.ts b/src/components/CMyEditor/CMyEditor.ts index 4ce7bed6..1b47206e 100755 --- a/src/components/CMyEditor/CMyEditor.ts +++ b/src/components/CMyEditor/CMyEditor.ts @@ -2,7 +2,7 @@ import { tools } from '@store/Modules/tools' import { CTitleBanner } from '../CTitleBanner' -import { defineComponent, ref, toRef } from 'vue' +import { defineComponent, onMounted, ref, toRef } from 'vue' import { useQuasar } from 'quasar' export default defineComponent({ @@ -38,7 +38,8 @@ export default defineComponent({ const $q = useQuasar() const editor = ref(null) - const myvalue = toRef(props, 'value') + //const myvalue = toRef(props, 'value') + const myvalue = ref('') const mycolor = ref('') const showeditor= ref(true) @@ -163,6 +164,15 @@ export default defineComponent({ // } } + function mounted() { + if (props.value === undefined) + myvalue.value = '' + else + myvalue.value = props.value + } + + onMounted(mounted) + return { myfonts, toolbarcomp, diff --git a/src/components/CMyEditor/CMyEditor.vue b/src/components/CMyEditor/CMyEditor.vue index b653e74c..b5bad38b 100755 --- a/src/components/CMyEditor/CMyEditor.vue +++ b/src/components/CMyEditor/CMyEditor.vue @@ -23,6 +23,7 @@ + - {{ grp.name }} {{ grp.surname }} ({{ grp.groupname }}) + {{ grp.title }} ({{ grp.groupname }}) - {{ grp.profile.qualifica }} + {{ grp.descr }} diff --git a/src/components/CMyGroups/CMyGroups.ts b/src/components/CMyGroups/CMyGroups.ts index 48c13aa7..1366575b 100755 --- a/src/components/CMyGroups/CMyGroups.ts +++ b/src/components/CMyGroups/CMyGroups.ts @@ -52,9 +52,9 @@ export default defineComponent({ let arr: any[] = [] try { if (props.modelValue === costanti.GROUPS) { - arr = userStore.my.profile.groups + arr = userStore.my.profile.mygroups } else if (props.modelValue === costanti.MY_GROUPS) { - arr = userStore.my.profile.groups + arr = userStore.my.profile.mygroups // } else if (props.modelValue === costanti.REQ_GROUP) { // arr = userStore.my.profile.req_groups } else if (props.modelValue === costanti.ASK_SENT_GROUP) { @@ -82,7 +82,7 @@ export default defineComponent({ }) const numGroups = computed(() => { - const arr = userStore.my.profile.groups + const arr = userStore.my.profile.mygroups return (arr) ? arr.length : 0 }) @@ -97,7 +97,7 @@ export default defineComponent({ userStore.loadGroups(username.value).then((ris) => { // console.log('ris', ris) if (ris) { - userStore.my.profile.groups = ris.listUsersGroup ? ris.listUsersGroup : [] + userStore.my.profile.mygroups = ris.listUsersGroup ? ris.listUsersGroup : [] userStore.groups = ris.listgroups ? ris.listgroups : [] userStore.my.profile.asked_groups = ris.listSentRequestGroups ? ris.listSentRequestGroups : [] filtroutente.value = [{ userId: userStore.my._id }] @@ -117,7 +117,7 @@ export default defineComponent({ userStore.setGroupsCmd($q, t, username.value, groupnameDest, shared_consts.GROUPSCMD.REMOVE_FROM_MYGROUP, null).then((res) => { if (res) { - userStore.my.profile.groups = userStore.my.profile.groups.filter((rec: IMyGroup) => rec.groupname !== groupnameDest) + userStore.my.profile.mygroups = userStore.my.profile.mygroups.filter((rec: IMyGroup) => rec.groupname !== groupnameDest) tools.showPositiveNotif($q, t('db.removedgroup')) } }) @@ -133,7 +133,7 @@ export default defineComponent({ }).onOk(() => { userStore.setGroupsCmd($q, t, username.value, usernameDest, shared_consts.GROUPSCMD.BLOCK_GROUP, null).then((res) => { if (res) { - userStore.my.profile.groups = userStore.my.profile.groups.filter((rec: IMyGroup) => rec.groupname !== usernameDest) + userStore.my.profile.mygroups = userStore.my.profile.mygroups.filter((rec: IMyGroup) => rec.groupname !== usernameDest) tools.showPositiveNotif($q, t('db.blockedgroup')) } }) diff --git a/src/components/CMyGroups/CMyGroups.vue b/src/components/CMyGroups/CMyGroups.vue index ad3cfbd0..149810a1 100755 --- a/src/components/CMyGroups/CMyGroups.vue +++ b/src/components/CMyGroups/CMyGroups.vue @@ -15,7 +15,6 @@ />
-
diff --git a/src/components/CMyPopupEdit/CMyPopupEdit.ts b/src/components/CMyPopupEdit/CMyPopupEdit.ts index 2b759ac3..4293ab2c 100755 --- a/src/components/CMyPopupEdit/CMyPopupEdit.ts +++ b/src/components/CMyPopupEdit/CMyPopupEdit.ts @@ -273,6 +273,9 @@ export default defineComponent({ } function changevalRec(newval: any) { + if (col.value && col.value.allowchar === costanti.ALLOWCHAR_CODE) { + myvalue.value = tools.removespaces(newval) + } console.log('popypedit: changevalRec', newval) // console.log('row', props.row, 'col', props.mycol, 'newval', newval) // console.log('row[col.value.name]', props.row[col.value.name]) @@ -280,6 +283,7 @@ export default defineComponent({ // console.log('image', newval) } myrow.value[col.value.name] = newval + // console.log('changevalRec update:row', newval) emit('update:row', props.row) if (props.isInModif) @@ -590,13 +594,13 @@ export default defineComponent({ function getDirectoryGall() { let ris = '' if (fieldsTable.tableForUsers.includes(props.table)) { - console.log('1') ris = 'profile/' + myrow.value['username'] + '/' + props.table }else if (props.table === 'users') { - console.log('2') ris = 'profile/' + userStore.my.username + }else if (props.table === 'mygroups') { + if (myrow.value.hasOwnProperty('groupname')) + ris = 'mygroups/' + myrow.value['groupname'] } else { - console.log('3') ris = props.table } return ris @@ -639,6 +643,16 @@ export default defineComponent({ } + function getToByCol(col: IColGridTable){ + if (props.table === 'myskills') { + return '/mypage/'+ props.row['_id'] + } else if (props.table === 'mygroups') { + return '/grp/' + props.row['groupname'] + } + + return '' + } + onBeforeMount(mounted) crea() @@ -677,6 +691,7 @@ export default defineComponent({ myImgGall, noPopupeditByCol, getTitleEditor, + getToByCol, } } }) diff --git a/src/components/CMyPopupEdit/CMyPopupEdit.vue b/src/components/CMyPopupEdit/CMyPopupEdit.vue index 1c04367b..b168f076 100755 --- a/src/components/CMyPopupEdit/CMyPopupEdit.vue +++ b/src/components/CMyPopupEdit/CMyPopupEdit.vue @@ -30,17 +30,18 @@ @update:model-value="Savedb">
-
+
@@ -503,13 +513,14 @@
-
+
@@ -540,6 +551,7 @@
val === (myrec[`${props.optval}`])) - if (rec) { - arrrec.push(rec[`${props.optval}`]) + if (props.arrvalue) { + for (const val of props.arrvalue) { + rec = optionsreal.value.find((myrec: any) => val === (myrec[`${props.optval}`])) + if (rec) { + arrrec.push(rec[`${props.optval}`]) + } } } - if (arrrec) { + if (arrrec.length > 0) { if (props.funcgetvaluebyid) myarrvalue.value = props.funcgetvaluebyid(arrrec) else diff --git a/src/components/CMySelect/CMySelect.vue b/src/components/CMySelect/CMySelect.vue index eac54a1d..fa63b558 100755 --- a/src/components/CMySelect/CMySelect.vue +++ b/src/components/CMySelect/CMySelect.vue @@ -159,6 +159,7 @@ {{ opt[optlab] }} + {{ opt['hint'] }} @@ -200,6 +201,7 @@ {{ scope.opt[optlab] }} + {{ scope.opt['hint'] }} diff --git a/src/model/GlobalStore.ts b/src/model/GlobalStore.ts index 188e2099..ae104803 100755 --- a/src/model/GlobalStore.ts +++ b/src/model/GlobalStore.ts @@ -1,5 +1,5 @@ import { IAction } from '@src/model/Projects' -import { IPaymentType } from '@src/model/UserStore' +import { IMyGroup, IPaymentType } from '@src/model/UserStore' import { IDepartment, IProducer, IShareWithUs, IStorehouse, } from '@src/model/Products' @@ -261,6 +261,7 @@ export interface IGlobalState { subSkills: ISubSkill[], statusSkills: IStatusSkill[], sectors: ISector[], + catgrps: ICatGrp[], cities: ICity[], } @@ -484,6 +485,9 @@ export interface IColGridTable { required?: boolean label?: string label_trans?: string + visibleif?: number + visib_field?: string + visib_value?: any align?: string field?: string sortable?: boolean @@ -495,6 +499,7 @@ export interface IColGridTable { askaction?: string foredit?: boolean fieldtype?: number + field_outtype?: number noshowlabel?: boolean tipovisu?: number link?: string @@ -506,6 +511,7 @@ export interface IColGridTable { notsave?: boolean showWhen?: number maxlength?: number + allowchar?: number filter_table?: string filter_field?: string remote_table?: string @@ -633,6 +639,16 @@ export interface ISector { theme: string } +export interface ICatGrp { + _id: number + descr: string + idCatGrp?: number + icon?: string + img?: string + color: string + theme: string +} + export interface ILevel { _id: number descr: string diff --git a/src/model/UserStore.ts b/src/model/UserStore.ts index 65d33cdc..3fef22f1 100755 --- a/src/model/UserStore.ts +++ b/src/model/UserStore.ts @@ -1,6 +1,6 @@ import { IToken } from '@model/other' import { ICart, IOrderCart, IShareWithUs } from '@src/model/Products' -import { IGallery } from '@model/GlobalStore' +import { IGallery, IImgGallery } from '@model/GlobalStore' const enum ESexType { None = 0, @@ -17,7 +17,7 @@ export interface IMyGroup { groupname: string title?: string descr?: string - photos: IGallery[] + photos: IImgGallery[] visibility?: number date_created?: Date admins?: IFriends[] @@ -69,7 +69,7 @@ export interface IUserProfile { myshares: IShareWithUs[] friends: IFriends[] req_friends: IFriends[] - groups: IMyGroup[] + mygroups: IMyGroup[] // in memory asked_friends: any[] diff --git a/src/statics/lang/it.js b/src/statics/lang/it.js index 70fe8906..71e23b60 100755 --- a/src/statics/lang/it.js +++ b/src/statics/lang/it.js @@ -502,6 +502,7 @@ const msg_it = { photo: 'Foto', images: 'Immagini', image: 'Immagine', + date_created: 'Creato il', err: { required: 'è richiesto', email: 'inserire una email valida', @@ -841,6 +842,9 @@ const msg_it = { sectors: { name: 'Settore', }, + catgrps: { + name: 'Categoria', + }, contribtype: { name: 'Contributo' }, @@ -890,6 +894,7 @@ const msg_it = { block_group: 'Blocca Gruppo', cancel_ask_group: 'Annulla la richiesta', cancel_ask_group_short: 'Annulla richiesta', + pwd: 'Password per accedere', } }, diff --git a/src/store/Modules/costanti.ts b/src/store/Modules/costanti.ts index 5f6501ae..792ae7f1 100755 --- a/src/store/Modules/costanti.ts +++ b/src/store/Modules/costanti.ts @@ -11,6 +11,11 @@ export const costanti = { SHOW_USERINFO: 1, SHOW_GROUPINFO: 5, + BINARY_CHECK: 1, + + RISERVATO_PASSWORD: 1, + NASCOSTO_CERCA: 2, + VISUTABLE_SCHEDA_USER: -1, VISUTABLE_SCHEDA_GROUP: -3, @@ -42,6 +47,8 @@ export const costanti = { DRAGULA: false, + ALLOWCHAR_CODE: 1, + showWhen: { NewRec: 1, InPage: 2, @@ -84,6 +91,7 @@ export const costanti = { onlydate: 7000, hours: 8000, crypted: 9000, + object: 10000, }, FieldTypeArr: [ diff --git a/src/store/Modules/fieldsTable.ts b/src/store/Modules/fieldsTable.ts index df5bd9e3..35f8bb1a 100755 --- a/src/store/Modules/fieldsTable.ts +++ b/src/store/Modules/fieldsTable.ts @@ -48,6 +48,9 @@ function AddCol(params: IColGridTable) { required: (params.required === undefined) ? false : params.required, label: (params.label === undefined) ? '' : params.label, label_trans: (params.label_trans === undefined) ? '' : params.label_trans, + visibleif: (params.visibleif === undefined) ? 0 : params.visibleif, + visib_field: (params.visib_field === undefined) ? '' : params.visib_field, + visib_value: (params.visib_value === undefined) ? '' : params.visib_value, align: (params.align === undefined) ? 'left' : params.align, field: (params.field === undefined) ? params.name : params.field, subfield: (params.subfield === undefined) ? '' : params.subfield, @@ -62,6 +65,7 @@ function AddCol(params: IColGridTable) { action: (params.action === undefined) ? '' : params.action, foredit: (params.foredit === undefined) ? true : params.foredit, fieldtype: (params.fieldtype === undefined) ? costanti.FieldType.string : params.fieldtype, + field_outtype: (params.field_outtype === undefined) ? costanti.FieldType.string : params.field_outtype, tipovisu: (params.tipovisu === undefined) ? costanti.TipoVisu.TESTO : params.tipovisu, link: (params.link === undefined) ? '' : params.link, askaction: (params.askaction === undefined) ? '' : params.askaction, @@ -69,6 +73,7 @@ function AddCol(params: IColGridTable) { jointable: (params.jointable === undefined) ? '' : params.jointable, addall: (params.addall === undefined) ? false : params.addall, filter: (params.filter === undefined) ? null : params.filter, + allowchar: (params.allowchar === undefined) ? null : params.allowchar, showWhen: (params.showWhen === undefined) ? costanti.showWhen.NewRec + costanti.showWhen.InEdit + costanti.showWhen.InView : params.showWhen, noshowlabel: (params.noshowlabel === undefined) ? false : params.noshowlabel, notsave: (params.notsave === undefined) ? false : params.notsave, @@ -328,6 +333,24 @@ export const colSectors = [ AddCol(DuplicateRec), ] +export const colCatGrps = [ + AddCol({ name: '_id', label_trans: 'index', fieldtype: costanti.FieldType.number }), + AddCol({ name: 'descr', label_trans: 'store.description' }), + AddCol({ + name: 'idCatGrp', + label_trans: 'sectors.name', + fieldtype: costanti.FieldType.select, + jointable: 'catgrps', + }), + AddCol({ name: 'main', label_trans: 'store.main', fieldtype: costanti.FieldType.boolean }), + AddCol({ name: 'color', label_trans: 'products.color' }), + AddCol({ name: 'theme', label_trans: 'products.theme' }), + AddCol({ name: 'img', label_trans: 'store.img' }), + AddCol({ name: 'icon', label_trans: 'store.icon' }), + AddCol(DeleteRec), + AddCol(DuplicateRec), +] + export const colLevels = [ AddCol({ name: '_id', label_trans: 'index', fieldtype: costanti.FieldType.number }), @@ -431,24 +454,36 @@ export const colmyUserPeople = [ export const colmyUserGroup = [ // AddCol({ name: '_id', label_trans: 'reg.id' }), - AddCol({ name: 'groupname', label_trans: 'reg.groupname', required: true }), - AddCol({ name: 'title', label_trans: 'reg.name', required: true }), + AddCol({ name: 'groupname', label_trans: 'reg.groupname', required: true, + maxlength: 30, + allowchar: costanti.ALLOWCHAR_CODE, + showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit, + }), + AddCol({ name: 'title', label_trans: 'reg.name', required: true, noshowlabel: true, }), AddCol({ - name: 'idSector', - label_trans: 'sectors.name', + name: 'idCatGrp', + label_trans: 'catgrps.name', fieldtype: costanti.FieldType.select, required: true, - jointable: 'sectors', + jointable: 'catgrps', visible: true, icon: 'category', + noshowlabel: true, + }), + AddCol({ name: 'descr', label_trans: 'proj.longdescr', required: true, noshowlabel: true, }), + AddCol({ name: 'visibility', label_trans: 'bot.visibility', fieldtype: costanti.FieldType.multiselect, jointable: 'visibilGroup', + showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit + costanti.showWhen.InView_OnlyifExist, + }), + AddCol({ name: 'pwd', label_trans: 'groups.pwd', fieldtype: costanti.FieldType.crypted, + visibleif: costanti.BINARY_CHECK, visib_field: 'visibility', visib_value: costanti.RISERVATO_PASSWORD, + showWhen: costanti.showWhen.NewRec + costanti.showWhen.InEdit, }), - AddCol({ name: 'descr', label_trans: 'proj.longdescr', required: true }), - AddCol({ name: 'visibility', label_trans: 'bot.visibility', fieldtype: costanti.FieldType.select, jointable: 'visibilGroup', required: true }), AddCol({ name: 'admins', label_trans: 'groups.admins', fieldtype: costanti.FieldType.multiselect, jointable: 'friendsandme', + field_outtype: costanti.FieldType.object, }), AddCol({ name: 'photos', @@ -472,6 +507,10 @@ export const colmyUserGroup = [ }), AddCol({ name: 'date_created', label_trans: 'reg.date_created', fieldtype: costanti.FieldType.onlydate, showWhen: costanti.showWhen.InPage + costanti.showWhen.InView_OnlyifExist }), + AddCol({ name: 'note', label_trans: 'proj.longdescr', fieldtype: costanti.FieldType.html, + titlepopupedit: 'Dettagli', field_extra1: 'groupname', subfield_extra1: '' }), + AddCol(ModifRec), + AddCol(DeleteRec), ] @@ -1928,6 +1967,13 @@ export const fieldsTable = { colkey: '_id', collabel: 'descr', }, + { + value: 'catgrps', + label: 'Categorie', + columns: colCatGrps, + colkey: '_id', + collabel: 'descr', + }, { value: 'levels', label: 'Livello', diff --git a/src/store/Modules/tools.ts b/src/store/Modules/tools.ts index cc66762e..bf41e974 100644 --- a/src/store/Modules/tools.ts +++ b/src/store/Modules/tools.ts @@ -1912,8 +1912,8 @@ export const tools = { this.showNotif(q, msg, { color: 'negative', icon: 'notifications' }, 10000) }, - showNeutralNotif(q: any, msg: string) { - this.showNotif(q, msg, { color: 'info', icon: 'notifications' }, 10000) + showNeutralNotif(q: any, msg: string, time = 10000) { + this.showNotif(q, msg, { color: 'info', icon: 'notifications' }, time) }, showNotif(q: any, msg: string, data ?: INotify | null, time?: number) { @@ -4437,7 +4437,7 @@ export const tools = { userStore.setGroupsCmd($q, t, username, groupnameDest, shared_consts.GROUPSCMD.SETGROUP, null) .then((res: any) => { if (res) { - userStore.my.profile.groups = [...userStore.my.profile.groups, res] + userStore.my.profile.mygroups = [...userStore.my.profile.mygroups, res] tools.showPositiveNotif($q, t('db.addedgroup')) } }) diff --git a/src/store/UserStore.ts b/src/store/UserStore.ts index 8c2e08a0..0329cc77 100755 --- a/src/store/UserStore.ts +++ b/src/store/UserStore.ts @@ -50,7 +50,7 @@ export const DefaultUser: IUserFields = { myshares: [], friends: [], req_friends: [], - groups: [], + mygroups: [], asked_friends: [], asked_groups: [], }, @@ -94,7 +94,7 @@ export const DefaultProfile: IUserProfile = { myshares: [], friends: [], req_friends: [], - groups: [], + mygroups: [], asked_friends: [], asked_groups: [], } @@ -178,7 +178,7 @@ export const useUserStore = defineStore('UserStore', { IsMyGroupByGroupname(groupname: string): boolean { if (this.my.profile.friends) - return this.my.profile.groups.findIndex((rec) => rec.groupname === groupname) >= 0 + return this.my.profile.mygroups.findIndex((rec) => rec.groupname === groupname) >= 0 else return false }, @@ -234,7 +234,7 @@ export const useUserStore = defineStore('UserStore', { try { //++Todo: Sistemare! - return costanti.DIR_UPLOAD + 'groups/' + group.groupname + '/' + group.photos[0].directory + return costanti.DIR_UPLOAD + 'mygroups/' + group.groupname + '/' + group.photos[0].imagefile } catch (e) { } return 'images/noimg.png' @@ -856,7 +856,7 @@ export const useUserStore = defineStore('UserStore', { verified_by_aportador, made_gift, perm, - profile: { img, teleg_id, myshares: [], friends: [], req_friends: [], asked_friends: [], groups: [], asked_groups: [] }, + profile: { img, teleg_id, myshares: [], friends: [], req_friends: [], asked_friends: [], mygroups: [], asked_groups: [] }, }) isLogged = true diff --git a/src/store/globalStore.ts b/src/store/globalStore.ts index 6bbe141e..d629d7fd 100644 --- a/src/store/globalStore.ts +++ b/src/store/globalStore.ts @@ -121,6 +121,7 @@ export const useGlobalStore = defineStore('GlobalStore', { subSkills: [], statusSkills: [], sectors: [], + catgrps: [], cities: [], }), @@ -239,6 +240,8 @@ export const useGlobalStore = defineStore('GlobalStore', { return state.statusSkills else if (table === 'sectors') return state.sectors + else if (table === 'catgrps') + return state.catgrps else { return ris } @@ -1223,6 +1226,7 @@ export const useGlobalStore = defineStore('GlobalStore', { this.statusSkills = (res.data.statusSkills) ? [...res.data.statusSkills] : [] this.sectors = (res.data.sectors) ? [...res.data.sectors] : [] this.cities = (res.data.cities) ? [...res.data.cities] : [] + this.catgrps = (res.data.catgrps) ? [...res.data.catgrps] : [] // console.log('res.data.cart', res.data.cart) @@ -1390,6 +1394,8 @@ export const useGlobalStore = defineStore('GlobalStore', { myarr = myarr.filter(filter) } + // console.log('myarr', table, myarr) + return myarr }, diff --git a/src/views/user/mygroup/mygroup.vue b/src/views/user/mygroup/mygroup.vue index 8f69eb9c..0acd3237 100755 --- a/src/views/user/mygroup/mygroup.vue +++ b/src/views/user/mygroup/mygroup.vue @@ -4,7 +4,7 @@
- +
@@ -36,6 +36,10 @@

+
+
+
+
+ sizes="max-height: 120px" styleadd="bottom: -20px !important;">
@@ -22,6 +22,7 @@
+
diff --git a/src/views/user/myprofile/myprofile.vue b/src/views/user/myprofile/myprofile.vue index 16b24254..75008517 100755 --- a/src/views/user/myprofile/myprofile.vue +++ b/src/views/user/myprofile/myprofile.vue @@ -39,7 +39,7 @@
-
+
{{ myuser.profile.qualifica }}