minimo 6 caratteri la registrazione username

Ridurre a 3 gli stati ContribTypes (
aggiornato il regex dell'username in fase di registrazione: caratteri speciali consentiti solo all'interno di una parola
This commit is contained in:
paoloar77
2022-02-15 12:45:53 +01:00
parent e7f65ceb16
commit 10f10d874b
18 changed files with 39 additions and 16 deletions

View File

@@ -14,7 +14,11 @@ export class Patterns {
*
* public static Password: RegExp = /^((?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[@#$%!\-]).{6,20})/i
*
* 8 to 20 characters string with at least one digit, one upper case letter, one lower case letter and one special symbol
* 6 to 30 characters string with at least one digit, one upper case letter, one lower case letter and one special symbol
*/
public static Username = /^[a-zA-Z0-9]+([_@.-]?[a-zA-Z0-9])*$/i
// * 8 to 20 characters string with at least one digit, one upper case letter, one lower case letter
public static Password = /^((?=.*[A-Z])(?=.*\d)(?!.* ).{8,30})/i
}

View File

@@ -384,7 +384,7 @@
:useinput="isInModif">
</CMySelect>
</div>
<div v-else-if="col.fieldtype === costanti.FieldType.star5">
<div v-else-if="(col.fieldtype === costanti.FieldType.star5 || col.fieldtype === costanti.FieldType.star3)">
<div v-if="isInModif">
<CMySelect
:type_out="col.field_outtype"
@@ -410,7 +410,7 @@
:color="tools.getColByLevel(myvalue)"
icon="star_border"
icon-selected="star"
:max="5"
:max="costanti.FieldType.star5 ? 5 : 3"
:readonly="true"
/>
</div>
@@ -701,7 +701,7 @@
:optlab="fieldsTable.getLabelByTable(col.jointable)">
</CMyToggleList>
</div>
<div v-else-if="col.fieldtype === costanti.FieldType.star5">
<div v-else-if="(col.fieldtype === costanti.FieldType.star5 || col.fieldtype === costanti.FieldType.star3)">
<CMySelect
:type_out="col.field_outtype"
:col="col"

View File

@@ -40,7 +40,7 @@
:label="$t('reg.password')"
:rules="[
val => !!val || $t('reg.err.required'),
val => val.length > 6 || $t('reg.err.atleast') + ' 6 ' + $t('reg.err.char'),
val => val.length > 8 || $t('reg.err.atleast') + ' 8 ' + $t('reg.err.char'),
]">
<template v-slot:prepend>

View File

@@ -18,7 +18,7 @@ import useVuelidate from '@vuelidate/core'
import { minLength, required, sameAs } from '@vuelidate/validators'
// import { ValidationRuleset } from 'vuelidate'
import { complexity, registereduser, aportadorexist } from '../../validation'
import { complexity, complexityUser, registereduser, aportadorexist } from '../../validation'
// import 'vue3-tel-input/dist/vue3-tel-input.css'
import { useRoute, useRouter } from 'vue-router'
@@ -94,6 +94,7 @@ export default defineComponent({
username: {
required,
minLength: minLength(6),
complexityUser,
registereduser,
},
terms: {

View File

@@ -136,6 +136,7 @@ export default defineComponent({
username: 1,
name: 1,
surname: 1,
mycities: 1,
'profile.img': 1,
'profile.qualifica': 1,
}

View File

@@ -192,6 +192,7 @@ const msg_de = {
errore_generico: 'Please review fields again',
atleast: 'must be at least',
complexity: 'must contains at least 1 lowercase letter, 1 uppercase letter, 1 digit',
complexityUser: 'caratteri consentiti: tratteggio (_), meno (-) e il punto (.)',
notmore: 'must not be more than',
char: 'characters long',
terms: 'You need to agree with the terms & conditions.',

View File

@@ -379,6 +379,7 @@ const msg_enUs = {
errore_generico: 'Please review fields again',
atleast: 'must be at least',
complexity: 'must contains at least 1 lowercase letter, 1 uppercase letter, 1 digit',
complexityUser: 'caratteri consentiti: tratteggio (_), meno (-) e il punto (.)',
notmore: 'must not be more than',
char: 'characters long',
terms: 'You need to agree with the terms & conditions.',

View File

@@ -382,6 +382,7 @@ const msg_es = {
errore_generico: 'Por favor, rellene los campos correctamente',
atleast: 'debe ser al menos largo',
complexity: 'debe contener al menos 1 minúscula, 1 mayúscula, 1 dígito',
complexityUser: 'caratteri consentiti: tratteggio (_), meno (-) e il punto (.)',
notmore: 'no tiene que ser más largo que',
char: 'caracteres',
terms: 'Debes aceptar las condiciones, para continuar..',

View File

@@ -380,6 +380,7 @@ const msg_fr = {
errore_generico: 'S\'il vous plaît remplir les champs correctement',
atleast: 'ça doit être au moins long',
complexity: 'doit contenir au moins 1 minuscule, 1 majuscule, 1 chiffre',
complexityUser: 'caratteri consentiti: tratteggio (_), meno (-) e il punto (.)',
notmore: 'il ne doit pas être plus long que',
char: 'caractères',
terms: 'Vous devez accepter les conditions, pour continuer..',

View File

@@ -453,7 +453,7 @@ const msg_it = {
sospeso: 'Sospeso',
username: 'Username',
username_reg: 'Scegli il tuo Username',
username_hint: 'i caratteri speciali consentiti sono il tratteggio (_) e il meno (-)',
username_hint: 'caratteri consentiti: tratteggio (_), meno (-) e il punto (.)',
username_pseudonimo: 'Username (Pseudonimo)',
username_short: 'Username',
name: 'Nome',
@@ -517,6 +517,7 @@ const msg_it = {
errore_generico: 'Si prega di compilare correttamente i campi',
atleast: 'dev\'essere lungo almeno di',
complexity: 'deve contenere almeno 1 minuscola, 1 maiuscola, 1 cifra',
complexityUser: 'caratteri consentiti: tratteggio (_), meno (-) e il punto (.)',
notmore: 'non dev\'essere lungo più di',
char: 'caratteri',
terms: 'Devi accettare le condizioni, per continuare.',

View File

@@ -392,6 +392,7 @@ const msg_pt = {
errore_generico: 'Por favor preencha os campos corretamente',
atleast: 'deve ser pelo menos',
complexity: 'deve conter pelo menos 1 letra minúscula, 1 capital, 1 dígito',
complexityUser: 'caratteri consentiti: tratteggio (_), meno (-) e il punto (.)',
notmore: 'não deve ser maior do que',
char: 'caracteres',
terms: 'Você deve aceitar as condições, para continuar',

View File

@@ -393,6 +393,7 @@ const msg_si = {
errore_generico: 'Prosimo, da pravilno izpolnete vsa polja',
atleast: 'mora biti dolgo vsaj',
complexity: 'ora vsebobati vsaj 1 malo črko, 1 veliko črko, 1 številko',
complexityUser: 'caratteri consentiti: tratteggio (_), meno (-) e il punto (.)',
notmore: 'ne sme biti dolgo več kot',
char: 'karakterji',
terms: 'Za nadaljevanje, moraš sprejeti pogoje poslovanja.',

View File

@@ -84,6 +84,7 @@ export const costanti = {
binary: 8,
html: 16,
select: 32,
star3: 35,
star5: 40,
number: 64,
typeinrec: 128,

View File

@@ -591,7 +591,7 @@ export const colmySkills = [
AddCol({
name: 'numLevel',
label_trans: 'level.name',
fieldtype: costanti.FieldType.star5,
fieldtype: costanti.FieldType.star3,
required: false,
jointable: 'levels',
showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit + costanti.showWhen.InView_OnlyifExist,
@@ -604,7 +604,7 @@ export const colmySkills = [
fieldtype: costanti.FieldType.multiselect,
jointable: 'statusSkills',
showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit + costanti.showWhen.InView_OnlyifExist,
noshowlabel: false,
noshowlabel: true,
icon: 'mood',
}),
AddCol({
@@ -613,7 +613,7 @@ export const colmySkills = [
fieldtype: costanti.FieldType.multiselect,
jointable: 'contribtypes',
showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit + costanti.showWhen.InView_OnlyifExist,
noshowlabel: false,
noshowlabel: true,
icon: 'currency_exchange',
//icon: 'fas fa-hands-helping',
}),

View File

@@ -4315,6 +4315,11 @@ export const tools = {
return t('reg.err.complexity')
}
}
if (item.complexityUser !== undefined) {
if (item.complexityUser.$invalid) {
return t('reg.err.complexityUser')
}
}
// if (!item.maxLength) { return t('reg.err.notmore') + ` ${item.$params.maxLength.max} ` + t('reg.err.char') }
if (item.required !== undefined) {

View File

@@ -3,3 +3,7 @@ import { Patterns } from '@/common'
export function complexity(password: string) {
return Patterns.Password.test(password)
}
export function complexityUser(username: string) {
return Patterns.Username.test(username)
}

View File

@@ -2,6 +2,6 @@ export { duplicate } from './duplicate'
export { registereduser } from './registereduser'
export { aportadorexist } from './aportadorexist'
export { registeredemail } from './registeredemail'
export { complexity } from './complexity'
export { complexity, complexityUser } from './complexity'
export { alfanum } from './alfanum'
export { email } from './email'

View File

@@ -215,21 +215,21 @@
</div>
<div class="row">
<q-btn
label="emptyDbSkill" color="negative"
label="1. Cancella e Ricrea tutte le Tabelle (Sector, Skill, SubSkill, City, Province, Contribtype, AdType)" color="negative"
@click="EseguiFunz('emptyDbSkill')"></q-btn>
<br>
</div>
<div class="row">
<q-btn
label="copyFrom1To13" color="negative"
@click="EseguiFunz('copyFrom1To13')"></q-btn>
label="2. Popola Tutte le Tabelle vuote (o incomplete)" color="negative"
@click="EseguiFunz('PopulateTables')"></q-btn>
<br>
</div>
<div class="row">
<q-btn
label="Populate Tables" color="negative"
@click="EseguiFunz('PopulateTables')"></q-btn>
label="copyFrom1To13" color="negative"
@click="EseguiFunz('copyFrom1To13')"></q-btn>
<br>
</div>