diff --git a/src/components/CImgTitle/CImgTitle.scss b/src/components/CImgTitle/CImgTitle.scss new file mode 100644 index 0000000..9aed146 --- /dev/null +++ b/src/components/CImgTitle/CImgTitle.scss @@ -0,0 +1,114 @@ + +.imgtitle { + display: flex; + justify-content: space-between; + /* flex-flow: row nowrap; */ + + padding: 1rem 0 1rem 0; + margin: .125rem; + + * { + width: 100%; + flex: 1; + margin-left: auto; + margin-right: auto; + } + + &__img { + min-width: 250px; + } + &__imgh100 { + max-height: 100px; + } + &__imgh150 { + max-height: 150px; + } + &__imgw150 { + max-width: 150px; + } + &__imgw100 { + max-width: 100px; + } +} + +@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 + .landing > section.padding_testo { + padding-top: 0.5rem; + padding-bottom: 0.1rem; + } + + .imgtitle { + padding: 0.25rem 0 0.25rem 0; + } + +} + +.landing > section.padding_testo { + padding-top: 1rem; + padding-bottom: 0.25rem; +} + +.section_text { + padding: 10px; +} + +.title{ + font-size: 3.5rem; + padding: 10px; + text-shadow: .2rem .2rem .2rem #3d3d3d; +} + +@media (max-width: 400px) { + .title{ + padding: 5px; + font-size: 3rem; + } +} + +.mylegendinside{ + font-size: 1rem; + margin-bottom: 50px; + opacity: .8; + + @media (max-width: 400px) { + margin-bottom: -10px; + } +} + +.mylegend{ + text-align: center; + color: black; + font-size: 1rem; + font-style: italic; + opacity: .8; + text-shadow: .05rem .05rem .05rem #aeaeae; + z-index: 1000; + @media (max-width: 400px) { + } +} diff --git a/src/components/CImgTitle/CImgTitle.ts b/src/components/CImgTitle/CImgTitle.ts new file mode 100644 index 0000000..0d9f049 --- /dev/null +++ b/src/components/CImgTitle/CImgTitle.ts @@ -0,0 +1,44 @@ +import Vue from 'vue' +import { Component, Prop } from 'vue-property-decorator' +import { GlobalStore, UserStore } from '@store' + +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: 'CImgTitle' +}) +export default class CImgTitle extends Vue { + @Prop({ required: false, default: '' }) public src: string + @Prop({ required: false, default: '' }) public title: string + @Prop({ required: false, default: 0 }) public myheight: number + @Prop({ required: false, default: 0 }) public myheightmobile: number + @Prop({ required: false, default: '' }) public legendinside: string + @Prop({ required: false, default: '' }) public legend: string + + get tools() { + return tools + } + + get getsrc() { + // return this.src + const filefull = tools.getimgFullpathbysize(this.src) + + return tools.getimgbysize(filefull.path, filefull.file) + } +} diff --git a/src/components/CImgTitle/CImgTitle.vue b/src/components/CImgTitle/CImgTitle.vue new file mode 100644 index 0000000..3f64fe9 --- /dev/null +++ b/src/components/CImgTitle/CImgTitle.vue @@ -0,0 +1,15 @@ + + + + diff --git a/src/components/CImgTitle/index.ts b/src/components/CImgTitle/index.ts new file mode 100644 index 0000000..884ac1f --- /dev/null +++ b/src/components/CImgTitle/index.ts @@ -0,0 +1 @@ +export {default as CImgTitle} from './CImgTitle.vue' diff --git a/src/components/CPreloadImages/CPreloadImages.scss b/src/components/CPreloadImages/CPreloadImages.scss new file mode 100644 index 0000000..8b6ae01 --- /dev/null +++ b/src/components/CPreloadImages/CPreloadImages.scss @@ -0,0 +1,66 @@ +$heightBtn: 100%; +$grayshadow: #555; + +.text-subtitle-carica { + font-size: 1rem; + font-weight: 400; + line-height: 1.75rem; + letter-spacing: .00937em; + text-shadow: .1rem .1rem .1rem $grayshadow; +} + +.text-subtitle-certificato { + font-size: 0.75rem; + line-height: 1rem; +} + +@media (max-width: 718px) { + // PER VERSIONE MOBILE + .text-subtitle-carica { + font-size: 1rem; + } +} + +.op { + text-align: center !important; + font-size: 1rem; + font-weight: 400; + line-height: 1.75rem; + letter-spacing: .00937em; + text-shadow: .1rem .1rem .1rem $grayshadow; + + &__cell { + font-size: 1rem; + color: red; + } + + &__email { + font-size: 1rem; + color: #3b5998; + } + + &__email a { + text-decoration: none; + } + + &__facebook a { + font-size: 1rem; + text-decoration: none; + } + + &__storia { + margin-top: 1rem; + margin-bottom: 1rem; + text-align: justify; + } +} + +.myimg { + border-radius: 300px !important; +} + +.q-img { + &__image { + border-radius: 300px !important; + } +} diff --git a/src/components/CPreloadImages/CPreloadImages.ts b/src/components/CPreloadImages/CPreloadImages.ts new file mode 100644 index 0000000..9303774 --- /dev/null +++ b/src/components/CPreloadImages/CPreloadImages.ts @@ -0,0 +1,29 @@ +import Vue from 'vue' +import { Component, Prop, Watch } from 'vue-property-decorator' + +import { tools } from '../../store/Modules/tools' +import { toolsext } from '@src/store/Modules/toolsext' +import { IPreloadImages } from '../../model' + +@Component({ + name: 'CPreloadImages' +}) + +export default class CPreloadImages extends Vue { + @Prop({ required: true }) public arrimg: IPreloadImages[] + + get tools() { + return tools + } + + public getimg(recimg: IPreloadImages) { + if (recimg.mobile) { + const filefull = tools.getimgFullpathbysize(recimg.imgname) + + return tools.getimgbysize(filefull.path, filefull.file) + } else { + return recimg.imgname + } + } + +} diff --git a/src/components/CPreloadImages/CPreloadImages.vue b/src/components/CPreloadImages/CPreloadImages.vue new file mode 100644 index 0000000..704f450 --- /dev/null +++ b/src/components/CPreloadImages/CPreloadImages.vue @@ -0,0 +1,14 @@ + + + + + diff --git a/src/components/CPreloadImages/index.ts b/src/components/CPreloadImages/index.ts new file mode 100644 index 0000000..3e5e65a --- /dev/null +++ b/src/components/CPreloadImages/index.ts @@ -0,0 +1 @@ +export {default as CPreloadImages} from './CPreloadImages.vue' diff --git a/src/components/Header/Header.ts b/src/components/Header/Header.ts index 72037d2..0f90b5e 100644 --- a/src/components/Header/Header.ts +++ b/src/components/Header/Header.ts @@ -314,13 +314,12 @@ export default class Header extends Vue { get Username() { return UserStore.state.username } - get Name() { + get myName() { return UserStore.state.name } - get Surname() { + get mySurname() { return UserStore.state.surname } - get Verificato() { return UserStore.state.verified_email } @@ -345,4 +344,8 @@ export default class Header extends Vue { get static_data(){ return static_data } + + get isLogged() { + return UserStore.state.isLogged + } } diff --git a/src/db/db_data.js b/src/db/db_data.js index fd813d6..0a7b509 100644 --- a/src/db/db_data.js +++ b/src/db/db_data.js @@ -3,6 +3,12 @@ import { IEvents } from "../model"; export const db_data = { URL_FACEBOOK: "https://www.facebook.com/associazioneshen", + + userdata : { + calendar_editable: false, + + }, + events: [ { title: 'Scambi Reiki', diff --git a/src/db/i18n_website.js b/src/db/i18n_website.js index 04268e0..d37277f 100644 --- a/src/db/i18n_website.js +++ b/src/db/i18n_website.js @@ -16,10 +16,10 @@ const msg_website = { Test2: 'Test2', projects: 'Progetti', favproj: 'Favoriti', - projall: 'Tutti', - projectsShared: 'Miei Condivisi', - myprojects: 'Miei Personali' }, + projall: 'Tutti', + projectsShared: 'Miei Condivisi', + myprojects: 'Miei Personali', msg: { hello: 'Buongiorno', myAppName: 'FreePlanet', @@ -136,11 +136,11 @@ const msg_website = { Test1: 'Test1', Test2: 'Test2', projects: 'Proyectos', - favproj: 'Favoritos', - projall: 'Todos', - projectsShared: 'Mis Compartidos', - myprojects: 'Mis Personales', }, + favproj: 'Favoritos', + projall: 'Todos', + projectsShared: 'Mis Compartidos', + myprojects: 'Mis Personales', msg: { hello: 'Buenos Días', myAppName: 'FreePlanet', @@ -258,11 +258,11 @@ const msg_website = { Test1: 'Test1', Test2: 'Test2', projects: 'Projects', - favproj: 'Favorite', - projall: 'All', - projectsShared: 'My Shared', - myprojects: 'My Personals', }, + favproj: 'Favorite', + projall: 'All', + projectsShared: 'My Shared', + myprojects: 'My Personals', msg: { hello: 'Hello!', myAppName: 'FreePlanet', @@ -363,6 +363,24 @@ const msg_website = { }, contacts: 'Contacts' }, + }, + fr: { + pages: { + + }, + msg: { + + }, + + }, + de: { + pages: { + + }, + msg: { + + }, + } } diff --git a/src/db/static_data.ts b/src/db/static_data.ts index c1b03a9..1ea15b9 100644 --- a/src/db/static_data.ts +++ b/src/db/static_data.ts @@ -1,9 +1,225 @@ -import { Todos, Projects, UserStore } from '@store' +import { Todos, Projects, UserStore, GlobalStore } from '@store' import globalroutines from '../globalroutines/index' import Quasar, { date, Screen } from 'quasar' -import { IListRoutes, ILang, IMenuList, IProject, ITodo, Privacy, IPerson, IFunctionality } from '../model/index' +import { + IListRoutes, + ILang, + IMenuList, + IProject, + ITodo, + Privacy, + IPerson, + IFunctionality, + IPreloadImages +} from '../model/index' import { RouteNames } from '../router/route-names' +import { tools } from '@src/store/Modules/tools' + +// const SHOW_PROJINTHEMENU = false +// +// let arrlistafavourite = [] +// let arrlistaprojtutti = [] +// let arrlistaprojmiei = [] +// if (SHOW_PROJINTHEMENU) { +// arrlistaprojtutti = Projects.getters.listaprojects(RouteNames.projectsall) +// arrlistaprojmiei = Projects.getters.listaprojects(RouteNames.myprojects) +// arrlistafavourite = Projects.getters.listaprojects(RouteNames.favouriteprojects) +// } +// PROGETTI -> FAVORITI : + +// if (arrlistafavourite.length > 0) { +// arrMenu.push({ +// icon: 'favorite_border', +// nametranslate: 'pages.' + RouteNames.favouriteprojects, +// urlroute: RouteNames.favouriteprojects, +// level_parent: 0.0, +// level_child: 0.5, +// routes2: arrlistafavourite, +// idelem: '' +// }) +// } + +const routes_todo: IListRoutes[] = [] +const arrlista = [ + { nametranslate: 'personal', description: 'personal' }, + { nametranslate: 'work', description: 'work' }, + { nametranslate: 'shopping', description: 'shopping' } +] + +arrlista.forEach((elem: IMenuList) => { + routes_todo.push( + { + path: '/todo/:category', + materialIcon: 'todo', + urlroute: 'todo', + name: elem.description, + component: () => import('@/views/todo-list/todo-list.vue'), + level_parent: 0, + level_child: 0.5, + inmenu: true, + submenu: true, + infooter: true, + meta: { + requiresAuth: true, + async asyncData() { + await Todos.actions.dbLoad({ checkPending: false }) + } + // middleware: [auth] + }, + idelem: elem.nametranslate, + } + ) +}) + +const routes_projects: IListRoutes[] = [ + { + // PROGETTI -> TUTTI : + path: '/' + RouteNames.projectsall + '/:idProj', + materialIcon: 'accessibility_new', + name: RouteNames.projectsall, + urlroute: RouteNames.projectsall, + component: () => import('@/views/projects/proj-list/proj-list.vue'), + inmenu: true, + submenu: true, + level_parent: 0.0, + level_child: 0.5, + infooter: true, + meta: { + requiresAuth: false, + async asyncData() { + // await Todos.actions.dbLoad({ checkPending: false }) + await Projects.actions.dbLoad({ checkPending: false, onlyiffirsttime: true }) + } + }, + idelem: process.env.PROJECT_ID_MAIN + }, + { + // PROGETTI -> TUTTI : + path: '/' + RouteNames.myprojects + '/:idProj', + materialIcon: 'accessibility_new', + name: RouteNames.myprojects, + urlroute: RouteNames.myprojects, + component: () => import('@/views/projects/proj-list/proj-list.vue'), + inmenu: true, + submenu: true, + level_parent: 0.0, + level_child: 0.5, + infooter: true, + meta: { + requiresAuth: false, + async asyncData() { + // await Todos.actions.dbLoad({ checkPending: false }) + await Projects.actions.dbLoad({ checkPending: false, onlyiffirsttime: true }) + } + }, + idelem: process.env.PROJECT_ID_MAIN + }, + { + // PROGETTI -> TUTTI : + path: '/' + RouteNames.projectsshared + '/:idProj', + materialIcon: 'accessibility_new', + name: RouteNames.projectsshared, + urlroute: RouteNames.projectsshared, + component: () => import('@/views/projects/proj-list/proj-list.vue'), + inmenu: true, + submenu: true, + level_parent: 0.0, + level_child: 0.5, + infooter: true, + meta: { + requiresAuth: false, + async asyncData() { + // await Todos.actions.dbLoad({ checkPending: false }) + await Projects.actions.dbLoad({ checkPending: false, onlyiffirsttime: true }) + } + }, + idelem: process.env.PROJECT_ID_MAIN + } +] + +const routes: IListRoutes[] = [ + { + path: '/', + materialIcon: 'home', + name: 'pages.home', + component: () => import('@/root/home/home.vue'), + reqauth: false, + inmenu: true, + infooter: true + }, + { + path: '', + faIcon: 'fa fa-list-alt', + materialIcon: 'format_list_numbered', + name: 'pages.Todo', + routes2: routes_todo, + level_parent: 0, + level_child: 0.5, + inmenu: true, + solotitle: true, + infooter: true + }, + ...routes_todo, + { + path: '', + faIcon: 'fa fa-list-alt', + materialIcon: 'next_week', + name: 'pages.projects', + routes2: routes_projects, + level_parent: 0, + level_child: 0.5, + inmenu: true, + solotitle: true, + infooter: true + }, + ...routes_projects, + { + path: '/category', + materialIcon: 'list', + name: 'pages.Category', + component: () => import('@/views/categories/category/category.vue'), + inmenu: true, + infooter: true + }, + { + path: '/admin/testp1/:category', + materialIcon: 'restore', + name: 'pages.Test1', + component: () => import('@/views/admin/testp1/testp1.vue'), + inmenu: true, + infooter: false, + reqauth: true + }, + + // --- NOT IN MENU: --- + { path: '/policy', name: 'pages.policy', component: () => import('@/root/policy/policy.vue') }, + { + path: '/signup', + materialIcon: 'how_to_reg', + name: 'pages.SignUp', + component: () => import('@/views/login/signup/signup.vue'), + inmenu: true, + infooter: true + }, + { + path: '/signin', + materialIcon: 'account_circle', + name: 'pages.SignIn', + component: () => import('@/views/login/signin/signin.vue'), + inmenu: true, + infooter: true + }, + { path: '/vreg', name: 'Verify Reg', component: () => import('@/views/login/vreg/vreg.vue') }, + { + path: '/admin/cfgserv', + name: 'cfgserv', + component: () => import('@/views/admin/cfgServer/cfgServer.vue'), + reqauth: true + }, + { path: '/offline', name: 'Offline', component: () => import('@/views/offline/offline.vue') } + +] const ds_operatori: IPerson[] = [ { @@ -23,7 +239,7 @@ const ds_operatori: IPerson[] = [ 'Grazie a delle meravigliose sincronicità ho incontrato persone con cui condividere il percorso, partecipare attivamente alla conduzione di un’associazione culturale per la divulgazione delle discipline olistiche e questo percorso che sempre più chiaramente si è mostrato essere “ciò che volevo fare da grande”. Gli interessi si sono così trasformati in percorsi formativi professionali per diventare Operatrice Olistica e Naturopata.

' + 'Insieme a Cristina e Kathryna nel 2019 abbiamo deciso di fondare L’associazione SHEN per creare un centro di formazione sia per chi desidera intraprendere una professione in ambito olistico sia per chi desidera fare un percorso di crescita personale.

' + 'E di certo il cammino non è ancora finito c’è così tanto da conoscere e sperimentare...

' + - 'I due giorni più importanti della vita sono quello in cui sei nato e quello in capisci perché. (Mark Twain)', + 'I due giorni più importanti della vita sono quello in cui sei nato e quello in capisci perché. (Mark Twain)' }] const arrLangUsed = [ @@ -48,12 +264,12 @@ const functionality: IFunctionality = { SHOW_NEWSLETTER: false, SHOW_ONLY_POLICY: false, EVENTS_CAN_BOOKING: false - } export const static_data = { functionality, ds_operatori, lang_available, + preLoadImages, arrLangUsed } diff --git a/src/js/storage.js___jb_tmp___ b/src/js/storage.js___jb_tmp___ new file mode 100644 index 0000000..e69de29 diff --git a/src/layouts/menuone/menuOne.ts b/src/layouts/menuone/menuOne.ts index acbc6b0..abcdf52 100644 --- a/src/layouts/menuone/menuOne.ts +++ b/src/layouts/menuone/menuOne.ts @@ -4,6 +4,8 @@ import { GlobalStore } from '../../store/Modules' import Component from 'vue-class-component' import { static_data } from '../../db/static_data' import { tools } from '../../store/Modules/tools' +import { IListRoutes } from '@src/model' +import { UserStore } from '@modules' export default class MenuOne extends Vue { @@ -30,6 +32,10 @@ export default class MenuOne extends Vue { return GlobalStore.getters.getmenu } + public visumenu(elem) { // : IListRoutes + return (elem.onlyAdmin && UserStore.state.isAdmin) || (!elem.onlyAdmin) + } + public setParentVisibilityBasedOnRoute(parent) { parent.routes.forEach((item) => { if (this.$route.path === item.path) { @@ -50,4 +56,13 @@ export default class MenuOne extends Vue { return static_data } + public getroute(elem) { + if (elem.idelem) { + return tools.getUrlByTipoProj(elem.urlroute) + elem.idelem + } else { + return elem.path + } + + } + } diff --git a/src/layouts/menuone/menuOne.vue b/src/layouts/menuone/menuOne.vue index c92adbb..aba8b69 100644 --- a/src/layouts/menuone/menuOne.vue +++ b/src/layouts/menuone/menuOne.vue @@ -4,7 +4,7 @@ + + diff --git a/src/router/route-config.ts b/src/router/route-config.ts index e7d95f6..060d872 100644 --- a/src/router/route-config.ts +++ b/src/router/route-config.ts @@ -38,298 +38,12 @@ export interface IMyRouteConfig extends RouteConfig { } export const cfgrouter = { - routes: [ - { - path: '/', - name: RouteNames.home, - component: () => import('@/root/home/home.vue') - }, - { - path: '/signup', - name: 'Registration', - component: () => import('@/views/login/signup/signup.vue') - }, - { - path: '/signin', - name: RouteNames.login, - component: () => import('@/views/login/signin/signin.vue') - }, - { - path: '/vreg', - name: 'Verify Reg', - component: () => import('@/views/login/vreg/vreg.vue') - }, - { - path: '/todo/:category', - name: 'Todos', - component: () => import('@/views/todo-list/todo-list.vue'), - meta: { - requiresAuth: true, - async asyncData() { - await Todos.actions.dbLoad({ checkPending: false }) - } - // middleware: [auth] - } - }, - { - path: '/category', - name: 'category', - component: () => import('@/views/categories/category/category.vue') - }, - { - path: '/admin/cfgserv', - name: 'cfgserv', - component: () => import('@/views/admin/cfgServer/cfgServer.vue'), - meta: { - requiresAuth: true - // middleware: [auth] - } - }, - { - path: '/admin/testp1/:category', - name: 'Categories', - component: () => import('@/views/admin/testp1/testp1.vue') - }, - { - path: '/estimate', - name: 'Estimate', - component: () => import('@/views/pages/estimate/estimate.vue') - }, - { - path: '/offline', - name: 'Offline', - component: () => import('@/views/offline/offline.vue') - }, - // { - // path: '/malaga', - // name: 'malaga', - // component: () => import('@/root/malaga/malaga.vue') - // }, - { - path: '/' + RouteNames.projectsall + '/:idProj', - name: RouteNames.projectsall, - component: () => import('@/views/projects/proj-list/proj-list.vue'), - meta: { - requiresAuth: false, - async asyncData() { - // await Todos.actions.dbLoad({ checkPending: false }) - await Projects.actions.dbLoad({ checkPending: false, onlyiffirsttime: true }) - } - // middleware: [auth] - } - }, - { - path: '/' + RouteNames.myprojects + '/:idProj', - name: RouteNames.myprojects, - component: () => import('@/views/projects/proj-list/proj-list.vue'), - meta: { - requiresAuth: true, - async asyncData() { - // await Todos.actions.dbLoad({ checkPending: false }) - await Projects.actions.dbLoad({ checkPending: false, onlyiffirsttime: true }) - } - // middleware: [auth] - } - }, - { - path: '/' + RouteNames.projectsshared + '/:idProj', - name: RouteNames.projectsshared, - component: () => import('@/views/projects/proj-list/proj-list.vue'), - meta: { - requiresAuth: true, - async asyncData() { - // await Todos.actions.dbLoad({ checkPending: false }) - await Projects.actions.dbLoad({ checkPending: false, onlyiffirsttime: true }) - } - // middleware: [auth] - } - }, - { - path: '/' + RouteNames.listprojects, - name: RouteNames.listprojects, - component: () => import('@/views/projects/proj-list/proj-list.vue'), - meta: { - requiresAuth: true, - async asyncData() { - // await Todos.actions.dbLoad({ checkPending: false }) - await Projects.actions.dbLoad({ checkPending: false, onlyiffirsttime: true }) - } - // middleware: [auth] - } - }, - { - path: '/' + RouteNames.favouriteprojects, - name: RouteNames.favouriteprojects, - component: () => import('@/views/projects/proj-list/proj-list.vue'), - meta: { - requiresAuth: true, - async asyncData() { - // await Todos.actions.dbLoad({ checkPending: false }) - await Projects.actions.dbLoad({ checkPending: false, onlyiffirsttime: true }) - } - // middleware: [auth] - } - } - /* - - { - path: '/requestresetpwd', - component: () => import('@/views/login/requestresetpwd.vue'), - meta: { nametranslate: 'Reset your Password' } - }, - { - path: '/updatepwd', - component: () => import('@/views/login/updatepassword.vue'), - meta: { nametranslate: 'Update your Password' } - } - - { - path: '/simpleform', - component: () => import('@/views/form/simpleForm/simpleForm.vue'), - meta: { nametranslate: 'SimpleForm' } - }, - { - path: '/embeeded', - component: () => import('@/views/form/embeeded/embeeded.vue'), - meta: { nametranslate: 'Embeeded' } - }*/ - ], getmenu() { - const arrlista = GlobalStore.state.listatodo - const lista: IListRoutes[] = [] - - arrlista.forEach((elem: IMenuList) => { - const item: IListRoutes = { - faIcon: 'fa fa-list-alt', - materialIcon: 'todo', - name: 'pages.' + elem.description, - route: '/todo/' + elem.nametranslate - } - lista.push(item) - }) - - const SHOW_PROJINTHEMENU = false - - let arrlistafavourite = [] - let arrlistaprojtutti = [] - let arrlistaprojmiei = [] - if (SHOW_PROJINTHEMENU) { - arrlistaprojtutti = Projects.getters.listaprojects(RouteNames.projectsall) - arrlistaprojmiei = Projects.getters.listaprojects(RouteNames.myprojects) - arrlistafavourite = Projects.getters.listaprojects(RouteNames.favouriteprojects) - } - - const arrMenu: IMenuList[] = [] - - // PROGETTI -> FAVORITI : - if (arrlistafavourite.length > 0) { - arrMenu.push({ - icon: 'favorite_border', - nametranslate: 'pages.' + RouteNames.favouriteprojects, - urlroute: RouteNames.favouriteprojects, - level_parent: 0.0, - level_child: 0.5, - routes2: arrlistafavourite, - idelem: '' - }) - } - - // PROGETTI -> TUTTI : - arrMenu.push({ - icon: 'accessibility_new', - nametranslate: 'pages.' + RouteNames.projectsall, - urlroute: RouteNames.projectsall, - level_parent: 0.0, - level_child: 0.5, - routes2: [], - idelem: process.env.PROJECT_ID_MAIN - }) - - // PROGETTI -> CONDIVISI : - arrMenu.push({ - icon: 'people_outline', - nametranslate: 'pages.' + RouteNames.projectsshared, - urlroute: RouteNames.projectsshared, - level_parent: 0.0, - level_child: 0.5, - routes2: arrlistaprojtutti, - idelem: process.env.PROJECT_ID_MAIN - }) - - // PROGETTI -> PERSONALI : - arrMenu.push({ - icon: 'person', - nametranslate: 'pages.' + RouteNames.myprojects, - urlroute: RouteNames.myprojects, - level_parent: 0.0, - level_child: 0.5, - routes2: arrlistaprojmiei, - idelem: process.env.PROJECT_ID_MAIN - }) - - const listaprojectMenu: IListRoutes[] = tools.convertMenuListInListRoutes(arrMenu) - const arrroutes: IListRoutes[] = [] - tools.addRoute(arrroutes, { route: '/', faIcon: 'fa fa-home', materialIcon: 'home', name: 'pages.home' }) // HOME - - tools.addRoute(arrroutes, { - route: '/todo', faIcon: 'fa fa-list-alt', materialIcon: 'format_list_numbered', name: 'pages.Todo', - routes2: lista, - level_parent: 0.5, - level_child: 0.5 - }) - - const myarrproj = [] - for (const myitem of listaprojectMenu) { - tools.addRoute(myarrproj, myitem) - } - - tools.addRoute(arrroutes, { - route: '', faIcon: 'fa fa-list-alt', materialIcon: 'next_week', name: 'pages.projects', - routes2: myarrproj, - level_parent: 0.0, - level_child: 0.5 - }) - - console.log('arrroutes', arrroutes) - console.log('listaprojectMenu', listaprojectMenu) - // console.log('arrlistaprojmiei', arrlistaprojmiei) - - if (UserStore.state.isAdmin) { - tools.addRoute(arrroutes, { - route: '/category', - faIcon: 'fa fa-list-alt', - materialIcon: 'category', - name: 'pages.Category', - level_parent: 0.0, - level_child: 0.0 - }) - tools.addRoute(arrroutes, { - route: '/admin/cfgserv', - faIcon: 'fa fa-database', - materialIcon: 'event_seat', - name: 'pages.Admin', - level_parent: 0.0, - level_child: 0.0 - }) - tools.addRoute(arrroutes, { - route: '/admin/testp1/par1', - faIcon: 'fa fa-database', - materialIcon: 'restore', - name: 'pages.Test1', - level_parent: 0.0, - level_child: 0.0 - }) - tools.addRoute(arrroutes, { - route: '/admin/testp1/par2', - faIcon: 'fa fa-database', - materialIcon: 'restore', - name: 'pages.Test2', - level_parent: 0.0, - level_child: 0.0 - }) + for (const route of static_data.routes) { + tools.addRoute(arrroutes, route) } return arrroutes diff --git a/src/shims-quasar.d.ts b/src/shims-quasar.d.ts new file mode 100644 index 0000000..e5b079e --- /dev/null +++ b/src/shims-quasar.d.ts @@ -0,0 +1,13 @@ +import Vue from 'vue' + +declare module 'vue/types/vue' { + interface Vue { + $q: any + } +} + +declare module 'vue/types/options' { + interface ComponentOptions { + preFectch?: (options: any) => void | Promise + } +} diff --git a/src/shims-vue.d.ts b/src/shims-vue.d.ts new file mode 100644 index 0000000..d9f24fa --- /dev/null +++ b/src/shims-vue.d.ts @@ -0,0 +1,4 @@ +declare module '*.vue' { + import Vue from 'vue' + export default Vue +} diff --git a/src/statics/i18n.js b/src/statics/i18n.js index 1ecde40..7c2aae4 100644 --- a/src/statics/i18n.js +++ b/src/statics/i18n.js @@ -967,31 +967,26 @@ const messages = { ...msgit, pages: { ...msg_website.it.pages, ...msgglobal.it.pages }, msg: { ...msg_website.it.msg, ...msgglobal.it.msg }, - homepage: { ...msg_website.it.homepage, ...msgglobal.it.homepage } }, es: { ...msges, pages: { ...msg_website.es.pages, ...msgglobal.es.pages }, msg: { ...msg_website.es.msg, ...msgglobal.es.msg }, - homepage: { ...msg_website.es.homepage, ...msgglobal.es.homepage } }, enUs: { ...msgenUs, pages: { ...msg_website.enUs.pages, ...msgglobal.enUs.pages }, msg: { ...msg_website.enUs.msg, ...msgglobal.enUs.msg }, - homepage: { ...msg_website.enUs.homepage, ...msgglobal.enUs.homepage } }, fr: { ...msgfr, pages: { ...msg_website.fr.pages, ...msgglobal.fr.pages }, msg: { ...msg_website.fr.msg, ...msgglobal.fr.msg }, - homepage: { ...msg_website.fr.homepage, ...msgglobal.fr.homepage }, }, de: { ...msgde, pages: { ...msg_website.de.pages, ...msgglobal.de.pages }, msg: { ...msg_website.de.msg, ...msgglobal.de.msg }, - homepage: { ...msg_website.de.homepage, ...msgglobal.de.homepage }, } } diff --git a/src/statics/images/imglogonotif.png b/src/statics/images/imglogonotif.png new file mode 100644 index 0000000..b5e10db Binary files /dev/null and b/src/statics/images/imglogonotif.png differ diff --git a/src/statics/js/workbox-sw-3-0-0.js b/src/statics/js/workbox-sw-3-0-0.js new file mode 100644 index 0000000..86617af --- /dev/null +++ b/src/statics/js/workbox-sw-3-0-0.js @@ -0,0 +1,3 @@ +var workbox=function(){"use strict";try{self.workbox.v["workbox:sw:3.0.0"]=1}catch(t){}const t="https://storage.googleapis.com/workbox-cdn/releases/3.0.0",e={backgroundSync:"background-sync",core:"core",expiration:"cache-expiration",googleAnalytics:"google-analytics",strategies:"strategies",precaching:"precaching",routing:"routing",cacheableResponse:"cacheable-response",broadcastUpdate:"broadcast-cache-update",rangeRequests:"range-requests"};return new class{constructor(){return this.v={},this.t={debug:"localhost"===self.location.hostname,modulePathPrefix:null,modulePathCb:null},this.e=this.t.debug?"dev":"prod",this.s=!1,new Proxy(this,{get(t,s){if(t[s])return t[s];const o=e[s];return o&&t.loadModule(`workbox-${o}`),t[s]}})}setConfig(t={}){if(this.s)throw new Error("Config must be set before accessing workbox.* modules");Object.assign(this.t,t),this.e=this.t.debug?"dev":"prod"}skipWaiting(){self.addEventListener("install",()=>self.skipWaiting())}clientsClaim(){self.addEventListener("activate",()=>self.clients.claim())}loadModule(t){const e=this.o(t);try{importScripts(e),this.s=!0}catch(s){throw console.error(`Unable to import module '${t}' from '${e}'.`),s}}o(e){if(this.t.modulePathCb)return this.t.modulePathCb(e,this.t.debug);let s=[t];const o=`${e}.${this.e}.js`,r=this.t.modulePathPrefix;return r&&""===(s=r.split("/"))[s.length-1]&&s.splice(s.length-1,1),s.push(o),s.join("/")}}}(); + +//# sourceMappingURL=workbox-sw.js.map diff --git a/src/statics/js/workbox-sw.js b/src/statics/js/workbox-sw.js new file mode 100644 index 0000000..0908b00 --- /dev/null +++ b/src/statics/js/workbox-sw.js @@ -0,0 +1,3 @@ +var workbox=function(){"use strict";try{self.workbox.v["workbox:sw:3.4.1"]=1}catch(t){}const t="https://storage.googleapis.com/workbox-cdn/releases/3.4.1",e={backgroundSync:"background-sync",broadcastUpdate:"broadcast-cache-update",cacheableResponse:"cacheable-response",core:"core",expiration:"cache-expiration",googleAnalytics:"google-analytics",navigationPreload:"navigation-preload",precaching:"precaching",rangeRequests:"range-requests",routing:"routing",strategies:"strategies",streams:"streams"};return new class{constructor(){return this.v={},this.t={debug:"localhost"===self.location.hostname,modulePathPrefix:null,modulePathCb:null},this.e=this.t.debug?"dev":"prod",this.s=!1,new Proxy(this,{get(t,s){if(t[s])return t[s];const o=e[s];return o&&t.loadModule(`workbox-${o}`),t[s]}})}setConfig(t={}){if(this.s)throw new Error("Config must be set before accessing workbox.* modules");Object.assign(this.t,t),this.e=this.t.debug?"dev":"prod"}skipWaiting(){self.addEventListener("install",()=>self.skipWaiting())}clientsClaim(){self.addEventListener("activate",()=>self.clients.claim())}loadModule(t){const e=this.o(t);try{importScripts(e),this.s=!0}catch(s){throw console.error(`Unable to import module '${t}' from '${e}'.`),s}}o(e){if(this.t.modulePathCb)return this.t.modulePathCb(e,this.t.debug);let s=[t];const o=`${e}.${this.e}.js`,r=this.t.modulePathPrefix;return r&&""===(s=r.split("/"))[s.length-1]&&s.splice(s.length-1,1),s.push(o),s.join("/")}}}(); + +//# sourceMappingURL=workbox-sw.js.map diff --git a/src/statics/js/workbox-sw3-4-1.js b/src/statics/js/workbox-sw3-4-1.js new file mode 100644 index 0000000..0908b00 --- /dev/null +++ b/src/statics/js/workbox-sw3-4-1.js @@ -0,0 +1,3 @@ +var workbox=function(){"use strict";try{self.workbox.v["workbox:sw:3.4.1"]=1}catch(t){}const t="https://storage.googleapis.com/workbox-cdn/releases/3.4.1",e={backgroundSync:"background-sync",broadcastUpdate:"broadcast-cache-update",cacheableResponse:"cacheable-response",core:"core",expiration:"cache-expiration",googleAnalytics:"google-analytics",navigationPreload:"navigation-preload",precaching:"precaching",rangeRequests:"range-requests",routing:"routing",strategies:"strategies",streams:"streams"};return new class{constructor(){return this.v={},this.t={debug:"localhost"===self.location.hostname,modulePathPrefix:null,modulePathCb:null},this.e=this.t.debug?"dev":"prod",this.s=!1,new Proxy(this,{get(t,s){if(t[s])return t[s];const o=e[s];return o&&t.loadModule(`workbox-${o}`),t[s]}})}setConfig(t={}){if(this.s)throw new Error("Config must be set before accessing workbox.* modules");Object.assign(this.t,t),this.e=this.t.debug?"dev":"prod"}skipWaiting(){self.addEventListener("install",()=>self.skipWaiting())}clientsClaim(){self.addEventListener("activate",()=>self.clients.claim())}loadModule(t){const e=this.o(t);try{importScripts(e),this.s=!0}catch(s){throw console.error(`Unable to import module '${t}' from '${e}'.`),s}}o(e){if(this.t.modulePathCb)return this.t.modulePathCb(e,this.t.debug);let s=[t];const o=`${e}.${this.e}.js`,r=this.t.modulePathPrefix;return r&&""===(s=r.split("/"))[s.length-1]&&s.splice(s.length-1,1),s.push(o),s.join("/")}}}(); + +//# sourceMappingURL=workbox-sw.js.map diff --git a/src/store/Modules/ApiTables.ts b/src/store/Modules/ApiTables.ts index 722da06..92d53f3 100644 --- a/src/store/Modules/ApiTables.ts +++ b/src/store/Modules/ApiTables.ts @@ -46,7 +46,7 @@ async function dbInsertSave(call, item, method) { console.log('dbInsertSave', item, method) - if (UserStore.state.userId === '') { + if (UserStore.getters.isUserInvalid) { return false } // Login not made @@ -76,7 +76,7 @@ async function dbDeleteItem(call, item) { if (!('serviceWorker' in navigator)) { // console.log('dbdeleteItem', item) - if (UserStore.state.userId === '') { + if (UserStore.getters.isUserInvalid) { return false } // Login not made @@ -234,6 +234,7 @@ async function checkPendingMsg() { } } } catch (e) { + // ... } return new Promise((resolve, reject) => { diff --git a/src/store/Modules/BookingStore.ts b/src/store/Modules/BookingStore.ts new file mode 100644 index 0000000..a85c148 --- /dev/null +++ b/src/store/Modules/BookingStore.ts @@ -0,0 +1,65 @@ +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('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 diff --git a/src/store/Modules/GlobalStore.ts b/src/store/Modules/GlobalStore.ts index d90ce31..12afe48 100644 --- a/src/store/Modules/GlobalStore.ts +++ b/src/store/Modules/GlobalStore.ts @@ -19,6 +19,7 @@ import globalroutines from './../../globalroutines/index' import { cfgrouter } from '../../router/route-config' +// import { static_data } from '@src/db/static_data' let stateConnDefault = 'online' @@ -291,6 +292,10 @@ namespace Actions { // return // } + // if (!static_data.functionality.PWA) { + // return + // } + if (!('serviceWorker' in navigator)) { return } @@ -337,11 +342,15 @@ namespace Actions { // Calling the Server to Save in the MongoDB the Subscriber function saveNewSubscriptionToServer(context, newSub) { // If already subscribed, exit + if (true) { + return + } + if (!newSub) { return } - if (UserStore.state.userId === undefined || UserStore.state.tokens[0] === undefined) { + if (UserStore.getters.isUserInvalid) { return } diff --git a/src/store/Modules/Projects.ts b/src/store/Modules/Projects.ts index 599b6d3..1b23b22 100644 --- a/src/store/Modules/Projects.ts +++ b/src/store/Modules/Projects.ts @@ -58,14 +58,19 @@ function updateDataCalculated(projout, projin) { } function getproj(projects, idproj, tipoproj: string) { - console.log('getproj', tipoproj) + + let ris = null if (tipoproj === RouteNames.myprojects) - return projects.filter((proj) => (proj.id_parent === idproj) && (proj.userId === UserStore.state.userId) && (proj.privacyread === Privacy.onlyme)) + ris = projects.filter((proj) => (proj.id_parent === idproj) && (proj.userId === UserStore.state.userId) && (proj.privacyread === Privacy.onlyme)) else if (tipoproj === RouteNames.projectsshared) - return projects.filter((proj) => (proj.id_parent === idproj) && (proj.userId === UserStore.state.userId) && (proj.privacyread !== Privacy.onlyme)) + ris = projects.filter((proj) => (proj.id_parent === idproj) && (proj.userId === UserStore.state.userId) && (proj.privacyread !== Privacy.onlyme)) else if (tipoproj === RouteNames.projectsall) - return projects.filter((proj) => (proj.id_parent === idproj) && (proj.userId !== UserStore.state.userId) ) + ris = projects.filter((proj) => (proj.id_parent === idproj) && (proj.userId !== UserStore.state.userId) ) + + // console.log('idproj', idproj, 'projects', projects, 'getproj', tipoproj, 'ris=', ris) + + return ris } namespace Getters { @@ -115,7 +120,7 @@ namespace Getters { const projs_dacompletare = b.read((state: IProjectsState) => (id_parent: string, tipoproj: string): IProject[] => { // console.log('projs_dacompletare') if (state.projects) { - // console.log('state.projects', state.projects) + // console.log('projs_dacompletare', state.projects) return getproj(state.projects, id_parent, tipoproj) } else { return [] @@ -130,7 +135,7 @@ namespace Getters { for (const proj of listaproj) { myarr.push({ nametranslate: '', description: proj.descr, idelem: proj._id }) } - // console.log(' myarr', myarr, listaproj) + console.log(' myarr', myarr, listaproj) return myarr } else { diff --git a/src/store/Modules/Store/calendar/CalendarStore.ts b/src/store/Modules/Store/calendar/CalendarStore.ts index 80806f0..cdb5dda 100644 --- a/src/store/Modules/Store/calendar/CalendarStore.ts +++ b/src/store/Modules/Store/calendar/CalendarStore.ts @@ -70,11 +70,17 @@ namespace Mutations { namespace Actions { async function loadAfterLogin(context) { + console.log('CalendarStore: loadAfterLogin') // Load local data state.editable = db_data.userdata.calendar_editable state.eventlist = db_data.events // state.bookedevent = db_data.userdata.bookedevent + if (UserStore.getters.isUserInvalid) { + state.bookedevent = [] + return false + } + // Load local data console.log('CALENDAR loadAfterLogin', 'userid=', UserStore.state.userId) diff --git a/src/store/Modules/Todos.ts b/src/store/Modules/Todos.ts index 3335c7b..dab56ca 100644 --- a/src/store/Modules/Todos.ts +++ b/src/store/Modules/Todos.ts @@ -41,7 +41,7 @@ function getindexbycategory(category: string) { return state.categories.indexOf(category) } -function gettodosByCategory(category: string): [] { +function gettodosByCategory(category: string): any[] { const indcat = state.categories.indexOf(category) if (!state.todos[indcat]) { return [] @@ -109,8 +109,8 @@ namespace Getters { }, 'items_dacompletare') const todos_completati = b.read((stateparam: ITodosState) => (cat: string): ITodo[] => { - console.log('todos_completati') const indcat = getindexbycategory(cat) + console.log('todos_completati', cat, 'indcat=', indcat, 'state.categories=', state.categories) if (stateparam.todos[indcat]) { let arrout = [] if (stateparam.showtype === costanti.ShowTypeTask.SHOW_LAST_N_COMPLETED) { // Show only the first N completed @@ -126,6 +126,8 @@ namespace Getters { arrout = [] } + console.log('arrout', arrout) + return arrout // return tools.mapSort(arrout) diff --git a/src/store/Modules/UserStore.ts b/src/store/Modules/UserStore.ts index fdb2f19..9c512cc 100644 --- a/src/store/Modules/UserStore.ts +++ b/src/store/Modules/UserStore.ts @@ -37,13 +37,22 @@ const state: IUserState = { } const b = storeBuilder.module('UserModule', state) -const stateGetter = b.state() namespace Getters { // const fullName = b.read(function fullName(state): string { // return state.userInfos.firstname?capitalize(state.userInfos.firstname) + " " + capitalize(state.userInfos.lastname):null; // }) + const isUserInvalid = b.read((mystate) => { + try { + const ris = (mystate.userId === undefined) || (mystate.userId.trim() === '') || (mystate.tokens[0] === undefined) + // console.log('state.userId', state.userId, 'ris', ris) + return ris + } catch (e) { + return true + } + }, 'isUserInvalid') + const lang = b.read((state) => { if (state.lang !== '') { return state.lang @@ -85,6 +94,9 @@ namespace Getters { }, 'IsMyGroup') export const getters = { + get isUserInvalid() { + return isUserInvalid() + }, get lang() { return lang() }, @@ -144,6 +156,7 @@ namespace Mutations { function setlang(state: IUserState, newstr: string) { console.log('SETLANG', newstr) state.lang = newstr + tools.setLangAtt(newstr) localStorage.setItem(tools.localStorage.lang, state.lang) } @@ -326,7 +339,7 @@ namespace Actions { password: String(hashedPassword), username: authData.username, name: authData.name, - surname: authData.surname, + surname: authData.surname } console.log(usertosend) @@ -395,16 +408,19 @@ namespace Actions { let sub = null try { - if ('serviceWorker' in navigator) { - sub = await navigator.serviceWorker.ready - .then(function (swreg) { - console.log('swreg') - const sub = swreg.pushManager.getSubscription() - return sub - }) - .catch((e) => { - sub = null - }) + if (static_data.functionality.PWA) { + if ('serviceWorker' in navigator) { + sub = await navigator.serviceWorker.ready + .then((swreg) => { + console.log('swreg') + sub = swreg.pushManager.getSubscription() + return sub + }) + .catch((e) => { + console.log(' ERROR ') + sub = null + }) + } } } catch (e) { console.log('Err navigator.serviceWorker.ready ... GetSubscription:', e) @@ -424,7 +440,6 @@ namespace Actions { options } - // console.log('PASSO 4') if (process.env.DEBUG === '1') { console.log(usertosend) } @@ -433,7 +448,7 @@ namespace Actions { let myres: any - console.log('Api.SendReq') + // console.log('Api.SendReq') return Api.SendReq('/users/login', 'POST', usertosend, true) .then((res) => { @@ -535,7 +550,7 @@ namespace Actions { } async function setGlobal(isLogged: boolean) { - // console.log('setGlobal') + console.log('setGlobal') // state.isLogged = true state.isLogged = isLogged if (isLogged) { @@ -557,6 +572,7 @@ namespace Actions { if (static_data.functionality.ENABLE_PROJECTS_LOADING) await Projects.actions.dbLoad({ checkPending: true, onlyiffirsttime: true }) + console.log('setGlobal: END') } async function autologin_FromLocalStorage(context) { @@ -636,6 +652,8 @@ namespace Actions { } } +const stateGetter = b.state() + // Module const UserModule = { get state() { diff --git a/src/store/Modules/tools.ts b/src/store/Modules/tools.ts index d304198..5799591 100644 --- a/src/store/Modules/tools.ts +++ b/src/store/Modules/tools.ts @@ -12,6 +12,7 @@ import { RouteNames } from '@src/router/route-names' import { lists } from './lists' import { static_data } from '@src/db/static_data' import { IColl, ITimeLineEntry, ITimeLineMain } from '@src/model/GlobalStore' +import { func_tools } from '@src/store/Modules/toolsext' export interface INotify { color?: string | 'primary' @@ -97,7 +98,7 @@ export const tools = { id: 5, label: '5', value: 5 - }, + } ] , @@ -1303,7 +1304,7 @@ export const tools = { executefunc(myself: any, myfunc: number, par: IParamDialog) { if (myfunc === costanti.FuncDialog.CANCEL_BOOKING) { console.log(' ENTRATO ! CancelBookingEvent ') - CalendarStore.actions.CancelBookingEvent(par.param1).then(ris => { + CalendarStore.actions.CancelBookingEvent(par.param1).then((ris) => { if (ris) tools.showPositiveNotif(myself.$q, myself.$t('cal.canceledbooking') + ' "' + par.param1.title + '"') else @@ -1368,7 +1369,7 @@ export const tools = { checkIfUserExist(mythis) { - if (UserStore.state.userId === undefined) { + if (UserStore.getters.isUserInvalid) { tools.showNotif(mythis.$q, mythis.$t('todo.usernotdefined')) return false } @@ -1384,7 +1385,7 @@ export const tools = { , checkLangPassed(mylang) { - // console.log('checkLangPassed') + console.log('checkLangPassed') const mybrowserLang = Quasar.lang.isoName @@ -1406,7 +1407,7 @@ export const tools = { console.log('non incluso ', mylang) mylang = static_data.arrLangUsed[0] - // Metti Inglese come default + // Metti come default UserStore.mutations.setlang(mylang) } } @@ -1817,7 +1818,7 @@ export const tools = { if (myheight > 1000) { maxheight = 1000 } else { - maxheight = parseInt(myheight, 10) + maxheight = parseInt(myheight, 10) } } } else { @@ -2058,7 +2059,7 @@ export const tools = { getimgFullpathbysize(fileimg: string) { const ind = fileimg.lastIndexOf('/') if (ind > 0) { - return { path: fileimg.substring(0, ind + 1) , file: fileimg.substring(ind + 1) } + return { path: fileimg.substring(0, ind + 1), file: fileimg.substring(ind + 1) } } else { return { path: '', file: fileimg } } @@ -2074,6 +2075,37 @@ export const tools = { msg = msg.replace('
', '\n') return msg + }, + gettextevent(myevent) { + return '"' + myevent.title + '" (' + this.getDateStr(myevent.date) + ') - ' + myevent.time + }, + + setLangAtt(mylang) { + console.log('setLangAtt =', mylang) + // console.log('PRIMA this.$q.lang.isoName', this.$q.lang.isoName) + + // dynamic import, so loading on demand only + import(`quasar/lang/${mylang}`).then((lang) => { + console.log(' Import dinamically lang =', lang) + Quasar.lang.set(lang.default) + import(`../../statics/i18n`).then(() => { + console.log(' *** MY LANG DOPO=', Quasar.lang.isoName) + }) + }) + + // this.$q.lang.set(mylang) + + }, + getappname(mythis) { + if (mythis === undefined) + return '' + if (mythis.$t === undefined) + return '' + if (Screen.width < 400) { + return mythis.$t('msg.myAppNameShort') + } else { + return mythis.$t('msg.myAppName') + } } // getLocale() { diff --git a/src/views/login/signin/signin.ts b/src/views/login/signin/signin.ts index 787f93b..209e0f7 100644 --- a/src/views/login/signin/signin.ts +++ b/src/views/login/signin/signin.ts @@ -1,4 +1,5 @@ -import { GlobalStore, UserStore } from '@store' +import { GlobalStore } from '@store' +import { UserStore } from '../../../store/Modules' import Vue from 'vue' import { Component, Prop, Watch } from 'vue-property-decorator' import { serv_constants } from '../../../store/Modules/serv_constants' @@ -58,12 +59,22 @@ export default class Signin extends Vue { public errorMsg(cosa: string, item: any) { try { - if (!item.$error) { return '' } - if (item.$params.email && !item.email) { return this.$t('reg.err.email') } + if (!item.$error) { + return '' + } + if (item.$params.email && !item.email) { + return this.$t('reg.err.email') + } - if (!item.required) { return this.$t('reg.err.required') } - if (!item.minLength) { return this.$t('reg.err.atleast') + ` ${item.$params.minLength.min} ` + this.$t('reg.err.char') } - if (!item.maxLength) { return this.$t('reg.err.notmore') + ` ${item.$params.maxLength.max} ` + this.$t('reg.err.char') } + if (!item.required) { + return this.$t('reg.err.required') + } + if (!item.minLength) { + return this.$t('reg.err.atleast') + ` ${item.$params.minLength.min} ` + this.$t('reg.err.char') + } + if (!item.maxLength) { + return this.$t('reg.err.notmore') + ` ${item.$params.maxLength.max} ` + this.$t('reg.err.char') + } return '' } catch (error) { // console.log("ERR : " + error); @@ -74,17 +85,17 @@ export default class Signin extends Vue { // console.log('checkErrors: ', riscode) try { if (riscode === tools.OK) { - tools.showNotif(this.$q, this.$t('login.completato'), { color: 'positive', icon: 'check'}) + tools.showNotif(this.$q, this.$t('login.completato'), { color: 'positive', icon: 'check' }) this.$router.push('/') } else if (riscode === serv_constants.RIS_CODE_LOGIN_ERR) { // Wait N seconds to avoid calling many times... - return new Promise(function(resolve, reject) { - setTimeout(function() { + return new Promise(function (resolve, reject) { + setTimeout(function () { resolve('anything') }, 3000) }).then(() => { - setTimeout( () => { + setTimeout(() => { this.$q.loading.hide() }, 200) tools.showNotif(this.$q, this.$t('login.errato')) @@ -103,7 +114,7 @@ export default class Signin extends Vue { if (riscode !== serv_constants.RIS_CODE_LOGIN_ERR) { this.iswaitingforRes = false - setTimeout( () => { + setTimeout(() => { this.$q.loading.hide() }, 200) } @@ -135,6 +146,7 @@ export default class Signin extends Vue { } public submit() { + console.log('submit LOGIN') this.$v.signin.$touch() if (this.$v.signin.$error) { @@ -146,7 +158,7 @@ export default class Signin extends Vue { if (process.env.DEBUG) { msg += ' ' + process.env.MONGODB_HOST } - this.$q.loading.show({ message: msg}) + this.$q.loading.show({ message: msg }) // disable Button Login: this.iswaitingforRes = true @@ -158,10 +170,15 @@ export default class Signin extends Vue { .then((riscode) => { // console.log('signin FINITO CALL: riscode=', riscode) if (riscode === tools.OK) { - router.push('/signin') + // router.push('/signin') } return riscode - }).then((riscode) => { + }) + .then((riscode) => { + if (process.env.DEBUG) { + console.log(' riscode=', riscode) + } + if (toolsext.getLocale() !== '') { this.$i18n.locale = toolsext.getLocale() } // Set Lang @@ -169,7 +186,10 @@ export default class Signin extends Vue { UserStore.mutations.setlang(this.$i18n.locale) } // Set Lang - // console.log('LANG ORA=', toolsext.getLocale()) + + if (process.env.DEBUG) { + console.log('LANG ORA=', toolsext.getLocale()) + } globalroutines(this, 'loadapp', '') return riscode diff --git a/src/views/projects/proj-list/proj-list.ts b/src/views/projects/proj-list/proj-list.ts index a6adc0f..a5b476e 100644 --- a/src/views/projects/proj-list/proj-list.ts +++ b/src/views/projects/proj-list/proj-list.ts @@ -57,9 +57,9 @@ export default class ProjList extends Vue { public percProgress: string = 'percProgress' public readonly: boolean = false - public selectStatus: [] = tools.selectStatus[toolsext.getLocale()] - public selectPhase: [] = tools.selectPhase[toolsext.getLocale()] - public selectPrivacy: [] = tools.selectPrivacy[toolsext.getLocale()] + public selectStatus: any[] = tools.selectStatus[toolsext.getLocale()] + public selectPhase: any[] = tools.selectPhase[toolsext.getLocale()] + public selectPrivacy: any[] = tools.selectPrivacy[toolsext.getLocale()] public $refs: { singleproject: SingleProject[], diff --git a/src/views/projects/proj-list/proj-list.vue b/src/views/projects/proj-list/proj-list.vue index ada8b29..c9af31e 100644 --- a/src/views/projects/proj-list/proj-list.vue +++ b/src/views/projects/proj-list/proj-list.vue @@ -10,7 +10,7 @@