Files
zitadel/console/src/app/pages/validators.ts
T
65058ed17c feat(console): domain verification, create org, regexp route guards, change org, iam member (#573)
* verification dialog, service

* i18n, verification dialog

* file saver

* savefile

* verify trigger

* delete project, i18n

* org create dialog

* org-create-self

* stylelint

* fix signout redirect

* rm unused dialog component, import

* project i18n de

* regexp roles

* use regex to check permissions

* border radius

* change validation flow

* update org member

* iam member change

* lint

* rm unused css

* Update console/src/assets/i18n/de.json

Co-authored-by: Fabi <[email protected]>

* Update console/src/assets/i18n/de.json

Co-authored-by: Fabi <[email protected]>

* change guard

Co-authored-by: Fabi <[email protected]>
2020-08-12 08:47:53 +02:00

46 lines
971 B
TypeScript

import { FormControl } from '@angular/forms';
export function symbolValidator(c: FormControl): any {
const REGEXP: RegExp = /[^a-z0-9]/gi;
return REGEXP.test(c.value) ? null : {
invalid: true,
symbolValidator: {
valid: false,
},
};
}
export function numberValidator(c: FormControl): any {
const REGEXP = /[0-9]/g;
return REGEXP.test(c.value) ? null : {
invalid: true,
numberValidator: {
valid: false,
},
};
}
export function upperCaseValidator(c: FormControl): any {
const REGEXP = /[A-Z]/g;
return REGEXP.test(c.value) ? null : {
invalid: true,
upperCaseValidator: {
valid: false,
},
};
}
export function lowerCaseValidator(c: FormControl): any {
const REGEXP = /[a-z]/g;
return REGEXP.test(c.value) ? null : {
invalid: true,
lowerCaseValidator: {
valid: false,
},
};
}