- Finished Booking an Event
- Starting UsersList (creating CGridTableRec component to view and edit a db table)
This commit is contained in:
26852
package-lock.json
generated
Normal file
26852
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
1
src/common/shared_nodejs.js
Symbolic link
1
src/common/shared_nodejs.js
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
../../../freeplanet_serverside/server/tools/shared_nodejs.js
|
||||||
7
src/common/shared_vuejs.ts
Normal file
7
src/common/shared_vuejs.ts
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
export const shared_consts = {
|
||||||
|
|
||||||
|
fieldsUserToChange() {
|
||||||
|
return ['username', 'email', 'name', 'surname', 'perm', 'date_reg']
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -128,7 +128,13 @@ $graytext: #555;
|
|||||||
margin: 10px;
|
margin: 10px;
|
||||||
border: solid 1px #4198ef;
|
border: solid 1px #4198ef;
|
||||||
border-radius: 1rem;
|
border-radius: 1rem;
|
||||||
|
padding: 2px;
|
||||||
}
|
}
|
||||||
|
&__table tr {
|
||||||
|
border: solid 1px #4198ef;
|
||||||
|
border-radius: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
&__align_center_mobile {
|
&__align_center_mobile {
|
||||||
text-align: left;
|
text-align: left;
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ import QDateTimeScroller from '@quasar/quasar-app-extension-qscroller/src/compon
|
|||||||
import { CTodo } from '@src/components/todos/CTodo'
|
import { CTodo } from '@src/components/todos/CTodo'
|
||||||
import { SingleProject } from '@src/components/projects/SingleProject'
|
import { SingleProject } from '@src/components/projects/SingleProject'
|
||||||
import { IEvents } from '@src/model'
|
import { IEvents } from '@src/model'
|
||||||
import { BookingStore } from '@store'
|
|
||||||
import { IBookedEvent, IBookedEventPage, EState } from '@src/model/Calendar'
|
import { IBookedEvent, IBookedEventPage, EState } from '@src/model/Calendar'
|
||||||
import { costanti } from '@src/store/Modules/costanti'
|
import { costanti } from '@src/store/Modules/costanti'
|
||||||
import router from '@router'
|
import router from '@router'
|
||||||
@@ -48,6 +47,7 @@ export default class CEventsCalendar extends Vue {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public formbookEventDefault: IBookedEvent = {
|
public formbookEventDefault: IBookedEvent = {
|
||||||
|
userId: '',
|
||||||
msgbooking: '',
|
msgbooking: '',
|
||||||
infoevent: '',
|
infoevent: '',
|
||||||
numpeople: 1,
|
numpeople: 1,
|
||||||
@@ -584,6 +584,7 @@ export default class CEventsCalendar extends Vue {
|
|||||||
// self.bookEventForm.booked = self.bookEventForm.bookedcheck
|
// self.bookEventForm.booked = self.bookEventForm.bookedcheck
|
||||||
|
|
||||||
const data: IBookedEvent = {
|
const data: IBookedEvent = {
|
||||||
|
userId: UserStore.state.userId,
|
||||||
id_bookedevent: myevent._id,
|
id_bookedevent: myevent._id,
|
||||||
numpeople: self.bookEventForm.numpeople,
|
numpeople: self.bookEventForm.numpeople,
|
||||||
infoevent: tools.gettextevent(myevent),
|
infoevent: tools.gettextevent(myevent),
|
||||||
|
|||||||
0
src/components/CGridTableRec/CGridTableRec.scss
Normal file
0
src/components/CGridTableRec/CGridTableRec.scss
Normal file
67
src/components/CGridTableRec/CGridTableRec.ts
Normal file
67
src/components/CGridTableRec/CGridTableRec.ts
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
import Vue from 'vue'
|
||||||
|
import { Component, Prop } from 'vue-property-decorator'
|
||||||
|
|
||||||
|
import { UserStore } from '../../store/Modules/index'
|
||||||
|
import { tools } from '../../store/Modules/tools'
|
||||||
|
|
||||||
|
import { shared_consts } from '../../common/shared_vuejs'
|
||||||
|
import { ICategory } from '../../model'
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
|
||||||
|
})
|
||||||
|
export default class CGridTableRec extends Vue {
|
||||||
|
@Prop({required: true}) public mytitle: string
|
||||||
|
@Prop({required: true}) public mylist: any[]
|
||||||
|
@Prop({required: true}) public mycolumns: any[]
|
||||||
|
@Prop({required: true}) public colkey: string
|
||||||
|
public $q
|
||||||
|
public $t
|
||||||
|
public loading: boolean = false
|
||||||
|
public paginationControl: {
|
||||||
|
page: number,
|
||||||
|
rowsPerPage: number // specifying this determines pagination is server-side
|
||||||
|
} = { page: 1, rowsPerPage: 10 }
|
||||||
|
|
||||||
|
public serverData: any [] = []
|
||||||
|
|
||||||
|
public idsel: string = ''
|
||||||
|
public colsel: string = ''
|
||||||
|
|
||||||
|
public separator: 'horizontal'
|
||||||
|
public filter: string = ''
|
||||||
|
public selected: any[] = []
|
||||||
|
public dark: boolean = true
|
||||||
|
|
||||||
|
get tableClass() {
|
||||||
|
if (this.dark) {
|
||||||
|
return 'bg-black'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public selItem(item, colsel) {
|
||||||
|
console.log('item', item)
|
||||||
|
this.idsel = item._id
|
||||||
|
this.colsel = colsel
|
||||||
|
console.log('this.idsel', this.idsel)
|
||||||
|
}
|
||||||
|
|
||||||
|
public SaveValue(newVal, valinitial) {
|
||||||
|
console.log('SaveValue', newVal, 'selected', this.selected)
|
||||||
|
|
||||||
|
const mydata = {}
|
||||||
|
|
||||||
|
mydata[this.colsel] = newVal
|
||||||
|
mydata[this.colkey] = this.idsel
|
||||||
|
|
||||||
|
console.log('this.idsel', this.idsel, 'this.colsel', this.colsel)
|
||||||
|
console.table(mydata)
|
||||||
|
|
||||||
|
this.$emit('save', mydata)
|
||||||
|
}
|
||||||
|
|
||||||
|
public created() {
|
||||||
|
|
||||||
|
this.serverData = this.mylist.slice() // [{ chiave: 'chiave1', valore: 'valore 1' }]
|
||||||
|
}
|
||||||
|
}
|
||||||
50
src/components/CGridTableRec/CGridTableRec.vue
Normal file
50
src/components/CGridTableRec/CGridTableRec.vue
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
<template>
|
||||||
|
<div class="q-pa-sm">
|
||||||
|
<q-table
|
||||||
|
:title="mytitle"
|
||||||
|
:data="serverData"
|
||||||
|
:columns="mycolumns"
|
||||||
|
:filter="filter"
|
||||||
|
:pagination.sync="paginationControl"
|
||||||
|
:row-key="colkey">
|
||||||
|
|
||||||
|
<!--<template v-slot:top="props">-->
|
||||||
|
<div class="col-2 q-table__title">{{ mytitle }}</div>
|
||||||
|
|
||||||
|
<q-space/>
|
||||||
|
|
||||||
|
<q-tr slot="body" slot-scope="props" :props="props">
|
||||||
|
|
||||||
|
<q-td v-for="col in mycolumns" :key="col.name" :props="props">
|
||||||
|
<div v-if="col.action">
|
||||||
|
<q-btn flat round color="red" icon="fas fa-trash-alt"
|
||||||
|
@click="col.clickfunz"></q-btn>
|
||||||
|
</div>
|
||||||
|
<div v-else>
|
||||||
|
{{ props.row[col.name] }}
|
||||||
|
<q-popup-edit v-model="props.row[col.name]" :disable="col.disable" :title="col.title" buttons
|
||||||
|
@save="SaveValue" @show="selItem(props.row, col.field)">
|
||||||
|
<q-input v-model="props.row[col.name]"/>
|
||||||
|
|
||||||
|
</q-popup-edit>
|
||||||
|
</div>
|
||||||
|
</q-td>
|
||||||
|
</q-tr>
|
||||||
|
<!--
|
||||||
|
<q-btn
|
||||||
|
flat round dense
|
||||||
|
:icon="props.inFullscreen ? 'fullscreen_exit' : 'fullscreen'"
|
||||||
|
@click="props.toggleFullscreen"
|
||||||
|
class="q-ml-md">
|
||||||
|
</q-btn>
|
||||||
|
-->
|
||||||
|
<!--</template>-->
|
||||||
|
</q-table>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script lang="ts" src="./CGridTableRec.ts">
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
@import './CGridTableRec.scss';
|
||||||
|
</style>
|
||||||
1
src/components/CGridTableRec/index.ts
Normal file
1
src/components/CGridTableRec/index.ts
Normal file
@@ -0,0 +1 @@
|
|||||||
|
export {default as CGridTableRec} from './CGridTableRec.vue'
|
||||||
@@ -151,7 +151,7 @@ export default class CSignIn extends Vue {
|
|||||||
// console.log('ERROR Subscription = ' + e)
|
// console.log('ERROR Subscription = ' + e)
|
||||||
// })
|
// })
|
||||||
} else {
|
} else {
|
||||||
this.$emit('SignIncheckErrors', riscode)
|
this.$emit('checkErrors', riscode)
|
||||||
}
|
}
|
||||||
|
|
||||||
this.iswaitingforRes = false
|
this.iswaitingforRes = false
|
||||||
@@ -160,7 +160,7 @@ export default class CSignIn extends Vue {
|
|||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
// console.log('ERROR SIGNIN = ' + error)
|
// console.log('ERROR SIGNIN = ' + error)
|
||||||
|
|
||||||
this.$emit('SignIncheckErrors', error)
|
this.$emit('checkErrors', error)
|
||||||
})
|
})
|
||||||
// console.log(' END submit')
|
// console.log(' END submit')
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -141,7 +141,7 @@
|
|||||||
<q-btn class="absolute-top-right" style="margin-right: 10px; color: white;"
|
<q-btn class="absolute-top-right" style="margin-right: 10px; color: white;"
|
||||||
dense flat round icon="close" @click="right = !right">
|
dense flat round icon="close" @click="right = !right">
|
||||||
</q-btn>
|
</q-btn>
|
||||||
<div v-if="isLogged" class="text-weight-bold text-user">{{ Username }} - {{ myName }}</div>
|
<div v-if="isLogged" class="text-weight-bold text-user">{{ Username }} - {{ myName }} <span v-if="isAdmin"> [Admin]</span></div>
|
||||||
<div v-else class="text-user text-italic bg-red">
|
<div v-else class="text-user text-italic bg-red">
|
||||||
{{ $t('user.loggati') }}
|
{{ $t('user.loggati') }}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -16,3 +16,4 @@ export * from './CDate'
|
|||||||
export * from './BannerCookies'
|
export * from './BannerCookies'
|
||||||
export * from './PagePolicy'
|
export * from './PagePolicy'
|
||||||
export * from './FormNewsletter'
|
export * from './FormNewsletter'
|
||||||
|
export * from './CGridTableRec'
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ export interface IEvents {
|
|||||||
|
|
||||||
export interface IBookedEvent {
|
export interface IBookedEvent {
|
||||||
_id?: any
|
_id?: any
|
||||||
userId: any
|
userId: string
|
||||||
id_bookedevent?: any
|
id_bookedevent?: any
|
||||||
numpeople: number
|
numpeople: number
|
||||||
infoevent: string
|
infoevent: string
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ export interface IUserState {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface IUserList {
|
export interface IUserList {
|
||||||
userId: string
|
_id: string
|
||||||
username: string
|
username: string
|
||||||
name?: string
|
name?: string
|
||||||
surname?: string
|
surname?: string
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
import { IBookingState } from '@src/model/BookingStore'
|
|
||||||
|
|
||||||
export * from './UserStore'
|
export * from './UserStore'
|
||||||
export * from './GlobalStore'
|
export * from './GlobalStore'
|
||||||
export * from './signin-option'
|
export * from './signin-option'
|
||||||
@@ -13,4 +11,3 @@ export * from './Projects'
|
|||||||
|
|
||||||
export * from './Calendar'
|
export * from './Calendar'
|
||||||
export * from './Estimate'
|
export * from './Estimate'
|
||||||
export * from './BookingStore'
|
|
||||||
|
|||||||
@@ -5,7 +5,9 @@ const msgglobal = {
|
|||||||
otherpages: {
|
otherpages: {
|
||||||
admin : {
|
admin : {
|
||||||
menu: 'Amministrazione',
|
menu: 'Amministrazione',
|
||||||
eventlist: 'Lista Prenotazioni',
|
eventlist: 'Prenotazioni',
|
||||||
|
usereventlist: 'Prenotazioni Utenti',
|
||||||
|
userlist: 'Lista Utenti',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
sendmsg: {
|
sendmsg: {
|
||||||
@@ -29,6 +31,10 @@ const msgglobal = {
|
|||||||
comp: {
|
comp: {
|
||||||
Conta: "Conta",
|
Conta: "Conta",
|
||||||
},
|
},
|
||||||
|
db: {
|
||||||
|
recupdated: 'Record Aggiornato',
|
||||||
|
recfailed: 'Errore durante aggiornamento Record'
|
||||||
|
},
|
||||||
components: {
|
components: {
|
||||||
authentication: {
|
authentication: {
|
||||||
login: {
|
login: {
|
||||||
@@ -60,6 +66,8 @@ const msgglobal = {
|
|||||||
incorso: 'Registrazione in corso...',
|
incorso: 'Registrazione in corso...',
|
||||||
richiesto: 'Campo Richiesto',
|
richiesto: 'Campo Richiesto',
|
||||||
email: 'Email',
|
email: 'Email',
|
||||||
|
date_reg: 'Data Reg.',
|
||||||
|
perm: 'Permessi',
|
||||||
username: 'Nome Utente',
|
username: 'Nome Utente',
|
||||||
name: 'Nome',
|
name: 'Nome',
|
||||||
surname: 'Cognome',
|
surname: 'Cognome',
|
||||||
@@ -188,10 +196,13 @@ const msgglobal = {
|
|||||||
eventstartdatetime: 'Data e Ora Inizio Evento',
|
eventstartdatetime: 'Data e Ora Inizio Evento',
|
||||||
enterEndDateTime: 'Data e Ora Fine Evento',
|
enterEndDateTime: 'Data e Ora Fine Evento',
|
||||||
selnumpeople: 'Partecipanti',
|
selnumpeople: 'Partecipanti',
|
||||||
|
selnumpeople_short: 'Num',
|
||||||
msgbooking: 'Messaggio da inviare',
|
msgbooking: 'Messaggio da inviare',
|
||||||
showinfo: 'Vedi Info',
|
showinfo: 'Vedi Info',
|
||||||
bookingtextdefault: 'Mi prenoto all\'evento',
|
bookingtextdefault: 'Mi prenoto all\'evento',
|
||||||
bookingtextdefault_of: 'di'
|
bookingtextdefault_of: 'di',
|
||||||
|
data: 'Data',
|
||||||
|
teachertitle: 'Insegnante',
|
||||||
},
|
},
|
||||||
newsletter: {
|
newsletter: {
|
||||||
title: 'Desideri ricevere la nostra Newsletter?',
|
title: 'Desideri ricevere la nostra Newsletter?',
|
||||||
@@ -214,7 +225,9 @@ const msgglobal = {
|
|||||||
otherpages: {
|
otherpages: {
|
||||||
admin : {
|
admin : {
|
||||||
menu: 'Administración',
|
menu: 'Administración',
|
||||||
eventlist: 'Lista Reserva',
|
eventlist: 'Reserva',
|
||||||
|
usereventlist: 'Reserva Usuarios',
|
||||||
|
userlist: 'Lista de usuarios',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
sendmsg: {
|
sendmsg: {
|
||||||
@@ -238,6 +251,10 @@ const msgglobal = {
|
|||||||
comp: {
|
comp: {
|
||||||
Conta: "Conta",
|
Conta: "Conta",
|
||||||
},
|
},
|
||||||
|
db: {
|
||||||
|
recupdated: 'Registro Actualizado',
|
||||||
|
recfailed: 'Error durante el registro de actualización'
|
||||||
|
},
|
||||||
components: {
|
components: {
|
||||||
authentication: {
|
authentication: {
|
||||||
login: {
|
login: {
|
||||||
@@ -269,6 +286,8 @@ const msgglobal = {
|
|||||||
incorso: 'Registro en curso...',
|
incorso: 'Registro en curso...',
|
||||||
richiesto: 'Campo requerido',
|
richiesto: 'Campo requerido',
|
||||||
email: 'Email',
|
email: 'Email',
|
||||||
|
date_reg: 'Fecha Reg.',
|
||||||
|
perm: 'Permisos',
|
||||||
username: 'Nombre usuario',
|
username: 'Nombre usuario',
|
||||||
name: 'Nombre',
|
name: 'Nombre',
|
||||||
surname: 'Apellido',
|
surname: 'Apellido',
|
||||||
@@ -391,10 +410,13 @@ const msgglobal = {
|
|||||||
eventstartdatetime: 'Evento de inicio de fecha y hora',
|
eventstartdatetime: 'Evento de inicio de fecha y hora',
|
||||||
enterEndDateTime: 'Fecha y hora del evento final',
|
enterEndDateTime: 'Fecha y hora del evento final',
|
||||||
selnumpeople: 'Partecipantes',
|
selnumpeople: 'Partecipantes',
|
||||||
|
selnumpeople_short: 'Num',
|
||||||
msgbooking: 'Mensaje para enviar',
|
msgbooking: 'Mensaje para enviar',
|
||||||
showinfo: 'Ver Info',
|
showinfo: 'Ver Info',
|
||||||
bookingtextdefault: 'Reservo el evento',
|
bookingtextdefault: 'Reservo el evento',
|
||||||
bookingtextdefault_of: 'de',
|
bookingtextdefault_of: 'de',
|
||||||
|
data: 'Fecha',
|
||||||
|
teachertitle: 'Maestro',
|
||||||
},
|
},
|
||||||
newsletter: {
|
newsletter: {
|
||||||
title: '¿Desea recibir nuestro boletín informativo?',
|
title: '¿Desea recibir nuestro boletín informativo?',
|
||||||
@@ -417,7 +439,9 @@ const msgglobal = {
|
|||||||
otherpages: {
|
otherpages: {
|
||||||
admin : {
|
admin : {
|
||||||
menu: 'Administration',
|
menu: 'Administration',
|
||||||
eventlist: 'Liste de Réservation',
|
eventlist: 'Réservation',
|
||||||
|
usereventlist: 'Réservation Utilisateur',
|
||||||
|
userlist: 'Liste d\'utilisateurs',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
sendmsg: {
|
sendmsg: {
|
||||||
@@ -441,6 +465,10 @@ const msgglobal = {
|
|||||||
comp: {
|
comp: {
|
||||||
Conta: "Conta",
|
Conta: "Conta",
|
||||||
},
|
},
|
||||||
|
db: {
|
||||||
|
recupdated: 'Enregistrement mis à jour',
|
||||||
|
recfailed: 'Erreur lors de la mise à jour'
|
||||||
|
},
|
||||||
components: {
|
components: {
|
||||||
authentication: {
|
authentication: {
|
||||||
login: {
|
login: {
|
||||||
@@ -471,6 +499,8 @@ const msgglobal = {
|
|||||||
incorso: 'Inscription en cours...',
|
incorso: 'Inscription en cours...',
|
||||||
richiesto: 'Champ obligatoire',
|
richiesto: 'Champ obligatoire',
|
||||||
email: 'Email',
|
email: 'Email',
|
||||||
|
date_reg: 'Date Inscript.',
|
||||||
|
perm: 'Autorisations',
|
||||||
username: 'Nom d\'utilisateur',
|
username: 'Nom d\'utilisateur',
|
||||||
name: 'Nom',
|
name: 'Nom',
|
||||||
surname: 'Prénom',
|
surname: 'Prénom',
|
||||||
@@ -593,10 +623,13 @@ const msgglobal = {
|
|||||||
eventstartdatetime: 'Date de début et heure de l\'événement',
|
eventstartdatetime: 'Date de début et heure de l\'événement',
|
||||||
enterEndDateTime: 'Date et heure de l\'événement final',
|
enterEndDateTime: 'Date et heure de l\'événement final',
|
||||||
selnumpeople: 'Participants',
|
selnumpeople: 'Participants',
|
||||||
|
selnumpeople_short: 'Num',
|
||||||
msgbooking: 'Message à envoyer',
|
msgbooking: 'Message à envoyer',
|
||||||
showinfo: 'Voir Info',
|
showinfo: 'Voir Info',
|
||||||
bookingtextdefault: 'Je réserve l\'événement',
|
bookingtextdefault: 'Je réserve l\'événement',
|
||||||
bookingtextdefault_of: 'du',
|
bookingtextdefault_of: 'du',
|
||||||
|
data: 'Date',
|
||||||
|
teachertitle: 'Professeur',
|
||||||
},
|
},
|
||||||
newsletter: {
|
newsletter: {
|
||||||
title: 'Souhaitez-vous recevoir notre newsletter?',
|
title: 'Souhaitez-vous recevoir notre newsletter?',
|
||||||
@@ -619,7 +652,9 @@ const msgglobal = {
|
|||||||
otherpages: {
|
otherpages: {
|
||||||
admin : {
|
admin : {
|
||||||
menu: 'Administration',
|
menu: 'Administration',
|
||||||
eventlist: 'Booking List',
|
eventlist: 'Booking',
|
||||||
|
usereventlist: 'Users Booking',
|
||||||
|
userlist: 'Users List',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
sendmsg: {
|
sendmsg: {
|
||||||
@@ -643,6 +678,10 @@ const msgglobal = {
|
|||||||
comp: {
|
comp: {
|
||||||
Conta: "Count",
|
Conta: "Count",
|
||||||
},
|
},
|
||||||
|
db: {
|
||||||
|
recupdated: 'Record Updated',
|
||||||
|
recfailed: 'Error during update Record'
|
||||||
|
},
|
||||||
components: {
|
components: {
|
||||||
authentication: {
|
authentication: {
|
||||||
login: {
|
login: {
|
||||||
@@ -673,6 +712,8 @@ const msgglobal = {
|
|||||||
incorso: 'Registration please wait...',
|
incorso: 'Registration please wait...',
|
||||||
richiesto: 'Field Required',
|
richiesto: 'Field Required',
|
||||||
email: 'Email',
|
email: 'Email',
|
||||||
|
date_reg: 'Reg. Date',
|
||||||
|
perm: 'Permissions',
|
||||||
username_login: 'Username or email',
|
username_login: 'Username or email',
|
||||||
username: 'Username',
|
username: 'Username',
|
||||||
name: 'Name',
|
name: 'Name',
|
||||||
@@ -794,10 +835,13 @@ const msgglobal = {
|
|||||||
eventstartdatetime: 'Event start date and time',
|
eventstartdatetime: 'Event start date and time',
|
||||||
enterEndDateTime: 'Event end date and time',
|
enterEndDateTime: 'Event end date and time',
|
||||||
selnumpeople: 'Participants',
|
selnumpeople: 'Participants',
|
||||||
|
selnumpeople_short: 'Num',
|
||||||
msgbooking: 'Message to send',
|
msgbooking: 'Message to send',
|
||||||
showinfo: 'Show Info',
|
showinfo: 'Show Info',
|
||||||
bookingtextdefault: 'I book the event',
|
bookingtextdefault: 'I book the event',
|
||||||
bookingtextdefault_of: 'of',
|
bookingtextdefault_of: 'of',
|
||||||
|
data: 'Date',
|
||||||
|
teachertitle: 'Teacher',
|
||||||
},
|
},
|
||||||
newsletter: {
|
newsletter: {
|
||||||
title: 'Would you like to receive our Newsletter?',
|
title: 'Would you like to receive our Newsletter?',
|
||||||
@@ -820,7 +864,9 @@ const msgglobal = {
|
|||||||
otherpages: {
|
otherpages: {
|
||||||
admin : {
|
admin : {
|
||||||
menu: 'Administration',
|
menu: 'Administration',
|
||||||
eventlist: 'Booking List',
|
eventlist: 'Booking',
|
||||||
|
usereventlist: 'Users Booking',
|
||||||
|
userlist: 'Users List',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
sendmsg: {
|
sendmsg: {
|
||||||
@@ -844,6 +890,10 @@ const msgglobal = {
|
|||||||
comp: {
|
comp: {
|
||||||
Conta: "Count",
|
Conta: "Count",
|
||||||
},
|
},
|
||||||
|
db: {
|
||||||
|
recupdated: 'Record Updated',
|
||||||
|
recfailed: 'Error during update Record'
|
||||||
|
},
|
||||||
components: {
|
components: {
|
||||||
authentication: {
|
authentication: {
|
||||||
login: {
|
login: {
|
||||||
@@ -875,6 +925,8 @@ const msgglobal = {
|
|||||||
incorso: 'Registration please wait...',
|
incorso: 'Registration please wait...',
|
||||||
richiesto: 'Field Required',
|
richiesto: 'Field Required',
|
||||||
email: 'Email',
|
email: 'Email',
|
||||||
|
date_reg: 'Reg. Date',
|
||||||
|
perm: 'Permissions',
|
||||||
username_login: 'Username or email',
|
username_login: 'Username or email',
|
||||||
username: 'Username',
|
username: 'Username',
|
||||||
name: 'Name',
|
name: 'Name',
|
||||||
@@ -997,10 +1049,13 @@ const msgglobal = {
|
|||||||
eventstartdatetime: 'Event start date and time',
|
eventstartdatetime: 'Event start date and time',
|
||||||
enterEndDateTime: 'Event end date and time',
|
enterEndDateTime: 'Event end date and time',
|
||||||
selnumpeople: 'Participants',
|
selnumpeople: 'Participants',
|
||||||
|
selnumpeople_short: 'Num',
|
||||||
msgbooking: 'Message to send',
|
msgbooking: 'Message to send',
|
||||||
showinfo: 'Show Info',
|
showinfo: 'Show Info',
|
||||||
bookingtextdefault: 'I book the event',
|
bookingtextdefault: 'I book the event',
|
||||||
bookingtextdefault_of: 'of',
|
bookingtextdefault_of: 'of',
|
||||||
|
data: 'Date',
|
||||||
|
teachertitle: 'Teacher',
|
||||||
},
|
},
|
||||||
newsletter: {
|
newsletter: {
|
||||||
title: 'Would you like to receive our Newsletter?',
|
title: 'Would you like to receive our Newsletter?',
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ export namespace ApiTool {
|
|||||||
idapp: process.env.APP_ID
|
idapp: process.env.APP_ID
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('mydata', mydata)
|
// console.log('mydata', mydata)
|
||||||
|
|
||||||
UserStore.mutations.setServerCode(tools.EMPTY)
|
UserStore.mutations.setServerCode(tools.EMPTY)
|
||||||
UserStore.mutations.setResStatus(0)
|
UserStore.mutations.setResStatus(0)
|
||||||
|
|||||||
@@ -1,65 +0,0 @@
|
|||||||
import { ICfgServer, IConfig, IBookingState, IListRoutes, IMenuList, StateConnection } from 'model'
|
|
||||||
import { storeBuilder } from './Store/Store'
|
|
||||||
|
|
||||||
import Vue from 'vue'
|
|
||||||
|
|
||||||
import translate from './../../globalroutines/util'
|
|
||||||
|
|
||||||
import urlBase64ToUint8Array from '../../js/utility'
|
|
||||||
|
|
||||||
import Api from '@api'
|
|
||||||
import * as Types from '@src/store/Api/ApiTypes'
|
|
||||||
import { costanti } from '@src/store/Modules/costanti'
|
|
||||||
import { tools } from '@src/store/Modules/tools'
|
|
||||||
import { toolsext } from '@src/store/Modules/toolsext'
|
|
||||||
import { GlobalStore, Projects, Todos, UserStore } from '@store'
|
|
||||||
|
|
||||||
import { static_data } from '@src/db/static_data'
|
|
||||||
import { db_data } from '@src/db/db_data'
|
|
||||||
import { IEvents } from '../../model'
|
|
||||||
import { serv_constants } from '@src/store/Modules/serv_constants'
|
|
||||||
|
|
||||||
const state: IBookingState = {
|
|
||||||
bookinglist: []
|
|
||||||
}
|
|
||||||
|
|
||||||
const b = storeBuilder.module<IBookingState>('BookingModule', state)
|
|
||||||
|
|
||||||
// Getters
|
|
||||||
namespace Getters {
|
|
||||||
export const getters = {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace Mutations {
|
|
||||||
export const mutations = {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace Actions {
|
|
||||||
async function loadAfterLogin(context) {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
export const actions = {
|
|
||||||
loadAfterLogin: b.dispatch(loadAfterLogin)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
const stateGetter = b.state()
|
|
||||||
|
|
||||||
// Module
|
|
||||||
const BookingModule = {
|
|
||||||
get state() {
|
|
||||||
return stateGetter()
|
|
||||||
},
|
|
||||||
actions: Actions.actions,
|
|
||||||
getters: Getters.getters,
|
|
||||||
mutations: Mutations.mutations
|
|
||||||
}
|
|
||||||
|
|
||||||
export default BookingModule
|
|
||||||
@@ -480,10 +480,15 @@ namespace Actions {
|
|||||||
.then((res) => {
|
.then((res) => {
|
||||||
state.networkDataReceived = true
|
state.networkDataReceived = true
|
||||||
|
|
||||||
console.log('******* checkUpdates RES :', res.data.cfgServer)
|
// console.log('******* checkUpdates RES :', res.data.cfgServer)
|
||||||
if (res.data.cfgServer) {
|
if (res.data.cfgServer) {
|
||||||
state.cfgServer = [...res.data.cfgServer]
|
state.cfgServer = [...res.data.cfgServer]
|
||||||
console.log('res.data.cfgServer', res.data.cfgServer)
|
// console.log('res.data.cfgServer', res.data.cfgServer)
|
||||||
|
}
|
||||||
|
|
||||||
|
// console.log('res.data.userslist', res.data.usersList)
|
||||||
|
if (res.data.usersList) {
|
||||||
|
UserStore.mutations.setusersList(res.data.usersList)
|
||||||
}
|
}
|
||||||
|
|
||||||
// console.log('********** res', 'state.todos', state.todos, 'checkPending', checkPending)
|
// console.log('********** res', 'state.todos', state.todos, 'checkPending', checkPending)
|
||||||
|
|||||||
@@ -47,19 +47,19 @@ const stateGetter = b.state()
|
|||||||
namespace Getters {
|
namespace Getters {
|
||||||
|
|
||||||
const findEventBooked = b.read((mystate: ICalendarState) => (myevent: IEvents, isconfirmed: boolean) => {
|
const findEventBooked = b.read((mystate: ICalendarState) => (myevent: IEvents, isconfirmed: boolean) => {
|
||||||
return mystate.bookedevent.find((bookedevent) => (bookedevent.id_bookedevent === myevent._id) && ((isconfirmed && bookedevent.booked) || (!isconfirmed)))
|
return mystate.bookedevent.find((bookedevent) => (bookedevent.id_bookedevent === myevent._id) && (bookedevent.userId === UserStore.state.userId) && ((isconfirmed && bookedevent.booked) || (!isconfirmed)))
|
||||||
}, 'findEventBooked')
|
}, 'findEventBooked')
|
||||||
|
|
||||||
const getNumParticipants = b.read((mystate: ICalendarState) => (myevent: IEvents) => {
|
const getNumParticipants = b.read((mystate: ICalendarState) => (myevent: IEvents, showall) => {
|
||||||
const myarr = mystate.bookedevent.filter((bookedevent) => (bookedevent.id_bookedevent === myevent._id) && (bookedevent.booked))
|
const myarr = mystate.bookedevent.filter((bookedevent) => (bookedevent.id_bookedevent === myevent._id) && (bookedevent.booked) && (showall || (!showall && bookedevent.userId === UserStore.state.userId) ))
|
||||||
if (myarr)
|
if (myarr)
|
||||||
return myarr.reduce((sum, bookedevent) => sum + bookedevent.numpeople, 0)
|
return myarr.reduce((sum, bookedevent) => sum + bookedevent.numpeople, 0)
|
||||||
else
|
else
|
||||||
return 0
|
return 0
|
||||||
}, 'getNumParticipants')
|
}, 'getNumParticipants')
|
||||||
|
|
||||||
const getEventsBookedByIdEvent = b.read((mystate: ICalendarState) => (idevent) => {
|
const getEventsBookedByIdEvent = b.read((mystate: ICalendarState) => (idevent, showall) => {
|
||||||
return mystate.bookedevent.filter((bookedevent) => (bookedevent.id_bookedevent === idevent) && (bookedevent.booked))
|
return mystate.bookedevent.filter((bookedevent) => (bookedevent.id_bookedevent === idevent) && (bookedevent.booked) && (showall || (!showall && bookedevent.userId === UserStore.state.userId) ))
|
||||||
}, 'getEventsBookedByIdEvent')
|
}, 'getEventsBookedByIdEvent')
|
||||||
|
|
||||||
export const getters = {
|
export const getters = {
|
||||||
@@ -89,7 +89,7 @@ namespace Mutations {
|
|||||||
|
|
||||||
namespace Actions {
|
namespace Actions {
|
||||||
async function loadAfterLogin(context) {
|
async function loadAfterLogin(context) {
|
||||||
console.log('CalendarStore: loadAfterLogin')
|
// console.log('CalendarStore: loadAfterLogin')
|
||||||
// Load local data
|
// Load local data
|
||||||
state.editable = db_data.userdata.calendar_editable
|
state.editable = db_data.userdata.calendar_editable
|
||||||
state.eventlist = db_data.events
|
state.eventlist = db_data.events
|
||||||
@@ -101,7 +101,7 @@ namespace Actions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Load local data
|
// Load local data
|
||||||
console.log('CALENDAR loadAfterLogin', 'userid=', UserStore.state.userId)
|
// console.log('CALENDAR loadAfterLogin', 'userid=', UserStore.state.userId)
|
||||||
|
|
||||||
let ris = null
|
let ris = null
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import router from '@router'
|
|||||||
import { serv_constants } from '../Modules/serv_constants'
|
import { serv_constants } from '../Modules/serv_constants'
|
||||||
import { tools } from '../Modules/tools'
|
import { tools } from '../Modules/tools'
|
||||||
import { toolsext } from '@src/store/Modules/toolsext'
|
import { toolsext } from '@src/store/Modules/toolsext'
|
||||||
import { GlobalStore, UserStore, Todos, Projects, BookingStore, CalendarStore } from '@store'
|
import { GlobalStore, UserStore, Todos, Projects, CalendarStore } from '@store'
|
||||||
import globalroutines from './../../globalroutines/index'
|
import globalroutines from './../../globalroutines/index'
|
||||||
|
|
||||||
import { static_data } from '@src/db/static_data'
|
import { static_data } from '@src/db/static_data'
|
||||||
@@ -15,6 +15,7 @@ import { db_data } from '@src/db/db_data'
|
|||||||
|
|
||||||
import translate from './../../globalroutines/util'
|
import translate from './../../globalroutines/util'
|
||||||
import * as Types from '@src/store/Api/ApiTypes'
|
import * as Types from '@src/store/Api/ApiTypes'
|
||||||
|
import { ICfgServer } from '@src/model'
|
||||||
|
|
||||||
const bcrypt = require('bcryptjs')
|
const bcrypt = require('bcryptjs')
|
||||||
|
|
||||||
@@ -91,6 +92,10 @@ namespace Getters {
|
|||||||
return '(' + userId + ')'
|
return '(' + userId + ')'
|
||||||
}, 'getNameSurnameByUserId')
|
}, 'getNameSurnameByUserId')
|
||||||
|
|
||||||
|
const getUsersList = b.read((mystate: IUserState) => {
|
||||||
|
return mystate.usersList
|
||||||
|
}, 'getUsersList')
|
||||||
|
|
||||||
const IsMyFriend = b.read((state) => (userIdOwner) => {
|
const IsMyFriend = b.read((state) => (userIdOwner) => {
|
||||||
// ++TODO Check if userIdOwner is my friend
|
// ++TODO Check if userIdOwner is my friend
|
||||||
// userIdOwner is my friend ?
|
// userIdOwner is my friend ?
|
||||||
@@ -104,7 +109,7 @@ namespace Getters {
|
|||||||
}, 'IsMyGroup')
|
}, 'IsMyGroup')
|
||||||
|
|
||||||
const getUserByUserId = b.read((mystate: IUserState) => (userId): IUserState => {
|
const getUserByUserId = b.read((mystate: IUserState) => (userId): IUserState => {
|
||||||
return mystate.usersList.find((item) => item.userId === userId)
|
return mystate.usersList.find((item) => item._id === userId)
|
||||||
}, 'getUserByUserId')
|
}, 'getUserByUserId')
|
||||||
|
|
||||||
export const getters = {
|
export const getters = {
|
||||||
@@ -134,6 +139,9 @@ namespace Getters {
|
|||||||
},
|
},
|
||||||
get getUserByUserId() {
|
get getUserByUserId() {
|
||||||
return getUserByUserId()
|
return getUserByUserId()
|
||||||
|
},
|
||||||
|
get getUsersList() {
|
||||||
|
return getUsersList()
|
||||||
}
|
}
|
||||||
// get fullName() { return fullName();},
|
// get fullName() { return fullName();},
|
||||||
}
|
}
|
||||||
@@ -171,6 +179,11 @@ namespace Mutations {
|
|||||||
state.password = newstr
|
state.password = newstr
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function setusersList(mystate: IUserState, usersList: IUserList[]) {
|
||||||
|
// console.log('setusersList', usersList)
|
||||||
|
mystate.usersList = [...usersList]
|
||||||
|
}
|
||||||
|
|
||||||
function setemail(state: IUserState, newstr: string) {
|
function setemail(state: IUserState, newstr: string) {
|
||||||
state.email = newstr
|
state.email = newstr
|
||||||
}
|
}
|
||||||
@@ -267,7 +280,8 @@ namespace Mutations {
|
|||||||
setAuth: b.commit(setAuth),
|
setAuth: b.commit(setAuth),
|
||||||
clearAuthData: b.commit(clearAuthData),
|
clearAuthData: b.commit(clearAuthData),
|
||||||
setErrorCatch: b.commit(setErrorCatch),
|
setErrorCatch: b.commit(setErrorCatch),
|
||||||
getMsgError: b.commit(getMsgError)
|
getMsgError: b.commit(getMsgError),
|
||||||
|
setusersList: b.commit(setusersList)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -306,6 +320,15 @@ namespace Actions {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function saveUserChange(context, user: IUserState) {
|
||||||
|
console.log('saveUserChange', user)
|
||||||
|
|
||||||
|
return await Api.SendReq(`/users/${user.userId}`, 'PATCH', { user })
|
||||||
|
.then((res) => {
|
||||||
|
return (res.data.code === serv_constants.RIS_CODE_OK)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
async function requestpwd(context, paramquery: IUserState) {
|
async function requestpwd(context, paramquery: IUserState) {
|
||||||
|
|
||||||
const usertosend = {
|
const usertosend = {
|
||||||
@@ -583,14 +606,14 @@ namespace Actions {
|
|||||||
// state.isLogged = true
|
// state.isLogged = true
|
||||||
state.isLogged = isLogged
|
state.isLogged = isLogged
|
||||||
if (isLogged) {
|
if (isLogged) {
|
||||||
console.log('state.isLogged', state.isLogged)
|
// console.log('state.isLogged', state.isLogged)
|
||||||
|
|
||||||
GlobalStore.mutations.setleftDrawerOpen(localStorage.getItem(tools.localStorage.leftDrawerOpen) === 'true')
|
GlobalStore.mutations.setleftDrawerOpen(localStorage.getItem(tools.localStorage.leftDrawerOpen) === 'true')
|
||||||
GlobalStore.mutations.setCategorySel(localStorage.getItem(tools.localStorage.categorySel))
|
GlobalStore.mutations.setCategorySel(localStorage.getItem(tools.localStorage.categorySel))
|
||||||
|
|
||||||
GlobalStore.actions.checkUpdates()
|
GlobalStore.actions.checkUpdates()
|
||||||
}
|
}
|
||||||
|
|
||||||
const p = await BookingStore.actions.loadAfterLogin()
|
|
||||||
const p2 = await CalendarStore.actions.loadAfterLogin()
|
const p2 = await CalendarStore.actions.loadAfterLogin()
|
||||||
|
|
||||||
const p3 = await GlobalStore.actions.loadAfterLogin()
|
const p3 = await GlobalStore.actions.loadAfterLogin()
|
||||||
@@ -601,7 +624,7 @@ namespace Actions {
|
|||||||
if (static_data.functionality.ENABLE_PROJECTS_LOADING)
|
if (static_data.functionality.ENABLE_PROJECTS_LOADING)
|
||||||
await Projects.actions.dbLoad({ checkPending: true, onlyiffirsttime: true })
|
await Projects.actions.dbLoad({ checkPending: true, onlyiffirsttime: true })
|
||||||
|
|
||||||
console.log('setGlobal: END')
|
// console.log('setGlobal: END')
|
||||||
}
|
}
|
||||||
|
|
||||||
async function autologin_FromLocalStorage(context) {
|
async function autologin_FromLocalStorage(context) {
|
||||||
@@ -675,6 +698,7 @@ namespace Actions {
|
|||||||
logout: b.dispatch(logout),
|
logout: b.dispatch(logout),
|
||||||
requestpwd: b.dispatch(requestpwd),
|
requestpwd: b.dispatch(requestpwd),
|
||||||
resetpwd: b.dispatch(resetpwd),
|
resetpwd: b.dispatch(resetpwd),
|
||||||
|
saveUserChange: b.dispatch(saveUserChange),
|
||||||
signin: b.dispatch(signin),
|
signin: b.dispatch(signin),
|
||||||
signup: b.dispatch(signup),
|
signup: b.dispatch(signup),
|
||||||
vreg: b.dispatch(vreg)
|
vreg: b.dispatch(vreg)
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
export {storeBuilder} from './Store/Store'
|
export {storeBuilder} from './Store/Store'
|
||||||
export {default as GlobalStore} from './GlobalStore'
|
export {default as GlobalStore} from './GlobalStore'
|
||||||
export {default as BookingStore} from './BookingStore'
|
|
||||||
export {default as UserStore} from './UserStore'
|
export {default as UserStore} from './UserStore'
|
||||||
export {default as Todos} from './Todos'
|
export {default as Todos} from './Todos'
|
||||||
export {default as Projects} from './Projects'
|
export {default as Projects} from './Projects'
|
||||||
|
|||||||
@@ -1398,7 +1398,7 @@ export const tools = {
|
|||||||
,
|
,
|
||||||
|
|
||||||
checkLangPassed(mylang) {
|
checkLangPassed(mylang) {
|
||||||
console.log('checkLangPassed')
|
// console.log('checkLangPassed')
|
||||||
|
|
||||||
const mybrowserLang = Quasar.lang.isoName
|
const mybrowserLang = Quasar.lang.isoName
|
||||||
|
|
||||||
@@ -2240,6 +2240,10 @@ export const tools = {
|
|||||||
CancelBookingEvent(mythis, eventparam: IEvents, bookeventid: string, notify: boolean) {
|
CancelBookingEvent(mythis, eventparam: IEvents, bookeventid: string, notify: boolean) {
|
||||||
console.log('CancelBookingEvent ', eventparam)
|
console.log('CancelBookingEvent ', eventparam)
|
||||||
tools.askConfirm(mythis.$q, translate('cal.titlebooking'), translate('cal.cancelbooking') + ' ' + tools.gettextevent(eventparam) + '?', translate('dialog.yes'), translate('dialog.no'), mythis, lists.MenuAction.DELETE, 0, { param1: bookeventid, param2: notify })
|
tools.askConfirm(mythis.$q, translate('cal.titlebooking'), translate('cal.cancelbooking') + ' ' + tools.gettextevent(eventparam) + '?', translate('dialog.yes'), translate('dialog.no'), mythis, lists.MenuAction.DELETE, 0, { param1: bookeventid, param2: notify })
|
||||||
|
},
|
||||||
|
CancelUserRec(mythis, id) {
|
||||||
|
console.log('CancelUserRec', id)
|
||||||
|
tools.askConfirm(mythis.$q, translate('cal.titlebooking'), translate('cal.canceluser') + '?', translate('dialog.yes'), translate('dialog.no'), mythis, lists.MenuAction.DELETE, 0, { param1: id })
|
||||||
}
|
}
|
||||||
|
|
||||||
// getLocale() {
|
// getLocale() {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ export function registeredemail(email: string) {
|
|||||||
return res.status !== PayloadMessageTypes.statusfound
|
return res.status !== PayloadMessageTypes.statusfound
|
||||||
}
|
}
|
||||||
|
|
||||||
return Axios.get(VALIDATE_USER_URL + email)
|
return Axios.get(VALIDATE_USER_URL + process.env.APP_ID + '/' + email)
|
||||||
.then(onSuccess)
|
.then(onSuccess)
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
return true
|
return true
|
||||||
|
|||||||
@@ -7,15 +7,11 @@ const VALIDATE_USER_URL = process.env.MONGODB_HOST + '/users/'
|
|||||||
|
|
||||||
export function registereduser(userName: string) {
|
export function registereduser(userName: string) {
|
||||||
|
|
||||||
let config = {
|
|
||||||
params: { userName: userName }
|
|
||||||
}
|
|
||||||
|
|
||||||
let onSuccess = (res: AxiosResponse) => {
|
let onSuccess = (res: AxiosResponse) => {
|
||||||
return res.status !== PayloadMessageTypes.statusfound
|
return res.status !== PayloadMessageTypes.statusfound
|
||||||
}
|
}
|
||||||
|
|
||||||
return Axios.get(VALIDATE_USER_URL + config.params.userName)
|
return Axios.get(VALIDATE_USER_URL + process.env.APP_ID + '/' + userName)
|
||||||
.then(onSuccess)
|
.then(onSuccess)
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
return true
|
return true
|
||||||
|
|||||||
Reference in New Issue
Block a user