Code development platform for open source projects from the European Union institutions

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

- add restriction for participant id and service group details

parent 3404e608
No related branches found
No related tags found
No related merge requests found
......@@ -27,7 +27,8 @@
[formControl]="domainForm.controls['smlSubdomain']" maxlength="63" >
<mat-hint align="end">Part of DNS Zone (e.g. for eHealth: 'ehealth', for peppol: '', ..</mat-hint>
<div
*ngIf="(!editMode && domainForm.controls['smlSubdomain'].touched || editMode) && domainForm.controls['smlSubdomain'].hasError('pattern')"
*ngIf="(!editMode && domainForm.controls['smlSubdomain'].touched || editMode)
&& domainForm.controls['smlSubdomain'].hasError('pattern')"
style="color:red; font-size: 70%">
SML domain should be up to 63 characters long, should only contain alphanumeric and hyphen characters,
should not start with a digit and should not end with a hyphen.
......
......@@ -19,6 +19,7 @@ export class DomainDetailsDialogComponent {
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}$';
// is part of domain
readonly domainCodePattern = '^[a-zA-Z0-9]{1,63}$';
editMode: boolean;
......
......@@ -11,11 +11,11 @@
<mat-form-field style="width:100%">
<input matInput placeholder="Participant identifier" name="participantIdentifier"
id="participantIdentifier_id"
[formControl]="dialogForm.controls['participantIdentifier']" maxlength="255" required>
[formControl]="dialogForm.controls['participantIdentifier']" maxlength="50" required>
<div
*ngIf="(!editMode && dialogForm.controls['participantIdentifier'].touched || editMode) && dialogForm.controls['participantIdentifier'].hasError('required')"
style="color:red; font-size: 70%">
Participant identifier must not be empty.
Participant identifier must not be empty and must be up to 50 characters long.
</div>
<div
*ngIf="(!editMode && dialogForm.controls['participantIdentifier'].hasError('dbExist'))"
......@@ -28,12 +28,18 @@
<input matInput placeholder="Participant scheme" name="participantScheme"
id="participantScheme_id"
[formControl]="dialogForm.controls['participantScheme']"
maxlength="255" required>
maxlength="25" required>
<div
*ngIf="(!editMode && dialogForm.controls['participantScheme'].touched || editMode) && dialogForm.controls['participantScheme'].hasError('required')"
style="color:red; font-size: 70%">
Participant scheme must not be empty.
</div>
<div
*ngIf="(!editMode && dialogForm.controls['participantScheme'].touched || editMode) &&
dialogForm.controls['participantScheme'].hasError('pattern')"
style="color:red; font-size: 70%">
Participant scheme must be up to 63 characters long. The Scheme Identifier MUST take the form [domain]-[identifierArea]-[identifierType] (ex.: 'busdox-actorid-upis') and may only contain the following characters: [a-z0-9]+-[a-z0-9]+-[a-z0-9]+.
</div>
</mat-form-field>
</div>
</mat-card-content>
......
......@@ -27,6 +27,9 @@ export class ServiceGroupDetailsDialogComponent implements OnInit {
static readonly NEW_MODE = 'New ServiceGroup';
static readonly EDIT_MODE = 'ServiceGroup Edit';
readonly participantSchemePattern ='^[a-z0-9]+-[a-z0-9]+-[a-z0-9]+$';
@ViewChild('domainSelector') domainSelector: any;
editMode: boolean;
......@@ -86,9 +89,10 @@ export class ServiceGroupDetailsDialogComponent implements OnInit {
value: '',
disabled: this.current.status !== SearchTableEntityStatus.NEW
},
this.current.status !== SearchTableEntityStatus.NEW ? Validators.required : null),
this.current.status === SearchTableEntityStatus.NEW ? Validators.required : null),
'participantScheme': new FormControl({value: '', disabled: this.current.status !== SearchTableEntityStatus.NEW},
this.current.status !== SearchTableEntityStatus.NEW ? Validators.required : null),
this.current.status === SearchTableEntityStatus.NEW ?
[Validators.required, Validators.pattern(this.participantSchemePattern)] : null),
'serviceGroupDomains': new FormControl({value: []}, [this.minSelectedListCount(1)]),
'users': new FormControl({value: []}, [this.minSelectedListCount(1)]),
'extension': new FormControl({value: ''}, []),
......
No preview for this file type
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