diff options
author | Yoav Schneiderman <yoav.schneiderman@intl.att.com> | 2019-12-30 16:27:14 +0200 |
---|---|---|
committer | Ittay Stern <ittay.stern@att.com> | 2019-12-31 10:26:19 +0200 |
commit | 7b10265c43a1097b730516e19177ad2ae419b808 (patch) | |
tree | b00eb6790a80625b9fd68f5c43a01f5c4f67a81b /vid-webpack-master/src/app | |
parent | 88898c121c8e405d8c6445d54f3fdc23675c0305 (diff) |
Add more VNFs after loading a template + Remove + Duplicate
Issue-ID: VID-738
Change-Id: I1a9ed50ba672e8317aeb9074e561cc8d70aad24d
Signed-off-by: Yoav Schneiderman <yoav.schneiderman@intl.att.com>
Signed-off-by: Ittay Stern <ittay.stern@att.com>
Diffstat (limited to 'vid-webpack-master/src/app')
2 files changed, 7 insertions, 2 deletions
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<T> { 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<AppState>, modalService: SdcUiServices.ModalService) { + constructor(private _logService: LogService, + private sharedTreeService : SharedTreeService, + private _store: NgRedux<AppState>, 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); } |