summaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/ng2/pages/properties-assignment/properties-assignment.page.component.ts
diff options
context:
space:
mode:
authoraribeiro <anderson.ribeiro@est.tech>2021-07-15 09:18:37 +0100
committeraribeiro <anderson.ribeiro@est.tech>2021-08-06 17:22:20 +0100
commit47bcc63a9daff1f310125fed006f27c93656fa83 (patch)
tree3c61670b039c0e63d14880f909e6047d54776492 /catalog-ui/src/app/ng2/pages/properties-assignment/properties-assignment.page.component.ts
parent0ed125f98ae8ea9e80c855a640c328654660d081 (diff)
Retrieve data types based on component model
Issue-ID: SDC-3660 Signed-off-by: aribeiro <anderson.ribeiro@est.tech> Change-Id: I09c533eb39277532b29e581e4dd57e9df952e8e6
Diffstat (limited to 'catalog-ui/src/app/ng2/pages/properties-assignment/properties-assignment.page.component.ts')
-rw-r--r--catalog-ui/src/app/ng2/pages/properties-assignment/properties-assignment.page.component.ts15
1 files changed, 12 insertions, 3 deletions
diff --git a/catalog-ui/src/app/ng2/pages/properties-assignment/properties-assignment.page.component.ts b/catalog-ui/src/app/ng2/pages/properties-assignment/properties-assignment.page.component.ts
index 6d009a8039..fbbc4d8b0e 100644
--- a/catalog-ui/src/app/ng2/pages/properties-assignment/properties-assignment.page.component.ts
+++ b/catalog-ui/src/app/ng2/pages/properties-assignment/properties-assignment.page.component.ts
@@ -67,6 +67,7 @@ import {ToscaPresentationData} from "../../../models/tosca-presentation";
import {Observable} from "rxjs";
import {ToscaGetFunctionType} from "../../../models/tosca-get-function-type.enum";
import {TranslateService} from "../../shared/translator/translate.service";
+import {Model} from '../../../models/model';
const SERVICE_SELF_TITLE = "SELF";
@Component({
@@ -130,6 +131,7 @@ export class PropertiesAssignmentComponent {
private inputsUtils: InputsUtils,
private componentServiceNg2: ComponentServiceNg2,
private componentInstanceServiceNg2: ComponentInstanceServiceNg2,
+ private propertyCreatorComponent: PropertyCreatorComponent,
@Inject("$stateParams") _stateParams,
@Inject("$scope") private $scope: ng.IScope,
@Inject("$state") private $state: ng.ui.IStateService,
@@ -220,6 +222,8 @@ export class PropertiesAssignmentComponent {
});
}
});
+
+ this.loadDataTypesByComponentModel(this.component.model);
};
ngOnDestroy() {
@@ -1142,7 +1146,8 @@ export class PropertiesAssignmentComponent {
}
/*** addProperty ***/
- addProperty = () => {
+ addProperty = (model: Model) => {
+ this.loadDataTypesByComponentModel(model)
let modalTitle = 'Add Property';
let modal = this.ModalService.createCustomModal(new ModalModel(
'sm',
@@ -1172,8 +1177,8 @@ export class PropertiesAssignmentComponent {
],
null
));
- this.ModalService.addDynamicContentToModal(modal, PropertyCreatorComponent, {});
modal.instance.open();
+ this.ModalService.addDynamicContentToModal(modal, PropertyCreatorComponent, {});
}
/*** addInput ***/
@@ -1245,6 +1250,10 @@ export class PropertiesAssignmentComponent {
private isInput = (instanceType:string):boolean =>{
return instanceType === ResourceType.VF || instanceType === ResourceType.PNF || instanceType === ResourceType.CVFC || instanceType === ResourceType.CR;
}
-
+
+ loadDataTypesByComponentModel(model:Model) {
+ let modelName = new Model(model).name;
+ this.propertyCreatorComponent.filterDataTypesByModel(modelName);
+ }
}