- Il circuito viene creato in automatico, quando scegli una provincia.

This commit is contained in:
Surya Paolo
2023-03-21 18:12:06 +01:00
parent de937c73f7
commit 59af1d0b8b
19 changed files with 76 additions and 112 deletions

View File

@@ -1,4 +1,4 @@
APP_VERSION="0.5.80" APP_VERSION="0.5.81"
SERVICE_WORKER_FILE="service-worker.js" SERVICE_WORKER_FILE="service-worker.js"
APP_ID="13" APP_ID="13"
DIRECTORY_LOCAL="newfreeplanet" DIRECTORY_LOCAL="newfreeplanet"

View File

@@ -1,4 +1,4 @@
APP_VERSION="0.5.80" APP_VERSION="0.5.81"
SERVICE_WORKER_FILE="service-worker.js" SERVICE_WORKER_FILE="service-worker.js"
APP_ID="13" APP_ID="13"
DIRECTORY_LOCAL=newfreeplanet DIRECTORY_LOCAL=newfreeplanet

View File

@@ -1,4 +1,4 @@
APP_VERSION="0.5.80" APP_VERSION="0.5.81"
SERVICE_WORKER_FILE="service-worker.js" SERVICE_WORKER_FILE="service-worker.js"
APP_ID="13" APP_ID="13"
DIRECTORY_LOCAL=newfreeplanet DIRECTORY_LOCAL=newfreeplanet

View File

@@ -1,4 +1,4 @@
APP_VERSION="0.5.80" APP_VERSION="0.5.81"
SERVICE_WORKER_FILE="service-worker.js" SERVICE_WORKER_FILE="service-worker.js"
APP_ID="13" APP_ID="13"
DIRECTORY_LOCAL="newfreeplanet" DIRECTORY_LOCAL="newfreeplanet"

View File

@@ -1,4 +1,4 @@
APP_VERSION="0.5.80" APP_VERSION="0.5.81"
SERVICE_WORKER_FILE="service-worker.js" SERVICE_WORKER_FILE="service-worker.js"
APP_ID="13" APP_ID="13"
DIRECTORY_LOCAL=newfreeplanet DIRECTORY_LOCAL=newfreeplanet

View File

@@ -1,4 +1,4 @@
APP_VERSION="0.5.80" APP_VERSION="0.5.81"
SERVICE_WORKER_FILE="service-worker.js" SERVICE_WORKER_FILE="service-worker.js"
APP_ID="14" APP_ID="14"
DIRECTORY_LOCAL="newfreeplanet" DIRECTORY_LOCAL="newfreeplanet"

View File

@@ -188,19 +188,19 @@ export default defineComponent({
const hint = computed(() => { const hint = computed(() => {
if (props.table === toolsext.TABMYGOODS) if (props.table === toolsext.TABMYGOODS)
return 'nome del Bene o settore da cercare' return 'digita il nome del Bene o del settore'
else if (props.table === toolsext.TABMYSKILLS) else if (props.table === toolsext.TABMYSKILLS)
return 'nome del Servizio o settore da cercare' return 'digita il nome del Servizio o del settore'
else if (props.table === toolsext.TABMYGROUPS) else if (props.table === toolsext.TABMYGROUPS)
return 'nome del Gruppo da cercare' return 'digita il nome del Gruppo'
else if (props.table === toolsext.TABCIRCUITS) else if (props.table === toolsext.TABCIRCUITS)
return 'nome del Circuito da cercare' return 'digita il nome della provincia'
else if (props.table === toolsext.TABMYBACHECAS) else if (props.table === toolsext.TABMYBACHECAS)
return 'nome dell\'Evento da cercare' return 'digita il nome dell\'Evento'
else if (props.table === toolsext.TABMYHOSPS) else if (props.table === toolsext.TABMYHOSPS)
return 'nome dell\'Ospitalità da cercare' return 'digita delle parole da cercare nella descrizione dell\'Ospitalità'
return 'nome da cercare' return 'digita una parola da cercare'
}) })
const visuType = computed(() => { const visuType = computed(() => {

View File

@@ -15,7 +15,6 @@
<q-input <q-input
v-model="search" v-model="search"
filled filled
dense
type="search" type="search"
debounce="500" debounce="500"
:hint="t('finder.search_skill')" :hint="t('finder.search_skill')"
@@ -23,7 +22,6 @@
> >
<template v-slot:after> <template v-slot:after>
<q-btn <q-btn
dense
label="" label=""
color="primary" color="primary"
@click="doSearch" @click="doSearch"

View File

@@ -22,6 +22,7 @@ import { useCircuitStore } from '@store/CircuitStore'
const STEP_NAME_SURNAME = 2 const STEP_NAME_SURNAME = 2
const STEP_FOTO = 5 const STEP_FOTO = 5
const STEP_CIRCUIT = 3
export default defineComponent({ export default defineComponent({
name: 'CMyProfileTutorial', name: 'CMyProfileTutorial',
@@ -94,6 +95,10 @@ export default defineComponent({
tools.scrollToTop() tools.scrollToTop()
} }
if ((step.value === STEP_CIRCUIT - 1) || (step.value === STEP_CIRCUIT )) {
mycircuit.value = circuitStore.getCircuitByProvince(strProv.value)
}
if (step.value === STEP_NAME_SURNAME + 1) { if (step.value === STEP_NAME_SURNAME + 1) {
let index = step.value let index = step.value
console.log('Salva ', arrStep[index]) console.log('Salva ', arrStep[index])
@@ -135,7 +140,7 @@ export default defineComponent({
icon: 'user' icon: 'user'
}, },
{ {
step: 3, step: STEP_CIRCUIT,
title: t('tutorial.step_circuito_title'), title: t('tutorial.step_circuito_title'),
extratitle: function () { return mycircuit.value ? ': ' + mycircuit.value.name : '' }, extratitle: function () { return mycircuit.value ? ': ' + mycircuit.value.name : '' },
label: t('tutorial.step_circuito'), label: t('tutorial.step_circuito'),
@@ -160,7 +165,7 @@ export default defineComponent({
icon: 'fas fa-tshirt', icon: 'fas fa-tshirt',
}, },
{ {
step: 5, step: STEP_FOTO,
title: t('tutorial.step_foto_title'), title: t('tutorial.step_foto_title'),
extratitle: function () { return ': (' + (userStore.my.profile.img ? t('dialog.yes') : t('dialog.no')) + ')' }, extratitle: function () { return ': (' + (userStore.my.profile.img ? t('dialog.yes') : t('dialog.no')) + ')' },
label: t('tutorial.step_foto'), label: t('tutorial.step_foto'),
@@ -351,6 +356,7 @@ export default defineComponent({
completed, completed,
getColorTutorial, getColorTutorial,
getFirstStepToFill, getFirstStepToFill,
STEP_CIRCUIT,
} }
}, },
}) })

View File

@@ -5,9 +5,10 @@
<CTitleBanner <CTitleBanner
class="q-pa-none" class="q-pa-none"
:title=" :title="
!progressStep (!progressStep
? $t('tutorial.title') + ` (` + progressLabel + `)` ? $t('tutorial.title', {step, numstep}) + ` (` + progressLabel + `)`
: $t('tutorial.title_completed') + ` (` + progressLabel + `)` : $t('tutorial.title_completed', {step, numstep}) + ` (` + progressLabel + `)`)
" "
:bgcolor="getColorTutorial()" :bgcolor="getColorTutorial()"
clcolor="text-white" clcolor="text-white"
@@ -168,11 +169,11 @@
? clickFinish() ? clickFinish()
: $refs.stepper.next() : $refs.stepper.next()
" "
color="primary" :color="(step === STEP_CIRCUIT && mycircuit && ((!userStore.IsMyCircuitByName(mycircuit.name) && !userStore.IsAskedCircuitByName(mycircuit.name)))) ? 'negative' : 'primary'"
:label=" :label="
step === numstep step === numstep
? $t('dialog.finish') ? $t('dialog.finish')
: $t('dialog.avanti') : (step === STEP_CIRCUIT && mycircuit && ((!userStore.IsMyCircuitByName(mycircuit.name) && !userStore.IsAskedCircuitByName(mycircuit.name))) ? $t('dialog.salta'): $t('dialog.avanti'))
" "
/> />
</q-stepper-navigation> </q-stepper-navigation>

File diff suppressed because one or more lines are too long

View File

@@ -3102,7 +3102,7 @@ export const colTableCircuit = [
fieldtype: costanti.FieldType.currency, visulabel: true, fieldtype: costanti.FieldType.currency, visulabel: true,
showWhen: costanti.showWhen.InPage + costanti.showWhen.InView, showWhen: costanti.showWhen.InPage + costanti.showWhen.InView,
}), }),
AddCol({ name: 'regulation', label_trans: 'circuit.regulation', fieldtype: costanti.FieldType.html, required: true }), AddCol({ name: 'regulation', label_trans: 'circuit.regulation', fieldtype: costanti.FieldType.html, required: false }),
AddCol({ name: 'deperimento', label_trans: 'circuit.deperimento', fieldtype: costanti.FieldType.boolean, disable: true }), AddCol({ name: 'deperimento', label_trans: 'circuit.deperimento', fieldtype: costanti.FieldType.boolean, disable: true }),
AddCol({ name: 'transactionsEnabled', label_trans: 'circuit.transactionsEnabled', fieldtype: costanti.FieldType.boolean }), AddCol({ name: 'transactionsEnabled', label_trans: 'circuit.transactionsEnabled', fieldtype: costanti.FieldType.boolean }),
AddCol({ AddCol({

View File

@@ -5592,7 +5592,7 @@ export const tools = {
const circuitStore = useCircuitStore() const circuitStore = useCircuitStore()
const globalStore = useGlobalStore() const globalStore = useGlobalStore()
// console.log('OUT', res) // console.log('updateMyData: ', res)
if (res && res.userprofile) { if (res && res.userprofile) {
// console.log('updateMyData', res.userprofile) // console.log('updateMyData', res.userprofile)
@@ -5600,6 +5600,7 @@ export const tools = {
if (res.listcircuits) { if (res.listcircuits) {
circuitStore.listcircuits = res.listcircuits circuitStore.listcircuits = res.listcircuits
// console.log('circuitStore.listcircuits', circuitStore.listcircuits)
} }
if (res.mygroups) { if (res.mygroups) {
globalStore.mygroups = res.mygroups globalStore.mygroups = res.mygroups
@@ -7115,7 +7116,7 @@ export const tools = {
ris = 'profile.born_city_id' ris = 'profile.born_city_id'
} }
if (tablejoin === 'provinces') { if (tablejoin === 'provinces') {
ris = 'profile.born_province' ris = 'profile.resid_province'
} }
if (tablejoin === 'regions') { if (tablejoin === 'regions') {
ris = '' ris = ''

View File

@@ -200,7 +200,7 @@ export const useNotifStore = defineStore('NotifStore', {
this.last_notifs = [] this.last_notifs = []
} }
this.updateArrNotif() this.updateArrNotif()
tools.updateMyData(res.data) tools.updateMyData(res.data.ris)
return true return true
}) })
.catch((error) => { .catch((error) => {

View File

@@ -837,6 +837,19 @@ export const useUserStore = defineStore('UserStore', {
async execDbOp(paramquery: any) { async execDbOp(paramquery: any) {
return Api.SendReq('/users/dbop', 'POST', paramquery) return Api.SendReq('/users/dbop', 'POST', paramquery)
.then((res) => { .then((res) => {
return res.data
}).catch((error) => {
return false
})
},
async execDbOpUser(paramquery: any) {
return Api.SendReq('/users/dbopuser', 'POST', paramquery)
.then((res) => {
tools.updateMyData(res.data.ris)
return res.data return res.data
}).catch((error) => { }).catch((error) => {
return false return false
@@ -850,7 +863,9 @@ export const useUserStore = defineStore('UserStore', {
value: step, value: step,
} }
this.my.profile.stepTutorial = step this.my.profile.stepTutorial = step
return await this.execDbOp({mydata}) const ris = await this.execDbOpUser({mydata})
return ris
}, },
async savenoNameSurname(val: boolean) { async savenoNameSurname(val: boolean) {
const mydata = { const mydata = {
@@ -860,7 +875,7 @@ export const useUserStore = defineStore('UserStore', {
} }
if (this.my.profile.noNameSurname !== val) { if (this.my.profile.noNameSurname !== val) {
this.my.profile.noNameSurname = val this.my.profile.noNameSurname = val
return await this.execDbOp({mydata}) return await this.execDbOpUser({mydata})
} }
}, },
async savenoFoto(val: boolean) { async savenoFoto(val: boolean) {
@@ -871,7 +886,7 @@ export const useUserStore = defineStore('UserStore', {
} }
if (this.my.profile.noFoto !== val) { if (this.my.profile.noFoto !== val) {
this.my.profile.noFoto = val this.my.profile.noFoto = val
return await this.execDbOp({mydata}) return await this.execDbOpUser({mydata})
} }
}, },

View File

@@ -86,6 +86,7 @@ export default defineComponent({
const cities = ref([] as ICity[]) const cities = ref([] as ICity[])
watch(() => path.value, (to: any, from: any) => { watch(() => path.value, (to: any, from: any) => {
loadCircuit() loadCircuit()
}) })
@@ -402,7 +403,7 @@ export default defineComponent({
myid: circuit.value ? circuit.value._id : '', myid: circuit.value ? circuit.value._id : '',
} }
} }
function extraparams_refused_groups() { function extraparams_refused_groups() {
return { return {
querytype: shared_consts.QUERYTYPE_REFUSED_GROUP_CIRCUIT, querytype: shared_consts.QUERYTYPE_REFUSED_GROUP_CIRCUIT,
myid: circuit.value ? circuit.value._id : '', myid: circuit.value ? circuit.value._id : '',
@@ -421,6 +422,17 @@ function extraparams_refused_groups() {
return (circuit.value && circuit.value.admins) ? circuit.value.admins.map((rec) => rec.username).join(', ') : '' return (circuit.value && circuit.value.admins) ? circuit.value.admins.map((rec) => rec.username).join(', ') : ''
} }
function getRegulation(reg: string) {
let strreg = reg + ''
if (!reg) {
const mystringa = t('circuit.regolamento', {nomecircuito: circuit.value!.name})
return mystringa
} else {
return reg
}
}
onMounted(mounted) onMounted(mounted)
return { return {
@@ -481,6 +493,7 @@ function extraparams_refused_groups() {
loadCircuit, loadCircuit,
extraparams_rich_groups, extraparams_rich_groups,
extraparams_refused_groups, extraparams_refused_groups,
getRegulation,
} }
} }
}) })

View File

@@ -773,8 +773,8 @@
</div> </div>
<div class="col-12 text-h7"> <div class="col-12 text-h7">
<span <span
v-if="checkifShow('descr') && showrules" v-if="checkifShow('descr') && showrules && circuit"
v-html="circuit.regulation" v-html="getRegulation(circuit.regulation)"
></span> ></span>
</div> </div>
</q-card-section> </q-card-section>
@@ -1029,7 +1029,7 @@
</div> </div>
<q-btn label="vedi Regolamento" @click="showrules = !showrules"> <q-btn label="vedi Regolamento" @click="showrules = !showrules">
</q-btn> </q-btn>
<div v-if="showrules" v-html="circuit.regulation"></div> <div v-if="showrules && circuit" v-html="getRegulation(circuit.regulation)"></div>
</q-card-section> </q-card-section>
<q-card-actions align="center"> <q-card-actions align="center">
<q-btn <q-btn

View File

@@ -45,9 +45,9 @@ export default defineComponent({
{ {
label: 'Provincia', label: 'Provincia',
table: 'provinces', table: 'provinces',
key: 'idProvince', key: 'profile.resid_province',
type: costanti.FieldType.select, type: costanti.FieldType.select,
value: tools.getCookie(tools.COOK_SEARCH + 'provinces', costanti.FILTER_TUTTI), value: tools.getCookie(tools.COOK_SEARCH + 'resid_provinces', costanti.FILTER_TUTTI),
addall: true, addall: true,
arrvalue: [], arrvalue: [],
filter: getFilterProvinceByRegion, filter: getFilterProvinceByRegion,
@@ -55,34 +55,6 @@ export default defineComponent({
icon: 'flag', icon: 'flag',
tablesel: 'provinces', tablesel: 'provinces',
}, },
{
label: 'Comune',
table: 'cities',
key: 'profile.born_city_id',
type: costanti.FieldType.select_by_server,
value: tools.getCookie(tools.COOK_SEARCH + 'cities', costanti.FILTER_TUTTI),
addall: true,
arrvalue: [],
useinput: true,
filter: null,
// filter: getFilterCitiesByProvince,
// param1: shared_consts.PARAM_SHOW_PROVINCE,
tablesel: 'cities',
},
{
label: 'In cambio di',
table: 'contribtypes',
key: 'idContribType',
value: 0,
arrvalue: tools.getCookie(tools.COOK_SEARCH + 'contribtypes', []),
type: costanti.FieldType.multiselect,
filter: null,
useinput: false,
icon: 'fas fa-hand-holding',
filteradv: true,
//icon: 'swap_horizontal_circle',
},
] ]
filtercustom.value = [] filtercustom.value = []
@@ -104,50 +76,6 @@ export default defineComponent({
let af_objId_tab = 'myId' let af_objId_tab = 'myId'
return { return {
lookup1: {
lk_tab,
lk_LF,
lk_FF,
lk_as,
af_objId_tab,
lk_proj: {
username: 1,
name: 1,
surname: 1,
'profile.img': 1,
'profile.born_city_id': 1,
'profile.qualifica': 1,
'profile.handshake': 1,
reported: 1,
date_report: 1,
username_who_report: 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,
reported: 1,
date_report: 1,
username_who_report: 1,
'profile.born_city_id': 1,
'profile.handshake': 1,
}
},
} }
} }
@@ -161,6 +89,7 @@ export default defineComponent({
} }
onMounted(mounted) onMounted(mounted)
return { return {

View File

@@ -37,6 +37,7 @@
noresultLabel="Username non trovato" noresultLabel="Username non trovato"
:arrfilters="arrfilterand" :arrfilters="arrfilterand"
:filtercustom="filtercustom" :filtercustom="filtercustom"
:prop_searchList="searchList"
:showType="costanti.SHOW_USERINFO" :showType="costanti.SHOW_USERINFO"
:showCol="false" :showCol="false"
:extraparams="extraparams()"> :extraparams="extraparams()">
@@ -45,7 +46,6 @@
</CMyFriends> </CMyFriends>
</div> </div>
</template> </template>
<!--:prop_searchList="searchList"-->
<script lang="ts" src="./myfriends.ts"> <script lang="ts" src="./myfriends.ts">
</script> </script>