import {PropertyFilterConstraintUi} from "../../../models/ui-models/property-filter-constraint-ui";
import {ConstraintOperatorType, FilterConstraintHelper} from "../../../utils/filter-constraint-helper";
import {ToscaFunctionHelper} from "../../../utils/tosca-function-helper";
+import {TopologyTemplateService} from "app/ng2/services/component-services/topology-template.service";
+import {CustomToscaFunction} from "../../../models/default-custom-functions";
+import {ToscaFunctionType} from "../../../models/tosca-function-type.enum";
@Component({
selector: 'service-dependencies-editor',
selectedProperty: PropertyFEModel;
selectedSourceType: string;
componentInstanceMap: Map<string, InstanceFeDetails> = new Map<string, InstanceFeDetails>();
+ customToscaFunctions: Array<CustomToscaFunction>;
capabilityDropdownList: DropdownValue[] = [];
SOURCE_TYPES = {
TOSCA_FUNCTION: {label: 'Tosca Function', value: SourceType.TOSCA_FUNCTION}
};
- constructor(private propertiesUtils: PropertiesUtils, private compositionService: CompositionService) {}
+ constructor(private propertiesUtils: PropertiesUtils, private compositionService: CompositionService, private topologyTemplateService: TopologyTemplateService) {}
ngOnInit(): void {
if (this.compositionService.componentInstances) {
});
});
}
+ this.initCustomToscaFunctions();
this.initCapabilityDropdown();
this.initCurrentRule();
this.initConstraintOperatorOptions();
this.syncRuleData();
}
+ private initCustomToscaFunctions() {
+ this.customToscaFunctions = [];
+ this.topologyTemplateService.getDefaultCustomFunction().toPromise().then((data) => {
+ for (let customFunction of data) {
+ this.customToscaFunctions.push(new CustomToscaFunction(customFunction));
+ }
+ });
+}
private initCapabilityDropdown(): void {
if (this.filterType == FilterType.CAPABILITY) {