Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS will be completely phased out by mid-2025. To see alternatives please check here

Skip to content
Snippets Groups Projects
Commit f69b44d4 authored by Joze RIHTARSIC's avatar Joze RIHTARSIC
Browse files

Pull request #235: UI: fix smpIdDomainPattern and subDomainPattern regular expressions validation

Merge in EDELIVERY/smp from bugfix/EDELIVERY-10114-smlsmpid-in-domain-popup-accepting-the-invalid-value to development

* commit 'aae6b7436df1888fb79c7ebbdfcc727f48450194':
  UI: fix smpIdDomainPattern and subDomainPattern regular expressions validation
parents 47041853 32c8b361
No related branches found
No related tags found
No related merge requests found
......@@ -18,8 +18,9 @@ export class DomainDetailsDialogComponent {
static readonly NEW_MODE = 'New Domain';
static readonly EDIT_MODE = 'Domain Edit';
readonly subDomainPattern = '^(?![0-9]+$)(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$';
readonly smpIdDomainPattern = '^(?![0-9]+$)(?!.*-$)(?!-)[a-zA-Z0-9-]{0,63}$';
readonly dnsDomainPattern = '^([a-zA-Z]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?){0,63}$';
readonly subDomainPattern = this.dnsDomainPattern;
readonly smpIdDomainPattern = this.dnsDomainPattern;
// is part of domain
readonly domainCodePattern = '^[a-zA-Z0-9]{1,63}$';
......@@ -28,7 +29,7 @@ export class DomainDetailsDialogComponent {
current: DomainRo & { confirmation?: string };
domainForm: FormGroup;
domain;
selectedSMLCert: CertificateRo =null;
selectedSMLCert: CertificateRo = null;
notInList(list: string[], exception: string) {
......@@ -96,7 +97,7 @@ export class DomainDetailsDialogComponent {
if (this.current.smlClientKeyAlias) {
this.selectedSMLCert = this.lookups.cachedCertificateList.find(crt => crt.alias === this.current.smlClientKeyAlias);
this.domainForm.controls['smlClientKeyCertificate'].setValue(this.selectedSMLCert );
this.domainForm.controls['smlClientKeyCertificate'].setValue(this.selectedSMLCert);
}
this.responsive.observe(Breakpoints.Small)
......@@ -113,14 +114,14 @@ export class DomainDetailsDialogComponent {
this.checkValidity(this.domainForm)
// check if empty domain already exists
if(this.current.status === SearchTableEntityStatus.NEW
&& !this.domainForm.value['smlSubdomain'] ){
if (this.current.status === SearchTableEntityStatus.NEW
&& !this.domainForm.value['smlSubdomain']) {
var domainWithNullSML = this.lookups.cachedDomainList.filter(function(dmn) {
var domainWithNullSML = this.lookups.cachedDomainList.filter(function (dmn) {
return !dmn.smlSubdomain;
})[0];
if(!domainWithNullSML) {
if (!domainWithNullSML) {
this.dialogRef.close(true);
} else {
this.domainForm.controls['smlSubdomain'].setErrors({'blankDomainError': true});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment