summaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/ng2/pages/properties-assignment/properties-assignment.page.component.ts
diff options
context:
space:
mode:
authorKrupaNagabhushan <krupa.nagabhushan@est.tech>2020-11-19 14:28:00 +0000
committerChristophe Closset <christophe.closset@intl.att.com>2021-01-14 13:56:39 +0000
commit3849231a17930b1bb2ba09af15673bfd07538b9d (patch)
tree9ca26d4457093bbb30924d6731b5615e795ed238 /catalog-ui/src/app/ng2/pages/properties-assignment/properties-assignment.page.component.ts
parent0d38c9a8ed4701b860901f67049920e9b1ca72f2 (diff)
Create inputs independent of properties
Issue-ID: SDC-3431 Signed-off-by: KrupaNagabhushan <krupa.nagabhushan@est.tech> Change-Id: I4f29d0e490a14292fd1aa9f96ca6621b37f325d8
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.ts35
1 files changed, 35 insertions, 0 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 e4a8749386..74e2680b80 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
@@ -1052,6 +1052,41 @@ export class PropertiesAssignmentComponent {
modal.instance.open();
}
+ /*** addInput ***/
+ addInput = () => {
+ let modalTitle = 'Add Input';
+ let modal = this.ModalService.createCustomModal(new ModalModel(
+ 'sm',
+ modalTitle,
+ null,
+ [
+ new ButtonModel('Save', 'blue', () => {
+ modal.instance.dynamicContent.instance.isLoading = true;
+ const newInput: InputBEModel = modal.instance.dynamicContent.instance.propertyModel;
+ this.topologyTemplateService.createServiceInput(this.component.uniqueId, newInput)
+ .subscribe((response) => {
+ modal.instance.dynamicContent.instance.isLoading = false;
+ const newInputProp: InputFEModel = this.inputsUtils.convertInputBEToInputFE(response);
+ this.inputs.push(newInputProp);
+ modal.instance.close();
+ }, (error) => {
+ modal.instance.dynamicContent.instance.isLoading = false;
+ this.Notification.error({
+ message: 'Failed to add input:' + error,
+ title: 'Failure'
+ });
+ });
+ }, () => !modal.instance.dynamicContent.instance.checkFormValidForSubmit()),
+ new ButtonModel('Cancel', 'outline grey', () => {
+ modal.instance.close();
+ }),
+ ],
+ null
+ ));
+ this.ModalService.addDynamicContentToModal(modal, PropertyCreatorComponent, {});
+ modal.instance.open();
+ }
+
/*** SEARCH RELATED FUNCTIONS ***/
searchPropertiesInstances = (filterData:FilterPropertiesAssignmentData) => {
let instanceBePropertiesMap:InstanceBePropertiesMap;