summaryrefslogtreecommitdiffstats
path: root/vid-webpack-master/src/app/shared/services
diff options
context:
space:
mode:
authorEinat Vinouze <einat.vinouze@intl.att.com>2019-08-27 16:01:01 +0300
committerIttay Stern <ittay.stern@att.com>2019-09-09 07:01:36 +0000
commite1f7974f0badbd4440d5b7ea5f1b1cb2d4973818 (patch)
tree46be9cdc44cbb475527bc3c43df23d16f7579d29 /vid-webpack-master/src/app/shared/services
parente25b88b5a7a0f3bf63ca7160a441b53145484bcc (diff)
Adding feature: Replace vfmodule
Issue-ID: VID-603 Change-Id: I59068a0979d6fb733e4243c8f78921f396dc9d17 Signed-off-by: Einat Vinouze <einat.vinouze@intl.att.com> Signed-off-by: Amichai Hemli <amichai.hemli@intl.att.com> Signed-off-by: Ittay Stern <ittay.stern@att.com>
Diffstat (limited to 'vid-webpack-master/src/app/shared/services')
-rw-r--r--vid-webpack-master/src/app/shared/services/aaiService/aai.service.spec.ts1
-rw-r--r--vid-webpack-master/src/app/shared/services/aaiService/aai.service.ts21
-rw-r--r--vid-webpack-master/src/app/shared/services/featureFlag/feature-flags.service.ts10
3 files changed, 24 insertions, 8 deletions
diff --git a/vid-webpack-master/src/app/shared/services/aaiService/aai.service.spec.ts b/vid-webpack-master/src/app/shared/services/aaiService/aai.service.spec.ts
index 5cff00b7e..f563cbc75 100644
--- a/vid-webpack-master/src/app/shared/services/aaiService/aai.service.spec.ts
+++ b/vid-webpack-master/src/app/shared/services/aaiService/aai.service.spec.ts
@@ -566,6 +566,7 @@ var expectedResult =
{
'vnfs': {
'DROR_vsp': {
+ 'upgradedVFMSonsCounter': 0,
'rollbackOnFailure': 'true',
'vfModules': {},
'isMissingData': false,
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 4e7e4dad8..d421fe8e1 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
@@ -37,12 +37,16 @@ import {
updateSubscribers,
updateUserId
} from "../../storeUtil/utils/general/general.actions";
-import {updateModel, createServiceInstance} from "../../storeUtil/utils/service/service.actions";
+import {
+ updateModel,
+ createServiceInstance,
+} 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 {VPNModalRow} from "../../../drawingBoard/service-planning/objectsToTree/models/vrf/vrfModal/vpnStep/vpn.step.model";
+import {ModelInfo} from "../../models/modelInfo";
@Injectable()
export class AaiService {
@@ -61,6 +65,14 @@ 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;
+ };
+
getUserId = (): Observable<any> => {
return this.http.get("../../getuserID", {responseType: 'text'}).do((res) => this.store.dispatch(updateUserId(res)));
};
@@ -213,7 +225,7 @@ export class AaiService {
};
public extractLcpRegionName(cloudRegionId: string, cloudOwner: string):string {
- return this.featureFlagsService.getFlagState(Features.FLAG_1810_CR_ADD_CLOUD_OWNER_TO_MSO_REQUEST) ?
+ return this.featureFlagsService.getFlagState(Features.FLAG_1810_CR_ADD_CLOUD_OWNER_TO_MSO_REQUEST) ?
cloudRegionId+AaiService.formatCloudOwnerTrailer(cloudOwner) : cloudRegionId;
};
@@ -271,7 +283,7 @@ export class AaiService {
public retrieveAndStoreServiceInstanceTopology(serviceInstanceId: string, subscriberId: string, serviceType: string, serviceModeId: string):Observable<ServiceInstance> {
return this.retrieveServiceInstanceTopology(serviceInstanceId, subscriberId, serviceType).do((service:ServiceInstance) => {
this.store.dispatch(createServiceInstance(service, serviceModeId));
- });
+ });
};
@@ -296,9 +308,6 @@ export class AaiService {
.do((res) => {
this.store.dispatch(setOptionalMembersVnfGroupInstance(serviceModelId, pathQuery, res))
});
- // let res = Observable.of((JSON.parse(JSON.stringify(this.loadMockMembers()))));
- // return res;
-
}
//TODO: make other places use this function
diff --git a/vid-webpack-master/src/app/shared/services/featureFlag/feature-flags.service.ts b/vid-webpack-master/src/app/shared/services/featureFlag/feature-flags.service.ts
index 01ecb2cdf..da79a1a4e 100644
--- a/vid-webpack-master/src/app/shared/services/featureFlag/feature-flags.service.ts
+++ b/vid-webpack-master/src/app/shared/services/featureFlag/feature-flags.service.ts
@@ -9,7 +9,9 @@ export enum Features {
FLAG_VF_MODULE_RESUME_STATUS_CREATE = 'FLAG_VF_MODULE_RESUME_STATUS_CREATE',
DRAG_AND_DROP_OPERATION = 'DRAG_AND_DROP_OPERATION',
FLAG_1906_COMPONENT_INFO = 'FLAG_1906_COMPONENT_INFO',
- FLAG_1908_RESUME_MACRO_SERVICE = 'FLAG_1908_RESUME_MACRO_SERVICE'
+ FLAG_1908_RESUME_MACRO_SERVICE = 'FLAG_1908_RESUME_MACRO_SERVICE',
+ FLAG_FLASH_REPLACE_VF_MODULE ='FLAG_FLASH_REPLACE_VF_MODULE',
+ FLAG_FLASH_VIEW_IN_NEW_VIEWEDIT_SCREEN ='FLAG_FLASH_VIEW_IN_NEW_VIEWEDIT_SCREEN'
}
@Injectable()
@@ -23,7 +25,11 @@ export class FeatureFlagsService {
/*static method for easy refactoring of code, so no injection of FeatureFlagsService is needed*/
public static getFlagState(flag: Features, store: NgRedux<AppState>):boolean {
- return store.getState().global.flags[flag];
+ let storeStateGlobalFields = store.getState().global;
+ if(storeStateGlobalFields && storeStateGlobalFields.flags && storeStateGlobalFields.flags[flag] !== undefined){
+ return storeStateGlobalFields.flags[flag];
+ }
+ return false;
}