baseUrl regex

This commit is contained in:
Michele Artini 2023-02-03 11:57:12 +01:00
parent 78ffdd538a
commit 7f71c5f3d0
2 changed files with 5 additions and 3 deletions

View File

@ -60,8 +60,10 @@
<mat-form-field appearance="fill" floatLabel="always" style="width: 100%;">
<mat-label>Base URL</mat-label>
<input matInput formControlName="baseurl" />
<mat-error *ngIf="addApiForm.get('baseurl')?.invalid">This field is
<strong>required</strong></mat-error>
<mat-error *ngIf="addApiForm.get('baseurl')?.invalid">
Invalid URL
<span *ngIf="addApiForm.get('baseurl')?.hasError('required')">: This field is <strong>required</strong></span>
</mat-error>
</mat-form-field>
<ng-container *ngFor="let p of selProtParams">

View File

@ -179,7 +179,7 @@ export class DsmAddApiDialog {
compatibility : new FormControl('', [Validators.required]),
contentdescription : new FormControl('', [Validators.required]),
protocol : new FormControl('', [Validators.required]),
baseurl : new FormControl('', [Validators.required]),
baseurl : new FormControl('', [Validators.required, Validators.pattern('^(http|https|ftp|file|sftp|jar|mongodb):\/\/')]),
metadataIdentifierPath : new FormControl('', [Validators.required])
});