From c39e7d3aa7bc26b1378fc6d29660c8be466dad45 Mon Sep 17 00:00:00 2001 From: imamSidero Date: Tue, 11 Oct 2022 14:23:30 +0100 Subject: 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 Issue-ID: SDC-4210 Change-Id: If7f0be254a62effe34ad426ba24eeb31f034dd3f --- catalog-ui/src/app/app.ts | 2 +- catalog-ui/src/app/utils/constants.ts | 1 + .../base-property-form/property-form-base-model.ts | 4 ++- .../property-form-base-view.html | 6 ++--- .../property-form-view-model.ts | 2 ++ .../property-form-view.html | 30 +++++++++++----------- 6 files changed, 25 insertions(+), 20 deletions(-) (limited to 'catalog-ui') diff --git a/catalog-ui/src/app/app.ts b/catalog-ui/src/app/app.ts index ba9bd44e03..76c1d28489 100644 --- a/catalog-ui/src/app/app.ts +++ b/catalog-ui/src/app/app.ts @@ -612,7 +612,7 @@ ng1appModule.config([ ng1appModule.value('ValidationPattern', /^[\s\w\&_.:-]{1,1024}$/); ng1appModule.value('ComponentNameValidationPattern', /^(?=.*[^. ])[\s\w\&_.:-]{1,1024}$/); //DE250513 - same as ValidationPattern above, plus requirement that name not consist of dots and/or spaces alone. -ng1appModule.value('PropertyNameValidationPattern', /^[a-zA-Z0-9_:-]{1,50}$/);// DE210977 +ng1appModule.value('PropertyNameValidationPattern', /^[a-zA-Z0-9_:-@]{1,100}$/);// DE210977 ng1appModule.value('TagValidationPattern', /^[\s\w_.-]{1,50}$/); ng1appModule.value('VendorReleaseValidationPattern', /^[\x20-\x21\x23-\x29\x2B-\x2E\x30-\x39\x3B\x3D\x40-\x5B\x5D-\x7B\x7D-\xFF]{1,25}$/); ng1appModule.value('VendorNameValidationPattern', /^[\x20-\x21\x23-\x29\x2B-\x2E\x30-\x39\x3B\x3D\x40-\x5B\x5D-\x7B\x7D-\xFF]{1,60}$/); diff --git a/catalog-ui/src/app/utils/constants.ts b/catalog-ui/src/app/utils/constants.ts index d6710ed767..0de83d257e 100644 --- a/catalog-ui/src/app/utils/constants.ts +++ b/catalog-ui/src/app/utils/constants.ts @@ -165,6 +165,7 @@ export class PROPERTY_DATA { export class PROPERTY_VALUE_CONSTRAINTS { public static MAX_LENGTH = 2500; public static JSON_MAX_LENGTH = 4096; + public static NAME_MAX_LENGTH = 100; } export class Role { 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 @@ - + diff --git a/catalog-ui/src/app/view-models/forms/property-forms/component-property-form/property-form-view-model.ts b/catalog-ui/src/app/view-models/forms/property-forms/component-property-form/property-form-view-model.ts index 103b1341c0..614f1583cb 100644 --- a/catalog-ui/src/app/view-models/forms/property-forms/component-property-form/property-form-view-model.ts +++ b/catalog-ui/src/app/view-models/forms/property-forms/component-property-form/property-form-view-model.ts @@ -47,6 +47,7 @@ interface IPropertyFormViewModelScope extends ng.IScope { editForm:ng.IFormController; footerButtons:Array; isNew:boolean; + nameMaxLength:number; isLoading:boolean; componentMetadata: { isService: boolean, isVfc: boolean } validationPattern:RegExp; @@ -241,6 +242,7 @@ export class PropertyFormViewModel { this.$scope.validationPattern = this.ValidationPattern; this.$scope.propertyNameValidationPattern = this.PropertyNameValidationPattern; this.$scope.commentValidationPattern = this.CommentValidationPattern; + this.$scope.nameMaxLength = PROPERTY_VALUE_CONSTRAINTS.NAME_MAX_LENGTH; this.$scope.isNew = (this.formState === FormState.CREATE); this.$scope.componentMetadata = { isService: this.workspaceService.metadata.isService(), diff --git a/catalog-ui/src/app/view-models/forms/property-forms/component-property-form/property-form-view.html b/catalog-ui/src/app/view-models/forms/property-forms/component-property-form/property-form-view.html index a6fd69755a..105bef3ea9 100644 --- a/catalog-ui/src/app/view-models/forms/property-forms/component-property-form/property-form-view.html +++ b/catalog-ui/src/app/view-models/forms/property-forms/component-property-form/property-form-view.html @@ -13,11 +13,11 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License. --> - +
- Delete + Delete Previous Next @@ -37,9 +37,9 @@ - +
@@ -65,7 +65,7 @@ @@ -122,7 +122,7 @@