diff --git a/src/App.scss b/src/App.scss index e085d76..6f6ae17 100644 --- a/src/App.scss +++ b/src/App.scss @@ -39,3 +39,8 @@ transform: translateX(1600px); } } + + +.my-notif-class{ + font-weight: bold; +} diff --git a/src/App.vue b/src/App.vue index c5327a0..5ccd927 100644 --- a/src/App.vue +++ b/src/App.vue @@ -17,6 +17,6 @@ - diff --git a/src/classes/routinestd.ts b/src/classes/routinestd.ts index 050c871..7e38386 100644 --- a/src/classes/routinestd.ts +++ b/src/classes/routinestd.ts @@ -12,10 +12,8 @@ export async function askConfirm($q: any, mytitle, mytext, ok, cancel) { title: mytitle }).then((ris) => { return true - // this.$q.notify('Agreed!') }).catch(() => { return false - // this.$q.notify('Disagreed...') }) } catch (e) { return false diff --git a/src/components/Header/Header.ts b/src/components/Header/Header.ts index 54d74b2..3040a58 100644 --- a/src/components/Header/Header.ts +++ b/src/components/Header/Header.ts @@ -99,7 +99,7 @@ export default class Header extends Vue { set lang(lang) { console.log('set lang(' + this.$i18n.locale) this.$i18n.locale = this.snakeToCamel(lang) - // this.$q.notify('IMPOSTA LANG= ' + this.$i18n.locale) + // tools.showNotif(this.$q, 'IMPOSTA LANG= ' + this.$i18n.locale) // console.log('IMPOSTA LANG= ' + this.$i18n.locale) UserStore.mutations.setlang(this.$i18n.locale) @@ -123,13 +123,6 @@ export default class Header extends Vue { public changeconn(value: string, oldValue: string) { this.strConn = value - - // this.$q.notify({ - // color : 'primary', - // icon: 'wifi', - // message: "CAMBIATOO! " + value - // }) - } @Watch('conndata_changed', { immediate: true, deep: true }) @@ -162,10 +155,9 @@ export default class Header extends Vue { const color = (value === 'online') ? 'positive' : 'warning' if (oldValue !== undefined) { - this.$q.notify({ + tools.showNotif(this.$q, this.$t('connection') + ` ${value}`, { color, - icon: 'wifi', - message: this.$t('connection') + ` ${value}` + icon: 'wifi' }) } @@ -235,7 +227,7 @@ export default class Header extends Vue { console.log('this.$q.i18n=', this.$q.i18n, 'this.$q.getLocale()=', this.$q.lang.isoName) const my = this.getLangAtt() - this.$q.notify('prima: ' + String(my)) + tools.showNotif(this.$q, 'prima: ' + String(my)) let mylang = tools.getItemLS(tools.localStorage.lang) if (mylang === '') { @@ -266,7 +258,6 @@ export default class Header extends Vue { this.setLangAtt(mylang) this.setshortlang(mylang) - // this.$q.notify('Dopo: ' + String(this.getLangAtt())) } diff --git a/src/components/categories/category/category.ts b/src/components/categories/category/category.ts index 5278fcd..5a48fba 100644 --- a/src/components/categories/category/category.ts +++ b/src/components/categories/category/category.ts @@ -3,6 +3,7 @@ import { Component, Watch } from 'vue-property-decorator' import { SingleCat } from '../SingleCat' import { ICategory } from '@src/model' +import { tools } from "@src/store/Modules/tools" @Component({ @@ -176,13 +177,10 @@ export default class Category extends Vue { const seldel = [...this.selectedSecond] if (this.deleteCategory(this.selectedSecond)) { - this.$q.notify({ + tools.showNotif(this.$q, `Deleted ` + (seldel.length.toString()) + ' item', { color: 'primary', icon: 'delete', - message: `Deleted ` + (seldel.length.toString()) + ' item' }) - - } } diff --git a/src/components/categories/tabledata/tabledata.ts b/src/components/categories/tabledata/tabledata.ts index b04297c..245d5a7 100644 --- a/src/components/categories/tabledata/tabledata.ts +++ b/src/components/categories/tabledata/tabledata.ts @@ -3,6 +3,7 @@ import { Component, Watch } from 'vue-property-decorator' import { ICategory } from '@src/model' import globalroutines from "@src/globalroutines" +import { tools } from "@src/store/Modules/tools" @Component({ }) @@ -172,10 +173,9 @@ export default class Tabledata extends Vue { const seldel = [...this.selectedSecond] if (this.deleteCategory(this.selectedSecond)) { - this.$q.notify({ + tools.showNotif(this.$q, `Deleted ` + (seldel.length.toString()) + ' item', { color: 'primary', - icon: 'delete', - message: `Deleted ` + (seldel.length.toString()) + ' item' + icon: 'delete' }) diff --git a/src/components/todos/SingleTodo/SingleTodo.ts b/src/components/todos/SingleTodo/SingleTodo.ts index e719dc9..7608192 100644 --- a/src/components/todos/SingleTodo/SingleTodo.ts +++ b/src/components/todos/SingleTodo/SingleTodo.ts @@ -450,7 +450,6 @@ export default class SingleTodo extends Vue { this.updateicon() } - // this.$q.notify('setPriority: ' + elem) } public async askConfirmDelete() { diff --git a/src/components/todos/todo/todo.ts b/src/components/todos/todo/todo.ts index bbb77bf..3a87cd0 100644 --- a/src/components/todos/todo/todo.ts +++ b/src/components/todos/todo/todo.ts @@ -321,13 +321,13 @@ export default class Todo extends Vue { } if (UserStore.state.userId === undefined) { - this.$q.notify(this.$t('todo.usernotdefined')) + tools.showNotif(this.$q, this.$t('todo.usernotdefined')) return } if (!this.isRegistered()) { // Not logged - this.$q.notify(this.$t('user.notregistered')) + tools.showNotif(this.$q, this.$t('user.notregistered')) return } @@ -341,7 +341,7 @@ export default class Todo extends Vue { console.log('data', data) if (data !== null) { - this.$q.notify(data) + tools.showNotif(this.$q, data) } // empty the field diff --git a/src/layouts/drawer/drawer.ts b/src/layouts/drawer/drawer.ts index 1b2a9f1..c0e5867 100644 --- a/src/layouts/drawer/drawer.ts +++ b/src/layouts/drawer/drawer.ts @@ -4,6 +4,7 @@ import { UserStore } from '@modules' import { GlobalStore } from '@modules' import Vue from 'vue' import { Component, Prop } from 'vue-property-decorator' +import { tools } from "@src/store/Modules/tools" const namespace: string = 'GlobalModule' @@ -46,7 +47,7 @@ export default class Drawer extends Vue { this.$router.replace('/') }, 1000) - this.$q.notify(this.$t('logout.uscito')) + tools.showNotif(this.$q, this.$t('logout.uscito'), {icon: 'exit_to_app'}) }) } } diff --git a/src/layouts/menuone/menuOne.vue b/src/layouts/menuone/menuOne.vue index 404be9d..a49328c 100644 --- a/src/layouts/menuone/menuOne.vue +++ b/src/layouts/menuone/menuOne.vue @@ -8,15 +8,15 @@
section.padding { padding: 40px 16px //padding-bottom: 90px diff --git a/src/root/home/home.ts b/src/root/home/home.ts index 59c4593..9d9f271 100644 --- a/src/root/home/home.ts +++ b/src/root/home/home.ts @@ -4,7 +4,8 @@ import { GlobalStore, UserStore } from '@store' import { Logo } from '../../components/logo' -import VueScrollReveal from 'vue-scroll-reveal'; +import VueScrollReveal from 'vue-scroll-reveal' +import { tools } from '@src/store/Modules/tools' Vue.use(VueScrollReveal, { class: 'v-scroll-reveal', // A CSS class applied to elements with the v-scroll-reveal directive; useful for animation overrides. @@ -17,21 +18,21 @@ Vue.use(VueScrollReveal, { z: 0 } // mobile: true -}); +}) @Component({ components: { Logo } }) export default class Home extends Vue { - text: string = '' - visibile: boolean = false - cardvisible: string = 'hidden' - displaycard: string = 'block' - svgclass: string = 'svgclass' - $t: any - firstClassSection: string = 'landing fade homep-cover-img animate-fade homep-cover-img-1' + public text: string = '' + public visibile: boolean = false + public cardvisible: string = 'hidden' + public displaycard: string = 'block' + public svgclass: string = 'svgclass' + public $t: any + public firstClassSection: string = 'landing fade homep-cover-img animate-fade homep-cover-img-1' public $q - polling + public polling constructor() { super() @@ -39,9 +40,9 @@ export default class Home extends Vue { this.initprompt() } - mounted() { + public mounted() { let primo = true - let mytime = 10000 + const mytime = 10000 this.polling = setInterval(() => { this.firstClassSection = 'landing fade homep-cover-img ' + (primo ? 'homep-cover-img-2' : 'homep-cover-img-1') @@ -52,11 +53,11 @@ export default class Home extends Vue { }, mytime) } - beforeDestroy() { + public beforeDestroy() { console.log('beforeDestroy') clearInterval(this.polling) } - created() { + public created() { GlobalStore.actions.prova() } @@ -69,8 +70,7 @@ export default class Home extends Vue { return process.env.TELEGRAM_SUPPORT } - - meta() { + public meta() { return { keywords: { name: 'keywords', content: 'Quasar website' }, // meta tags @@ -78,13 +78,12 @@ export default class Home extends Vue { mykey: { name: 'mykey', content: 'Key 1' }, description: { name: 'description', content: 'Page 1' }, keywords: { name: 'keywords', content: 'Quasar website' }, - equiv: { 'http-equiv': 'Content-Type', content: 'text/html; charset=UTF-8' } + equiv: { 'http-equiv': 'Content-Type', 'content': 'text/html; charset=UTF-8' } } } } - - mystilecard() { + public mystilecard() { return { visibility: this.cardvisible, display: this.displaycard @@ -95,27 +94,18 @@ export default class Home extends Vue { return GlobalStore.state.conta } - getenv(myvar) { + public getenv(myvar) { return process.env[myvar] } set conta(valore) { GlobalStore.actions.setConta(valore) - let my = this.$q.lang.isoName - this.showNotif(String(my)) + const my = this.$q.lang.isoName + tools.showNotif(this.$q, String(my)) } - showNotif(message: string, color = 'primary', icon = '') { - this.$q.notify({ - color, - icon, - message - }) - - } - - initprompt() { - window.addEventListener('beforeinstallprompt', function (event) { + public initprompt() { + window.addEventListener('beforeinstallprompt', function(event) { // console.log('******************************** beforeinstallprompt fired') event.preventDefault() // console.log('§§§§§§§§§§§§§§§§§§§§ IMPOSTA DEFERRED PROMPT !!!!!!!!!!!!!!!!! ') @@ -125,27 +115,27 @@ export default class Home extends Vue { } - get isInCostruction () { + get isInCostruction() { return process.env.IN_CONSTRUCTION === '1' } - getPermission() { + public getPermission() { return Notification.permission } - NotServiceWorker() { + public NotServiceWorker() { return (!('serviceWorker' in navigator)) } - PagLogin () { + public PagLogin() { this.$router.replace('/signin') } - PagReg () { + public PagReg() { this.$router.replace('/signup') } - displayConfirmNotification() { + public displayConfirmNotification() { let options = null if ('serviceWorker' in navigator) { options = { @@ -166,21 +156,21 @@ export default class Home extends Vue { if ('serviceWorker' in navigator) { navigator.serviceWorker.ready - .then(function (swreg) { + .then(function(swreg) { swreg.showNotification('Successfully subscribed!', options) }) } } } - urlBase64ToUint8Array(base64String) { - let padding = '='.repeat((4 - base64String.length % 4) % 4) - let base64 = (base64String + padding) + public urlBase64ToUint8Array(base64String) { + const padding = '='.repeat((4 - base64String.length % 4) % 4) + const base64 = (base64String + padding) .replace(/\-/g, '+') .replace(/_/g, '/') - let rawData = window.atob(base64) - let outputArray = new Uint8Array(rawData.length) + const rawData = window.atob(base64) + const outputArray = new Uint8Array(rawData.length) for (let i = 0; i < rawData.length; ++i) { outputArray[i] = rawData.charCodeAt(i) @@ -188,22 +178,21 @@ export default class Home extends Vue { return outputArray } - dataURItoBlob(dataURI) { - let byteString = atob(dataURI.split(',')[1]) - let mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0] - let ab = new ArrayBuffer(byteString.length) - let ia = new Uint8Array(ab) + public dataURItoBlob(dataURI) { + const byteString = atob(dataURI.split(',')[1]) + const mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0] + const ab = new ArrayBuffer(byteString.length) + const ia = new Uint8Array(ab) for (let i = 0; i < byteString.length; i++) { ia[i] = byteString.charCodeAt(i) } - let blob = new Blob([ab], { type: mimeString }) + const blob = new Blob([ab], { type: mimeString }) return blob } - - showNotificationExample() { + public showNotificationExample() { let options = null - let mythis = this + const mythis = this if ('serviceWorker' in navigator) { options = { body: mythis.$t('notification.subscribed'), @@ -222,23 +211,21 @@ export default class Home extends Vue { } navigator.serviceWorker.ready - .then(function (swreg) { + .then(function(swreg) { swreg.showNotification('aaa', options) }) } } - - - askfornotification() { - this.showNotif(this.$t('notification.waitingconfirm'), 'positive', 'notifications') + public askfornotification() { + tools.showNotif(this.$q, this.$t('notification.waitingconfirm'), {color: 'positive', icon: 'notifications'}) Notification.requestPermission((result) => { console.log('User Choice', result) if (result === 'granted') { - this.showNotif(this.$t('notification.confirmed'), 'positive', 'notifications') + tools.showNotif(this.$q, this.$t('notification.confirmed'), {color: 'positive', icon: 'notifications'}) } else { - this.showNotif(this.$t('notification.denied'), 'negative', 'notifications') + tools.showNotif(this.$q, this.$t('notification.denied'), {color: 'negative', icon: 'notifications'}) // displayConfirmNotification(); } @@ -246,8 +233,7 @@ export default class Home extends Vue { } - - test_fetch() { + public test_fetch() { fetch('https:/httpbin.org/post', { method: 'POST', headers: { @@ -257,20 +243,22 @@ export default class Home extends Vue { // mode: 'no-cors', mode: 'cors', body: JSON.stringify({ message: 'Does this work?' }) - }).then(function (response) { + }).then(function(response) { console.log(response) - if (response) + if (response) { return response.json() - else + } + else { return null - }).then(function (data) { + } + }).then(function(data) { console.log(data) - }).catch(function (err) { + }).catch(function(err) { console.log(err) }) } - openCreatePostModal() { + public openCreatePostModal() { console.log('APERTO ! openCreatePostModal') this.conta = this.conta + 1 @@ -287,7 +275,6 @@ export default class Home extends Vue { } - /* backgroundSequence() { window.clearTimeout() diff --git a/src/root/home/home.vue b/src/root/home/home.vue index df5c081..4ae8281 100644 --- a/src/root/home/home.vue +++ b/src/root/home/home.vue @@ -4,12 +4,12 @@
-
+
-
+
FreePlanet
{{$t('msg.sottoTitoloApp')}}
diff --git a/src/statics/i18n.js b/src/statics/i18n.js index f01eb99..4663d12 100644 --- a/src/statics/i18n.js +++ b/src/statics/i18n.js @@ -166,7 +166,7 @@ const messages = { forgetpassword: "Password dimenticata?", err: { required: 'è richiesto', - email: 'dev\'essere una email valida', + email: 'inserire una email valida', errore_generico: 'Si prega di compilare correttamente i campi', atleast: 'dev\'essere lungo almeno di', complexity: 'deve contenere almeno 1 carattere minuscolo, 1 maiuscola e 1 cifra', diff --git a/src/store/Modules/tools.ts b/src/store/Modules/tools.ts index 9987571..fd6a628 100644 --- a/src/store/Modules/tools.ts +++ b/src/store/Modules/tools.ts @@ -4,6 +4,12 @@ import { Todos, UserStore } from '@store' import globalroutines from './../../globalroutines/index' import { costanti } from './costanti' +export interface INotify { + color?: string | 'primary' + textColor?: string + icon?: string | '' +} + export const tools = { EMPTY: 0, CALLING: 10, @@ -431,7 +437,22 @@ export const tools = { }) }) } + }, + showNotif(q: any, msg, data?: INotify | null ) { + let myicon = data ? data.icon : 'ion-add' + if (!myicon) + myicon = 'ion-add' + let mycolor = data ? data.color : 'primary' + if (!mycolor) + mycolor = 'primary' + q.notify({ + message: msg, + icon: myicon, + classes: 'my-notif-class', + color: mycolor, + timeout: 3000 + }) } } diff --git a/src/views/login/requestresetpwd.vue b/src/views/login/requestresetpwd.vue index 964f25a..1656441 100644 --- a/src/views/login/requestresetpwd.vue +++ b/src/views/login/requestresetpwd.vue @@ -57,6 +57,7 @@ import { email, required } from "vuelidate/lib/validators" import { UserStore } from "../../store/Modules"; import { IUserState } from "../../model"; + import { tools } from "../../store/Modules/tools"; export default class RequestResetPwd extends Vue{ emailsent = false form: IUserState = { @@ -78,15 +79,11 @@ // } // }, - showNotif(msg: any) { - this.$q.notify(msg) - } - submit() { this.$v.form.$touch() if (this.$v.form.$error) { - this.showNotif(this.$t('reg.err.errore_generico')) + tools.showNotif(this.$q, this.$t('reg.err.errore_generico')) return } diff --git a/src/views/login/signin/signin.ts b/src/views/login/signin/signin.ts index 3028988..5c5f67f 100644 --- a/src/views/login/signin/signin.ts +++ b/src/views/login/signin/signin.ts @@ -1,12 +1,11 @@ +import { GlobalStore, UserStore } from '@store' import Vue from 'vue' import { Component, Prop, Watch } from 'vue-property-decorator' -import { GlobalStore, UserStore } from '@store' -import { tools } from '../../../store/Modules/tools' import { serv_constants } from '../../../store/Modules/serv_constants' - +import { tools } from '../../../store/Modules/tools' import { ISigninOptions, IUserState } from 'model' -import { validations, TSignin } from './signin-validate' +import { TSignin, validations } from './signin-validate' import { validationMixin } from 'vuelidate' @@ -18,31 +17,29 @@ import globalroutines from '../../../globalroutines/index' // import {Loading, QSpinnerFacebook, QSpinnerGears} from 'quasar' - @Component({ mixins: [validationMixin], - validations: validations, + validations, components: { Logo } }) export default class Signin extends Vue { public $v public $q - loading: boolean - $t: any + public loading: boolean + public $t: any public iswaitingforRes: boolean = false public signin: ISigninOptions = { username: process.env.TEST_USERNAME || '', - password: process.env.TEST_PASSWORD + password: process.env.TEST_PASSWORD || '' } - - created() { + public created() { this.$v.$reset() if (UserStore.state.resStatus === serv_constants.RIS_CODE__HTTP_FORBIDDEN_INVALID_TOKEN) { - this.showNotif(this.$t('fetch.error_doppiologin')) + tools.showNotif(this.$q, this.$t('fetch.error_doppiologin')) } // this.$myconfig.socialLogin.facebook = true @@ -53,9 +50,6 @@ export default class Signin extends Vue { return process.env } - showNotif(msg: any) { - this.$q.notify(msg) - } public getlinkforgetpwd() { return '/requestresetpwd' @@ -63,47 +57,47 @@ 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); } } - checkErrors(riscode) { + public checkErrors(riscode) { // console.log('checkErrors: ', riscode) try { if (riscode === tools.OK) { - this.showNotif({ type: 'positive', message: this.$t('login.completato') }) + 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( () => { this.$q.loading.hide() }, 200) - this.showNotif(this.$t('login.errato')) + tools.showNotif(this.$q, this.$t('login.errato')) this.iswaitingforRes = false this.$router.push('/signin') }) } else if (riscode === tools.ERR_SERVERFETCH) { - this.showNotif(this.$t('fetch.errore_server')) + tools.showNotif(this.$q, this.$t('fetch.errore_server')) } else if (riscode === tools.ERR_GENERICO) { - let msg = this.$t('fetch.errore_generico') + UserStore.mutations.getMsgError(riscode) - this.showNotif(msg) + const msg = this.$t('fetch.errore_generico') + UserStore.mutations.getMsgError(riscode) + tools.showNotif(this.$q, msg) } else { - this.showNotif('Errore num ' + riscode) + tools.showNotif(this.$q, 'Errore num ' + riscode) } if (riscode !== serv_constants.RIS_CODE_LOGIN_ERR) { @@ -118,44 +112,46 @@ export default class Signin extends Vue { } } - redirect(response) { + public redirect(response) { this.loading = false window.location.href = response.data.redirect } - error(error) { + public error(error) { this.loading = false this.$errorHandler(this, error) } - facebook() { + public facebook() { this.loading = true this.$axios.get('/backend/loginFacebook') - .then(response => this.redirect(response)) - .catch(error => this.error(error)) + .then((response) => this.redirect(response)) + .catch((error) => this.error(error)) } - google() { + public google() { } - submit() { + public submit() { this.$v.signin.$touch() if (this.$v.signin.$error) { - this.showNotif(this.$t('reg.err.errore_generico')) + tools.showNotif(this.$q, this.$t('reg.err.errore_generico')) return } let msg = this.$t('login.incorso') - if (process.env.DEBUG) + if (process.env.DEBUG) { msg += ' ' + process.env.MONGODB_HOST + } this.$q.loading.show({ message: msg}) // disable Button Login: this.iswaitingforRes = true - if (process.env.DEBUG) + if (process.env.DEBUG) { console.log('this.signin', this.signin) + } UserStore.actions.signin(this.signin) .then((riscode) => { @@ -165,10 +161,12 @@ export default class Signin extends Vue { } return riscode }).then((riscode) => { - if (UserStore.state.lang !== '') - this.$i18n.locale = UserStore.state.lang // Set Lang - else - UserStore.mutations.setlang(this.$i18n.locale) // Set Lang + if (UserStore.state.lang !== '') { + this.$i18n.locale = UserStore.state.lang + } // Set Lang + else { + UserStore.mutations.setlang(this.$i18n.locale) + } // Set Lang // console.log('LANG ORA=', UserStore.state.lang) @@ -178,10 +176,10 @@ export default class Signin extends Vue { .then((riscode) => { if (riscode === tools.OK) { GlobalStore.actions.createPushSubscription() - .then(rissub => { + .then((rissub) => { }) - .catch(e => { + .catch((e) => { console.log('ERROR Subscription = ' + e) }) } @@ -189,7 +187,7 @@ export default class Signin extends Vue { this.checkErrors(riscode) }) - .catch(error => { + .catch((error) => { console.log('ERROR SIGNIN = ' + error) this.checkErrors(error) diff --git a/src/views/login/signin/signin.vue b/src/views/login/signin/signin.vue index 09795e1..1c2b8fd 100644 --- a/src/views/login/signin/signin.vue +++ b/src/views/login/signin/signin.vue @@ -9,51 +9,55 @@
+
- - + :error-message="`${errorMsg('username', $v.signin.username)}`" + :label="$t('reg.username_login')"> - + + + + - + :error-message="`${errorMsg('password', $v.signin.password)}`" + :label="$t('reg.password')"> + - + + -
+
- - - - + + + + -
- {{$t('login.enter')}} - +
+ {{$t('login.enter')}} + +
diff --git a/src/views/login/signup/signup.ts b/src/views/login/signup/signup.ts index 64f77d5..2448f14 100644 --- a/src/views/login/signup/signup.ts +++ b/src/views/login/signup/signup.ts @@ -88,11 +88,6 @@ export default class Signup extends Vue { return process.env } - showNotif(params: any) { - this.$q.notify(params) - } - - public errorMsg(cosa: string, item: any) { try { if (!item.$error) return '' @@ -126,19 +121,19 @@ export default class Signup extends Vue { checkErrors(riscode: number) { console.log('checkErrors', riscode) if (riscode === tools.DUPLICATE_EMAIL_ID) { - this.showNotif(this.$t('reg.err.duplicate_email')) + tools.showNotif(this.$q, this.$t('reg.err.duplicate_email')) } else if (riscode === tools.DUPLICATE_USERNAME_ID) { - this.showNotif(this.$t('reg.err.duplicate_username')) + tools.showNotif(this.$q, this.$t('reg.err.duplicate_username')) } else if (riscode === tools.ERR_SERVERFETCH) { - this.showNotif(this.$t('fetch.errore_server')) + tools.showNotif(this.$q, this.$t('fetch.errore_server')) } else if (riscode === tools.ERR_GENERICO) { let msg = this.$t('fetch.errore_generico') + UserStore.mutations.getMsgError(riscode) - this.showNotif(msg) + tools.showNotif(this.$q, msg) } else if (riscode === tools.OK) { this.$router.push('/signin') - this.showNotif({type: 'warning', textColor: 'black', message: this.$t('components.authentication.email_verification.link_sent')}) + tools.showNotif(this.$q, this.$t('components.authentication.email_verification.link_sent'), {color: 'warning', textColor: 'black'}) } else { - this.showNotif('Errore num ' + riscode) + tools.showNotif(this.$q, 'Errore num ' + riscode) } @@ -152,12 +147,12 @@ export default class Signup extends Vue { this.duplicate_username = false if (!this.signup.terms) { - this.showNotif(this.$t('reg.err.terms')) + tools.showNotif(this.$q, this.$t('reg.err.terms')) return } if (this.$v.signup.$error) { - this.showNotif(this.$t('reg.err.errore_generico')) + tools.showNotif(this.$q, this.$t('reg.err.errore_generico')) return } diff --git a/src/views/login/updatepassword.vue b/src/views/login/updatepassword.vue index ef7ddc0..f3b1300 100644 --- a/src/views/login/updatepassword.vue +++ b/src/views/login/updatepassword.vue @@ -69,6 +69,7 @@ import { required } from "vuelidate/lib/validators" import { UserStore } from "../../store/Modules"; import { IUserState } from "../../model"; + import { tools } from "../../store/Modules/tools"; export default class UpdatePassword extends Vue { emailsent = false @@ -96,15 +97,11 @@ // } // }, - showNotif(msg: any) { - this.$q.notify(msg) - } - submit() { this.$v.form.$touch() if (this.$v.form.$error) { - this.showNotif(this.$t('reg.err.errore_generico')) + tools.showNotif(this.$q, this.$t('reg.err.errore_generico')) return } diff --git a/tslint.json b/tslint.json index df5276e..9e21ce7 100644 --- a/tslint.json +++ b/tslint.json @@ -6,6 +6,7 @@ "jsRules": {}, "rules": { "no-console": false, + "object-literal-sort-keys": false, // "no-restricted-syntax": [ // "error", // { @@ -22,11 +23,13 @@ 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",