Edit properties of non-normative data types
[sdc.git] / catalog-ui / src / app / ng2 / pages / type-workspace / type-workspace-properties / add-property / add-property.component.html
index af72e6d..3ac4f7a 100644 (file)
@@ -6,6 +6,7 @@
       <div class="i-sdc-form-item">
         <label class="i-sdc-form-label required">{{'PROPERTY_NAME_LABEL' | translate}}</label>
         <input class="i-sdc-form-input"
+               [ngClass]="{ 'disabled': property ? true : false }"
                type="text"
                data-tests-id="property-name"
                formControlName="name"
@@ -13,7 +14,7 @@
       </div>
       <div class="i-sdc-form-item">
         <label class="i-sdc-form-label required">{{'PROPERTY_TYPE_LABEL' | translate}}</label>
-        <select formControlName="type" (change)="onTypeChange()" [attr.disabled]="readOnly ? readOnly : null">
+          <select formControlName="type" (change)="onTypeChange()" [ngClass]="{ 'disabled': property ? true : false }">
           <option [ngValue]="null">{{'GENERAL_LABEL_SELECT' | translate}}</option>
           <option *ngFor="let type of typeList"
                   [ngValue]="type">{{type}}</option>
                 [readOnly]="readOnly">
       </textarea>
     </div>
-    <div class="default-value-container i-sdc-form-item" *ngIf="showDefaultValue()">
+      <div class="constraints-section i-sdc-form-item">
+          <label class="i-sdc-form-label" *ngIf="property ? property.constraints: false">Constraints</label>
+          <ng-container>
+              <app-constraints [propertyConstraints]="property ? property.constraints ? property.constraints : null : null"
+                               [isViewOnly]="readOnly"
+                               [propertyType]="property ? property.type : typeForm.value"
+                               (onConstraintChange)="onConstraintChange($event)">
+              </app-constraints>
+          </ng-container>
+      </div>
+
+      <div class="default-value-container i-sdc-form-item" *ngIf="showDefaultValue()">
       <label class="i-sdc-form-label">{{'PROPERTY_DEFAULT_VALUE_LABEL' | translate}}</label>
       <ng-container *ngIf="!readOnly">
         <input type="checkbox" formControlName="hasDefaultValue" [attr.disabled]="readOnly ? readOnly : null"/> {{'PROPERTY_SET_DEFAULT_VALUE_MSG' | translate}}