From 94d27e23ae4d38352dc7d7cd3a2acf3a62a7a6ec Mon Sep 17 00:00:00 2001 From: Alexey Sandler Date: Sun, 5 Apr 2020 09:59:35 +0300 Subject: Add another Network to the new view/edit screen Issue-ID: VID-802 Signed-off-by: Alexey Sandler Change-Id: Ie0e1dcd28f78307ec526c375c1bf4c655ec09ffe Signed-off-by: Alexey Sandler --- .../available-models-tree/available-models-tree.component.ts | 7 +++---- .../drawing-board-tree/drawing-board-tree.component.ts | 9 ++++----- .../drawing-board-tree/drawing-board-tree.service.ts | 4 ++++ .../components/genericFormPopup/generic-form-popup.component.ts | 4 ++-- 4 files changed, 13 insertions(+), 11 deletions(-) (limited to 'vid-webpack-master/src/app') diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/available-models-tree/available-models-tree.component.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/available-models-tree/available-models-tree.component.ts index 2e04f53bb..2014be99d 100644 --- a/vid-webpack-master/src/app/drawingBoard/service-planning/available-models-tree/available-models-tree.component.ts +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/available-models-tree/available-models-tree.component.ts @@ -24,7 +24,6 @@ import {createVnfGroupInstance} from "../../../shared/storeUtil/utils/vnfGroup/v import {VnfGroupControlGenerator} from "../../../shared/components/genericForm/formControlsServices/vnfGroupGenerator/vnfGroup.control.generator"; import {HighlightPipe} from "../../../shared/pipes/highlight/highlight-filter.pipe"; import * as _ from 'lodash'; -import {DrawingBoardTreeComponent} from "../drawing-board-tree/drawing-board-tree.component"; import {ComponentInfoModel} from "../component-info/component-info-model"; import {ComponentInfoService} from "../component-info/component-info.service"; import {FeatureFlagsService, Features} from "../../../shared/services/featureFlag/feature-flags.service"; @@ -166,12 +165,12 @@ export class AvailableModelsTreeComponent { let vnfGroup = this._defaultDataGeneratorService.generateVnfGroupInstance(this.serviceHierarchy.vnfGroups[node.data.name], isEcompGeneratedNaming, isAlaCarte, instanceName); this._store.dispatch(changeInstanceCounter(node.data.modelUniqueId, serviceId, 1 , {data: {type: 'VnfGroup'}})); this._store.dispatch(createVnfGroupInstance(vnfGroup, node.data.name, serviceId, node.data.name)); - DrawingBoardTreeComponent.triggerreCalculateIsDirty.next(this.serviceModelId); + DrawingBoardTreeService.triggerCheckIsDirty.next(this.serviceModelId); } else { let vfModule = this._defaultDataGeneratorService.generateVFModule(this.serviceHierarchy.vnfs[node.parent.data.name].vfModules[node.data.name], dynamicInputs, isEcompGeneratedNaming, isAlaCarte); if (this._sharedTreeService.selectedVNF) { this.store.dispatch(createVFModuleInstance(vfModule, node.data.name, this.serviceModelId, null, this._sharedTreeService.selectedVNF)); - DrawingBoardTreeComponent.triggerreCalculateIsDirty.next(this.serviceModelId); + DrawingBoardTreeService.triggerCheckIsDirty.next(this.serviceModelId); } else if (this._availableModelsTreeService.getOptionalVNFs(this.serviceModelId, node.parent.data.modelUniqueId).length === 1) { let existVnf = this._store.getState().service.serviceInstance[this.serviceModelId].vnfs; if(!_.isNil(existVnf)){ @@ -179,7 +178,7 @@ export class AvailableModelsTreeComponent { const modelUniqueId = this._sharedTreeService.modelUniqueId(existVnf[vnfKey]); if(modelUniqueId === node.parent.data.id){ this.store.dispatch(createVFModuleInstance(vfModule, node.data.name, this.serviceModelId, null, vnfKey)); - DrawingBoardTreeComponent.triggerreCalculateIsDirty.next(this.serviceModelId); + DrawingBoardTreeService.triggerCheckIsDirty.next(this.serviceModelId); } } } diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-tree/drawing-board-tree.component.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-tree/drawing-board-tree.component.ts index 1a42db403..18c3f72de 100644 --- a/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-tree/drawing-board-tree.component.ts +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-tree/drawing-board-tree.component.ts @@ -51,7 +51,6 @@ export class DrawingBoardTreeComponent implements OnInit, AfterViewInit { @Input() pageMode : DrawingBoardModes; static triggerDeleteActionService: Subject = new Subject(); static triggerUndoDeleteActionService: Subject = new Subject(); - static triggerreCalculateIsDirty: Subject = new Subject(); @ViewChild(ContextMenuComponent, {static: false}) public contextMenu: ContextMenuComponent; constructor(private _contextMenuService: ContextMenuService, @@ -87,12 +86,12 @@ export class DrawingBoardTreeComponent implements OnInit, AfterViewInit { }); }); - DrawingBoardTreeComponent.triggerUndoDeleteActionService.subscribe((serviceModelId) => { - this.drawingBoardTreeService.undoDeleteActionService(this.nodes, serviceModelId); + DrawingBoardTreeService.triggerCheckIsDirty.subscribe((serviceModelId)=>{ this.store.dispatch(changeServiceIsDirty(this.nodes, serviceModelId)); - }); + }) - DrawingBoardTreeComponent.triggerreCalculateIsDirty.subscribe((serviceModelId) => { + DrawingBoardTreeComponent.triggerUndoDeleteActionService.subscribe((serviceModelId) => { + this.drawingBoardTreeService.undoDeleteActionService(this.nodes, serviceModelId); this.store.dispatch(changeServiceIsDirty(this.nodes, serviceModelId)); }); diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-tree/drawing-board-tree.service.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-tree/drawing-board-tree.service.ts index 28b6e51b1..dfd89ca79 100644 --- a/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-tree/drawing-board-tree.service.ts +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-tree/drawing-board-tree.service.ts @@ -5,9 +5,13 @@ import {NgRedux} from "@angular-redux/store"; import {AppState} from "../../../shared/store/reducers"; import {FeatureFlagsService, Features} from "../../../shared/services/featureFlag/feature-flags.service"; import {ServiceInstanceActions} from "../../../shared/models/serviceInstanceActions"; +import {Subject} from "rxjs"; @Injectable() export class DrawingBoardTreeService { + + static triggerCheckIsDirty : Subject = new Subject(); + constructor(private store: NgRedux){} isVFModuleMissingData(node: ITreeNode, serviceModelId : string): boolean { if(node.data.type === 'VFmodule' &&!_.isNil(this.store.getState().service.serviceInstance[serviceModelId].vnfs) && !_.isNil(this.store.getState().service.serviceInstance[serviceModelId].vnfs[node.parent.data.vnfStoreKey])){ diff --git a/vid-webpack-master/src/app/shared/components/genericFormPopup/generic-form-popup.component.ts b/vid-webpack-master/src/app/shared/components/genericFormPopup/generic-form-popup.component.ts index 7368dd698..1d8d827df 100644 --- a/vid-webpack-master/src/app/shared/components/genericFormPopup/generic-form-popup.component.ts +++ b/vid-webpack-master/src/app/shared/components/genericFormPopup/generic-form-popup.component.ts @@ -13,9 +13,8 @@ import {AaiService} from "../../services/aaiService/aai.service"; import {GenericFormPopupService} from "./generic-form-popup.service"; import {FormControlModel} from "../../models/formControlModels/formControl.model"; import {FormGeneralErrorsService} from "../formGeneralErrors/formGeneralErrors.service"; -import {FeatureFlagsService, Features} from "../../services/featureFlag/feature-flags.service"; -import {InstantiationTemplatesModalComponent} from "./instantiationTemplatesModal/instantiation.templates.modal.component"; import {updateCurrentModalModeAction} from "../../storeUtil/utils/global/global.actions"; +import {DrawingBoardTreeService} from "../../../drawingBoard/service-planning/drawing-board-tree/drawing-board-tree.service"; export interface PopupModel { @@ -98,6 +97,7 @@ export class GenericFormPopupComponent extends DialogComponent { + DrawingBoardTreeService.triggerCheckIsDirty.next(that.uuidData.serviceId); this.closeDialog(that); }); -- cgit 1.2.3-korg