Merge pull request #25 from paoloar77/Booking

Booking
This commit is contained in:
Paolo Arena
2019-10-10 16:02:56 +02:00
committed by GitHub
41 changed files with 867 additions and 441 deletions

View File

@@ -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) {
}
}

View File

@@ -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)
}
}

View File

@@ -0,0 +1,15 @@
<template>
<div>
<q-parallax :src="getsrc" :height="tools.myheight_imgtitle(myheight, myheightmobile)">
<h2 class="text-white center_to_image title">{{title}}</h2>
<div v-if="legendinside" class="mylegendinside absolute-bottom custom-caption center_to_image" v-html="legendinside"></div>
</q-parallax>
<div v-if="legend" class="mylegend" v-html="legend"></div>
</div>
</template>
<script lang="ts" src="./CImgTitle.ts">
</script>
<style lang="scss" scoped>
@import './CImgTitle.scss';
</style>

View File

@@ -0,0 +1 @@
export {default as CImgTitle} from './CImgTitle.vue'

View File

@@ -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;
}
}

View File

@@ -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
}
}
}

View File

@@ -0,0 +1,14 @@
<template>
<div id="preloader">
<div v-for="(image, index) in arrimg">
<img :src="getimg(image)" width="1" height="1"/>
</div>
</div>
</template>
<script lang="ts" src="./CPreloadImages.ts">
</script>
<style lang="scss" scoped>
@import './CPreloadImages.scss';
</style>

View File

@@ -0,0 +1 @@
export {default as CPreloadImages} from './CPreloadImages.vue'

View File

@@ -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
}
}

View File

@@ -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',

View File

@@ -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: {
},
}
}

View File

@@ -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 unassociazione 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.<br><br>' +
'Insieme a Cristina e Kathryna nel 2019 abbiamo deciso di fondare Lassociazione 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.<br><br>' +
'E di certo il cammino non è ancora finito cè così tanto da conoscere e sperimentare...<br><br>' +
'<span class="citazione">I due giorni più importanti della vita sono quello in cui sei nato e quello in capisci perché. (Mark Twain)</span>',
'<span class="citazione">I due giorni più importanti della vita sono quello in cui sei nato e quello in capisci perché. (Mark Twain)</span>'
}]
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
}

View File

View File

@@ -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
}
}
}

View File

@@ -4,7 +4,7 @@
<template v-for="(parent, index) in getmenu">
<!--<div class="q-list-header">{{replaceUnderlineToSpace(index)}}</div>-->
<div v-for="myitemmenu in static_data.routes">
<div v-if="!!myitemmenu.routes2 && myitemmenu.inmenu">
<div v-if="!!myitemmenu.routes2 && myitemmenu.inmenu && visumenu(myitemmenu)">
<q-expansion-item
:header-inset-level="myitemmenu.level_parent"
:content-inset-level="myitemmenu.level_parent"
@@ -16,7 +16,7 @@
<q-expansion-item v-for="(child2, index) in myitemmenu.routes2"
:key="index"
:to="child2.path"
:to="getroute(child2)"
:header-inset-level="child2.level_child"
:duration="300"
:icon="child2.materialIcon"
@@ -26,7 +26,7 @@
:label="tools.getLabelByItem(child2, mythis)">
<q-expansion-item v-if="!!child2.routes2" v-for="(child3, index) in child2.routes2"
:key="index"
:to="child3.path"
:to="getroute(child3)"
:header-inset-level="child3.level_child"
:duration="300"
:icon="child3.materialIcon"
@@ -42,11 +42,11 @@
</q-expansion-item>
</div>
<div v-else>
<div v-if="myitemmenu.inmenu && !myitemmenu.submenu">
<div v-if="myitemmenu.inmenu && !myitemmenu.submenu && visumenu(myitemmenu)">
<q-slide-transition :duration=200>
<div v-show="true">
<q-expansion-item
:to="myitemmenu.path"
:to="getroute(myitemmenu)"
:header-inset-level="myitemmenu.level_parent"
:content-inset-level="myitemmenu.level_parent"
:label="tools.getLabelByItem(myitemmenu, mythis)"

View File

@@ -0,0 +1,7 @@
import { IAction } from '@src/model/Projects'
import { Component } from 'vue-router/types/router'
import { IEvents } from '@src/model/Calendar'
export interface IBookingState {
bookinglist: IEvents[]
}

View File

@@ -82,12 +82,17 @@ export interface IListRoutes {
solotitle?: boolean
infooter?: boolean
submenu?: boolean
onlyAdmin?: boolean
meta?: any
idelem?: string
urlroute?: string
// ------------------------
faIcon?: string
text?: string
routes2?: IListRoutes[]
level_parent?: number
level_child?: number
separator?: boolean
}
export interface IPerson {
@@ -186,11 +191,12 @@ export interface IParamDialog {
}
export interface IFunctionality {
PWA?: boolean
SHOW_USER_MENU?: boolean
SHOW_IF_IS_SERVER_CONNECTION?: boolean
ENABLE_TODOS_LOADING?: boolean
ENABLE_PROJECTS_LOADING?: boolean
SHOW_NEWSLETTER?: boolean
SHOW_ONLY_POLICY?: boolean
EVENTS_CAN_BOOKING?: false
BOOKING_EVENTS?: boolean
}

1
src/quasar.d.ts vendored Normal file
View File

@@ -0,0 +1 @@
declare module 'quasar'

View File

21
src/root/policy/policy.ts Normal file
View File

@@ -0,0 +1,21 @@
import Vue from 'vue'
import { Component } from 'vue-property-decorator'
import { static_data } from '@src/db/static_data'
import { PagePolicy } from '../../components/PagePolicy'
@Component({
name: 'Policy',
components: { PagePolicy }
})
export default class Policy extends Vue {
public mioalert = false
get static_data() {
return static_data
}
}

View File

@@ -0,0 +1,28 @@
<template>
<q-page class="">
<div class="landing">
<PagePolicy
owneremail="info@associazioneshen.it"
SiteName="Associazione Shen"
ownerDataName="Associazione Shen"
managerData="Cristina Barattoni"
includeData="dati anagrafici (ragione sociale, nome, cognome), recapiti (telefono, indirizzo email)"
url="www.associazioneshen.it"
lastdataupdate="11 luglio 2019"
country="Italia"
>
</PagePolicy>
<Footer></Footer>
</div>
</q-page>
</template>
<script lang="ts" src="./policy.ts">
</script>
<style lang="scss" scoped>
@import './policy.scss';
</style>

View File

@@ -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

13
src/shims-quasar.d.ts vendored Normal file
View File

@@ -0,0 +1,13 @@
import Vue from 'vue'
declare module 'vue/types/vue' {
interface Vue {
$q: any
}
}
declare module 'vue/types/options' {
interface ComponentOptions<V extends Vue> {
preFectch?: (options: any) => void | Promise<void>
}
}

4
src/shims-vue.d.ts vendored Normal file
View File

@@ -0,0 +1,4 @@
declare module '*.vue' {
import Vue from 'vue'
export default Vue
}

View File

@@ -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 },
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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) => {

View File

@@ -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<IBookingState>('BookingModule', state)
// Getters
namespace Getters {
export const getters = {
}
}
namespace Mutations {
export const mutations = {
}
}
namespace Actions {
async function loadAfterLogin(context) {
return true
}
export const actions = {
loadAfterLogin: b.dispatch(loadAfterLogin)
}
}
const stateGetter = b.state()
// Module
const BookingModule = {
get state() {
return stateGetter()
},
actions: Actions.actions,
getters: Getters.getters,
mutations: Mutations.mutations
}
export default BookingModule

View File

@@ -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
}

View File

@@ -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 {

View File

@@ -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)

View File

@@ -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)

View File

@@ -37,13 +37,22 @@ const state: IUserState = {
}
const b = storeBuilder.module<IUserState>('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() {

View File

@@ -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('<br>', '\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() {

View File

@@ -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

View File

@@ -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[],

View File

@@ -10,7 +10,7 @@
<template v-slot:before>
<div>
<!--{{idProjAtt}}-->
idProjAtt: {{idProjAtt}}
<div class="divtitlecat clMain">
<div class="flex-container clMain">
<q-btn v-if="!!getIdParent && CanISeeProjectParent" size="sm" push color="secondary" round

View File

@@ -1,72 +0,0 @@
{
"defaultSeverity": "error",
"extends": [
"tslint:recommended"
],
"jsRules": {},
"rules": {
"no-console": false,
"curly": [false],
"object-literal-sort-keys": false,
// "no-restricted-syntax": [
// "error",
// {
// "selector": "CallExpression[callee.object.nametranslate='console'][callee.property.nametranslate!=/^(log|warn|error|info|trace)$/]",
// "message": "Unexpected property on console object was called"
// }
// ],
"class-name": true,
"comment-format": [
true,
"check-space"
],
"indent": [
true,
"spaces"
],
"ordered-imports": false,
"no-duplicate-variable": true,
"no-eval": true,
"no-internal-module": false,
"no-trailing-whitespace": false,
"no-var-keyword": true,
"max-line-length": false,
"one-line": [
true,
"check-open-brace",
"check-whitespace"
],
"quotemark": [
true,
"single"
],
"semicolon": [true, "never"],
"trailing-comma": [true, {"multiline": "never", "singleline": "never"}],
"triple-equals": [
true,
"allow-null-check"
],
"typedef-whitespace": [
true,
{
"call-signature": "nospace",
"index-signature": "nospace",
"parameter": "nospace",
"property-declaration": "nospace",
"variable-declaration": "nospace"
}
],
"variable-name": [
true,
"ban-keywords"
],
"whitespace": [
true,
"check-branch",
"check-decl",
"check-operator",
"check-separator",
"check-type"
]
}
}