summaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/view-models
diff options
context:
space:
mode:
authoreschcam <cameron.scholes@est.tech>2023-04-17 17:13:01 +0100
committerMichael Morris <michael.morris@est.tech>2023-05-30 14:40:38 +0000
commitc2942fe4f0d079874e8bafaf5302df5df307df79 (patch)
tree4dac55caa262fb1525e0ab3a512d38d8d5f7ccd5 /catalog-ui/src/app/view-models
parentc176abb79ebc5b35d340258ba1bdbfa2939e103a (diff)
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 <cameron.scholes@est.tech> Change-Id: Id4ca2943f1423b8cc7d3182254298ba19c8a7ee3
Diffstat (limited to 'catalog-ui/src/app/view-models')
-rw-r--r--catalog-ui/src/app/view-models/forms/property-forms/component-property-form/property-form-view-model.ts54
-rw-r--r--catalog-ui/src/app/view-models/forms/property-forms/component-property-form/property-form-view.html28
2 files changed, 41 insertions, 41 deletions
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<any>;
- isNew:boolean;
- nameMaxLength:number;
- isLoading:boolean;
- componentMetadata: { isService: boolean, isVfc: boolean }
- validationPattern:RegExp;
- propertyNameValidationPattern:RegExp;
- commentValidationPattern:RegExp;
+ forms: any;
+ editForm: ng.IFormController;
+ footerButtons: Array<any>;
+ isNew: boolean;
+ nameMaxLength: number;
+ isLoading: boolean;
+ componentMetadata: { isService: boolean, isVfc: boolean };
+ validationPattern: RegExp;
+ propertyNameValidationPattern: RegExp;
+ commentValidationPattern: RegExp;
editPropertyModel: IEditPropertyModel;
componentInstanceMap: Map<string, InstanceFeDetails>;
customToscaFunctions: Array<CustomToscaFunction>;
@@ -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 @@
<div ng-switch-default>
<div class="i-sdc-form-item"
- data-ng-class="{error:(forms.editForm.value.$dirty && forms.editForm.value.$invalid), 'input-group' : editPropertyModel.property.addOn}">
+ 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>
+ class="input-group-addon">{{editPropertyModel.property.addOn}}</span>
<!-- Constraints any NOT Boolean -->
<input class="i-sdc-form-input"
- data-tests-id="defaultvalue"
- 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="editPropertyModel.property.value"
- type="text"
- name="value"
- data-ng-pattern="getValidationPattern((editPropertyModel.property.simpleType||editPropertyModel.property.type))"
- data-ng-model-options="{ debounce: 200 }"
- data-ng-change="('json'==editPropertyModel.property.type && forms.editForm.value.$setValidity('pattern', validateJson(editPropertyModel.property.value)))
+ data-tests-id="defaultvalue"
+ 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="editPropertyModel.property.value"
+ type="text"
+ name="value"
+ data-ng-pattern="getValidationPattern((editPropertyModel.property.simpleType||editPropertyModel.property.type))"
+ 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))))"
- autofocus/>
+ autofocus/>
<!-- Boolean -->
<select class="i-sdc-form-select"
data-tests-id="booleantype"