From c2942fe4f0d079874e8bafaf5302df5df307df79 Mon Sep 17 00:00:00 2001 From: eschcam Date: Mon, 17 Apr 2023 17:13:01 +0100 Subject: Fix certain default values breaking VFC For string default values in VFC, only alphanumeric characters should be allowed Issue-ID: SDC-4475 Signed-off-by: eschcam Change-Id: Id4ca2943f1423b8cc7d3182254298ba19c8a7ee3 --- .../property-form-view-model.ts | 54 +++++++++++----------- .../property-form-view.html | 28 +++++------ 2 files changed, 41 insertions(+), 41 deletions(-) (limited to 'catalog-ui/src/app/view-models/forms/property-forms/component-property-form') 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 39f008a688..fc0581a5c1 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 @@ -46,16 +46,16 @@ export interface IEditPropertyModel { } interface IPropertyFormViewModelScope extends ng.IScope { - forms:any; - editForm:ng.IFormController; - footerButtons:Array; - isNew:boolean; - nameMaxLength:number; - isLoading:boolean; - componentMetadata: { isService: boolean, isVfc: boolean } - validationPattern:RegExp; - propertyNameValidationPattern:RegExp; - commentValidationPattern:RegExp; + forms: any; + editForm: ng.IFormController; + footerButtons: Array; + isNew: boolean; + nameMaxLength: number; + isLoading: boolean; + componentMetadata: { isService: boolean, isVfc: boolean }; + validationPattern: RegExp; + propertyNameValidationPattern: RegExp; + commentValidationPattern: RegExp; editPropertyModel: IEditPropertyModel; componentInstanceMap: Map; customToscaFunctions: Array; @@ -75,19 +75,19 @@ interface IPropertyFormViewModelScope extends ng.IScope { isGetFunctionValueType: boolean; invalidMandatoryFields: boolean; - validateJson(json:string):boolean; - save(doNotCloseModal?:boolean):void; - getValidationPattern(type:string):RegExp; - validateIntRange(value:string):boolean; - close():void; - onSchemaTypeChange():void; - onTypeChange(resetSchema:boolean):void; - showSchema():boolean; - delete(property:PropertyModel):void; - getPrev():void; - getNext():void; - isSimpleType(typeName:string):boolean; - getDefaultValue():any; + validateJson(json: string): boolean; + save(doNotCloseModal?: boolean): void; + getValidationPattern(type: string): RegExp; + validateIntRange(value: string): boolean; + close(): void; + onSchemaTypeChange(): void; + onTypeChange(resetSchema: boolean): void; + showSchema(): boolean; + delete(property: PropertyModel): void; + getPrev(): void; + getNext(): void; + isSimpleType(typeName: string): boolean; + getDefaultValue(): any; onValueTypeChange(): void; } @@ -436,19 +436,19 @@ export class PropertyFormViewModel { return typeName && this.$scope.editPropertyModel.simpleTypes.indexOf(typeName) != -1; }; - this.$scope.showSchema = ():boolean => { + this.$scope.showSchema = (): boolean => { return [PROPERTY_TYPES.LIST, PROPERTY_TYPES.MAP].indexOf(this.$scope.editPropertyModel.property.type) > -1; }; - this.$scope.getValidationPattern = (type:string):RegExp => { + this.$scope.getValidationPattern = (type: string): RegExp => { return this.ValidationUtils.getValidationPattern(type); }; - this.$scope.validateIntRange = (value:string):boolean => { + this.$scope.validateIntRange = (value: string): boolean => { return !value || this.ValidationUtils.validateIntRange(value); }; - this.$scope.close = ():void => { + this.$scope.close = (): void => { this.$uibModalInstance.close(); }; 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 682c7a9b7c..d7c2af5b6e 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 @@ -211,25 +211,25 @@
+ data-ng-class="{error:(forms.editForm.value.$dirty && forms.editForm.value.$invalid), 'input-group' : editPropertyModel.property.addOn}"> {{editPropertyModel.property.addOn}} + class="input-group-addon">{{editPropertyModel.property.addOn}} + autofocus/>