- fixed strange things...

This commit is contained in:
Paolo Arena
2019-10-10 15:52:55 +02:00
parent 3ed8c7116b
commit 276b822fa5
44 changed files with 1271 additions and 594 deletions

View File

@@ -1 +0,0 @@
cfg_freeplanet.app/

View File

@@ -1,3 +1,44 @@
body {
font-family: 'Source Sans Pro', 'Helvetica Neue', Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
color: #a7a7a7;
line-height: 1.5;
//font-size: 1rem;
}
html {
font-size: 100%; // default font size (browser 16) -> (10 62.5%)
}
p {
font-size: 125%; // default font size (browser 16) -> (10 62.5%)
margin: 0 0 8px;
}
$grayshadow: #555;
$graytext: #555;
$textcol: blue;
$textcol_scuro: darkblue;
$heightBtn: 100%;
.flex-item {
// background-color: #d5e2eb;
display: flex;
padding: 2px;
margin: 2px;
margin-left: 3px;
margin-right: 3px;
color: #000;
font-size: 1rem;
height: $heightBtn;
line-height: $heightBtn;
vertical-align: middle;
//flex: 0 0 100%;
}
.fade-enter-active, .fade-leave-active {
transition: opacity .2s;
}
@@ -40,7 +81,8 @@
}
}
.my-notif-class {
.my-notif-class{
font-weight: bold;
}
@@ -53,15 +95,14 @@
.lowperc {
color: red;
}
.medperc {
color: blue;
}
.highperc {
color: green;
}
.hide-if-small {
@media (max-width: 600px) {
display: none;
@@ -74,24 +115,200 @@
}
}
.tothebottomfixed {
left: 0;
right: 0;
position: fixed;
z-index: 9999;
box-sizing: border-box;
overflow: hidden;
margin: 0 auto;
bottom: 10px;
.links, .links a {
text-shadow: 1px 1px 1px #555 !important;
// font-weight: bold;
color: cornflowerblue !important;
}
.links:hover {
color: white !important;
}
.tothetop {
left: 0;
right: 0;
position: fixed;
z-index: 9999;
box-sizing: border-box;
overflow: hidden;
margin: 0 auto;
top: 20px;
.text-subtitle1 {
font-size: 1.35rem;
font-weight: 400;
line-height: 1.75rem;
text-shadow: .25 .25rem .5rem $grayshadow;
letter-spacing: .00937em;
&.big {
font-size: 1.5rem;
}
}
.text-subtitle2 {
font-size: 1.15rem;
font-weight: 400;
line-height: 1.75rem;
letter-spacing: .00937em;
text-shadow: .25rem .25rem .5rem $grayshadow;
}
.text-subtitle3 {
font-size: 1rem;
font-weight: 400;
line-height: 1.75rem;
letter-spacing: .00937em;
}
@media (max-width: 718px) {
// PER VERSIONE MOBILE
p {
font-size: 100%; // default font size (browser 16) -> (10 62.5%)
font-family: "Abyssinica SIL", serif;
text-justify: auto;
margin: 0 0 4px;
}
.text-subtitle1 {
font-size: 1.25rem;
}
.text-subtitle2 {
font-size: 1rem;
}
.text-subtitle3 {
font-size: 0.75rem;
}
.cltexth3 {
font-size: 1.25rem;
}
.text-big{
font-size: 1.25rem;
}
}
.my-card {
width: 100%;
max-width: 350px;
min-width: 300px;
padding: 1rem 1rem;
box-shadow: none;
}
.text-trans {
opacity: 0.9;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=90)";
filter: alpha(opacity=90);
}
.text-spacetrans {
padding: 0 !important;
background: rgba(0,0,0,0.3) !important;
border-radius: 30px !important;
}
.text-shadow {
text-shadow: .15rem .15rem .15rem $grayshadow;
}
.citazione{
font-size: 0.75rem;
font-family: "Lucida Calligraphy", serif;
}
.cltexth3, .cltexth2, .cltexth4 {
font-size: 1.25rem;
font-weight: 400;
line-height: 1.75rem;
letter-spacing: .01em;
text-align: center !important;
}
.cltexth4 {
font-size: 1rem;
}
.cltexth2 {
font-size: 1.5rem;
}
.boldhigh, .boldop, .text-big{
font-weight: 500;
text-shadow: .05rem .05rem .05rem $grayshadow;
}
.boldop{
color: darkblue;
}
.text-big{
font-size: 1.5rem;
}
.center_to_image{
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
width: 100%;
text-align: center;
}
.center_img {
display: block;
margin-left: auto;
margin-right: auto;
}
.padding_cell {
padding: 0.75rem 0.5rem;
}
@media (max-width: 3000px) {
.q-parallax__media > img {
max-height: 550px !important;
min-width:inherit !important;
min-height: inherit !important;
}
}
@media (max-width: 1000px) {
.q-parallax__media > img {
max-height: 500px !important;
min-width:inherit !important;
min-height: inherit !important;
}
}
@media (max-width: 800px) {
.q-parallax__media > img {
max-height: 450px !important;
min-width:inherit !important;
min-height: inherit !important;
}
}
@media (max-width: 718px) {
.q-parallax__media > img {
max-height: 450px !important;
min-height: inherit !important;
min-width:100% !important;
}
}
// preloading images:
@media screen {
div#preloader {
position: absolute;
left: -9999px;
top: -9999px;
}
div#preloader img {
display: block;
}
}
@media print {
div#preloader,
div#preloader img {
visibility: hidden;
display: none;
}
}

View File

@@ -7,10 +7,14 @@ import { Header } from './components/Header'
import globalroutines from './globalroutines/index'
import { GlobalStore } from './store/Modules'
import { toolsext } from '@src/store/Modules/toolsext'
import { BannerCookies, CPreloadImages } from '@components'
import { static_data } from '@src/db/static_data'
@Component({
components: {
appHeader: Header
appHeader: Header,
BannerCookies, CPreloadImages
},
router
})
@@ -47,7 +51,7 @@ export default class App extends Vue {
// console.log('window.location.href', window.location.href)
let chiamaautologin = true
this.listaRoutingNoLogin.forEach(mystr => {
this.listaRoutingNoLogin.forEach((mystr) => {
if (window.location.href.includes(mystr)) {
chiamaautologin = false
}
@@ -59,9 +63,9 @@ export default class App extends Vue {
.then((loadstorage) => {
if (loadstorage) {
if (UserStore.state.lang !== '') {
if (toolsext.getLocale() !== '') {
// console.log('SETLOCALE :', this.$i18n.locale)
this.$i18n.locale = UserStore.state.lang // Set Lang
this.$i18n.locale = toolsext.getLocale() // Set Lang
} else {
UserStore.mutations.setlang(this.$i18n.locale)
}
@@ -81,5 +85,7 @@ export default class App extends Vue {
}
get static_data() {
return static_data
}
}

View File

@@ -5,6 +5,10 @@
<app-header></app-header>
<q-ajax-bar></q-ajax-bar>
<CPreloadImages :arrimg="static_data.preLoadImages">
</CPreloadImages>
<q-page-container>
<transition name="fade" mode="out-in">
<router-view/>
@@ -12,6 +16,7 @@
</q-page-container>
</q-layout>
</div>
<BannerCookies urlInfo="/policy"></BannerCookies>
</div>
</template>
<script lang="ts" src="./App.ts">

View File

@@ -25,6 +25,7 @@ import { Screen } from 'quasar'
})
export default class CImgText extends Vue {
@Prop({ required: false, default: '' }) public src: string
@Prop({ required: false, default: '' }) public src2: string
@Prop({ required: false, default: 'myclimg' }) public class1: string
@Prop({ required: false, default: '' }) public style1: string
}

View File

@@ -4,6 +4,7 @@
<div class="row items-start q-col-gutter-xs imgtext">
<div class="imgtext__img">
<img v-if="src" :src="src" class="myclimg" :style="style1">
<img v-if="src2" :src="src2" class="myclimg" :style="style1">
<div class="section_text">
<slot></slot>
</div>

View File

@@ -10,7 +10,7 @@
<!--</span>-->
<FormNewsletter v-if="static_data.SHOW_NEWSLETTER" :idwebsite="tools.appid()"
<FormNewsletter v-if="static_data.functionality.SHOW_NEWSLETTER" :idwebsite="tools.appid()"
:locale="tools.getLocale()">
</FormNewsletter>
@@ -52,7 +52,7 @@
</div>
<p class="text-center">
<router-link v-if="static_data.SHOW_ONLY_POLICY" to="/policy"><span class="footer_link">{{$t('privacy_policy')}}</span></router-link>
<router-link v-if="static_data.functionality.SHOW_ONLY_POLICY" to="/policy"><span class="footer_link">{{$t('privacy_policy')}}</span></router-link>
</p>
</div>

View File

@@ -41,7 +41,7 @@
</q-input>
<router-link to="/policy"><span class="news_link">$t('newsletter.acceptlicense')</span></router-link>
<router-link to="/policy"><span class="news_link">{{$t('privacy_policy')}}</span></router-link>
<q-toggle dark v-model="accept" :label="$t('newsletter.acceptlicense')"/>

View File

@@ -286,3 +286,12 @@ canvas {
display: inline-block;
padding: 4px 2px;
}
.text-user {
text-shadow: .05rem .05rem .15rem #fff;
background-color: limegreen;
border-radius: 1rem !important;
text-align: center;
margin: 1px;
margin-bottom: 5px;
}

View File

@@ -68,12 +68,12 @@ export default class Header extends Vue {
}
// -------------------------------------------------------------------------
// QUASAR Example using event to open drawer from another component or page
// QUASAR Example using myevent to open drawer from another component or page
// -------------------------------------------------------------------------
// (1) This code is inside layout file that have a drawer
// if this.leftDrawerOpen is true, drawer is displayed
// (2) Listen for an event in created
// (2) Listen for an myevent in created
/* created(){
this.$root.$on("openLeftDrawer", this.openLeftDrawercb);
},
@@ -85,7 +85,7 @@ export default class Header extends Vue {
}
}
// (4) In another component or page, emit the event!
// (4) In another component or page, emit the myevent!
// Call the method when clicking button etc.
methods: {
openLeftDrawer() {
@@ -160,7 +160,7 @@ export default class Header extends Vue {
const color = (value === 'online') ? 'positive' : 'warning'
if (this.static_data.SHOW_IF_IS_SERVER_CONNECTION) {
if (this.static_data.functionality.SHOW_IF_IS_SERVER_CONNECTION) {
if (!!oldValue) {
tools.showNotif(this.$q, this.$t('connection') + ` ${value}`, {
@@ -314,6 +314,12 @@ export default class Header extends Vue {
get Username() {
return UserStore.state.username
}
get myName() {
return UserStore.state.name
}
get mySurname() {
return UserStore.state.surname
}
get Verificato() {
return UserStore.state.verified_email
@@ -339,4 +345,8 @@ export default class Header extends Vue {
get static_data(){
return static_data
}
get isLogged() {
return UserStore.state.isLogged
}
}

View File

@@ -58,7 +58,7 @@
-->
<q-btn
v-if="!isonline && static_data.SHOW_IF_IS_SERVER_CONNECTION"
v-if="!isonline && static_data.functionality.SHOW_IF_IS_SERVER_CONNECTION"
flat
dense
round
@@ -102,7 +102,7 @@
<label>{{ $t('msg.hello') }}</label> <span v-model="prova"></span> !
</div>-->
<q-btn v-if="static_data.SHOW_USER_MENU" dense flat round icon="menu" @click="right = !right">
<q-btn v-if="static_data.functionality.SHOW_USER_MENU" dense flat round icon="menu" @click="right = !right">
</q-btn>
</q-toolbar>
@@ -121,7 +121,7 @@
</q-drawer>
<q-drawer v-if="static_data.SHOW_USER_MENU" v-model="right" side="right" overlay bordered>
<q-drawer v-if="static_data.functionality.SHOW_USER_MENU" v-model="right" side="right" overlay bordered>
<div id="profile">
<q-img class="absolute-top" src="../../statics/images/landing_first_section.png"
style="height: 150px">

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 } 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 = [
@@ -40,15 +256,24 @@ const lang_available: ILang[] = [
// { label: 'German', icon: 'fa-flag-de', value: 'de', image: '../statics/images/de.png', short: 'DE' },
]
export const static_data = {
const preLoadImages: IPreloadImages[] = []
const functionality: IFunctionality = {
SHOW_USER_MENU: true,
SHOW_IF_IS_SERVER_CONNECTION: false,
ENABLE_TODOS_LOADING: true,
ENABLE_PROJECTS_LOADING: true,
SHOW_NEWSLETTER: false,
SHOW_ONLY_POLICY: false,
BOOKING_EVENTS: false
}
export const static_data = {
routes,
functionality,
ds_operatori,
lang_available,
preLoadImages,
arrLangUsed
}

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

@@ -1,5 +1,6 @@
export interface IEvents {
_id?: any
time?: string
duration?: number
duration2?: number
@@ -18,9 +19,23 @@ export interface IEvents {
avatar2?: string
infoextra?: string
linkpdf?: string
nobookable?: boolean
}
export interface IBookedEvent {
id_bookedevent?: any
numpeople: number
infoevent: string
msgbooking: string
datebooked?: Date
booked: boolean
}
export interface ICalendarState {
editable: boolean
eventlist: IEvents[]
bookedevent: IBookedEvent[]
// ---------------
titlebarHeight: number
locale: string,
maxDays: number,

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 {
@@ -139,6 +144,7 @@ export interface ITimeLineEntry {
image2?: string
image3?: string
image4?: string
video?: string
side: string
link_url?: string
link_url_lang?: IAllLang
@@ -166,6 +172,7 @@ export interface IColl {
date: string
subtitle?: IAllLang
img: string
img2?: string
linkagg?: string
linkagg_type?: number
width?: number
@@ -176,3 +183,20 @@ export interface ICollaborations {
withwhom_title: IAllLang
list: IColl[]
}
export interface IParamDialog {
param1?: any
param2?: any
param3?: any
}
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
BOOKING_EVENTS?: boolean
}

View File

@@ -3,6 +3,8 @@ import { IToken } from 'model/other'
export const DefaultUser = <IUserState>{
email: '',
username: '',
name: '',
surname: '',
password: '',
lang: 'it'
}
@@ -11,6 +13,8 @@ export interface IUserState {
userId?: string
email?: string
username?: string
name?: string
surname?: string
password?: string
lang?: string
repeatPassword?: string

View File

@@ -1,3 +1,5 @@
import { IBookingState } from '@src/model/BookingStore'
export * from './UserStore'
export * from './GlobalStore'
export * from './signin-option'
@@ -11,3 +13,4 @@ export * from './Projects'
export * from './Calendar'
export * from './Estimate'
export * from './BookingStore'

View File

@@ -2,6 +2,8 @@
export interface ISignupOptions {
email?: string
username: string
name?: string
surname?: string
password?: string
lang?: string
repeatPassword?: string

View File

@@ -1,13 +1,3 @@
body {
font-family: 'Source Sans Pro', 'Helvetica Neue', Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
color: #a7a7a7;
line-height: 1.5;
//font-size: 1rem;
}
$grayshadow: #555;
.testo-banda {
//background: -webkit-gradient(linear, left top, left bottom, from(#3144f0), to(transparent));
@@ -15,9 +5,18 @@ $grayshadow: #555;
//background: rgba(0, 0, 0, .6)
}
$grayshadow: #555;
$textcol: blue;
$textcol_scuro: darkblue;
p {
margin: 0 0 16px;
text-shadow: 2px 2px 4px $grayshadow;
margin: 0 0 1.25rem;
//text-shadow: .125rem .125rem .25rem $grayshadow;
}
h4 {
font-size: 1.25rem;
}
.mycard {
@@ -42,8 +41,51 @@ p {
//padding: 0 16px
}
.intro {
display: flex;
justify-content: space-between;
align-items: stretch;
/* flex-flow: row nowrap; */
padding: 1.25rem 0 1.25rem 0;
margin: .125rem;
* {
width: 100%;
flex: 1;
margin-left: auto;
margin-right: auto;
}
&__associazione {
min-width: 350px;
}
&__comeassociarsi{
min-width: 350px;
}
}
.subtitle {
font-weight: 600;
text-align: center;
letter-spacing: 0.125rem;
text-transform: uppercase;
font-size: 1rem;
}
.landing > section.padding {
padding: 90px 16px
padding: 5.62rem 1rem;
}
.landing > section.padding_testo {
padding-top: 1.25rem;
padding-bottom: 1rem;
}
.landing > section.padding_gallery {
padding-top: 3.125rem;
padding-bottom: 5.625rem;
}
.landing > section > div {
@@ -59,7 +101,7 @@ p {
}
.landing__toolbar .q-btn {
border-radius: 0 0 5px 5px;
border-radius: 0 0 .315rem .315rem;
-ms-flex-item-align: stretch;
align-self: stretch
}
@@ -73,7 +115,7 @@ p {
}
.landing__arrow {
bottom: 25px;
bottom: 1.5rem;
opacity: .4
}
@@ -83,24 +125,24 @@ p {
}
.landing__logo {
width: 150px;
height: 150px;
margin-top: 21px;
width: 9.40rem;
height: 9.40rem;
margin-top: 1.315rem;
//-webkit-animation: logo-rotate 240s linear infinite;
//animation: logo-rotate 240s linear infinite
}
.landing__features .q-icon {
font-size: 64px
font-size: 4rem
}
h4 {
line-height: 1.5;
text-shadow: 4px 4px 8px $grayshadow;
text-shadow: .25rem .25rem .5rem $grayshadow;
}
.landing__features h4, .landing__features h6 {
margin: 26px 0
margin: 1rem 0
}
.landing__features p {
@@ -111,19 +153,22 @@ h4 {
.landing__footer {
//background: -webkit-gradient(linear, left top, left bottom, color-stop(65%, rgba(0, 0, 0, .1)), to(#000));
background: linear-gradient(180deg, rgba(0, 0, 0, .8) 75%, #FFF);
padding-top: 72px !important;
padding-bottom: 72px !important
background: linear-gradient(180deg, rgba(0, 0, 0, .8) 95%, #FFF);
padding-top: 4.5rem !important;
padding-bottom: 4.5rem !important;
padding-left: 1.25rem;
padding-right: 1.25rem;
color: #9f9f9f;
}
.icon_contact:hover {
color: blue;
border-color: white;
border-width: 1px;
border-width: .0625rem;
}
.landing__footer .doc-link {
color: #fff
color: $textcol;
}
.landing__footer .doc-link:hover {
@@ -147,7 +192,7 @@ h4 {
}
.q-col-gutter-sm {
padding: 50px 50px;
padding: 3.125rem 3.125rem;
//margin-left: -48px
}
@@ -187,7 +232,7 @@ body.mobile .landing:before {
.home {
//background-color: rgb(250, 250, 250);
padding: 5px;
padding: 3.125rem;
display: flex;
//flex-wrap: nowrap;
flex-direction: column;
@@ -196,17 +241,17 @@ body.mobile .landing:before {
}
.btn-start {
margin: 5px;
margin: 3.125rem;
}
.shadow {
//color: white;
text-shadow: 2px 2px 4px $grayshadow;
text-shadow: 0.125rem 0.125rem 0.25rem $grayshadow;
}
.shadow-max {
//color: white;
text-shadow: 4px 4px 8px $grayshadow;
text-shadow: .25rem .25rem .5rem $grayshadow;
}
.text-h1 {
@@ -227,31 +272,12 @@ body.mobile .landing:before {
font-weight: 700;
}
.text-subtitle1 {
font-size: 1.35rem;
font-weight: 400;
line-height: 1.75rem;
text-shadow: 4px 4px 8px $grayshadow;
letter-spacing: .00937em;
&.big {
font-size: 1.5rem;
}
}
.text-subtitle2 {
font-size: 1.15rem;
.text-vers{
font-size: 0.75rem;
font-weight: 400;
line-height: 1.75rem;
letter-spacing: .00937em;
text-shadow: 4px 4px 8px $grayshadow;
}
.text-subtitle3 {
font-size: 1rem;
font-weight: 400;
line-height: 1.75rem;
letter-spacing: .00937em;
text-shadow: 2px 2px 4px $grayshadow;
text-shadow: .25rem .25rem .5rem $grayshadow;
}
.homep-cover-img-1 {
@@ -274,19 +300,19 @@ body.mobile .landing:before {
}
.landing__footer-icons {
font-size: 28px
font-size: 1.75rem
}
.landing__footer-icons a {
margin: 0 8px 8px;
margin: 0 .5rem .5rem;
text-decoration: none;
outline: 0;
color: #fff;
color: $textcol;
transition: color .28s
}
.landing__footer-icons a:hover {
color: #e0e0e0
color: $textcol_scuro;
}
.doc-img {
@@ -295,12 +321,12 @@ body.mobile .landing:before {
.mylist {
background: #3fdaff;
padding-left: 20px;
padding-left: 1.25rem;
}
.clgutter {
margin-top: 20px;
padding: 10px;
margin-top: 1.25rem;
padding: .62rem;
}
.carousel_img_3 {
@@ -321,35 +347,44 @@ body.mobile .landing:before {
height: 7vh
}
.clgutter {
margin-top: 0px;
padding: 0px;
margin-top: 0;
padding: 0;
}
.landing__hero .text-h1 {
font-size: 3rem;
line-height: 3.05rem;
margin-bottom: 24px
margin-bottom: 1.5rem
}
.landing > section.padding {
padding: 40px 16px
//padding-bottom: 90px
padding: 2.5rem 1rem;
}
.landing > section.padding_testo {
padding-top: 1.25rem;
padding-bottom: 1rem;
}
.landing > section.padding_gallery {
padding-top: 3.125rem;
padding-bottom: 5.625rem;
}
.landing__features h4, .landing__features h6 {
margin: 20px 0
margin: 1.25rem 0
}
h4 {
line-height: 1.4;
text-shadow: 4px 4px 8px $grayshadow;
text-shadow: 0.25rem 0.25rem 0.5rem $grayshadow;
}
.landing .feature-item {
text-align: center;
margin-top: 20px;
margin-top: 1.25rem;
}
.landing__hero-content {
padding-bottom: 180px
padding-bottom: 11.25rem;
}
.landing__hero-btns {
-webkit-box-pack: center;
@@ -358,17 +393,14 @@ body.mobile .landing:before {
}
.q-col-gutter-sm {
padding: 10px 5px;
padding: .625rem .315rem;
}
.text-subtitle1 {
font-size: 1.25rem;
}
.text-subtitle2 {
font-size: 1rem;
}
.text-subtitle3 {
font-size: 0.75rem;
.text-vers{
font-size: 0.6rem;
}
.carousel_img_3 {
@@ -382,8 +414,25 @@ body.mobile .landing:before {
.custom-caption {
text-align: center;
padding: 12px;
color: white;
padding: .75rem;
color: $textcol;
background-color: rgba(0, 0, 0, .3);
}
.mycontacts {
color: gray;
letter-spacing: 0.078rem;
}
.mycontacts_title {
text-shadow: 0.125rem 0.125rem 0.125rem #555;
font-weight: bold;
color: #999;
letter-spacing: 0.125rem;
}
.mycontacts_text {
color: #999;
letter-spacing: 0.093rem;
}

View File

@@ -4,8 +4,12 @@ import { GlobalStore, UserStore } from '@store'
import { Logo } from '../../components/logo'
import { Footer } from '../../components/Footer'
import VueScrollReveal from 'vue-scroll-reveal'
import { tools } from '@src/store/Modules/tools'
import { toolsext } from '@src/store/Modules/toolsext'
import { Screen } from 'quasar'
Vue.use(VueScrollReveal, {
class: 'v-scroll-reveal', // A CSS class applied to elements with the v-scroll-reveal directive; useful for animation overrides.
@@ -21,7 +25,7 @@ Vue.use(VueScrollReveal, {
})
@Component({
components: { Logo }
components: { Logo, Footer }
})
export default class Home extends Vue {
public text: string = ''

View File

@@ -402,6 +402,8 @@
<q-page-scroller position="bottom-right" :scroll-offset="850" :offset="[18, 18]" style="opacity: 0.3">
<q-btn fab icon="keyboard_arrow_up" color="accent" />
</q-page-scroller>
<Footer></Footer>
</div>
</q-page>

View File

@@ -7,6 +7,7 @@ import { ProgressBar } from '@src/store/Modules/Interface'
import { isEqual } from 'lodash'
import { UserStore } from '@store'
import { tools } from '@src/store/Modules/tools'
import { toolsext } from '@src/store/Modules/toolsext'
Vue.use(VueRouter)
/*
@@ -16,7 +17,7 @@ Vue.use(VueRouter)
const Router = new VueRouter({
scrollBehavior: () => ({ x: 0, y: 0 } as PositionResult),
routes: cfgrouter.routes,
routes: cfgrouter.getmenu(),
// Leave these as is and change from quasar.conf.js instead!
// quasar.conf.js -> build -> vueRouterMode

View File

@@ -1,11 +1,13 @@
import { RouteConfig, Route, RouteRecord } from 'vue-router/types'
import { tools } from '@src/store/Modules/tools'
import { toolsext } from '@src/store/Modules/toolsext'
import auth from '../middleware/auth'
import { GlobalStore, Projects, Todos, UserStore } from '@store'
import { RouteNames } from '@src/router/route-names'
import { IListRoutes, IMenuList } from '@src/model'
import { static_data } from '@src/db/static_data'
interface IMyMeta {
title?: string,
@@ -36,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

View File

@@ -9,6 +9,7 @@ const msgglobal = {
delete: 'Elimina',
cancel: 'Annulla',
today: 'Oggi',
book: 'Prenota',
msg: {
titledeleteTask: 'Elimina Task',
deleteTask: "Vuoi Eliminare {mytodo}?"
@@ -49,6 +50,8 @@ const msgglobal = {
richiesto: 'Campo Richiesto',
email: 'Email',
username: 'Nome Utente',
name: 'Nome',
surname: 'Cognome',
username_login: 'Nome Utente o email',
password: 'Password',
repeatPassword: 'Ripeti password',
@@ -151,6 +154,13 @@ const msgglobal = {
themebgcolor: 'Tema Colore Sfondo'
},
cal: {
booked: 'Prenotato',
booked_error: 'Prenotazione non avvenuta. Riprovare più tardi',
booking: 'Prenota Evento',
titlebooking: 'Prenotazione',
cancelbooking: 'Cancella Prenotazione',
canceledbooking: 'Prenotazione Cancellata',
cancelederrorbooking: 'Cancellazione non effettuata, Riprovare più tardi',
event: 'Evento',
starttime: 'Dalle',
endtime: 'alle',
@@ -164,7 +174,11 @@ const msgglobal = {
infoextra: 'Date e Ora Extra:',
alldayevent: 'Tutto il giorno',
eventstartdatetime: 'Data e Ora Inizio Evento',
enterEndDateTime: 'Data e Ora Fine Evento'
enterEndDateTime: 'Data e Ora Fine Evento',
selnumpeople: 'Partecipanti',
msgbooking: 'Messaggio da inviare',
bookingtextdefault: 'Mi prenoto all\'evento',
bookingtextdefault_of: 'di'
},
newsletter: {
title: 'Desideri ricevere la nostra Newsletter?',
@@ -191,6 +205,7 @@ const msgglobal = {
delete: 'Borrar',
cancel: 'Cancelar',
today: 'Hoy',
book: 'Reserva',
msg: {
titledeleteTask: 'Borrar Tarea',
deleteTask: 'Quieres borrar {mytodo}?'
@@ -231,6 +246,8 @@ const msgglobal = {
richiesto: 'Campo requerido',
email: 'Email',
username: 'Nombre usuario',
name: 'Nombre',
surname: 'Apellido',
username_login: 'Nombre usuario o email',
password: 'contraseña',
repeatPassword: 'Repetir contraseña',
@@ -327,6 +344,13 @@ const msgglobal = {
themebgcolor: 'Tema Colores Fondo'
},
cal: {
booked: 'Reservado',
booked_error: 'Reserva fallida. Intenta nuevamente más tarde',
booking: 'Reserva Evento',
titlebooking: 'Reserva',
cancelbooking: 'Cancelar Reserva',
canceledbooking: 'Reserva Cancelada',
cancelederrorbooking: 'Cancelación no realizada, intente nuevamente más tarde',
event: 'Evento',
starttime: 'Inicio',
endtime: 'fin',
@@ -340,7 +364,11 @@ const msgglobal = {
infoextra: 'Fecha y Hora Extras:',
alldayevent: 'Todo el dia',
eventstartdatetime: 'Evento de inicio de fecha y hora',
enterEndDateTime: 'Fecha y hora del evento final'
enterEndDateTime: 'Fecha y hora del evento final',
selnumpeople: 'Partecipantes',
msgbooking: 'Mensaje para enviar',
bookingtextdefault: 'Reservo el evento',
bookingtextdefault_of: 'de',
},
newsletter: {
title: '¿Desea recibir nuestro boletín informativo?',
@@ -367,6 +395,7 @@ const msgglobal = {
delete: 'Supprimer',
cancel: 'annuler',
today: 'Aujourd\'hui',
book: 'Réserve',
msg: {
titledeleteTask: 'Supprimer la tâche',
deleteTask: 'Voulez-vous supprimer {mytodo}?'
@@ -406,6 +435,8 @@ const msgglobal = {
richiesto: 'Champ obligatoire',
email: 'Email',
username: 'Nom d\'utilisateur',
name: 'Nom',
surname: 'Prénom',
username_login: 'Nom d\'utilisateur ou email',
password: 'mot de passe',
repeatPassword: 'Répéter le mot de passe',
@@ -502,6 +533,13 @@ const msgglobal = {
themebgcolor: 'Tema Colores Fondo'
},
cal: {
booked: 'Réservé',
booked_error: 'La réservation a échoué. Réessayez plus tard',
booking: 'Réserver l\'événement',
titlebooking: 'Réservation',
cancelbooking: 'Annuler la réservation',
canceledbooking: 'Réservation annulée',
cancelederrorbooking: 'Annulation non effectuée, réessayez plus tard',
event: 'événement',
starttime: 'Accueil',
endtime: 'fin',
@@ -515,7 +553,11 @@ const msgglobal = {
infoextra: 'Extras Date et heure:',
alldayevent: 'Toute la journée',
eventstartdatetime: 'Date de début et heure de l\'événement',
enterEndDateTime: 'Date et heure de l\'événement final'
enterEndDateTime: 'Date et heure de l\'événement final',
selnumpeople: 'Participants',
msgbooking: 'Message à envoyer',
bookingtextdefault: 'Je réserve l\'événement',
bookingtextdefault_of: 'du',
},
newsletter: {
title: 'Souhaitez-vous recevoir notre newsletter?',
@@ -542,6 +584,7 @@ const msgglobal = {
delete: 'Delete',
cancel: 'Cancel',
today: 'Today',
book: 'Book',
msg: {
titledeleteTask: 'Delete Task',
deleteTask: 'Delete Task {mytodo}?'
@@ -582,6 +625,8 @@ const msgglobal = {
email: 'Email',
username_login: 'Username or email',
username: 'Username',
name: 'Name',
surname: 'Surname',
password: 'Password',
repeatPassword: 'Repeat password',
terms: "I agree with the terms and conditions",
@@ -676,6 +721,13 @@ const msgglobal = {
themebgcolor: 'Theme Color Background'
},
cal: {
booked: 'Booked',
booked_error: 'Reservation failed. Try again later',
booking: 'Book the Event',
titlebooking: 'Reservation',
cancelbooking: 'Cancel Reservation',
canceledbooking: 'Booking cancelled',
cancelederrorbooking: 'Cancellation unsuccessfully, try again later',
event: 'Event',
starttime: 'From',
endtime: 'to',
@@ -687,9 +739,13 @@ const msgglobal = {
enterdate: 'Enter date',
details: 'Details',
infoextra: 'Extra Info DateTime',
alldayevent: 'All-Day event',
alldayevent: 'All-Day myevent',
eventstartdatetime: 'Event start date and time',
enterEndDateTime: 'Event end date and time'
enterEndDateTime: 'Event end date and time',
selnumpeople: 'Participants',
msgbooking: 'Message to send',
bookingtextdefault: 'I book the event',
bookingtextdefault_of: 'of',
},
newsletter: {
title: 'Would you like to receive our Newsletter?',
@@ -716,6 +772,7 @@ const msgglobal = {
delete: 'Delete',
cancel: 'Cancel',
today: 'Today',
book: 'Book',
msg: {
titledeleteTask: 'Delete Task',
deleteTask: 'Delete Task {mytodo}?'
@@ -757,6 +814,8 @@ const msgglobal = {
email: 'Email',
username_login: 'Username or email',
username: 'Username',
name: 'Name',
surname: 'Surname',
password: 'Password',
repeatPassword: 'Repeat password',
terms: "I agree with the terms and conditions",
@@ -852,6 +911,13 @@ const msgglobal = {
themebgcolor: 'Theme Color Background'
},
cal: {
booked: 'Booked',
booked_error: 'Reservation failed. Try again later',
booking: 'Book the Event',
titlebooking: 'Reservation',
cancelbooking: 'Cancel Reservation',
canceledbooking: 'Booking cancelled',
cancelederrorbooking: 'Cancellation unsuccessfully, try again later',
event: 'Event',
starttime: 'From',
endtime: 'to',
@@ -863,9 +929,13 @@ const msgglobal = {
enterdate: 'Enter date',
details: 'Details',
infoextra: 'Extra Info DateTime',
alldayevent: 'All-Day event',
alldayevent: 'All-Day myevent',
eventstartdatetime: 'Event start date and time',
enterEndDateTime: 'Event end date and time'
enterEndDateTime: 'Event end date and time',
selnumpeople: 'Participants',
msgbooking: 'Message to send',
bookingtextdefault: 'I book the event',
bookingtextdefault_of: 'of',
},
newsletter: {
title: 'Would you like to receive our Newsletter?',
@@ -897,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 },
}
}

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

@@ -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 {
@@ -274,7 +279,7 @@ namespace Actions {
async function dbLoad(context, { checkPending, onlyiffirsttime }) {
if (!static_data.ENABLE_PROJECTS_LOADING)
if (!static_data.functionality.ENABLE_PROJECTS_LOADING)
return null
if (onlyiffirsttime) {
@@ -442,7 +447,6 @@ namespace Actions {
modify: b.dispatch(modify),
ActionCutPaste: b.dispatch(ActionCutPaste)
}
}
// Module

View File

@@ -1,5 +1,5 @@
import Api from '@api'
import { ICalendarState } from 'model'
import { IBookedEvent, ICalendarState, IEvents } from 'model'
import { ILinkReg, IResult, IIdToken, IToken } from 'model/other'
import { storeBuilder } from '../Store'
@@ -8,9 +8,15 @@ import { tools } from '../../tools'
import translate from '../../../../globalroutines/util'
import * as Types from '../../../Api/ApiTypes'
import { db_data } from '@src/db/db_data'
import { UserStore } from '@store'
// State
const state: ICalendarState = {
editable: false,
eventlist: [],
bookedevent: [],
// ---------------
titlebarHeight: 0,
locale: 'it-IT',
maxDays: 1,
@@ -24,7 +30,7 @@ const state: ICalendarState = {
noScroll: false,
showMonthLabel: false,
showWorkWeeks: false,
intervalRange: {min: 9, max: 23},
intervalRange: { min: 9, max: 23 },
intervalRangeStep: 1,
intervalHeight: 35,
resourceHeight: 60,
@@ -39,19 +45,15 @@ const stateGetter = b.state()
namespace Getters {
// const lang = b.read((state) => {
// if (state.lang !== '') {
// return state.lang
// } else {
// return process.env.LANG_DEFAULT
// }
// }, 'lang')
//
// export const getters = {
// get lang() {
// return lang()
// },
// }
const findEventBooked = b.read((mystate: ICalendarState) => (myevent: IEvents, isconfirmed: boolean) => {
return mystate.bookedevent.find((bookedevent) => (bookedevent.id_bookedevent === myevent._id) && ((isconfirmed && bookedevent.booked) || (!isconfirmed)))
}, 'findEventBooked')
export const getters = {
get findEventBooked() {
return findEventBooked()
}
}
}
@@ -67,6 +69,110 @@ 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)
let ris = null
ris = await Api.SendReq('/booking/' + UserStore.state.userId + '/' + process.env.APP_ID, 'GET', null)
.then((res) => {
if (res.data.bookedevent) {
state.bookedevent = res.data.bookedevent
} else {
state.bookedevent = []
}
})
.catch((error) => {
console.log('error dbLoad', error)
// UserStore.mutations.setErrorCatch(error)
return new Types.AxiosError(serv_constants.RIS_CODE_ERR, null, tools.ERR_GENERICO, error)
})
return ris
}
function getparambyevent(bookevent) {
return {
id_bookedevent: bookevent.id_bookedevent,
infoevent: bookevent.infoevent,
numpeople: bookevent.numpeople,
msgbooking: bookevent.msgbooking,
datebooked: bookevent.datebooked,
userId: UserStore.state.userId,
booked: bookevent.booked,
}
}
async function BookEvent(context, bookevent: IBookedEvent) {
console.log('BookEvent', bookevent)
const param = getparambyevent(bookevent)
return await Api.SendReq('/booking', 'POST', param)
.then((res) => {
if (res.status === 200) {
if (res.data.code === serv_constants.RIS_CODE_OK) {
state.bookedevent.push(bookevent)
return true
}
}
return false
})
.catch((error) => {
console.error(error)
return false
})
}
async function CancelBookingEvent(context, event: IEvents) {
console.log('CALSTORE: CancelBookingEvent', event)
const myeventtoCancel = state.bookedevent.find((eventbooked) => (eventbooked.id_bookedevent === event._id))
const param = getparambyevent(myeventtoCancel)
param.booked = false // Cancel Booking
return await Api.SendReq('/booking', 'POST', param)
.then((res) => {
if (res.status === 200) {
if (res.data.code === serv_constants.RIS_CODE_OK) {
state.bookedevent = state.bookedevent.filter((eventbooked) => (eventbooked.id_bookedevent !== event._id))
return true
}
}
return false
})
.catch((error) => {
console.error(error)
// UserStore.mutations.setErrorCatch(error)
return false
})
}
export const actions = {
loadAfterLogin: b.dispatch(loadAfterLogin),
BookEvent: b.dispatch(BookEvent),
CancelBookingEvent: b.dispatch(CancelBookingEvent)
}
// async function resetpwd(context, paramquery: ICalendarState) {
// }
@@ -80,9 +186,9 @@ namespace Actions {
const CalendarModule = {
get state() {
return stateGetter()
}
// actions: Actions.actions,
// getters: Getters.getters,
},
actions: Actions.actions,
getters: Getters.getters
// mutations: Mutations.mutations
}

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)
@@ -253,7 +255,7 @@ namespace Actions {
async function dbLoad(context, { checkPending }) {
if (!static_data.ENABLE_PROJECTS_LOADING)
if (!static_data.functionality.ENABLE_PROJECTS_LOADING)
return null
console.log('dbLoad', nametable, checkPending, 'userid=', UserStore.state.userId)

View File

@@ -7,9 +7,11 @@ import router from '@router'
import { serv_constants } from '../Modules/serv_constants'
import { tools } from '../Modules/tools'
import { toolsext } from '@src/store/Modules/toolsext'
import { GlobalStore, UserStore, Todos, Projects } from '@store'
import { GlobalStore, UserStore, Todos, Projects, BookingStore, CalendarStore } from '@store'
import globalroutines from './../../globalroutines/index'
import { static_data } from '@src/db/static_data'
import translate from './../../globalroutines/util'
import * as Types from '@src/store/Api/ApiTypes'
@@ -20,6 +22,8 @@ const state: IUserState = {
userId: '',
email: '',
username: '',
name: '',
surname: '',
password: '',
lang: process.env.LANG_DEFAULT,
repeatPassword: '',
@@ -33,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
@@ -81,6 +94,9 @@ namespace Getters {
}, 'IsMyGroup')
export const getters = {
get isUserInvalid() {
return isUserInvalid()
},
get lang() {
return lang()
},
@@ -108,6 +124,8 @@ namespace Mutations {
function authUser(state: IUserState, data: IUserState) {
state.userId = data.userId
state.username = data.username
state.name = data.name
state.surname = data.surname
if (data.verified_email) {
state.verified_email = data.verified_email
}
@@ -138,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)
}
@@ -176,6 +195,8 @@ namespace Mutations {
function clearAuthData(state: IUserState) {
state.userId = ''
state.username = ''
state.name = ''
state.surname = ''
resetArrToken(state.tokens)
state.x_auth_token = ''
state.verified_email = false
@@ -221,7 +242,6 @@ namespace Mutations {
setErrorCatch: b.commit(setErrorCatch),
getMsgError: b.commit(getMsgError)
}
}
namespace Actions {
@@ -318,6 +338,8 @@ namespace Actions {
email: authData.email,
password: String(hashedPassword),
username: authData.username,
name: authData.name,
surname: authData.surname
}
console.log(usertosend)
@@ -336,6 +358,8 @@ namespace Actions {
if (res.status === 200) {
const userId = newuser._id
const username = authData.username
const name = authData.name
const surname = authData.surname
if (process.env.DEV) {
console.log('USERNAME = ' + username)
console.log('IDUSER= ' + userId)
@@ -344,6 +368,8 @@ namespace Actions {
Mutations.mutations.authUser({
userId,
username,
name,
surname,
verified_email: false
})
@@ -353,6 +379,8 @@ namespace Actions {
localStorage.setItem(tools.localStorage.lang, state.lang)
localStorage.setItem(tools.localStorage.userId, userId)
localStorage.setItem(tools.localStorage.username, username)
localStorage.setItem(tools.localStorage.name, name)
localStorage.setItem(tools.localStorage.surname, surname)
localStorage.setItem(tools.localStorage.token, state.x_auth_token)
localStorage.setItem(tools.localStorage.expirationDate, expirationDate.toString())
localStorage.setItem(tools.localStorage.verified_email, String(false))
@@ -380,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)
@@ -409,7 +440,6 @@ namespace Actions {
options
}
// console.log('PASSO 4')
if (process.env.DEBUG === '1') {
console.log(usertosend)
}
@@ -418,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) => {
@@ -438,11 +468,15 @@ namespace Actions {
if (myuser) {
const userId = myuser.userId
const username = authData.username
const name = myuser.name
const surname = myuser.surname
const verified_email = myuser.verified_email
Mutations.mutations.authUser({
userId,
username,
name,
surname,
verified_email
})
@@ -452,6 +486,8 @@ namespace Actions {
localStorage.setItem(tools.localStorage.lang, state.lang)
localStorage.setItem(tools.localStorage.userId, userId)
localStorage.setItem(tools.localStorage.username, username)
localStorage.setItem(tools.localStorage.name, name)
localStorage.setItem(tools.localStorage.surname, surname)
localStorage.setItem(tools.localStorage.token, state.x_auth_token)
localStorage.setItem(tools.localStorage.expirationDate, expirationDate.toString())
localStorage.setItem(tools.localStorage.isLogged, String(true))
@@ -486,6 +522,8 @@ namespace Actions {
localStorage.removeItem(tools.localStorage.token)
localStorage.removeItem(tools.localStorage.userId)
localStorage.removeItem(tools.localStorage.username)
localStorage.removeItem(tools.localStorage.name)
localStorage.removeItem(tools.localStorage.surname)
localStorage.removeItem(tools.localStorage.isLogged)
// localStorage.removeItem(rescodes.localStorage.leftDrawerOpen)
localStorage.removeItem(tools.localStorage.verified_email)
@@ -512,6 +550,7 @@ namespace Actions {
}
async function setGlobal(isLogged: boolean) {
console.log('setGlobal')
// state.isLogged = true
state.isLogged = isLogged
if (isLogged) {
@@ -522,12 +561,18 @@ namespace Actions {
GlobalStore.actions.checkUpdates()
}
return await GlobalStore.actions.loadAfterLogin()
.then(() => {
return Todos.actions.dbLoad({ checkPending: true })
}).then(() => {
return Projects.actions.dbLoad({ checkPending: true, onlyiffirsttime: true })
})
const p = await BookingStore.actions.loadAfterLogin()
const p2 = await CalendarStore.actions.loadAfterLogin()
const p3 = await GlobalStore.actions.loadAfterLogin()
if (static_data.functionality.ENABLE_TODOS_LOADING)
await Todos.actions.dbLoad({ checkPending: true })
if (static_data.functionality.ENABLE_PROJECTS_LOADING)
await Projects.actions.dbLoad({ checkPending: true, onlyiffirsttime: true })
console.log('setGlobal: END')
}
async function autologin_FromLocalStorage(context) {
@@ -547,6 +592,8 @@ namespace Actions {
if (now < expirationDate) {
const userId = String(localStorage.getItem(tools.localStorage.userId))
const username = String(localStorage.getItem(tools.localStorage.username))
const name = String(localStorage.getItem(tools.localStorage.name))
const surname = String(localStorage.getItem(tools.localStorage.surname))
const verified_email = localStorage.getItem(tools.localStorage.verified_email) === 'true'
GlobalStore.state.wasAlreadySubOnDb = localStorage.getItem(tools.localStorage.wasAlreadySubOnDb) === 'true'
@@ -558,6 +605,8 @@ namespace Actions {
Mutations.mutations.authUser({
userId,
username,
name,
surname,
verified_email
})
@@ -603,6 +652,8 @@ namespace Actions {
}
}
const stateGetter = b.state()
// Module
const UserModule = {
get state() {

View File

@@ -10,5 +10,9 @@ export const costanti = {
CONFIG_ID_STATE_CONN: '2',
CONFIG_ID_SHOW_TYPE_TODOS: '3',
FuncDialog: {
CANCEL_BOOKING: 1
},
MAX_PHASES: 5,
}

View File

@@ -1,5 +1,6 @@
export {storeBuilder} from './Store/Store'
export {default as GlobalStore} from './GlobalStore'
export {default as BookingStore} from './BookingStore'
export {default as UserStore} from './UserStore'
export {default as Todos} from './Todos'
export {default as Projects} from './Projects'

View File

@@ -1,10 +1,10 @@
import { Todos, Projects, UserStore } from '@store'
import { Todos, Projects, UserStore, CalendarStore } from '@store'
import globalroutines from './../../globalroutines/index'
import { costanti } from './costanti'
import { toolsext } from './toolsext'
import { translation } from './translation'
import Quasar, { date, Screen } from 'quasar'
import { ICollaborations, IListRoutes, IMenuList, IProject, ITodo, Privacy } from '@src/model'
import { ICollaborations, IListRoutes, IMenuList, IParamDialog, IProject, ITodo, Privacy } from '@src/model'
import * as ApiTables from '@src/store/Modules/ApiTables'
import translate from '@src/globalroutines/util'
import { RouteNames } from '@src/router/route-names'
@@ -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'
@@ -55,6 +56,8 @@ export const tools = {
userId: 'uid',
token: 'tk',
username: 'uname',
name: 'nm',
surname: 'sn',
lang: 'lg'
},
@@ -70,6 +73,35 @@ export const tools = {
COMPLETED: 10
},
SelectListNumPeople: [
{
id: 1,
label: '1',
value: 1
},
{
id: 2,
label: '2',
value: 2
},
{
id: 3,
label: '3',
value: 3
},
{
id: 4,
label: '4',
value: 4
},
{
id: 5,
label: '5',
value: 5
}
]
,
selectPhase: {
it: [
{
@@ -1267,8 +1299,48 @@ export const tools = {
result.push(json[key])
})
return result
}
,
},
executefunc(myself: any, myfunc: number, par: IParamDialog) {
if (myfunc === costanti.FuncDialog.CANCEL_BOOKING) {
console.log(' ENTRATO ! CancelBookingEvent ')
CalendarStore.actions.CancelBookingEvent(par.param1).then((ris) => {
if (ris)
tools.showPositiveNotif(myself.$q, myself.$t('cal.canceledbooking') + ' "' + par.param1.title + '"')
else
tools.showNegativeNotif(myself.$q, myself.$t('cal.cancelederrorbooking'))
})
}
},
async askConfirm($q: any, mytitle, mytext, ok, cancel, myself: any, funcok: number, funccancel: number, par: IParamDialog) {
return $q.dialog({
message: mytext,
ok: {
label: ok,
push: true
},
title: mytitle,
cancel: true,
persistent: false
}).onOk(() => {
console.log('OK')
tools.executefunc(myself, funcok, par)
return true
}).onCancel(() => {
console.log('CANCEL')
tools.executefunc(myself, funccancel, par)
return false
})
},
showPositiveNotif(q: any, msg) {
tools.showNotif(q, msg, { color: 'positive', icon: 'notifications' })
},
showNegativeNotif(q: any, msg) {
tools.showNotif(q, msg, { color: 'negative', icon: 'notifications' })
},
showNotif(q: any, msg, data ?: INotify | null
) {
@@ -1297,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
}
@@ -1313,7 +1385,7 @@ export const tools = {
,
checkLangPassed(mylang) {
// console.log('checkLangPassed')
console.log('checkLangPassed')
const mybrowserLang = Quasar.lang.isoName
@@ -1335,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)
}
}
@@ -1728,7 +1800,6 @@ export const tools = {
},
heightgallery() {
if (Screen.width < 400) {
return '200px'
@@ -1747,7 +1818,7 @@ export const tools = {
if (myheight > 1000) {
maxheight = 1000
} else {
maxheight = parseInt(myheight, 10)
maxheight = parseInt(myheight, 10)
}
}
} else {
@@ -1988,15 +2059,55 @@ 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 }
}
},
convertHTMLtoText(myhtml) {
let msg = myhtml
msg = msg.replace('&quot;', '"')
msg = msg.replace('&gt;', '>')
msg = msg.replace('&lt;', '<')
msg = msg.replace('&amp;', '&')
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() {
// if (navigator.languages && navigator.languages.length > 0) {
// return navigator.languages[0]

View File

@@ -27,7 +27,7 @@ export const func_tools = {
getDateStr(mydate) {
const DateFormatter = new Intl.DateTimeFormat(func_tools.getLocale() || void 0, {
weekday: 'long',
weekday: 'short',
day: 'numeric',
month: 'long',
year: 'numeric'

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

@@ -19,6 +19,12 @@ export const validations = {
registereduser,
required
},
name: {
required
},
surname: {
required
},
email: {
email,
registeredemail,

View File

@@ -30,9 +30,11 @@ export default class Signup extends Vue {
public signup: ISignupOptions = {
email: process.env.TEST_EMAIL || '',
username: process.env.TEST_USERNAME || '',
name: process.env.TEST_NAME || '',
surname: process.env.TEST_SURNAME || '',
password: process.env.TEST_PASSWORD || '',
repeatPassword: process.env.TEST_PASSWORD || '',
terms: process.env.PROD ? false : true
terms: !process.env.PROD
}
public created() {
@@ -107,6 +109,9 @@ export default class Signup extends Vue {
} else if (cosa === 'username') {
// console.log(item);
if (!item.isUnique) { return this.$t('reg.err.duplicate_username') }
} else if ((cosa === 'name') || (cosa === 'surname')) {
// console.log(item);
}
if (!item.complexity) { return this.$t('reg.err.complexity') }

View File

@@ -41,6 +41,38 @@
</q-input>
<q-input
v-model="signup.name"
rounded outlined
@blur="$v.signup.name.$touch"
:error="$v.signup.name.$error"
bottom-slots
debounce="1000"
:error-message="errorMsg('name', $v.signup.name)"
:label="$t('reg.name')">
<template v-slot:prepend>
<q-icon name="person"/>
</template>
</q-input>
<q-input
v-model="signup.surname"
rounded outlined
@blur="$v.signup.surname.$touch"
:error="$v.signup.surname.$error"
bottom-slots
debounce="1000"
:error-message="errorMsg('surname', $v.signup.surname)"
:label="$t('reg.surname')">
<template v-slot:prepend>
<q-icon name="person"/>
</template>
</q-input>
<q-input
v-model="signup.password"
type="password"

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"
]
}
}