diff options
author | Amichai Hemli <amichai.hemli@intl.att.com> | 2019-09-26 08:09:33 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-09-26 08:09:33 +0000 |
commit | c8a8cc746697e23ac87fc72d4fb1ff01c534e9c0 (patch) | |
tree | 4902dec45f44ff575a2e11bacb9708a729b6bb9a | |
parent | dcf470807a0dc13a14a8948f3879406e84f09df2 (diff) | |
parent | 5438f8b8657dfd140a339a2524b11957869e21e0 (diff) |
Merge "check if FLAG_FLASH_REPLACE_VF_MODULE open in the right place"
3 files changed, 23 insertions, 29 deletions
diff --git a/vid-automation/src/main/java/vid/automation/test/test/ViewEditWithDrawingBoardTest.java b/vid-automation/src/main/java/vid/automation/test/test/ViewEditWithDrawingBoardTest.java index 073db0999..bfe922209 100644 --- a/vid-automation/src/main/java/vid/automation/test/test/ViewEditWithDrawingBoardTest.java +++ b/vid-automation/src/main/java/vid/automation/test/test/ViewEditWithDrawingBoardTest.java @@ -54,7 +54,7 @@ public class ViewEditWithDrawingBoardTest extends VidBaseTestCase { private String serviceType = "TYLER SILVIA"; private String serviceInstanceToResumeName; - @FeatureTogglingTest({Features.FLAG_1902_VNF_GROUPING, Features.FLAG_FLASH_REPLACE_VF_MODULE}) + @FeatureTogglingTest({Features.FLAG_1902_VNF_GROUPING}) @Test public void testDeleteVnfGroupWithMembers() { @@ -184,7 +184,7 @@ public class ViewEditWithDrawingBoardTest extends VidBaseTestCase { ); } - @FeatureTogglingTest({Features.FLAG_1908_MACRO_NOT_TRANSPORT_NEW_VIEW_EDIT, Features.FLAG_1908_RESUME_MACRO_SERVICE, Features.FLAG_FLASH_REPLACE_VF_MODULE}) + @FeatureTogglingTest({Features.FLAG_1908_MACRO_NOT_TRANSPORT_NEW_VIEW_EDIT, Features.FLAG_1908_RESUME_MACRO_SERVICE}) @Test public void testResumeServiceInstanceWithCollectionResource() { diff --git a/vid-webpack-master/src/app/shared/resolvers/viewEdit/viewEdit.resolver.ts b/vid-webpack-master/src/app/shared/resolvers/viewEdit/viewEdit.resolver.ts index d2f76e4f6..540e02fe6 100644 --- a/vid-webpack-master/src/app/shared/resolvers/viewEdit/viewEdit.resolver.ts +++ b/vid-webpack-master/src/app/shared/resolvers/viewEdit/viewEdit.resolver.ts @@ -1,6 +1,6 @@ import {ActivatedRouteSnapshot, Resolve} from "@angular/router"; import {Injectable} from "@angular/core"; -import {from, Observable} from "rxjs"; +import {from, Observable, of} from "rxjs"; import {AaiService} from "../../services/aaiService/aai.service"; import {forkJoin} from "rxjs/observable/forkJoin"; import {AppState} from "../../store/reducers"; @@ -9,11 +9,14 @@ import {createServiceInstance} from "../../storeUtil/utils/service/service.actio import {ServiceInstance} from "../../models/serviceInstance"; import * as _ from "lodash"; import {ModelInfo} from "../../models/modelInfo"; +import {FeatureFlagsService, Features} from "../../services/featureFlag/feature-flags.service"; @Injectable() export class ViewEditResolver implements Resolve<Observable<boolean>> { - constructor(private _aaiService: AaiService, private _store: NgRedux<AppState>) { + constructor(private _aaiService: AaiService, + private featureFlagsService:FeatureFlagsService, + private _store: NgRedux<AppState>) { } resolve(route: ActivatedRouteSnapshot): Observable<boolean> { @@ -26,12 +29,16 @@ export class ViewEditResolver implements Resolve<Observable<boolean>> { let streams: Observable<any>[] = [serviceModelApi, serviceInstanceApi]; streams = streams.filter( stream => stream !== undefined); return forkJoin(streams).switchMap(([serviceModel, serviceInstance]) => { - return from(this.retrieveLatestVersionAndSetServiceInstance(serviceInstance.modelInfo.modelInvariantId).then((response)=>{ - this.setServiceLatestAvailableVersion(serviceInstance, response); - this.applyRequestsResponsesToStateAndInitServiceInstance(serviceModelId, serviceInstance, serviceModel); - return true; - })); - + if (this.featureFlagsService.getFlagState(Features.FLAG_FLASH_REPLACE_VF_MODULE)) { + return from(this.retrieveLatestVersionAndSetServiceInstance(serviceInstance.modelInfo.modelInvariantId).then((response) => { + this.setServiceLatestAvailableVersion(serviceInstance, response); + this.applyRequestsResponsesToStateAndInitServiceInstance(serviceModelId, serviceInstance, serviceModel); + return true; + })); + } + else { + return of(true); + } }); } diff --git a/vid-webpack-master/src/app/shared/services/aaiService/aai.service.ts b/vid-webpack-master/src/app/shared/services/aaiService/aai.service.ts index d421fe8e1..1cc5593f7 100644 --- a/vid-webpack-master/src/app/shared/services/aaiService/aai.service.ts +++ b/vid-webpack-master/src/app/shared/services/aaiService/aai.service.ts @@ -4,7 +4,7 @@ import {Injectable} from '@angular/core'; import * as _ from 'lodash'; import 'rxjs/add/operator/catch'; import 'rxjs/add/operator/do'; -import {of} from "rxjs"; +import {Observable, of} from "rxjs"; import {AicZone} from "../../models/aicZone"; import {CategoryParams} from "../../models/categoryParams"; @@ -29,22 +29,12 @@ import {VnfInstance} from "../../models/vnfInstance"; import {VfModuleInstance} from "../../models/vfModuleInstance"; import {ServiceInstance} from "../../models/serviceInstance"; import {VfModuleMap} from "../../models/vfModulesMap"; -import { - updateAicZones, - updateCategoryParameters, - updateLcpRegionsAndTenants, - updateServiceTypes, - updateSubscribers, - updateUserId -} from "../../storeUtil/utils/general/general.actions"; -import { - updateModel, - createServiceInstance, -} from "../../storeUtil/utils/service/service.actions"; +import {updateAicZones, updateCategoryParameters, updateLcpRegionsAndTenants, updateServiceTypes, updateSubscribers, updateUserId} from "../../storeUtil/utils/general/general.actions"; +import {createServiceInstance, updateModel,} from "../../storeUtil/utils/service/service.actions"; import {FeatureFlagsService, Features} from "../featureFlag/feature-flags.service"; import {VnfMember} from "../../models/VnfMember"; import {setOptionalMembersVnfGroupInstance} from "../../storeUtil/utils/vnfGroup/vnfGroup.actions"; -import {Observable} from "rxjs";import {NetworkModalRow} from "../../../drawingBoard/service-planning/objectsToTree/models/vrf/vrfModal/networkStep/network.step.model"; +import {NetworkModalRow} from "../../../drawingBoard/service-planning/objectsToTree/models/vrf/vrfModal/networkStep/network.step.model"; import {VPNModalRow} from "../../../drawingBoard/service-planning/objectsToTree/models/vrf/vrfModal/vpnStep/vpn.step.model"; import {ModelInfo} from "../../models/modelInfo"; @@ -66,11 +56,8 @@ export class AaiService { }; retrieveServiceLatestUpdateableVersion = (modelInvariantId: string): Observable<ModelInfo> => { - if (this.featureFlagsService.getFlagState(Features.FLAG_FLASH_REPLACE_VF_MODULE)){ - let pathQuery: string = Constants.Path.SERVICE_LATEST_VERSION + modelInvariantId; - return this.http.get<ModelInfo>(pathQuery) - } - return; + let pathQuery: string = Constants.Path.SERVICE_LATEST_VERSION + modelInvariantId; + return this.http.get<ModelInfo>(pathQuery) }; getUserId = (): Observable<any> => { |