* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
getValidationPattern(type:string):RegExp;
validateIntRange(value:string):boolean;
close():void;
- onValueChange():void;
onSchemaTypeChange():void;
onTypeChange(resetSchema:boolean):void;
showSchema():boolean;
private initResource = ():void => {
this.$scope.editPropertyModel.property = new PropertyModel(this.property);
this.$scope.editPropertyModel.property.type = this.property.type ? this.property.type : null;
+ this.$scope.editPropertyModel.property.value = this.property.value ? this.property.value : this.property.defaultValue;
this.$scope.constraints = this.property.constraints && this.property.constraints[0] ? this.property.constraints[0]["validValues"] : null;
this.initToscaGetFunction();
this.setMaxLength();
this.$scope.editPropertyModel.hasGetFunctionValue = this.$scope.editPropertyModel.property.isToscaFunction();
this.$scope.editPropertyModel.isGetFunctionValid = true;
}
-
+
private isDataTypeForPropertyType = (property:PropertyModel):boolean=> {
property.simpleType = "";
if (property.type && PROPERTY_DATA.TYPES.indexOf(property.type) > -1) {
}
return true;
};
-
+
private getTypeForDataTypeDerivedFromSimple = (dataTypeName:string):string => {
if (!this.$scope.dataTypes[dataTypeName]) {
return 'string';
this.$uibModalInstance.close();
};
- // put default value when instance value is empty
- this.$scope.onValueChange = ():void => {
- if (!this.$scope.editPropertyModel.property.value) {
- if (this.$scope.isPropertyValueOwner) {
- this.$scope.editPropertyModel.property.value = this.$scope.editPropertyModel.property.defaultValue;
- }
- }
- };
-
// Add the done button at the footer.
this.$scope.footerButtons = [
{'name': 'Save', 'css': 'blue', 'callback': this.$scope.save},