diff options
author | imamSidero <imam.hussain@est.tech> | 2022-10-11 14:23:30 +0100 |
---|---|---|
committer | Michael Morris <michael.morris@est.tech> | 2022-10-17 14:57:35 +0000 |
commit | c39e7d3aa7bc26b1378fc6d29660c8be466dad45 (patch) | |
tree | c6886b3147f1130138df646dd4c50a66f3272cc9 /catalog-ui/src/app/view-models/forms/property-forms/base-property-form | |
parent | c3462d9ccaf7a89b38b8228938c99df451b1189b (diff) |
Increase character limit of VFC property name to 100 and allow @ character
VFC property name character limit is increased to 100 and allowing @ special character
Signed-off-by: imamSidero <imam.hussain@est.tech>
Issue-ID: SDC-4210
Change-Id: If7f0be254a62effe34ad426ba24eeb31f034dd3f
Diffstat (limited to 'catalog-ui/src/app/view-models/forms/property-forms/base-property-form')
2 files changed, 6 insertions, 4 deletions
diff --git a/catalog-ui/src/app/view-models/forms/property-forms/base-property-form/property-form-base-model.ts b/catalog-ui/src/app/view-models/forms/property-forms/base-property-form/property-form-base-model.ts index fe578b6865..421e205af5 100644 --- a/catalog-ui/src/app/view-models/forms/property-forms/base-property-form/property-form-base-model.ts +++ b/catalog-ui/src/app/view-models/forms/property-forms/base-property-form/property-form-base-model.ts @@ -25,7 +25,7 @@ import * as _ from "lodash"; import {DataTypesService} from "app/services/data-types-service"; import {PropertyModel, DataTypesMap, Component} from "app/models"; -import {ValidationUtils, PROPERTY_DATA} from "app/utils"; +import {ValidationUtils, PROPERTY_DATA, PROPERTY_VALUE_CONSTRAINTS} from "app/utils"; export interface IPropertyFormBaseViewScope extends ng.IScope { @@ -51,6 +51,7 @@ export interface IPropertyFormBaseViewScope extends ng.IScope { isDescriptionDisable:boolean; isPropertyValueDisable:boolean; isArrowsDisabled:boolean; + nameMaxLength:number; //Validation pattern validationPattern:RegExp; @@ -138,6 +139,7 @@ export abstract class PropertyFormBaseView { this.$scope.dataTypes = this.DataTypesService.getAllDataTypesFromModel(this.component.model); //Get all data types in service this.$scope.modalPropertyFormBase = this.$uibModalInstance; this.$scope.isNew = !angular.isDefined(this.$scope.property.name); + this.$scope.nameMaxLength = PROPERTY_VALUE_CONSTRAINTS.NAME_MAX_LENGTH; this.initValidations(); this.initButtonsState(); diff --git a/catalog-ui/src/app/view-models/forms/property-forms/base-property-form/property-form-base-view.html b/catalog-ui/src/app/view-models/forms/property-forms/base-property-form/property-form-base-view.html index ae96b66641..bb4524ee45 100644 --- a/catalog-ui/src/app/view-models/forms/property-forms/base-property-form/property-form-base-view.html +++ b/catalog-ui/src/app/view-models/forms/property-forms/base-property-form/property-form-base-view.html @@ -37,9 +37,9 @@ <label class="i-sdc-form-label" ng-class="{'required': !isService}">Name</label> <input class="i-sdc-form-input" data-tests-id="propertyName" - data-ng-maxlength="50" + data-ng-maxlength="nameMaxLength" data-ng-disabled="isNameDisable" - maxlength="50" + maxlength="{{nameMaxLength}}" data-ng-model="property.name" type="text" name="propertyName" @@ -50,7 +50,7 @@ <div class="input-error" data-ng-show="forms.editForm.propertyName.$dirty && forms.editForm.propertyName.$invalid"> <span ng-show="forms.editForm.propertyName.$error.required" translate="VALIDATION_ERROR_REQUIRED" translate-values="{'field': 'Property name' }"></span> - <span ng-show="forms.editForm.propertyName.$error.maxlength" translate="VALIDATION_ERROR_MAX_LENGTH" translate-values="{'max': '50' }"></span> + <span ng-show="forms.editForm.propertyName.$error.maxlength" translate="VALIDATION_ERROR_MAX_LENGTH" translate-values="{'max': '{{nameMaxLength}}' }"></span> <span ng-show="forms.editForm.propertyName.$error.pattern" translate="VALIDATION_ERROR_SPECIAL_CHARS_NOT_ALLOWED"></span> </div> </div> |