From 7b10265c43a1097b730516e19177ad2ae419b808 Mon Sep 17 00:00:00 2001 From: Yoav Schneiderman Date: Mon, 30 Dec 2019 16:27:14 +0200 Subject: Add more VNFs after loading a template + Remove + Duplicate Issue-ID: VID-738 Change-Id: I1a9ed50ba672e8317aeb9074e561cc8d70aad24d Signed-off-by: Yoav Schneiderman Signed-off-by: Ittay Stern --- .../service-planning/duplicate/duplicate.service.spec.ts | 2 ++ .../drawingBoard/service-planning/duplicate/duplicate.service.ts | 7 +++++-- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'vid-webpack-master/src/app') diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/duplicate/duplicate.service.spec.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/duplicate/duplicate.service.spec.ts index 50bfa936e..6423e8ad1 100644 --- a/vid-webpack-master/src/app/drawingBoard/service-planning/duplicate/duplicate.service.spec.ts +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/duplicate/duplicate.service.spec.ts @@ -7,6 +7,7 @@ import {IModalConfig} from 'onap-ui-angular/dist/components/common'; import {AppState} from "../../../shared/store/reducers"; import {getTestBed, TestBed} from "@angular/core/testing"; import {FeatureFlagsService} from "../../../shared/services/featureFlag/feature-flags.service"; +import {SharedTreeService} from "../objectsToTree/shared.tree.service"; class MockAppStore { getState(){ @@ -68,6 +69,7 @@ describe('Drawing board tree service', () => { TestBed.configureTestingModule({ providers : [ DuplicateService, + SharedTreeService, LogService, {provide: FeatureFlagsService, useClass: MockFeatureFlagsService}, {provide: NgRedux, useClass: MockAppStore}, diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/duplicate/duplicate.service.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/duplicate/duplicate.service.ts index 847790de9..c8338cbfc 100644 --- a/vid-webpack-master/src/app/drawingBoard/service-planning/duplicate/duplicate.service.ts +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/duplicate/duplicate.service.ts @@ -13,11 +13,14 @@ import {changeInstanceCounter, duplicateBulkInstances} from "../../../shared/sto import {IModalConfig} from "onap-ui-angular/dist/modals/models/modal-config"; import {FeatureFlagsService} from "../../../shared/services/featureFlag/feature-flags.service"; import {Utils} from "../../../shared/utils/utils"; +import {SharedTreeService} from "../objectsToTree/shared.tree.service"; @Injectable() export class DuplicateService { - constructor(private _logService: LogService, private _store: NgRedux, modalService: SdcUiServices.ModalService) { + constructor(private _logService: LogService, + private sharedTreeService : SharedTreeService, + private _store: NgRedux, modalService: SdcUiServices.ModalService) { this.modalService = modalService; } @@ -123,7 +126,7 @@ export class DuplicateService { newObjects[uniqueStoreKey] = clone; } this.store.dispatch(duplicateBulkInstances(this.currentServiceId, newObjects, this.existingNames, node)); - this.store.dispatch(changeInstanceCounter(toClone.modelInfo.modelUniqueId, this.currentServiceId, this.numberOfDuplicates, node)); + this.store.dispatch(changeInstanceCounter(this.sharedTreeService.modelUniqueId(toClone), this.currentServiceId, this.numberOfDuplicates, node)); this._logService.info("Duplicate " + this.storeKey + " serviceId: " + this.currentServiceId + "number of duplicate: " + this.numberOfDuplicates, toClone); } -- cgit 1.2.3-korg