aboutsummaryrefslogtreecommitdiffstats
path: root/vid-webpack-master/src
diff options
context:
space:
mode:
Diffstat (limited to 'vid-webpack-master/src')
-rw-r--r--vid-webpack-master/src/app/drawingBoard/service-planning/duplicate/duplicate.service.spec.ts2
-rw-r--r--vid-webpack-master/src/app/drawingBoard/service-planning/duplicate/duplicate.service.ts7
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);
}