2 ~ Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
4 ~ Licensed under the Apache License, Version 2.0 (the "License");
5 ~ you may not use this file except in compliance with the License.
6 ~ You may obtain a copy of the License at
8 ~ http://www.apache.org/licenses/LICENSE-2.0
10 ~ Unless required by applicable law or agreed to in writing, software
11 ~ distributed under the License is distributed on an "AS IS" BASIS,
12 ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 ~ See the License for the specific language governing permissions and
14 ~ limitations under the License.
19 <div data-ng-repeat="i in getNumber(mapKeys.length) track by $index" class="map-item" data-ng-class="{'primitive-value-map':!isSchemaTypeDataType}">
20 <div class="i-sdc-form-item map-item-field" data-ng-class="{error:(parentFormObj['mapKey'+fieldsPrefixName+$index].$dirty && parentFormObj['mapKey'+fieldsPrefixName+$index].$invalid)}">
21 <label class="i-sdc-form-label required">Key</label>
22 <input class="i-sdc-form-input"
23 data-tests-id="mapKey{{fieldsPrefixName}}{{$index}}"
24 data-ng-model="mapKeys[$index]"
26 data-ng-maxlength="50"
28 name="mapKey{{fieldsPrefixName}}{{$index}}"
29 data-ng-pattern="MapKeyValidationPattern"
30 data-ng-model-options="{ debounce: 200 }"
31 data-ng-change="changeKeyOfMap(mapKeys[$index], $index,'mapKey'+fieldsPrefixName+$index);$event.stopPropagation();"
32 data-ng-readonly="readOnly"
35 <div class="input-error" data-ng-show="parentFormObj['mapKey'+fieldsPrefixName+$index].$dirty && parentFormObj['mapKey'+fieldsPrefixName+$index].$invalid">
36 <span ng-show="parentFormObj['mapKey'+fieldsPrefixName+$index].$error.keyExist" translate="PROPERTY_EDIT_MAP_UNIQUE_KEYS"></span>
37 <span ng-show="parentFormObj['mapKey'+fieldsPrefixName+$index].$error.required" translate="VALIDATION_ERROR_REQUIRED" translate-values="{'field': 'Key' }"></span>
38 <span ng-show="parentFormObj['mapKey'+fieldsPrefixName+$index].$error.maxlength" translate="VALIDATION_ERROR_MAX_LENGTH" translate-values="{'max': '50' }"></span>
39 <span ng-show="parentFormObj['mapKey'+fieldsPrefixName+$index].$error.pattern" translate="VALIDATION_ERROR_SPECIAL_CHARS_NOT_ALLOWED"></span>
42 <div data-ng-if="!isSchemaTypeDataType" class="i-sdc-form-item map-item-field" data-ng-class="{error:(parentFormObj['mapValue'+fieldsPrefixName+$index].$dirty && parentFormObj['mapValue'+fieldsPrefixName+$index].$invalid)}">
43 <label class="i-sdc-form-label required">Value</label>
44 <input class="i-sdc-form-input"
45 ng-if="!((schemaProperty.simpleType||schemaProperty.type) == 'boolean')"
46 data-ng-readonly="readOnly"
47 data-ng-model="valueObjRef[mapKeys[$index]]"
49 name="mapValue{{fieldsPrefixName}}{{$index}}"
50 data-tests-id="mapValue{{fieldsPrefixName}}{{$index}}"
51 data-ng-pattern="getValidationPattern((schemaProperty.simpleType||schemaProperty.type))"
52 data-ng-change="!parentFormObj['mapValue'+fieldsPrefixName+$index].$error.pattern && parseToCorrectType(valueObjRef, key, (schemaProperty.simpleType||schemaProperty.type))"
53 data-ng-model-options="{ debounce: 200 }"
54 data-ng-maxlength="maxLength"
55 maxlength="{{maxLength}}"
58 <select class="i-sdc-form-select"
59 data-tests-id="mapValue{{fieldsPrefixName}}{{$index}}"
60 ng-if="(schemaProperty.simpleType||schemaProperty.type) == 'boolean'"
61 data-ng-disabled="readOnly"
62 name="mapValue{{fieldsPrefixName}}{{$index}}"
63 data-ng-model="valueObjRef[mapKeys[$index]]"
65 <option value="true">true</option>
66 <option value="false">false</option>
68 <div class="input-error" data-ng-show="parentFormObj['mapValue'+fieldsPrefixName+$index].$dirty && parentFormObj['mapValue'+fieldsPrefixName+$index].$invalid">
69 <span ng-show="parentFormObj['mapValue'+fieldsPrefixName+$index].$error.required" translate="VALIDATION_ERROR_REQUIRED" translate-values="{'field': 'Value' }"></span>
70 <span ng-show="parentFormObj['mapValue'+fieldsPrefixName+$index].$error.pattern" translate="PROPERTY_EDIT_PATTERN"></span>
71 <span ng-show="parentFormObj['mapValue'+fieldsPrefixName+$index].$error.maxlength" translate="VALIDATION_ERROR_MAX_LENGTH" translate-values="{'max': '{{maxLength}}' }"></span>
74 <div data-ng-if="isSchemaTypeDataType" class="i-sdc-form-item map-item-field">
75 <label class="i-sdc-form-label">Value</label>
76 <fields-structure value-obj-ref="valueObjRef[mapKeysStatic[$index]]"
77 type-name="schemaProperty.type"
78 parent-form-obj="parentFormObj"
79 fields-prefix-name="'mapValue'+fieldsPrefixName+''+$index"
83 <span ng-click="deleteMapItem($index)" class="delete-map-item" data-tests-id="delete-map-item{{fieldsPrefixName}}{{$index}}" data-ng-class="{'disabled': readOnly}"></span>
85 <div class="add-map-item" data-ng-class="{'schema-data-type':isSchemaTypeDataType}">
86 <div class="add-btn" data-tests-id="add-map-item"
87 data-ng-class="{'disabled': readOnly || !schemaProperty.type || mapKeys.indexOf('')>-1 || !isMapKeysUnique}" data-ng-click="addMapItemFields()">Add</div>