check if FLAG_FLASH_REPLACE_VF_MODULE open in the right place

modern View/Edit couldn't be opened when FLAG_FLASH_REPLACE_VF_MODULE
is on before that fix.
Issue-ID: VID-652

Signed-off-by: Eylon Malin <eylon.malin@intl.att.com>
Change-Id: Ib7ff6f374b6c8aa62133a7ef53fc21877f4b3c53
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 d2f76e4..540e02f 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 {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 @@
     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);
+      }
     });
   }