Fix datatype in model not found
[sdc.git] / catalog-ui / src / app / view-models / forms / property-forms / component-property-form / property-form-view.html
index 35e3932..dc26d1f 100644 (file)
                         <input type="radio" name="hasGetFunctionValue"
                                ng-model="editPropertyModel.hasGetFunctionValue"
                                ng-value="false"
-                               ng-change="onValueTypeChange()"/> Value
+                               ng-change="onValueTypeChange()"/> {{(editPropertyModel.property.type == 'map' || editPropertyModel.property.type == 'list') ? 'Entries' : 'Value'}}
                         <input type="radio" name="hasGetFunctionValue"
                                ng-model="editPropertyModel.hasGetFunctionValue"
                                ng-value="true"
                                               fields-prefix-name="currentPropertyIndex"
                                               read-only="editPropertyModel.property.readonly && !isPropertyValueOwner"
                                               default-value="{{getDefaultValue()}}"
+                                              types="dataTypes"
                                               expand-by-default="true"></fields-structure>
 
                         </div>
                             <div ng-switch-when="map">
                                 <type-map value-obj-ref="myValue"
                                           schema-property="editPropertyModel.property.schema.property"
+                                          parent-property="editPropertyModel.property"
+                                          component-instance-map="componentInstanceMap"
                                           parent-form-obj="forms.editForm"
                                           fields-prefix-name="currentPropertyIndex"
                                           read-only="(editPropertyModel.property.readonly && !isPropertyValueOwner) || isVnfConfiguration"
                                           default-value="{{getDefaultValue()}}"
                                           max-length="maxLength"
+                                          types="dataTypes"
                                           constraints="editPropertyModel.property.constraints && editPropertyModel.property.constraints[0].validValues">
                                 </type-map>
                             </div>
                             <div ng-switch-when="list">
                                 <type-list value-obj-ref="myValue"
                                            schema-property="editPropertyModel.property.schema.property"
+                                           parent-property="editPropertyModel.property"
+                                           component-instance-map="componentInstanceMap"
                                            parent-form-obj="forms.editForm"
                                            fields-prefix-name="currentPropertyIndex"
                                            read-only="editPropertyModel.property.readonly && !isPropertyValueOwner"
                                            default-value="{{getDefaultValue()}}"
                                            max-length="maxLength"
+                                           types="dataTypes"
                                            constraints="editPropertyModel.property.constraints && editPropertyModel.property.constraints[0].validValues"></type-list>
                             </div>
 
                                      data-ng-class="{error:(forms.editForm.value.$dirty && forms.editForm.value.$invalid), 'input-group' : editPropertyModel.property.addOn}">
                                     <span ng-if="editPropertyModel.property.addOn"
                                           class="input-group-addon">{{editPropertyModel.property.addOn}}</span>
-                                    <!-- Has Constraints -->
-                                    <select class="i-sdc-form-select"
-                                            data-tests-id="constraints"
-                                            ng-if="(editPropertyModel.property.constraints)"
-                                            data-ng-disabled="editPropertyModel.property.readonly && !isPropertyValueOwner"
-
-                                            data-ng-change="onValueChange()"
-                                            data-ng-model="editPropertyModel.property.value">
-                                        <!-- Get the default value in case exist -->
-                                        <option value="{{editPropertyModel.property.value}}" name="{{editPropertyModel.property.value}}" hidden
-                                                selected>
-                                            {{editPropertyModel.property.value}}
-                                        </option>
-                                        <!-- add all constratint to Select list -->
-                                        <option ng-repeat='value in constraints' value="{{value}}" name="{{value}}">
-                                            {{value}}
-                                        </option>
-                                    </select>
-
 
-                                    <!-- No Constraints -->
+                                    <!-- Constraints any NOT Boolean -->
                                     <input class="i-sdc-form-input"
                                            data-tests-id="defaultvalue"
-                                           ng-if="!(editPropertyModel.property.constraints) && !((editPropertyModel.property.simpleType||editPropertyModel.property.type) == 'boolean')"
+                                           ng-if="!((editPropertyModel.property.simpleType||editPropertyModel.property.type) == 'boolean')"
                                            data-ng-maxlength="maxLength"
                                            data-ng-disabled="editPropertyModel.property.readonly && !isPropertyValueOwner"
                                            maxlength="{{maxLength}}"
                                            data-ng-model-options="{ debounce: 200 }"
                                            data-ng-change="('json'==editPropertyModel.property.type && forms.editForm.value.$setValidity('pattern', validateJson(editPropertyModel.property.value)))
                                                         ||(!forms.editForm.value.$error.pattern && ('integer'==editPropertyModel.property.type && forms.editForm.value.$setValidity('pattern', validateIntRange(editPropertyModel.property.value)) || onValueChange()))"
-                                           data-ng-change=""
                                            autofocus/>
                                     <!-- Boolean -->
                                     <select class="i-sdc-form-select"
                 <div class="constraints-section i-sdc-form-item" data-ng-if="editPropertyModel.property.constraints || !(isViewOnly || componentMetadata.isService)">
                     <label class="i-sdc-form-label">Constraints</label>
                     <ng-container>
-                        <app-constraints [property]="editPropertyModel.property"
+                        <app-constraints [property-constraints]="editPropertyModel.property.constraints"
                                          [is-view-only]="isViewOnly || componentMetadata.isService"
+                                         [property-type]="editPropertyModel.property.type"
                                          (on-constraint-change)="onConstraintChange($event)">
                         </app-constraints>
                     </ng-container>