Don't fetch scheduled tasks when there's no scheduler 30/107430/2
authorIttay Stern <ittay.stern@att.com>
Mon, 11 May 2020 05:06:50 +0000 (08:06 +0300)
committerIttay Stern <ittay.stern@att.com>
Wed, 13 May 2020 06:35:40 +0000 (06:35 +0000)
Change-Id: Idc78256615164f06d110c9847e90a9112fb1e2d5
Issue-ID: VID-825
Issue-ID: VID-174
Signed-off-by: Ittay Stern <ittay.stern@att.com>
vid-app-common/src/main/webapp/app/vid/scripts/services/change-management.service.js

index 6b45a74..b90d417 100644 (file)
@@ -21,9 +21,9 @@
 (function () {
     'use strict';
 
-    appDS2.service('changeManagementService', ['$http', '$q', 'COMPONENT', 'VIDCONFIGURATION', changeManagementService]);
+    appDS2.service('changeManagementService', ['$http', '$q', 'COMPONENT', 'VIDCONFIGURATION', 'featureFlags', changeManagementService]);
 
-    function changeManagementService($http, $q, COMPONENT, VIDCONFIGURATION) {
+    function changeManagementService($http, $q, COMPONENT, VIDCONFIGURATION, featureFlags) {
         this.getWorkflows = function (vnfs) {
             var requestVnfs = _.map(vnfs, function (vnf) {
                 return {
         this.getMSOChangeManagements = function() {
             var deferred = $q.defer();
 
-            $http.get(COMPONENT.GET_MSO_WORKFLOWS)
-            .success(function (response) {
-                deferred.resolve({data: response});
-            })
-            .error(function(data, status, headers, config) {
-                deferred.reject({message: data, status: status});
-            });
+            if(featureFlags.isOn(COMPONENT.FEATURE_FLAGS.FLAG_GUILIN_CHANGEMG_SUBMIT_TO_SO)) {
+                deferred.resolve({data: []}); // no scheduler
+            } else {
+                $http.get(COMPONENT.GET_MSO_WORKFLOWS)
+                .success(function (response) {
+                    deferred.resolve({data: response});
+                })
+                .error(function (data, status, headers, config) {
+                    deferred.reject({message: data, status: status});
+                });
+            }
 
             return deferred.promise;
         };