fix fields login

This commit is contained in:
Paolo Arena
2019-03-13 13:40:17 +01:00
parent 67748ce94f
commit 9376b397d7
21 changed files with 207 additions and 203 deletions

View File

@@ -39,3 +39,8 @@
transform: translateX(1600px);
}
}
.my-notif-class{
font-weight: bold;
}

View File

@@ -17,6 +17,6 @@
</template>
<script lang="ts" src="./App.ts">
</script>
<style lang="scss" scoped>
<style lang="scss">
@import './App.scss';
</style>

View File

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

View File

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

View File

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

View File

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

View File

@@ -450,7 +450,6 @@ export default class SingleTodo extends Vue {
this.updateicon()
}
// this.$q.notify('setPriority: ' + elem)
}
public async askConfirmDelete() {

View File

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

View File

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

View File

@@ -8,15 +8,15 @@
<div v-for="item in parent.routes">
<div v-if="item.routes2">
<q-expansion-item
:header-inset-level="1"
:content-inset-level="1"
:header-inset-level="0.5"
:content-inset-level="0.5"
:label="$t(item.name)"
:icon="item.materialIcon"
class="titleSubMenu"
>
<q-expansion-item v-for="(child2, index) in item.routes2" :to="child2.route" :key="index"
:header-inset-level="1.1"
:header-inset-level="0.5"
:duration="300"
expand-icon="map"
:active="child2.label === 'Outbox'"

View File

@@ -286,19 +286,29 @@ body.mobile .landing:before {
padding-left: 20px;
}
.clgutter{
margin-top:20px;
padding: 10px;
}
@media (max-width: 718px) {
.landing__hero {
text-align: center
}
.landing__header {
height: 9vh
height: 7vh
}
.clgutter{
margin-top: 0px;
padding: 0px;
}
.landing__hero .text-h1 {
font-size: 3rem;
line-height: 3.05rem;
margin-bottom: 24px
}
.landing > section.padding {
padding: 40px 16px
//padding-bottom: 90px

View File

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

View File

@@ -4,12 +4,12 @@
<section>
<div class="landing__hero">
<div class="landing__header"></div>
<div class="landing__hero-content row justify-center q-gutter-xl">
<div class="landing__hero-content row justify-center q-gutter-xs clgutter">
<div class="row">
<logo></logo>
</div>
<div class="flex justify-end">
<div class="q-gutter-sm testo-banda">
<div class="q-gutter-xs testo-banda clgutter">
<div class="text-h1 shadow-max">FreePlanet</div>
<div class="text-subtitle1 shadow text-italic q-pl-sm">{{$t('msg.sottoTitoloApp')}}
</div>

View File

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

View File

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

View File

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

View File

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

View File

@@ -9,34 +9,36 @@
<!--Prova URL : {{env('PROVA_PAOLO')}}-->
<form>
<div class="q-gutter-md">
<q-field
:error="$v.signin.username.$error"
:error-label="`${errorMsg('username', $v.signin.username)}`"
>
<q-input
v-model="signin.username"
rounded outlined
autocomplete="username"
@change="val => { signin.username = val }"
:before="[{icon: 'person', handler () {}}]"
@blur="$v.signin.username.$touch"
:error="$v.signin.username.$error"
:float-label="$t('reg.username_login')"></q-input>
</q-field>
:error-message="`${errorMsg('username', $v.signin.username)}`"
:label="$t('reg.username_login')">
<q-field
:error="$v.signin.password.$error"
:error-label="`${errorMsg('password', $v.signin.password)}`"
>
<template v-slot:prepend>
<q-icon name="person"/>
</template>
</q-input>
<q-input
v-model="signin.password"
type="password"
:before="[{icon: 'vpn_key', handler () {}}]"
rounded outlined
@blur="$v.signin.password.$touch"
:error="$v.signin.password.$error"
:float-label="$t('reg.password')"></q-input>
</q-field>
:error-message="`${errorMsg('password', $v.signin.password)}`"
:label="$t('reg.password')">
<template v-slot:prepend>
<q-icon name="vpn_key"/>
</template>
</q-input>
<div>
<a :href="getlinkforgetpwd">{{$t('reg.forgetpassword')}}</a>
</div>
@@ -52,9 +54,11 @@
</q-card>
<div align="center">
<q-btn rounded size="lg" color="primary" @click="submit" :disable="$v.$error || iswaitingforRes">{{$t('login.enter')}}
<q-btn rounded size="lg" color="primary" @click="submit"
:disable="$v.$error || iswaitingforRes">{{$t('login.enter')}}
</q-btn>
</div>
</div>
</form>
</q-page>
</div>

View File

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

View File

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

View File

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