From 0ee08f8430ec146899326dc18788142bebb0ef89 Mon Sep 17 00:00:00 2001 From: Paolo Arena Date: Mon, 14 Oct 2019 20:32:15 +0200 Subject: [PATCH 1/8] Show data Table with pagination (startRow, endRow, filter, sorting) --- src/common/shared_vuejs.ts | 7 +- src/components/CGridTableRec/CGridTableRec.ts | 177 ++++++++++++++++-- .../CGridTableRec/CGridTableRec.vue | 19 +- src/model/GlobalStore.ts | 8 + src/model/UserStore.ts | 3 + src/store/Modules/GlobalStore.ts | 19 +- src/store/Modules/UserStore.ts | 70 ++++--- src/store/Modules/serv_constants.ts | 1 + src/store/Modules/tools.ts | 5 + 9 files changed, 265 insertions(+), 44 deletions(-) diff --git a/src/common/shared_vuejs.ts b/src/common/shared_vuejs.ts index d0a6301..c6c2531 100644 --- a/src/common/shared_vuejs.ts +++ b/src/common/shared_vuejs.ts @@ -1,7 +1,12 @@ export const shared_consts = { + Permissions: { + Normal: 0, + Admin: 1 + }, + fieldsUserToChange() { - return ['username', 'email', 'name', 'surname', 'perm', 'date_reg'] + return ['username', 'email', 'name', 'surname', 'perm', 'date_reg', 'verified_email'] } } diff --git a/src/components/CGridTableRec/CGridTableRec.ts b/src/components/CGridTableRec/CGridTableRec.ts index 6c6bc3b..a5d0f86 100644 --- a/src/components/CGridTableRec/CGridTableRec.ts +++ b/src/components/CGridTableRec/CGridTableRec.ts @@ -1,38 +1,46 @@ import Vue from 'vue' import { Component, Prop } from 'vue-property-decorator' -import { UserStore } from '../../store/Modules/index' +import { GlobalStore, UserStore } from '../../store/Modules/index' import { tools } from '../../store/Modules/tools' import { shared_consts } from '../../common/shared_vuejs' import { ICategory } from '../../model' +import { CTodo } from '../todos/CTodo' +import { SingleProject } from '../projects/SingleProject' -@Component({ - -}) +@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 + @Prop({ required: true }) public mytable: string + @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: { + public pagination: { + sortBy: string, + descending: boolean + rowsNumber: number page: number, rowsPerPage: number // specifying this determines pagination is server-side - } = { page: 1, rowsPerPage: 10 } + } = { sortBy: '', descending: false, page: 1, rowsNumber: 10, rowsPerPage: 10 } public serverData: any [] = [] public idsel: string = '' public colsel: string = '' + public valPrec: string = '' public separator: 'horizontal' public filter: string = '' - public selected: any[] = [] + public selected: any public dark: boolean = true + public returnedData + public returnedCount + get tableClass() { if (this.dark) { return 'bg-black' @@ -41,11 +49,21 @@ export default class CGridTableRec extends Vue { public selItem(item, colsel) { console.log('item', item) + this.selected = item this.idsel = item._id this.colsel = colsel console.log('this.idsel', this.idsel) } + public undoVal() { + console.log('undoVal', 'colsel', this.colsel, 'valprec', this.valPrec, 'this.colkey', this.colkey, 'this.selected', this.selected) + console.table(this.serverData) + if (this.colsel) + this.selected[this.colsel] = this.valPrec + // this.serverData[this.colsel] = this.valPrec + + } + public SaveValue(newVal, valinitial) { console.log('SaveValue', newVal, 'selected', this.selected) @@ -53,6 +71,7 @@ export default class CGridTableRec extends Vue { mydata[this.colsel] = newVal mydata[this.colkey] = this.idsel + this.valPrec = valinitial console.log('this.idsel', this.idsel, 'this.colsel', this.colsel) console.table(mydata) @@ -62,6 +81,140 @@ export default class CGridTableRec extends Vue { public created() { - this.serverData = this.mylist.slice() // [{ chiave: 'chiave1', valore: 'valore 1' }] + // this.serverData = this.mylist.slice() // [{ chiave: 'chiave1', valore: 'valore 1' }] } + + get getrows() { + return this.pagination.rowsNumber + } + + public onRequest(props) { + const { page, rowsPerPage, rowsNumber, sortBy, descending } = props.pagination + const filter = props.filter + + this.loading = true + + // update rowsCount with appropriate value + + // get all rows if "All" (0) is selected + const fetchCount = rowsPerPage === 0 ? rowsNumber : rowsPerPage + + // calculate starting row of data + const startRow = (page - 1) * rowsPerPage + const endRow = startRow + fetchCount + + // fetch data from "server" + this.fetchFromServer(startRow, endRow, filter, sortBy, descending).then((ris) => { + + this.pagination.rowsNumber = this.getRowsNumberCount(filter) + + // clear out existing data and add new + this.serverData.splice(0, this.serverData.length, ...this.returnedData) + + // don't forget to update local pagination object + this.pagination.page = page + this.pagination.rowsPerPage = rowsPerPage + this.pagination.sortBy = sortBy + this.pagination.descending = descending + + // ...and turn of loading indicator + this.loading = false + }) + } + + // emulate ajax call + // SELECT * FROM ... WHERE...LIMIT... + public async fetchFromServer(startRow, endRow, filter, sortBy, descending) { + + let myobj = null + if (sortBy) { + myobj = {} + if (descending) + myobj[sortBy] = -1 + else + myobj[sortBy] = 1 + } + + const params = { + table: this.mytable, + startRow, + endRow, + filter, + sortBy: myobj, + descending + } + + console.table(params) + + const data = await GlobalStore.actions.loadTable(params) + + if (data) { + this.returnedData = data.rows + this.returnedCount = data.count + } else { + this.returnedData = [] + this.returnedCount = 0 + } + + // if (!filter) { + // data = this.original.slice(startRow, startRow + count) + // } + // else { + // let found = 0 + // for (let index = startRow, items = 0; index < this.original.length && items < count; ++index) { + // let row = this.original[index] + // // match filter? + // if (!row['name'].includes(filter)) { + // // get a different row, until one is found + // continue + // } + // ++found + // if (found >= startRow) { + // data.push(row) + // ++items + // } + // } + // } + + // handle sortBy + // if (sortBy) { + // data.sort((a, b) => { + // let x = descending ? b : a + // let y = descending ? a : b + // if (sortBy === 'desc') { + // // string sort + // return x[sortBy] > y[sortBy] ? 1 : x[sortBy] < y[sortBy] ? -1 : 0 + // } + // else { + // // numeric sort + // return parseFloat(x[sortBy]) - parseFloat(y[sortBy]) + // } + // }) + // } + } + + // emulate 'SELECT count(*) FROM ...WHERE...' + public getRowsNumberCount(filter) { + + // if (!filter) { + // return this.original.length + // } + // let count = 0 + // this.original.forEach((treat) => { + // if (treat['name'].includes(filter)) { + // ++count + // } + // }) + // return count + + return this.returnedCount + } + + public mounted() { + this.onRequest({ + pagination: this.pagination, + filter: undefined + }) + } + } diff --git a/src/components/CGridTableRec/CGridTableRec.vue b/src/components/CGridTableRec/CGridTableRec.vue index ed24f0b..f9d20c4 100644 --- a/src/components/CGridTableRec/CGridTableRec.vue +++ b/src/components/CGridTableRec/CGridTableRec.vue @@ -1,17 +1,26 @@ - -
- -
-
- {{ props.row[col.name] }} +
+ {{ visuValByType(col, props.row[col.name]) }} @@ -73,6 +70,12 @@
+ +
+ +
+
- - + + + + + + +
- {{$t('login.enter')}}
- {{$t('reg.submit')}} + {{$t('reg.submit')}}
diff --git a/src/components/Header/Header.ts b/src/components/Header/Header.ts index fa3a853..ecc3f77 100644 --- a/src/components/Header/Header.ts +++ b/src/components/Header/Header.ts @@ -7,7 +7,7 @@ import { CSignIn } from '../../components/CSignIn' import { GlobalStore, UserStore } from '@modules' // import { StateConnection } from '../../model' -import { Watch } from 'vue-property-decorator' +import { Prop, Watch } from 'vue-property-decorator' import { tools } from '../../store/Modules/tools' import { toolsext } from '@src/store/Modules/toolsext' @@ -24,6 +24,7 @@ import globalroutines from '../../globalroutines' }) export default class Header extends Vue { + @Prop({ required: false, default: '' }) public extraContent: string public $t public $v public $q diff --git a/src/components/Header/Header.vue b/src/components/Header/Header.vue index 16a4539..ba57bbe 100644 --- a/src/components/Header/Header.vue +++ b/src/components/Header/Header.vue @@ -108,7 +108,7 @@ @click="right = !right"> + icon="img:statics/images/avatar/avatar3_small.png" @click="right = !right"> @@ -136,12 +136,13 @@
- + -
{{ Username }} - {{ myName }} [Admin] [Manager]
+
{{ Username }} - {{ myName }} [Admin] [Manager]
{{ $t('user.loggati') }}
@@ -172,8 +173,11 @@
- +


+ + + diff --git a/src/components/index.ts b/src/components/index.ts index 6284742..f9b2c6b 100644 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -17,3 +17,4 @@ export * from './BannerCookies' export * from './PagePolicy' export * from './FormNewsletter' export * from './CGridTableRec' +export * from './Shen/CTesseraElettronica' diff --git a/src/model/GlobalStore.ts b/src/model/GlobalStore.ts index 3be0c98..f15afad 100644 --- a/src/model/GlobalStore.ts +++ b/src/model/GlobalStore.ts @@ -222,6 +222,9 @@ export interface IColGridTable { sortable?: boolean disable?: boolean titlepopupedit?: string + visible?: boolean icon?: string action?: any + foredit?: boolean + isdate?: boolean } diff --git a/src/statics/i18n.js b/src/statics/i18n.js index 0a49e6f..54aef51 100644 --- a/src/statics/i18n.js +++ b/src/statics/i18n.js @@ -4,12 +4,13 @@ const msgglobal = { it: { grid: { editvalues: 'Modifica Valori', - showprevedit: 'Mostra Eventi Passati' + showprevedit: 'Mostra Eventi Passati', + columns: 'Colonne', }, otherpages: { admin : { menu: 'Amministrazione', - eventlist: 'Prenotazioni', + eventlist: 'Le tue Prenotazioni', usereventlist: 'Prenotazioni Utenti', userlist: 'Lista Utenti', }, @@ -59,7 +60,7 @@ const msgglobal = { verify_email: 'Verifica la tua email', go_login: 'Torna al Login', incorrect_input: 'Inserimento incorretto.', - link_sent: 'Per confermare la Registrazione, leggi la tua casella di posta e Clicca su "Verifica Email".\nSe non la trovi, cerca nella cartella Spam.' + link_sent: 'Ora leggi la tua email e conferma la registrazione' } } }, @@ -96,7 +97,7 @@ const msgglobal = { email: 'inserire una email valida', errore_generico: 'Si prega di compilare correttamente i campi', atleast: 'dev\'essere lungo almeno di', - complexity: 'deve contenere almeno 1 minuscola, 1 maiuscola e 1 cifra', + complexity: 'deve contenere almeno 1 minuscola, 1 maiuscola, 1 cifra e 1 carattere speciale', notmore: 'non dev\'essere lungo più di', char: 'caratteri', terms: 'Devi accettare le condizioni, per continuare.', @@ -214,6 +215,7 @@ const msgglobal = { bookingtextdefault_of: 'di', data: 'Data', teachertitle: 'Insegnante', + peoplebooked: 'Prenotaz.', }, newsletter: { title: 'Desideri ricevere la nostra Newsletter?', @@ -235,12 +237,13 @@ const msgglobal = { es: { grid: { editvalues: 'Cambiar valores', - showprevedit: 'Mostrar eventos pasados' + showprevedit: 'Mostrar eventos pasados', + columns: 'Columnas', }, otherpages: { admin : { menu: 'Administración', - eventlist: 'Reserva', + eventlist: 'Sus Reservas', usereventlist: 'Reserva Usuarios', userlist: 'Lista de usuarios', }, @@ -290,7 +293,7 @@ const msgglobal = { verify_email: 'Revisa tu email', go_login: 'Vuelve al Login', incorrect_input: 'Entrada correcta.', - link_sent: 'Para confirmar el registro, lea su buzón y haga clic en "Verificar correo electrónico".\n' + 'Si no lo encuentras, busca en la carpeta Spam.' + link_sent: 'Ahora lea su correo electrónico y confirme el registro' } } }, @@ -327,7 +330,7 @@ const msgglobal = { email: 'Debe ser una email válida.', errore_generico: 'Por favor, rellene los campos correctamente', atleast: 'debe ser al menos largo', - complexity: 'debe contener al menos 1 minúscula, 1 mayúscula y 1 dígito', + complexity: 'debe contener al menos 1 minúscula, 1 mayúscula, 1 dígito y 1 caractér especial', notmore: 'no tiene que ser más largo que', char: 'caracteres', terms: 'Debes aceptar las condiciones, para continuar..', @@ -439,6 +442,7 @@ const msgglobal = { bookingtextdefault_of: 'de', data: 'Fecha', teachertitle: 'Maestro', + peoplebooked: 'Reserv.', }, newsletter: { title: '¿Desea recibir nuestro boletín informativo?', @@ -460,12 +464,13 @@ const msgglobal = { fr: { grid: { editvalues: 'Changer les valeurs', - showprevedit: 'Afficher les événements passés' + showprevedit: 'Afficher les événements passés', + columns: 'Colonnes', }, otherpages: { admin : { menu: 'Administration', - eventlist: 'Réservation', + eventlist: 'Vos réservations', usereventlist: 'Réservation Utilisateur', userlist: 'Liste d\'utilisateurs', }, @@ -515,7 +520,7 @@ const msgglobal = { verify_email: 'Vérifiez votre email', go_login: 'Retour à la connexion', incorrect_input: 'Entrée correcte.', - link_sent: 'Pour confirmer l’enregistrement, lisez votre boîte aux lettres et cliquez sur "Vérifier le courrier électronique".".\n' + 'Si vous ne le trouvez pas, regardez dans le dossier Spam.' + link_sent: 'Maintenant, lisez votre email et confirmez votre inscription' } } }, @@ -551,7 +556,7 @@ const msgglobal = { email: 'Ce doit être un email valide.', errore_generico: 'S\'il vous plaît remplir les champs correctement', atleast: 'ça doit être au moins long', - complexity: 'doit contenir au moins 1 minuscule, 1 majuscule et 1 chiffre', + complexity: 'doit contenir au moins 1 minuscule, 1 majuscule, 1 chiffre et 1 caractère spécial', notmore: 'il ne doit pas être plus long que', char: 'caractères', terms: 'Vous devez accepter les conditions, pour continuer..', @@ -663,6 +668,7 @@ const msgglobal = { bookingtextdefault_of: 'du', data: 'Date', teachertitle: 'Professeur', + peoplebooked: 'Réserv.', }, newsletter: { title: 'Souhaitez-vous recevoir notre newsletter?', @@ -684,12 +690,13 @@ const msgglobal = { enUs: { grid: { editvalues: 'Edit Values', - showprevedit: 'Show Past Events' + showprevedit: 'Show Past Events', + columns: 'Columns', }, otherpages: { admin : { menu: 'Administration', - eventlist: 'Booking', + eventlist: 'Your Booking', usereventlist: 'Users Booking', userlist: 'Users List', }, @@ -739,7 +746,7 @@ const msgglobal = { verify_email: 'Verify your email', go_login: 'Back to Login', incorrect_input: 'Incorrect input.', - link_sent: 'To confirm the Registration, read your mailbox and click on "Verify email".\nIf you can not find it check your junk mail or spam.' + link_sent: 'Now read your email and confirm registration' } } }, @@ -775,7 +782,7 @@ const msgglobal = { email: 'must be a valid email', errore_generico: 'Please review fields again', atleast: 'must be at least', - complexity: 'must contains at least 1 lowercase letter, 1 uppercase letter, and 1 digit', + complexity: 'must contains at least 1 lowercase letter, 1 uppercase letter, 1 digit and one special symbol', notmore: 'must not be more than', char: 'characters long', terms: 'You need to agree with the terms & conditions.', @@ -886,6 +893,7 @@ const msgglobal = { bookingtextdefault_of: 'of', data: 'Date', teachertitle: 'Teacher', + peoplebooked: 'Booked', }, newsletter: { title: 'Would you like to receive our Newsletter?', @@ -907,12 +915,13 @@ const msgglobal = { de: { grid: { editvalues: 'Edit Values', - showprevedit: 'Show Past Events' + showprevedit: 'Show Past Events', + columns: 'Columns', }, otherpages: { admin : { menu: 'Administration', - eventlist: 'Booking', + eventlist: 'Your Booking', usereventlist: 'Users Booking', userlist: 'Users List', }, @@ -962,7 +971,7 @@ const msgglobal = { verify_email: 'Verify your email', go_login: 'Back to Login', incorrect_input: 'Incorrect input.', - link_sent: 'To confirm the Registration, read your mailbox and click on "Verify email".\nIf you can not find it check your junk mail or spam.' + link_sent: 'Now read your email and confirm registration' } } }, @@ -999,7 +1008,7 @@ const msgglobal = { email: 'must be a valid email', errore_generico: 'Please review fields again', atleast: 'must be at least', - complexity: 'must contains at least 1 lowercase letter, 1 uppercase letter, and 1 digit', + complexity: 'must contains at least 1 lowercase letter, 1 uppercase letter, 1 digit and one special symbol', notmore: 'must not be more than', char: 'characters long', terms: 'You need to agree with the terms & conditions.', @@ -1111,6 +1120,7 @@ const msgglobal = { bookingtextdefault_of: 'of', data: 'Date', teachertitle: 'Teacher', + peoplebooked: 'Booked', }, newsletter: { title: 'Would you like to receive our Newsletter?', diff --git a/src/store/Modules/Store/calendar/CalendarStore.ts b/src/store/Modules/Store/calendar/CalendarStore.ts index 0cc40c7..3da9a8f 100644 --- a/src/store/Modules/Store/calendar/CalendarStore.ts +++ b/src/store/Modules/Store/calendar/CalendarStore.ts @@ -105,7 +105,7 @@ namespace Actions { let ris = null - const showall = UserStore.state.isAdmin ? '1' : '0' + const showall = UserStore.state.isAdmin || UserStore.state.isManager ? '1' : '0' ris = await Api.SendReq('/booking/' + UserStore.state.userId + '/' + process.env.APP_ID + '/' + showall, 'GET', null) .then((res) => { diff --git a/src/store/Modules/UserStore.ts b/src/store/Modules/UserStore.ts index 27910fd..a0ff41d 100644 --- a/src/store/Modules/UserStore.ts +++ b/src/store/Modules/UserStore.ts @@ -112,6 +112,10 @@ namespace Getters { }, 'IsMyGroup') const getUserByUserId = b.read((mystate: IUserState) => (userId): IUserState => { + // Check if is this User! + if (state.userId === userId) + return state + return mystate.usersList.find((item) => item._id === userId) }, 'getUserByUserId') diff --git a/src/store/Modules/tools.ts b/src/store/Modules/tools.ts index 1c8f52a..904a5dc 100644 --- a/src/store/Modules/tools.ts +++ b/src/store/Modules/tools.ts @@ -1317,7 +1317,10 @@ export const tools = { executefunc(myself: any, table, func: number, par: IParamDialog) { if (func === lists.MenuAction.DELETE) { console.log('param1', par.param1) - CalendarStore.actions.CancelBookingEvent({ideventbook: par.param1, notify: par.param2 === true ? '1' : '0'}).then((ris) => { + CalendarStore.actions.CancelBookingEvent({ + ideventbook: par.param1, + notify: par.param2 === true ? '1' : '0' + }).then((ris) => { if (ris) { tools.showPositiveNotif(myself.$q, myself.$t('cal.canceledbooking') + ' "' + par.param1.title + '"') if (myself.bookEventpage) @@ -1327,7 +1330,7 @@ export const tools = { }) } else if (func === lists.MenuAction.DELETE_RECTABLE) { console.log('param1', par.param1) - GlobalStore.actions.DeleteRec({table, id: par.param1}).then((ris) => { + GlobalStore.actions.DeleteRec({ table, id: par.param1 }).then((ris) => { if (ris) { myself.ActionAfterYes(func, par.param2) tools.showPositiveNotif(myself.$q, myself.$t('db.deletedrecord')) @@ -1622,8 +1625,15 @@ export const tools = { return date.formatDate(mytimestamp, 'DD/MM/YYYY') else return '' - } - , + }, + + getstrDateTime(mytimestamp) { + // console.log('getstrDate', mytimestamp) + if (!!mytimestamp) + return date.formatDate(mytimestamp, 'DD/MM/YYYY HH:MM') + else + return '' + }, getstrMMMDate(mytimestamp) { // console.log('getstrDate', mytimestamp) if (!!mytimestamp) @@ -1825,13 +1835,25 @@ export const tools = { }, heightgallery() { + return tools.heightGallVal().toString() + 'px' + }, + + heightGallVal() { + let maxh2 = 0 + if (Screen.width < 400) { - return '200px' + maxh2 = 350 } else if (Screen.width < 600) { - return '300px' + maxh2 = 400 + } else if (Screen.width < 800) { + maxh2 = 450 + } else if (Screen.width < 1000) { + maxh2 = 500 } else { - return '500px' + maxh2 = 600 } + + return maxh2 }, myheight_imgtitle(myheight?, myheightmobile?) { @@ -1849,18 +1871,7 @@ export const tools = { maxheight = 500 } - let maxh2 = 0 - if (Screen.width < 400) { - maxh2 = 350 - } else if (Screen.width < 600) { - maxh2 = 400 - } else if (Screen.width < 800) { - maxh2 = 450 - } else if (Screen.width < 1000) { - maxh2 = 500 - } else { - maxh2 = 500 - } + const maxh2 = this.heightGallVal() console.log('maxh2', maxh2) console.log('maxheight', maxheight) @@ -2223,7 +2234,7 @@ export const tools = { } else if (riscode === tools.OK) { mythis.$router.push('/signin') tools.showNotif(mythis.$q, mythis.$t('components.authentication.email_verification.link_sent'), { - color: 'warning', + color: 'info', textColor: 'black' }) } else { @@ -2250,11 +2261,17 @@ export const tools = { }, CancelBookingEvent(mythis, eventparam: IEvents, bookeventid: string, notify: boolean) { 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 + }) }, ActionRecTable(mythis, action, table, id, item?) { console.log('CancelRecTable', id) - return tools.askConfirm(mythis.$q, translate('db.deleterecord'), translate('db.deletetherecord'), translate('dialog.yes'), translate('dialog.no'), mythis, table, action, 0, { param1: id, param2: item }) + return tools.askConfirm(mythis.$q, translate('db.deleterecord'), translate('db.deletetherecord'), translate('dialog.yes'), translate('dialog.no'), mythis, table, action, 0, { + param1: id, + param2: item + }) }, isBitActive(bit, whattofind) { return ((bit & whattofind) === whattofind) From 4a7c68fbd5e45c971d0e679b1905b68044f5bfa9 Mon Sep 17 00:00:00 2001 From: Paolo Arena Date: Fri, 18 Oct 2019 01:47:36 +0200 Subject: [PATCH 5/8] - fixed added meta tags "title, keywords and description" - fixed height images in gallery --- quasar.conf.js | 2 +- src/App.ts | 10 ++++------ src/boot/vue-meta.ts | 6 ++++++ src/common/pattern.ts | 10 +++++----- src/components/CImgText/CImgText.scss | 24 ------------------------ src/components/CImgTitle/CImgTitle.scss | 24 ------------------------ src/components/logo/logo.ts | 2 +- src/db/i18n_website.js | 3 +++ src/index.template.html | 2 -- src/root/home/home.ts | 2 +- src/root/home/home.vue | 2 +- src/statics/i18n.js | 10 +++++----- src/store/Modules/GlobalStore.ts | 4 ---- src/store/Modules/tools.ts | 10 +++++++--- 14 files changed, 34 insertions(+), 77 deletions(-) create mode 100644 src/boot/vue-meta.ts diff --git a/quasar.conf.js b/quasar.conf.js index efab0d7..306ab82 100644 --- a/quasar.conf.js +++ b/quasar.conf.js @@ -65,7 +65,7 @@ module.exports = function (ctx) { store: 'src/store/index.ts' }, // app plugins (/src/plugins) - boot: ['vue-i18n', 'axios', 'vee-validate', 'myconfig', 'local-storage', 'error-handler', 'globalroutines', 'vue-idb', 'dragula', 'guard'], + boot: ['vue-i18n', 'vue-meta', 'axios', 'vee-validate', 'myconfig', 'local-storage', 'error-handler', 'globalroutines', 'vue-idb', 'dragula', 'guard'], css: [ 'app.styl' ], diff --git a/src/App.ts b/src/App.ts index 479254e..3f5965b 100644 --- a/src/App.ts +++ b/src/App.ts @@ -27,12 +27,10 @@ export default class App extends Vue { public meta() { return { - keywords: { name: 'keywords', content: 'WebSite' }, - // meta tags - meta: { - keywords: { name: 'keywords', content: 'MyKeywords' }, - mykey: { name: 'mykey', content: 'Key 1' } - } + title: this.$t('msg.myAppName'), + keywords: [{ name: 'keywords', content: 'associazione shen, centro olistico lugo' }, + { name: 'description', content: this.$t('msg.myAppDescription') }] + // equiv: { 'http-equiv': 'Content-Type', 'content': 'text/html; charset=UTF-8' } } } diff --git a/src/boot/vue-meta.ts b/src/boot/vue-meta.ts new file mode 100644 index 0000000..b0c7933 --- /dev/null +++ b/src/boot/vue-meta.ts @@ -0,0 +1,6 @@ +import Component from 'vue-class-component' + +// Register the meta hook +Component.registerHooks([ + 'meta' +]) diff --git a/src/common/pattern.ts b/src/common/pattern.ts index 7c3f49a..55653a5 100644 --- a/src/common/pattern.ts +++ b/src/common/pattern.ts @@ -4,16 +4,16 @@ export class Patterns { /** * Alphanumeric, spaces and dashes allowed. Min 2 characters length. */ - public static DisplayName: RegExp = /^[0-9a-zA-Z\s\-]{2,}/i; + public static DisplayName: RegExp = /^[0-9a-zA-Z\s\-]{2,}/i /** - * Same pattern used by JQuery userName validation + * Same pattern used by JQuery userName validation */ - public static Email: RegExp = /^((“[\w-\s]+”)|([\w-]+(?:\.[\w-]+)*)|(“[\w-\s]+”)([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}[0-9];{1,2})\]?$)/i; + public static Email: RegExp = /^((“[\w-\s]+”)|([\w-]+(?:\.[\w-]+)*)|(“[\w-\s]+”)([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}[0-9];{1,2})\]?$)/i /** * 6 to 20 characters string with at least one digit, one upper case letter, one lower case letter and one special symbol */ - public static Password: RegExp = /^((?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[@#$%]).{6,20})/i; + public static Password: RegExp = /^((?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[@#$%!\-]).{6,20})/i -} \ No newline at end of file +} diff --git a/src/components/CImgText/CImgText.scss b/src/components/CImgText/CImgText.scss index 3cee8a0..6164b55 100644 --- a/src/components/CImgText/CImgText.scss +++ b/src/components/CImgText/CImgText.scss @@ -31,32 +31,8 @@ } } -@media (max-width: 1600px) { - .myclimg { - max-height: 550px !important; - width: 100%; - } -} - -@media (max-width: 1000px) { - .myclimg { - max-height: 450px !important; - width: 100%; - } -} - -@media (max-width: 800px) { - .myclimg { - max-height: 400px !important; - width: 100%; - } -} - @media (max-width: 400px) { - .myclimg { - // height: inherit !important; - } // PER VERSIONE MOBILE .landing > section.padding_testo { diff --git a/src/components/CImgTitle/CImgTitle.scss b/src/components/CImgTitle/CImgTitle.scss index 9aed146..49c484c 100644 --- a/src/components/CImgTitle/CImgTitle.scss +++ b/src/components/CImgTitle/CImgTitle.scss @@ -31,30 +31,6 @@ } } -@media (max-width: 2500px) { - .myclimg { - height: 550px !important; - } -} - -@media (max-width: 1600px) { - .myclimg { - height: 550px !important; - } -} - -@media (max-width: 1000px) { - .myclimg { - height: 450px !important; - } -} - -@media (max-width: 800px) { - .myclimg { - height: 400px !important; - } -} - @media (max-width: 718px) { // PER VERSIONE MOBILE diff --git a/src/components/logo/logo.ts b/src/components/logo/logo.ts index 750f71a..f0aa558 100644 --- a/src/components/logo/logo.ts +++ b/src/components/logo/logo.ts @@ -12,6 +12,6 @@ export default class Logo extends Vue { } get logoalt() { - return process.env.APP_NAME + return this.$t('msg.myAppName') } } diff --git a/src/db/i18n_website.js b/src/db/i18n_website.js index d37277f..3d305ae 100644 --- a/src/db/i18n_website.js +++ b/src/db/i18n_website.js @@ -23,6 +23,7 @@ const msg_website = { msg: { hello: 'Buongiorno', myAppName: 'FreePlanet', + myAppDescription: 'Il primo Vero Social Libero, Equo e Solidale, dove Vive Consapevolezza e Aiuto Comunitario. Gratuito e senza Pubblicità', underconstruction: 'App in costruzione...', myDescriz: '', sottoTitoloApp: 'Il primo Vero Social', @@ -144,6 +145,7 @@ const msg_website = { msg: { hello: 'Buenos Días', myAppName: 'FreePlanet', + myAppDescription: 'El primer Verdadero Social Libre, justo y Solidario Donde vive Conciencia y Ayuda comunitaria, Gratis y sin publicidad', underconstruction: 'App en construcción...', myDescriz: '', sottoTitoloApp: 'El primer Verdadero Social', @@ -266,6 +268,7 @@ const msg_website = { msg: { hello: 'Hello!', myAppName: 'FreePlanet', + myAppDescription: 'The first Real Social Free, Fair and Equitable Where the conscience and community help live. Free and without advertising', underconstruction: 'App in construction...', myDescriz: '', sottoTitoloApp: 'The first Real Social', diff --git a/src/index.template.html b/src/index.template.html index 2dcfdeb..0ea2927 100644 --- a/src/index.template.html +++ b/src/index.template.html @@ -1,8 +1,6 @@ - <%= htmlWebpackPlugin.options.appName %> - diff --git a/src/root/home/home.ts b/src/root/home/home.ts index c054667..a690a10 100644 --- a/src/root/home/home.ts +++ b/src/root/home/home.ts @@ -60,7 +60,7 @@ export default class Home extends Vue { } get appname() { - return process.env.APP_NAME + return this.$t('msg.myAppName') } public beforeDestroy() { diff --git a/src/root/home/home.vue b/src/root/home/home.vue index a612117..e8b423e 100644 --- a/src/root/home/home.vue +++ b/src/root/home/home.vue @@ -201,7 +201,7 @@
-
{{getenv('APP_NAME')}}
+
{{$t('msg.myAppName')}}
{{$t('msg.sottoTitoloApp')}}
diff --git a/src/statics/i18n.js b/src/statics/i18n.js index 54aef51..c1145ab 100644 --- a/src/statics/i18n.js +++ b/src/statics/i18n.js @@ -97,7 +97,7 @@ const msgglobal = { email: 'inserire una email valida', errore_generico: 'Si prega di compilare correttamente i campi', atleast: 'dev\'essere lungo almeno di', - complexity: 'deve contenere almeno 1 minuscola, 1 maiuscola, 1 cifra e 1 carattere speciale', + complexity: 'deve contenere almeno 1 minuscola, 1 maiuscola, 1 cifra e 1 carattere speciale (!,$,#,%,-) ', notmore: 'non dev\'essere lungo più di', char: 'caratteri', terms: 'Devi accettare le condizioni, per continuare.', @@ -330,7 +330,7 @@ const msgglobal = { email: 'Debe ser una email válida.', errore_generico: 'Por favor, rellene los campos correctamente', atleast: 'debe ser al menos largo', - complexity: 'debe contener al menos 1 minúscula, 1 mayúscula, 1 dígito y 1 caractér especial', + complexity: 'debe contener al menos 1 minúscula, 1 mayúscula, 1 dígito y 1 caractér especial (!,$,#,%,-)', notmore: 'no tiene que ser más largo que', char: 'caracteres', terms: 'Debes aceptar las condiciones, para continuar..', @@ -556,7 +556,7 @@ const msgglobal = { email: 'Ce doit être un email valide.', errore_generico: 'S\'il vous plaît remplir les champs correctement', atleast: 'ça doit être au moins long', - complexity: 'doit contenir au moins 1 minuscule, 1 majuscule, 1 chiffre et 1 caractère spécial', + complexity: 'doit contenir au moins 1 minuscule, 1 majuscule, 1 chiffre et 1 caractère spécial (!,$,#,%,-)', notmore: 'il ne doit pas être plus long que', char: 'caractères', terms: 'Vous devez accepter les conditions, pour continuer..', @@ -782,7 +782,7 @@ const msgglobal = { email: 'must be a valid email', errore_generico: 'Please review fields again', atleast: 'must be at least', - complexity: 'must contains at least 1 lowercase letter, 1 uppercase letter, 1 digit and one special symbol', + complexity: 'must contains at least 1 lowercase letter, 1 uppercase letter, 1 digit and one special symbol (!,$,#,%,-)', notmore: 'must not be more than', char: 'characters long', terms: 'You need to agree with the terms & conditions.', @@ -1008,7 +1008,7 @@ const msgglobal = { email: 'must be a valid email', errore_generico: 'Please review fields again', atleast: 'must be at least', - complexity: 'must contains at least 1 lowercase letter, 1 uppercase letter, 1 digit and one special symbol', + complexity: 'must contains at least 1 lowercase letter, 1 uppercase letter, 1 digit and one special symbol (!,$,#,%,-)', notmore: 'must not be more than', char: 'characters long', terms: 'You need to agree with the terms & conditions.', diff --git a/src/store/Modules/GlobalStore.ts b/src/store/Modules/GlobalStore.ts index 020caec..192a772 100644 --- a/src/store/Modules/GlobalStore.ts +++ b/src/store/Modules/GlobalStore.ts @@ -297,10 +297,6 @@ namespace Actions { // return // } - // if (!static_data.functionality.PWA) { - // return - // } - if (!static_data.functionality.PWA) return diff --git a/src/store/Modules/tools.ts b/src/store/Modules/tools.ts index 904a5dc..2191da9 100644 --- a/src/store/Modules/tools.ts +++ b/src/store/Modules/tools.ts @@ -1845,12 +1845,16 @@ export const tools = { maxh2 = 350 } else if (Screen.width < 600) { maxh2 = 400 - } else if (Screen.width < 800) { + } else if (Screen.width < 700) { maxh2 = 450 + } else if (Screen.width < 800) { + maxh2 = 550 } else if (Screen.width < 1000) { - maxh2 = 500 + maxh2 = 650 + } else if (Screen.width < 1200) { + maxh2 = 700 } else { - maxh2 = 600 + maxh2 = 750 } return maxh2 From 313a7db77dbac6ba2d19d44aee37121dc5cd97f4 Mon Sep 17 00:00:00 2001 From: Paolo Arena Date: Sun, 20 Oct 2019 01:22:38 +0200 Subject: [PATCH 6/8] - Added TablesList page - Added Insert Record empty --- .../CEventsCalendar/CEventsCalendar.ts | 23 +-- .../CEventsCalendar/CEventsCalendar.vue | 7 +- src/components/CGridTableRec/CGridTableRec.ts | 147 ++++++++++++++---- .../CGridTableRec/CGridTableRec.vue | 77 +++++++-- src/components/CPage/CPage.scss | 0 src/components/CPage/CPage.ts | 36 ----- src/components/CPage/CPage.vue | 28 ---- src/components/CPage/index.ts | 1 - src/components/Header/Header.ts | 19 ++- src/components/Header/Header.vue | 10 +- src/components/index.ts | 2 +- src/model/Calendar.ts | 18 ++- src/model/GlobalStore.ts | 11 +- src/statics/i18n.js | 20 +++ src/store/Modules/GlobalStore.ts | 25 ++- src/store/Modules/tools.ts | 16 +- 16 files changed, 292 insertions(+), 148 deletions(-) delete mode 100644 src/components/CPage/CPage.scss delete mode 100644 src/components/CPage/CPage.ts delete mode 100644 src/components/CPage/CPage.vue delete mode 100644 src/components/CPage/index.ts diff --git a/src/components/CEventsCalendar/CEventsCalendar.ts b/src/components/CEventsCalendar/CEventsCalendar.ts index f125114..43f0195 100644 --- a/src/components/CEventsCalendar/CEventsCalendar.ts +++ b/src/components/CEventsCalendar/CEventsCalendar.ts @@ -26,6 +26,7 @@ import router from '@router' import { static_data } from '@src/db/static_data' import translate from '@src/globalroutines/util' import { lists } from '../../store/Modules/lists' +import { GlobalStore } from '../../store/Modules' @Component({ name: 'CEventsCalendar', @@ -349,7 +350,7 @@ export default class CEventsCalendar extends Vue { public getEndTime(eventparam) { let endTime = new Date(eventparam.date + ' ' + eventparam.time + ':00') - endTime = date.addToDate(endTime, { minutes: eventparam.duration }) + endTime = date.addToDate(endTime, { minutes: eventparam.dur }) endTime = date.formatDate(endTime, 'HH:mm') return endTime } @@ -394,7 +395,9 @@ export default class CEventsCalendar extends Vue { public addBookEventMenu(eventparam) { if (!UserStore.state.isLogged || !UserStore.state.verified_email) { - this.$router.push('/signin') + // Visu right Toolbar to make SignIn + GlobalStore.state.RightDrawerOpen = true + // this.$router.push('/signin') } else { console.log('addBookEventMenu') this.resetForm() @@ -421,7 +424,7 @@ export default class CEventsCalendar extends Vue { if (eventparam.time) { timestamp = eventparam.date + ' ' + eventparam.time const startTime = new Date(timestamp) - const endTime = date.addToDate(startTime, { minutes: eventparam.duration }) + const endTime = date.addToDate(startTime, { minutes: eventparam.dur }) this.eventForm.dateTimeStart = this.formatDate(startTime) + ' ' + this.formatTime(startTime) // endTime.toString() this.eventForm.dateTimeEnd = this.formatDate(endTime) + ' ' + this.formatTime(endTime) // endTime.toString() } else { @@ -513,8 +516,8 @@ export default class CEventsCalendar extends Vue { } const data: IEvents = { time: '', - duration: 0, - duration2: 0, + dur: 0, + dur2: 0, title: form.title, details: form.details, icon: form.icon, @@ -524,7 +527,7 @@ export default class CEventsCalendar extends Vue { if (form.allDay === false) { // get time into separate var data.time = String(form.dateTimeStart).slice(11, 16) - data.duration = self.getDuration(form.dateTimeStart, form.dateTimeEnd, 'minutes') + data.dur = self.getDuration(form.dateTimeStart, form.dateTimeEnd, 'minutes') } if (update === true) { const index = self.findEventIndex(self.contextDay) @@ -648,7 +651,7 @@ export default class CEventsCalendar extends Vue { public handleSwipe({ evt, ...info }) { if (this.dragging === false) { - if (info.duration >= 30 && this.ignoreNextSwipe === false) { + if (info.dur >= 30 && this.ignoreNextSwipe === false) { if (info.direction === 'right') { this.calendarPrev() } else if (info.direction === 'left') { @@ -743,7 +746,7 @@ export default class CEventsCalendar extends Vue { s.top = timeStartPos(eventparam.time) + 'px' } if (timeDurationHeight) { - s.height = timeDurationHeight(eventparam.duration) + 'px' + s.height = timeDurationHeight(eventparam.dur) + 'px' } s['align-items'] = 'flex-start' return s @@ -804,10 +807,10 @@ export default class CEventsCalendar extends Vue { if (eventsloc.length > 0) { // check for overlapping times const startTime = new Date(CalendarStore.state.eventlist[i].date + ' ' + CalendarStore.state.eventlist[i].time) - const endTime = date.addToDate(startTime, { minutes: CalendarStore.state.eventlist[i].duration }) + const endTime = date.addToDate(startTime, { minutes: CalendarStore.state.eventlist[i].dur }) for (let j = 0; j < eventsloc.length; ++j) { const startTime2 = new Date(eventsloc[j].date + ' ' + eventsloc[j].time) - const endTime2 = date.addToDate(startTime2, { minutes: eventsloc[j].duration2 }) + const endTime2 = date.addToDate(startTime2, { minutes: eventsloc[j].dur2 }) if (date.isBetweenDates(startTime, startTime2, endTime2) || date.isBetweenDates(endTime, startTime2, endTime2)) { eventsloc[j].side = 'left' // CalendarStore.state.eventlist[i].side = 'right' diff --git a/src/components/CEventsCalendar/CEventsCalendar.vue b/src/components/CEventsCalendar/CEventsCalendar.vue index 9817f5a..544ce1e 100644 --- a/src/components/CEventsCalendar/CEventsCalendar.vue +++ b/src/components/CEventsCalendar/CEventsCalendar.vue @@ -1,10 +1,5 @@ -$t(' - + -
- {{ visuValByType(col, props.row[col.name]) }} - - +
+
+ + + + + +
+
+
+
+ {{ visuValByType(col, props.row[col.name]) }} + + + + +
diff --git a/src/components/CPage/CPage.scss b/src/components/CPage/CPage.scss deleted file mode 100644 index e69de29..0000000 diff --git a/src/components/CPage/CPage.ts b/src/components/CPage/CPage.ts deleted file mode 100644 index 1d16cac..0000000 --- a/src/components/CPage/CPage.ts +++ /dev/null @@ -1,36 +0,0 @@ -import Vue from 'vue' -import { Component, Prop } from 'vue-property-decorator' -import { GlobalStore, UserStore } from '@store' - -import { Logo } from '../../components/logo' - -import { Footer } from '../../components/Footer' - -import VueScrollReveal from 'vue-scroll-reveal' -import { tools } from '@src/store/Modules/tools' -import { toolsext } from '@src/store/Modules/toolsext' -import { Screen } from 'quasar' - -Vue.use(VueScrollReveal, { - class: 'v-scroll-reveal', // A CSS class applied to elements with the v-scroll-reveal directive; useful for animation overrides. - duration: 1200, - scale: 0.95, - distance: '10px', - rotate: { - x: 0, - y: 0, - z: 0 - } - // mobile: true -}) - -@Component({ - name: 'CPage', - components: { Logo, Footer } -}) -export default class CPage extends Vue { - @Prop({ required: true }) public imghead: string = '' - @Prop({ required: true }) public headtitle: string = '' - @Prop({ required: true }) public img1: string = '' - @Prop({ required: true }) public text1: string = '' -} diff --git a/src/components/CPage/CPage.vue b/src/components/CPage/CPage.vue deleted file mode 100644 index 9646e04..0000000 --- a/src/components/CPage/CPage.vue +++ /dev/null @@ -1,28 +0,0 @@ - - - diff --git a/src/components/CPage/index.ts b/src/components/CPage/index.ts deleted file mode 100644 index bb5e7cb..0000000 --- a/src/components/CPage/index.ts +++ /dev/null @@ -1 +0,0 @@ -export {default as CPage} from './CPage.vue' diff --git a/src/components/Header/Header.ts b/src/components/Header/Header.ts index ecc3f77..020f9a2 100644 --- a/src/components/Header/Header.ts +++ b/src/components/Header/Header.ts @@ -37,16 +37,11 @@ export default class Header extends Vue { public clCloudDownload: string = '' public clCloudUp_Indexeddb: string = '' public clCloudDown_Indexeddb: string = 'clIndexeddbsend' - public right: boolean = false public photo = '' public visuimg: boolean = true - get getappname(){ - if (Screen.width < 400) { - return this.$t('msg.myAppNameShort') - } else { - return this.$t('msg.myAppName') - } + get tools() { + return tools } get conn_changed() { @@ -110,6 +105,14 @@ export default class Header extends Vue { localStorage.setItem(tools.localStorage.leftDrawerOpen, value.toString()) } + get rightDrawerOpen() { + return GlobalStore.state.RightDrawerOpen + } + + set rightDrawerOpen(value) { + GlobalStore.state.RightDrawerOpen = value + } + get lang() { return this.$q.lang.isoName } @@ -380,7 +383,7 @@ export default class Header extends Vue { } public clickregister() { - this.right = false + this.rightDrawerOpen = false this.$router.replace('/signup') } } diff --git a/src/components/Header/Header.vue b/src/components/Header/Header.vue index ba57bbe..991deb0 100644 --- a/src/components/Header/Header.vue +++ b/src/components/Header/Header.vue @@ -39,7 +39,7 @@ - {{getappname}} + {{tools.getappname()}}
{{$t('msg.myDescriz')}} {{ getAppVersion() }}
@@ -105,10 +105,10 @@ + @click="rightDrawerOpen = !rightDrawerOpen"> + icon="img:statics/images/avatar/avatar3_small.png" @click="rightDrawerOpen = !rightDrawerOpen"> @@ -128,7 +128,7 @@ - +
@@ -139,7 +139,7 @@ + dense flat round icon="close" @click="rightDrawerOpen = !rightDrawerOpen">
{{ Username }} - {{ myName }} [Admin] [Manager]
diff --git a/src/components/index.ts b/src/components/index.ts index f9b2c6b..f15ec27 100644 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -4,7 +4,7 @@ export * from './logo' export * from './CProgress' export * from './CCard' export * from './CBook' -export * from './CPage' +export * from './CMyPage' export * from './CTitle' export * from './CImgText' export * from './CImgTitle' diff --git a/src/model/Calendar.ts b/src/model/Calendar.ts index 8127050..456e916 100644 --- a/src/model/Calendar.ts +++ b/src/model/Calendar.ts @@ -1,11 +1,13 @@ export interface IEvents { _id?: any - time?: string - duration?: number - duration2?: number + typol?: string + short_tit?: string title?: string details?: string + time?: string + dur?: number + dur2?: number date?: string side?: string bgcolor?: string @@ -13,13 +15,19 @@ export interface IEvents { icon?: string img?: string where?: string - teacher?: string - teacher2?: string + contribtype?: number + teacher?: string // teacherid + teacher2?: string // teacherid2 avatar?: string avatar2?: string infoextra?: string + linkpage?: string linkpdf?: string nobookable?: boolean + news?: boolean + dupId?: any + canceled?: boolean + deleted?: boolean } export interface IBookedEvent { diff --git a/src/model/GlobalStore.ts b/src/model/GlobalStore.ts index f15afad..ffd00a3 100644 --- a/src/model/GlobalStore.ts +++ b/src/model/GlobalStore.ts @@ -48,6 +48,7 @@ export interface IGlobalState { mobileMode: boolean menuCollapse: boolean leftDrawerOpen: boolean + RightDrawerOpen: boolean category: string stateConnection: string networkDataReceived: boolean @@ -214,7 +215,7 @@ export interface IParamsQuery { export interface IColGridTable { name: string - required: boolean + required?: boolean label?: string label_trans?: string align?: string @@ -227,4 +228,12 @@ export interface IColGridTable { action?: any foredit?: boolean isdate?: boolean + visuonlyEditVal?: boolean +} + +export interface ITableRec { + label: string + value: string + columns: IColGridTable[] + colkey: string } diff --git a/src/statics/i18n.js b/src/statics/i18n.js index c1145ab..02332b2 100644 --- a/src/statics/i18n.js +++ b/src/statics/i18n.js @@ -6,6 +6,7 @@ const msgglobal = { editvalues: 'Modifica Valori', showprevedit: 'Mostra Eventi Passati', columns: 'Colonne', + tableslist: 'Tabelle', }, otherpages: { admin : { @@ -13,6 +14,7 @@ const msgglobal = { eventlist: 'Le tue Prenotazioni', usereventlist: 'Prenotazioni Utenti', userlist: 'Lista Utenti', + tableslist: 'Lista Tabelle', }, manage: { menu: 'Gestione' @@ -78,6 +80,8 @@ const msgglobal = { incorso: 'Registrazione in corso...', richiesto: 'Campo Richiesto', email: 'Email', + cell: 'Móvil', + img: 'Imagen de archivo', date_reg: 'Data Reg.', perm: 'Permessi', username: 'Nome Utente', @@ -239,6 +243,7 @@ const msgglobal = { editvalues: 'Cambiar valores', showprevedit: 'Mostrar eventos pasados', columns: 'Columnas', + tableslist: 'Tablas' }, otherpages: { admin : { @@ -246,6 +251,7 @@ const msgglobal = { eventlist: 'Sus Reservas', usereventlist: 'Reserva Usuarios', userlist: 'Lista de usuarios', + tableslist: 'Listado de tablas', }, manage: { menu: 'Gestionar' @@ -311,6 +317,8 @@ const msgglobal = { incorso: 'Registro en curso...', richiesto: 'Campo requerido', email: 'Email', + cell: 'Telefono', + img: 'File image', date_reg: 'Fecha Reg.', perm: 'Permisos', username: 'Nombre usuario', @@ -466,6 +474,7 @@ const msgglobal = { editvalues: 'Changer les valeurs', showprevedit: 'Afficher les événements passés', columns: 'Colonnes', + tableslist: 'Tables', }, otherpages: { admin : { @@ -473,6 +482,7 @@ const msgglobal = { eventlist: 'Vos réservations', usereventlist: 'Réservation Utilisateur', userlist: 'Liste d\'utilisateurs', + tableslist: 'Liste des tables', }, manage: { menu: 'Gérer' @@ -537,6 +547,8 @@ const msgglobal = { incorso: 'Inscription en cours...', richiesto: 'Champ obligatoire', email: 'Email', + cell: 'Téléphone', + img: 'Fichier image', date_reg: 'Date Inscript.', perm: 'Autorisations', username: 'Nom d\'utilisateur', @@ -692,6 +704,7 @@ const msgglobal = { editvalues: 'Edit Values', showprevedit: 'Show Past Events', columns: 'Columns', + tableslist: 'Tables', }, otherpages: { admin : { @@ -699,6 +712,7 @@ const msgglobal = { eventlist: 'Your Booking', usereventlist: 'Users Booking', userlist: 'Users List', + tableslist: 'List of tables', }, manage: { menu: 'Manage' @@ -763,6 +777,8 @@ const msgglobal = { incorso: 'Registration please wait...', richiesto: 'Field Required', email: 'Email', + cell: 'Phone', + img: 'File Image', date_reg: 'Reg. Date', perm: 'Permissions', username_login: 'Username or email', @@ -917,6 +933,7 @@ const msgglobal = { editvalues: 'Edit Values', showprevedit: 'Show Past Events', columns: 'Columns', + tableslist: 'Tables', }, otherpages: { admin : { @@ -924,6 +941,7 @@ const msgglobal = { eventlist: 'Your Booking', usereventlist: 'Users Booking', userlist: 'Users List', + tableslist: 'List of tables', }, manage: { menu: 'Manage' @@ -989,6 +1007,8 @@ const msgglobal = { incorso: 'Registration please wait...', richiesto: 'Field Required', email: 'Email', + cell: 'Phone', + img: 'File Image', date_reg: 'Reg. Date', perm: 'Permissions', username_login: 'Username or email', diff --git a/src/store/Modules/GlobalStore.ts b/src/store/Modules/GlobalStore.ts index 192a772..04c6b98 100644 --- a/src/store/Modules/GlobalStore.ts +++ b/src/store/Modules/GlobalStore.ts @@ -17,7 +17,6 @@ import { GlobalStore, Projects, Todos, UserStore } from '@store' import messages from '../../statics/i18n' import globalroutines from './../../globalroutines/index' - import { cfgrouter } from '../../router/route-config' import { static_data } from '@src/db/static_data' import { IParamsQuery } from '@src/model/GlobalStore' @@ -41,6 +40,7 @@ const state: IGlobalState = { mobileMode: false, menuCollapse: true, leftDrawerOpen: true, + RightDrawerOpen: false, stateConnection: stateConnDefault, networkDataReceived: false, cfgServer: [], @@ -504,15 +504,30 @@ namespace Actions { } async function loadTable(context, params: IParamsQuery) { - console.log('loadTable', params) + // console.log('loadTable', params) return await Api.SendReq('/gettable', 'POST', params) .then((res) => { - console.table(res) + // console.table(res) return res.data }) .catch((error) => { - console.log('error loadUsersList', error) + console.log('error loadTable', error) + UserStore.mutations.setErrorCatch(error) + return null + }) + } + + async function saveTable(context, mydata: object) { + // console.log('saveTable', mydata) + + return await Api.SendReq('/settable', 'POST', mydata) + .then((res) => { + // console.table(res) + return res.data + }) + .catch((error) => { + console.log('error saveTable', error) UserStore.mutations.setErrorCatch(error) return null }) @@ -551,7 +566,6 @@ namespace Actions { }) } - export const actions = { setConta: b.dispatch(setConta), createPushSubscription: b.dispatch(createPushSubscription), @@ -563,6 +577,7 @@ namespace Actions { checkUpdates: b.dispatch(checkUpdates), saveFieldValue: b.dispatch(saveFieldValue), loadTable: b.dispatch(loadTable), + saveTable: b.dispatch(saveTable), DeleteRec: b.dispatch(DeleteRec) } diff --git a/src/store/Modules/tools.ts b/src/store/Modules/tools.ts index 2191da9..618b254 100644 --- a/src/store/Modules/tools.ts +++ b/src/store/Modules/tools.ts @@ -33,6 +33,7 @@ export interface INotify { } export const tools = { + MAX_CHARACTERS: 60, projects: 'projects', todos: 'todos', EMPTY: 0, @@ -1681,7 +1682,11 @@ export const tools = { if (!value) { return '' } - return value.substring(0, numchars) + '...' + try { + return value.substring(0, numchars) + '...' + }catch (e) { + return value + } }, getDateNow() { @@ -1877,8 +1882,8 @@ export const tools = { const maxh2 = this.heightGallVal() - console.log('maxh2', maxh2) - console.log('maxheight', maxheight) + // console.log('maxh2', maxh2) + // console.log('maxheight', maxheight) let ris = 0 @@ -1892,7 +1897,7 @@ export const tools = { ris = parseInt(myheightmobile, 10) } - console.log('ris', ris) + // console.log('ris', ris) return ris }, @@ -2199,7 +2204,8 @@ export const tools = { tools.showNotif(mythis.$q, mythis.$t('login.errato'), { color: 'negative', icon: 'notifications' }) mythis.iswaitingforRes = false if (ispageLogin) { - mythis.$router.push('/signin') + GlobalStore.state.RightDrawerOpen = true + // mythis.$router.push('/signin') } }) From b8ec241b372108bdc187653a3923400adbdda407 Mon Sep 17 00:00:00 2001 From: Paolo Arena Date: Sun, 20 Oct 2019 01:23:04 +0200 Subject: [PATCH 7/8] - Added TablesList page - Added Insert Record empty --- src/components/CMyPage/CMyPage.scss | 0 src/components/CMyPage/CMyPage.ts | 57 +++++++++++++++++++++++++++++ src/components/CMyPage/CMyPage.vue | 19 ++++++++++ src/components/CMyPage/index.ts | 1 + 4 files changed, 77 insertions(+) create mode 100644 src/components/CMyPage/CMyPage.scss create mode 100644 src/components/CMyPage/CMyPage.ts create mode 100644 src/components/CMyPage/CMyPage.vue create mode 100644 src/components/CMyPage/index.ts diff --git a/src/components/CMyPage/CMyPage.scss b/src/components/CMyPage/CMyPage.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/components/CMyPage/CMyPage.ts b/src/components/CMyPage/CMyPage.ts new file mode 100644 index 0000000..fb44dd4 --- /dev/null +++ b/src/components/CMyPage/CMyPage.ts @@ -0,0 +1,57 @@ +import Vue from 'vue' +import { Component, Prop } from 'vue-property-decorator' +import { GlobalStore, UserStore } from '@store' + +import { Footer } from '../../components/Footer' + +// import VueScrollReveal from 'vue-scroll-reveal' +import { tools } from '@src/store/Modules/tools' +import { toolsext } from '@src/store/Modules/toolsext' +import { Screen } from 'quasar' +import { CImgTitle } from '../../components/CImgTitle/index' +import { CTitle } from '../../components/CTitle/index' + +// Vue.use(VueScrollReveal, { +// class: 'v-scroll-reveal', // A CSS class applied to elements with the v-scroll-reveal directive; useful for animation overrides. +// duration: 1200, +// scale: 0.95, +// distance: '10px', +// rotate: { +// x: 0, +// y: 0, +// z: 0 +// } +// // mobile: true +// }) + +@Component({ + name: 'CMyPage', + components: { Footer, CImgTitle, CTitle } +}) +export default class CMyPage extends Vue { + @Prop({ required: true, default: '' }) public title: string + @Prop({ required: true, default: '' }) public keywords: string + @Prop({ required: true, default: '' }) public description: string + @Prop({ required: false, default: '' }) public img: string + @Prop({ required: false, default: '' }) public imgbackground: string + @Prop({ required: false, default: '' }) public sizes: string + public $t + public $q + + public meta() { + return { + title: this.$t('msg.myAppName'), + titleTemplate: (title) => `${this.title} - ${this.$t('msg.myAppName')}`, + meta: { + keywords: { name: 'keywords', content: this.keywords }, + description: { name: 'description', content: this.description }, + equiv: { 'http-equiv': 'Content-Type', 'content': 'text/html; charset=UTF-8' } + } + } + } + + public mounted() { + // console.log('CMYPage title=', this.title) + // console.table(this.meta) + } +} diff --git a/src/components/CMyPage/CMyPage.vue b/src/components/CMyPage/CMyPage.vue new file mode 100644 index 0000000..cc33c69 --- /dev/null +++ b/src/components/CMyPage/CMyPage.vue @@ -0,0 +1,19 @@ + + + + + diff --git a/src/components/CMyPage/index.ts b/src/components/CMyPage/index.ts new file mode 100644 index 0000000..15d7c2c --- /dev/null +++ b/src/components/CMyPage/index.ts @@ -0,0 +1 @@ +export {default as CMyPage} from './CMyPage.vue' From 9656b14cd06d56297d49d714d23b56902c9aa5a2 Mon Sep 17 00:00:00 2001 From: Paolo Arena Date: Sun, 20 Oct 2019 22:44:18 +0200 Subject: [PATCH 8/8] - Load Events - Edit Events - When a field is updated: undate also memory list record - Duplicate Event --- .../CEventsCalendar/CEventsCalendar.ts | 49 ++++-- .../CEventsCalendar/CEventsCalendar.vue | 38 ++-- src/components/CGridTableRec/CGridTableRec.ts | 17 +- .../CGridTableRec/CGridTableRec.vue | 8 +- src/model/Calendar.ts | 20 ++- src/model/GlobalStore.ts | 8 +- src/statics/i18n.js | 162 +++++++++++++++++- src/store/Modules/GlobalStore.ts | 71 +++++++- .../Modules/Store/calendar/CalendarStore.ts | 12 +- src/store/Modules/lists.ts | 1 + src/store/Modules/tools.ts | 37 +++- 11 files changed, 348 insertions(+), 75 deletions(-) diff --git a/src/components/CEventsCalendar/CEventsCalendar.ts b/src/components/CEventsCalendar/CEventsCalendar.ts index 43f0195..38ae934 100644 --- a/src/components/CEventsCalendar/CEventsCalendar.ts +++ b/src/components/CEventsCalendar/CEventsCalendar.ts @@ -349,7 +349,7 @@ export default class CEventsCalendar extends Vue { } public getEndTime(eventparam) { - let endTime = new Date(eventparam.date + ' ' + eventparam.time + ':00') + let endTime = new Date(eventparam.date) endTime = date.addToDate(endTime, { minutes: eventparam.dur }) endTime = date.formatDate(endTime, 'HH:mm') return endTime @@ -421,8 +421,8 @@ export default class CEventsCalendar extends Vue { this.resetForm() this.contextDay = { ...eventparam } let timestamp - if (eventparam.time) { - timestamp = eventparam.date + ' ' + eventparam.time + if (eventparam.withtime) { + timestamp = eventparam.date const startTime = new Date(timestamp) const endTime = date.addToDate(startTime, { minutes: eventparam.dur }) this.eventForm.dateTimeStart = this.formatDate(startTime) + ' ' + this.formatTime(startTime) // endTime.toString() @@ -431,7 +431,7 @@ export default class CEventsCalendar extends Vue { timestamp = eventparam.date this.eventForm.dateTimeStart = timestamp } - this.eventForm.allDay = !eventparam.time + this.eventForm.allDay = !eventparam.withtime this.eventForm.bgcolor = eventparam.bgcolor this.eventForm.icon = eventparam.icon this.eventForm.title = eventparam.title @@ -515,7 +515,7 @@ export default class CEventsCalendar extends Vue { // an add } const data: IEvents = { - time: '', + withtime: false, dur: 0, dur2: 0, title: form.title, @@ -526,7 +526,7 @@ export default class CEventsCalendar extends Vue { } if (form.allDay === false) { // get time into separate var - data.time = String(form.dateTimeStart).slice(11, 16) + // data.time = String(form.dateTimeStart).slice(11, 16) data.dur = self.getDuration(form.dateTimeStart, form.dateTimeEnd, 'minutes') } if (update === true) { @@ -685,7 +685,8 @@ export default class CEventsCalendar extends Vue { return this.draggedEvent.date !== day.date } else if (type === 'interval') { stopAndPrevent(ev) - return this.draggedEvent.date !== day.date && this.draggedEvent.time !== day.time + // return this.draggedEvent.date !== day.date && this.draggedEvent.time !== day.time + return this.draggedEvent.date !== day.date } } @@ -697,7 +698,7 @@ export default class CEventsCalendar extends Vue { this.draggedEvent.side = void 0 } else if (type === 'interval') { this.draggedEvent.date = day.date - this.draggedEvent.time = day.time + // this.draggedEvent.time = day.time this.draggedEvent.side = void 0 } } @@ -724,6 +725,16 @@ export default class CEventsCalendar extends Vue { return this.dateFormatter.format(mydate) } + public getTeacherName(teacherusername) { + const op = CalendarStore.state.operators.find((myop) => myop.username === teacherusername) + return (op) ? `${op.name} ${op.surname}` : '' + } + + public getTeacherImg(teacherusername) { + const op = CalendarStore.state.operators.find((myop) => myop.username === teacherusername) + return (op) ? op.img : 'avatar/noimage.png' + } + public badgeClasses(eventparam, type) { const cssColor = tools.isCssColor(eventparam.bgcolor) const isHeader = type === 'header' @@ -743,7 +754,7 @@ export default class CEventsCalendar extends Vue { s.color = colors.luminosity(eventparam.bgcolor) > 0.5 ? 'black' : 'white' } if (timeStartPos) { - s.top = timeStartPos(eventparam.time) + 'px' + s.top = timeStartPos(tools.getstrTime(eventparam.date)) + 'px' } if (timeDurationHeight) { s.height = timeDurationHeight(eventparam.dur) + 'px' @@ -786,7 +797,8 @@ export default class CEventsCalendar extends Vue { for (let i = 0; i < CalendarStore.state.eventlist.length; ++i) { // console.log(' ciclo i = ', i, CalendarStore.state.eventlist[i]) - const dateEvent = new Date(CalendarStore.state.eventlist[i].date + ' 00:00:00') + // const dateEvent = new Date(CalendarStore.state.eventlist[i].date + ' 00:00:00') + const dateEvent = new Date(CalendarStore.state.eventlist[i].date) if (dateEvent >= datenow) { eventsloc.push(CalendarStore.state.eventlist[i]) @@ -802,14 +814,15 @@ export default class CEventsCalendar extends Vue { for (let i = 0; i < CalendarStore.state.eventlist.length; ++i) { let added = false // console.log(' ciclo i = ', i, CalendarStore.state.eventlist[i]) - if (CalendarStore.state.eventlist[i].date === dt) { - if (CalendarStore.state.eventlist[i].time) { + if (tools.getstrYYMMDDDate(CalendarStore.state.eventlist[i].date) === dt) { + // if (CalendarStore.state.eventlist[i].time) { if (eventsloc.length > 0) { // check for overlapping times - const startTime = new Date(CalendarStore.state.eventlist[i].date + ' ' + CalendarStore.state.eventlist[i].time) + // const startTime = new Date(CalendarStore.state.eventlist[i].date + ' ' + CalendarStore.state.eventlist[i].time) + const startTime = new Date(CalendarStore.state.eventlist[i].date) const endTime = date.addToDate(startTime, { minutes: CalendarStore.state.eventlist[i].dur }) for (let j = 0; j < eventsloc.length; ++j) { - const startTime2 = new Date(eventsloc[j].date + ' ' + eventsloc[j].time) + const startTime2 = new Date(eventsloc[j].date) const endTime2 = date.addToDate(startTime2, { minutes: eventsloc[j].dur2 }) if (date.isBetweenDates(startTime, startTime2, endTime2) || date.isBetweenDates(endTime, startTime2, endTime2)) { eventsloc[j].side = 'left' @@ -820,14 +833,15 @@ export default class CEventsCalendar extends Vue { } } } - } + // } if (!added) { // CalendarStore.state.eventlist[i].side = void 0 eventsloc.push(CalendarStore.state.eventlist[i]) } } else if (CalendarStore.state.eventlist[i].days) { // check for overlapping dates - const startDate = new Date(CalendarStore.state.eventlist[i].date + ' 00:00:00') + // const startDate = new Date(CalendarStore.state.eventlist[i].date + ' 00:00:00') + const startDate = new Date(CalendarStore.state.eventlist[i].date) const endDate = date.addToDate(startDate, { days: CalendarStore.state.eventlist[i].days }) if (date.isBetweenDates(dt, startDate, endDate)) { eventsloc.push(CalendarStore.state.eventlist[i]) @@ -866,7 +880,8 @@ export default class CEventsCalendar extends Vue { // check if event is in the past const datenow = tools.addDays(tools.getDateNow(), -1) - let dateEvent = new Date(myevent.date + ' 00:00:00') + // let dateEvent = new Date(myevent.date + ' 00:00:00') + let dateEvent = new Date(myevent.date) if (myevent.days) { dateEvent = tools.addDays(dateEvent, myevent.days) diff --git a/src/components/CEventsCalendar/CEventsCalendar.vue b/src/components/CEventsCalendar/CEventsCalendar.vue index 544ce1e..045b603 100644 --- a/src/components/CEventsCalendar/CEventsCalendar.vue +++ b/src/components/CEventsCalendar/CEventsCalendar.vue @@ -32,16 +32,16 @@ - + - {{myevent.teacher}} + {{getTeacherName(myevent.teacher)}} - - + + - + - {{myevent.teacher2}} + {{getTeacherName(myevent.teacher2)}}
@@ -68,10 +68,10 @@ {{ myevent.infoextra }} - + - {{$t('cal.hours')}}: - {{$t('cal.starttime')}} {{ myevent.time }} {{$t('cal.endtime')}}: {{ + {{$t('cal.starttime')}} {{ tools.getstrTime(myevent.date) }} {{$t('cal.endtime')}}: {{ getEndTime(myevent) }} @@ -242,10 +242,10 @@ {{ myevent.infoextra }} - + - {{$t('cal.hours')}}: - {{$t('cal.starttime')}} {{ myevent.time }} {{$t('cal.endtime')}} - {{ + {{$t('cal.starttime')}} {{ tools.getstrTime(myevent.date) }} {{$t('cal.endtime')}} - {{ getEndTime(myevent) }} @@ -386,7 +386,7 @@