- other committ
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -19,6 +19,12 @@ export const validations = {
|
||||
registereduser,
|
||||
required
|
||||
},
|
||||
name: {
|
||||
required
|
||||
},
|
||||
surname: {
|
||||
required
|
||||
},
|
||||
email: {
|
||||
email,
|
||||
registeredemail,
|
||||
|
||||
@@ -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') }
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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[],
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user