diff --git a/.env.development b/.env.development index a080aa54..d0629b54 100755 --- a/.env.development +++ b/.env.development @@ -1,4 +1,4 @@ -APP_VERSION="0.3.10" +APP_VERSION="0.3.11" SERVICE_WORKER_FILE="service-worker.js" APP_ID="13" DIRECTORY_LOCAL="newfreeplanet" diff --git a/_ALL_SITES/insiemesipuo.app/.env.development b/_ALL_SITES/insiemesipuo.app/.env.development index 7faab557..b1c24b54 100755 --- a/_ALL_SITES/insiemesipuo.app/.env.development +++ b/_ALL_SITES/insiemesipuo.app/.env.development @@ -1,4 +1,4 @@ -APP_VERSION="0.3.10" +APP_VERSION="0.3.11" SERVICE_WORKER_FILE="service-worker.js" APP_ID="13" DIRECTORY_LOCAL="newfreeplanet" diff --git a/_ALL_SITES/popolodelnuovomondo.app/.env.development b/_ALL_SITES/popolodelnuovomondo.app/.env.development index 010ae292..7977e596 100755 --- a/_ALL_SITES/popolodelnuovomondo.app/.env.development +++ b/_ALL_SITES/popolodelnuovomondo.app/.env.development @@ -1,4 +1,4 @@ -APP_VERSION="0.3.10" +APP_VERSION="0.3.11" SERVICE_WORKER_FILE="service-worker.js" APP_ID="12" DIRECTORY_LOCAL="newfreeplanet" diff --git a/_ALL_SITES/riso.app/.env.development b/_ALL_SITES/riso.app/.env.development index 1f3b4a10..5a9c9525 100755 --- a/_ALL_SITES/riso.app/.env.development +++ b/_ALL_SITES/riso.app/.env.development @@ -1,4 +1,4 @@ -APP_VERSION="0.3.10" +APP_VERSION="0.3.11" SERVICE_WORKER_FILE="service-worker.js" APP_ID="13" DIRECTORY_LOCAL="newfreeplanet" diff --git a/_ALL_SITES/riso.app/.env.test b/_ALL_SITES/riso.app/.env.test index e1ad7cf8..a5fbe754 100755 --- a/_ALL_SITES/riso.app/.env.test +++ b/_ALL_SITES/riso.app/.env.test @@ -1,4 +1,4 @@ -APP_VERSION="0.3.10" +APP_VERSION="0.3.11" SERVICE_WORKER_FILE="service-worker.js" APP_ID="13" DIRECTORY_LOCAL=newfreeplanet diff --git a/src/components/CGridTableRec/CGridTableRec.ts b/src/components/CGridTableRec/CGridTableRec.ts index 60d7f01d..7eade28a 100755 --- a/src/components/CGridTableRec/CGridTableRec.ts +++ b/src/components/CGridTableRec/CGridTableRec.ts @@ -495,9 +495,13 @@ export default defineComponent({ if (item.table === 'regions') { - obj['mycities.reg'] = item.value - if (item.value !== '' && item.value !== costanti.FILTER_TUTTI) { - filtersearch3and.push(obj) + let myfield = tools.getFieldSearchByTable(mytable.value, item.table, 'mycities.reg') + obj[myfield] = item.value + if (myfield) { + obj['mycities.reg'] = item.value + if (item.value !== '' && item.value !== costanti.FILTER_TUTTI) { + filtersearch3and.push(obj) + } } if (item.value && recProvince && idRegion !== costanti.FILTER_TUTTI) { @@ -506,9 +510,12 @@ export default defineComponent({ } else if (item.table === 'provinces') { - obj['mycities.prov'] = item.value - if (item.value !== '' && item.value !== costanti.FILTER_TUTTI) { - filtersearch3and.push(obj) + let myfield = tools.getFieldSearchByTable(mytable.value, item.table, 'mycities.prov') + obj[myfield] = item.value + if (myfield) { + if (item.value !== '' && item.value !== costanti.FILTER_TUTTI) { + filtersearch3and.push(obj) + } } if (item.value && recCities && idProvince !== costanti.FILTER_TUTTI) { @@ -518,9 +525,12 @@ export default defineComponent({ } else if (item.table === 'cities') { if (item.value && item.value.hasOwnProperty('_id')) { - obj['idCity'] = item.value._id - if (item.value && item.value !== '' && item.value._id !== costanti.FILTER_TUTTI) { - filtersearch3and.push(obj) + let myfield = tools.getFieldSearchByTable(mytable.value, item.table, 'idCity') + if (myfield) { + obj[myfield] = item.value._id + if (item.value && item.value !== '' && item.value._id !== costanti.FILTER_TUTTI) { + filtersearch3and.push(obj) + } } } } else if (shared_consts.TABLES_WITH_FILTER_FIELD.includes(item.table)) { diff --git a/src/components/CGridTableRec/CGridTableRec.vue b/src/components/CGridTableRec/CGridTableRec.vue index f4f89fe1..e76dcde6 100755 --- a/src/components/CGridTableRec/CGridTableRec.vue +++ b/src/components/CGridTableRec/CGridTableRec.vue @@ -145,7 +145,7 @@ --> + @click="setCmd($q, shared_consts.FRIENDSCMD.REMOVE_FROM_MYFRIENDS, userStore.my.username, '', contact.username)"> {{ $t('friends.remove_from_myfriends') }} - + {{ $t('friends.block_user') }} @@ -40,13 +40,13 @@ - + {{ $t('friends.accept_friend') }} + @click="setCmd($q, shared_consts.FRIENDSCMD.REQFRIEND, userStore.my.username, false, contact.username, false)"> {{ $t('friends.reject_ask_friend') }} @@ -104,7 +104,7 @@ + @click="setCmd($q, shared_consts.FRIENDSCMD.CANCEL_REQ_FRIEND, userStore.my.username, '', contact.username, '')"> {{ $t('friends.cancel_ask_friend') }} @@ -114,10 +114,10 @@ - + - + @@ -125,12 +125,12 @@ - + {{ $t('friends.ask_friend') }} - + {{ $t('friends.reject_trust') }} @@ -140,20 +140,31 @@ + - + + + + {{ $t('friends.ask_friend') }} - + + + + + {{ $t('friends.cancel_ask_friend') }} - + + + + {{ $t('friends.remove_from_myfriends') }} @@ -167,7 +178,7 @@ + @click="setCmd($q, shared_consts.FRIENDSCMD.SETTRUST, userStore.my.username, true, contact.username)"> {{ $t('friends.accept_trust') }} diff --git a/src/components/Header/Header.ts b/src/components/Header/Header.ts index 553fb497..39f6301d 100755 --- a/src/components/Header/Header.ts +++ b/src/components/Header/Header.ts @@ -278,7 +278,7 @@ export default defineComponent({ } else if (tools.isTest()) { strv = 'TEST ' } - return `[${strv} ver. ${process.env.APP_VERSION}]` + return `${strv}v. ${process.env.APP_VERSION}` } function getLangAtt() { diff --git a/src/store/Modules/fieldsTable.ts b/src/store/Modules/fieldsTable.ts index 623385c3..784bd28c 100755 --- a/src/store/Modules/fieldsTable.ts +++ b/src/store/Modules/fieldsTable.ts @@ -523,6 +523,15 @@ export const colmyUserPeople = [ name: 'profile.img', field: 'profile', subfield: 'img', label_trans: 'reg.img', sortable: false, showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit, }), + AddCol({ + name: 'profile.born_city_id', label_trans: 'reg.born_city', fieldtype: costanti.FieldType.select_by_server, + jointable: 'cities', + tablesel: 'cities', + remote_table: 'mycities', + remote_key: '_id', + remote_field: 'comune', + noshowlabel: true, + }), // AddCol({ name: 'sospeso', label_trans: 'reg.sospeso', fieldtype: costanti.FieldType.boolean }), // AddCol({ name: 'deleted', label_trans: 'reg.deleted', fieldtype: costanti.FieldType.boolean }), ] @@ -2174,6 +2183,15 @@ export const fieldsTable = { } else return null }, + getColByColumns(mycolumns: any, namecol: string) { + if (mycolumns) { + // console.log('tablerec', tablerec.columns) + const mycol = mycolumns.find((col: any) => col.name === namecol) + // console.log('mycol = ', mycol) + return mycol + } else + return null + }, getArrColsByTable(mytable: string) { const tablerec: any = this.tablesList.find((rec) => rec.value === mytable) if (tablerec) { diff --git a/src/store/Modules/tools.ts b/src/store/Modules/tools.ts index 28713467..d5c0c3d6 100644 --- a/src/store/Modules/tools.ts +++ b/src/store/Modules/tools.ts @@ -5316,6 +5316,24 @@ export const tools = { }, + getFieldSearchByTable: function (mytable: string, tablejoin: string, field: string) { + let ris = field + if (mytable === 'users') { + if (tablejoin === 'cities') { + ris = 'profile.born_city_id' + } + if (tablejoin === 'provinces') { + ris = 'profile.born_province' + } + if (tablejoin === 'regions') { + ris = '' + } + } + + return ris + }, + + // getLocale() { // if (navigator.languages && navigator.languages.length > 0) { diff --git a/src/views/user/myfriends/myfriends.ts b/src/views/user/myfriends/myfriends.ts index 459fd146..0cc72d5a 100755 --- a/src/views/user/myfriends/myfriends.ts +++ b/src/views/user/myfriends/myfriends.ts @@ -28,6 +28,7 @@ export default defineComponent({ const filter = ref(costanti.FIND_PEOPLE) function mounted() { + console.log('mounted') searchList.value = [ { label: 'Regione', @@ -57,7 +58,7 @@ export default defineComponent({ { label: 'Comune', table: 'cities', - key: 'idCity', + key: 'profile.born_city_id', type: costanti.FieldType.select_by_server, value: tools.getCookie(tools.COOK_SEARCH + 'cities', costanti.FILTER_TUTTI), addall: true, @@ -113,9 +114,31 @@ export default defineComponent({ username: 1, name: 1, 'profile.img': 1, + 'profile.born_city_id': 1, 'profile.qualifica': 1, } - } + }, + lookup2: { + lk_tab: 'cities', + lk_LF: 'profile.born_city_id', + lk_FF: '_id', + lk_as: 'comune', + af_objId_tab: '', + lk_proj: { + idCity: 1, + numLevel: 1, + comune: 1, + userId: 1, + username: 1, + name: 1, + surname: 1, + mycities: 1, + 'profile.img': 1, + 'profile.qualifica': 1, + 'profile.born_city_id': 1, + } + }, + } } diff --git a/src/views/user/myfriends/myfriends.vue b/src/views/user/myfriends/myfriends.vue index 7a7ae45f..42715504 100755 --- a/src/views/user/myfriends/myfriends.vue +++ b/src/views/user/myfriends/myfriends.vue @@ -13,6 +13,7 @@ @@ -34,7 +35,6 @@ noresultLabel="Username non trovato" :arrfilters="arrfilterand" :filtercustom="filtercustom" - :prop_searchList="searchList" :showType="costanti.SHOW_USERINFO" :showCol="false" :extraparams="extraparams()"> @@ -43,6 +43,7 @@ +