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

Skip to content
Snippets Groups Projects
domain-panel.component.html 4.18 KiB
Newer Older
<div id="domain-panel" class="mat-elevation-z2" >
  <form [formGroup]="domainForm" (ngSubmit)="onSaveClicked()">
    <h3>Domain details</h3>
    <mat-form-field style="width:100%">
      <mat-label>Domain Code</mat-label>
      <input matInput placeholder="Domain Code"
             id="domainCode_id" #domainCode
             matTooltip="The SMP's domain code. The code must be unique and is used in HTTP header 'Domain' or URL path sequence when retrieving /creating the resource using the webservice API"
             formControlName="domainCode" maxlength="63"
             (keydown)="onFieldKeyPressed('domainCode', 'domainCodeTimeout')"
             required>
      <mat-hint align="end">For WS API integration: the Domain property</mat-hint>
      <div
        *ngIf="(!editMode && domainForm.controls['domainCode'].touched || editMode) &&  domainForm.controls['domainCode'].hasError('pattern')"
        style="color:red; font-size: 70%">
        Domain code must contain only chars and numbers and must be less than 63 chars long.
      </div>
      <div
        *ngIf="!!fieldWarningTimeoutMap.domainCodeTimeout"
        style="color:darkorange; font-size: 70%">
        Domain code must contain only chars and numbers and must be less than 63 chars long.
      </div>
      <div
        *ngIf="(!editMode && domainForm.controls['domainCode'].touched || editMode) &&  domainForm.controls['domainCode'].hasError('notInList')"
        style="color:red; font-size: 70%">
        The Domain code already exists!
      </div>
    </mat-form-field>
    <mat-form-field style="width:100%">
      <input matInput placeholder="SML domain"
             matTooltip="The domain-specific part of the SML DNS zone (e.g., ‘mydomain’ for mydomain.sml.dns.zone or leave empty for sml.dns.zone). Note: has informative value only, SML DNS zone used for publishing is based on SML configuration."
             name="smlSubdomain"
             (keydown)="onFieldKeyPressed('domainCode', 'smlSubdomainTimeout')"
             id="smldomain_id"
             formControlName="smlSubdomain" maxlength="63">
      <mat-hint align="end">The domain-specific part of the SML DNS zone (e.g., ‘mydomain’ for
        mydomain.sml.dns.zone).
      </mat-hint>
      <div
        *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 nor a hyphen and should not end with a hyphen.
      </div>
      <div
        *ngIf="!!fieldWarningTimeoutMap.smlSubdomainTimeout"
        style="color:darkorange; 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 nor a hyphen and should not end with a hyphen.
      </div>
      <div
        *ngIf="(!editMode && domainForm.controls['smlSubdomain'].touched || editMode) &&  domainForm.controls['smlSubdomain'].hasError('notInList')"
        style="color:red; font-size: 70%">
        The SML subdomain is already defined!
      </div>
      <div
        *ngIf="(!editMode &&  domainForm.controls['smlSubdomain'].hasError('blankDomainError'))"
        style="color:red; font-size: 70%">
        Domain with empty sml subdomain already exists!
      </div>
    </mat-form-field>
    <mat-form-field style="width:100%">
      <mat-select placeholder="Response signature Certificate (Signature CertAlias)"
                  formControlName="signatureKeyAlias"
                  name="cert"
                  matTooltip="Certificate is used for signing REST responses for the domain."
                  id="signatureKeyAlias_id">
        <mat-option [value]="''">Choose certificate for signing soap response</mat-option>
        <mat-option *ngFor="let cert of keystoreCertificates" [value]="cert.alias">
          {{cert.alias}} ({{cert.certificateId}})
        </mat-option>
      </mat-select>
      <mat-hint align="end">Empty value will cause that Resource responses will not be signed by SMP!
      </mat-hint>
    </mat-form-field>
  </form>
</div>