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

Skip to content
Snippets Groups Projects
domain-panel.component.html 4.53 KiB
Newer Older
<div id="domain-panel" class="mat-elevation-z2" >
  <form [formGroup]="domainForm" >
    <h3>Domain details</h3>
    <div class="panel" *ngIf="_domain!=null &&  !_domain.domainId"><p style="font-weight: bold">Enter data and click 'Save' to create new domain</div>
Joze RIHTARSIC's avatar
Joze RIHTARSIC committed
    <smp-warning-panel *ngIf=" !!_domain?.domainId && !domainResourceTypes?.length"

                       icon="warning"
                       label="To complete domain configuration please select at least one resource type on tab 'Resource Types'"></smp-warning-panel>
    <mat-form-field style="width:100%">
      <mat-label>Domain Code</mat-label>
      <input matInput
             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
             auto-focus-directive>
      <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%">
      <mat-label>Response signature Certificate (Signature CertAlias)</mat-label>
      <mat-select formControlName="signatureKeyAlias"
                  matTooltip="Certificate is used for signing REST responses for the domain."
                  id="signatureKeyAlias_id">
        <mat-option [value]="''" ></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>

    <mat-form-field style="width:100%">
      <mat-label>Visibility of the domain</mat-label>
      <mat-select  formControlName="visibility"
                  name="visibility"
                  matTooltip="Visibility of the domain."
                  id="domainVisibility_id">
        <mat-option *ngFor="let visibility of domainVisibilityOptions"
                    [value]="visibility.value">
          {{visibility.key}}
        </mat-option>
      </mat-select>
      <mat-hint align="end">Domain visibility. In case of Internal user must be authenticated
        to get read the domain resources
      </mat-hint>
    </mat-form-field>

  <mat-form-field *ngIf="domainResourceTypes?.length" style="width:100%">
    <mat-label>Default resource type for the domain</mat-label>
    <mat-select formControlName="defaultResourceTypeIdentifier"
                matTooltip="Default resource type for the domain."
                id="domainDefaultResourceType_id">
      <mat-option [value]="''" disabled></mat-option>
      <mat-option *ngFor="let resDef of domainResourceTypes"
                  [value]="resDef.identifier">
        {{resDef.name}} ({{resDef.identifier}})
      </mat-option>
    </mat-select>
    <mat-hint align="end">Domain visibility. In case of Internal user must be authenticated
      to get read the domain resources
    </mat-hint>
  </mat-form-field>
    <mat-toolbar class ="mat-elevation-z2">
      <mat-toolbar-row  class="smp-toolbar-row">
        <button id="cancelButton" mat-raised-button (click)="onResetButtonClicked()" color="primary"
                [disabled]="!resetButtonEnabled">
          <mat-icon>refresh</mat-icon>
          <span>Reset</span>
        </button>
        <button id="saveButton" mat-raised-button (click)="onSaveButtonClicked()" color="primary"
                [disabled]="!submitButtonEnabled">
          <mat-icon>save</mat-icon>
          <span>Save</span>
        </button>
      </mat-toolbar-row>
    </mat-toolbar>
  </form>
</div>