diff options
Diffstat (limited to 'catalog-ui/src/app/view-models/forms/property-forms/module-property-modal')
2 files changed, 13 insertions, 2 deletions
diff --git a/catalog-ui/src/app/view-models/forms/property-forms/module-property-modal/module-property-model.ts b/catalog-ui/src/app/view-models/forms/property-forms/module-property-modal/module-property-model.ts index 3a61371e85..510814b333 100644 --- a/catalog-ui/src/app/view-models/forms/property-forms/module-property-modal/module-property-model.ts +++ b/catalog-ui/src/app/view-models/forms/property-forms/module-property-modal/module-property-model.ts @@ -22,6 +22,7 @@ * Created by obarda on 1/18/2017. */ 'use strict'; +import * as _ from "lodash"; import {PropertyModel, DisplayModule, Component, Resource, Service, ComponentInstance} from "app/models"; import {UNIQUE_GROUP_PROPERTIES_NAME} from "app/utils"; import {IPropertyFormBaseViewScope, PropertyFormBaseView} from "../base-property-form/property-form-base-model"; @@ -102,7 +103,9 @@ export class ModulePropertyView extends PropertyFormBaseView { } } else { deferred.resolve(true); - this.$uibModalInstance.close(); + if (isNeedToCloseModal === true) { + this.$uibModalInstance.close(); + } } return deferred.promise; @@ -147,6 +150,13 @@ export class ModulePropertyView extends PropertyFormBaseView { this.initValidation(); + this.$scope.clearValidationError = ():void => { + this.$scope.forms.editForm.$valid = true; + this.$scope.forms.editForm.$invalid = false; + this.$scope.forms.editForm['value'].$error = {}; + this.$scope.forms.editForm.$error = {}; + } + // put default value when instance value is empty this.$scope.onValueChange = ():void => { diff --git a/catalog-ui/src/app/view-models/forms/property-forms/module-property-modal/module-property-view.html b/catalog-ui/src/app/view-models/forms/property-forms/module-property-modal/module-property-view.html index 175f4c199b..ff48cc2357 100644 --- a/catalog-ui/src/app/view-models/forms/property-forms/module-property-modal/module-property-view.html +++ b/catalog-ui/src/app/view-models/forms/property-forms/module-property-modal/module-property-view.html @@ -12,7 +12,8 @@ name="value" data-ng-pattern="getValidationPattern(property.type)" data-ng-model-options="{ debounce: 200 }" - data-ng-change="onValueChange()" + data-ng-blur="onValueChange()" + data-ng-focus="clearValidationError()" /> <select class="i-sdc-form-select" data-tests-id="booleantype" |