Disable Scheduler by feature toggle FLAG_GUILIN_CHANGEMG_SUBMIT_TO_SO

Issue-ID: VID-174
Change-Id: I8693021ed952e9ff250cf72360db43f0741af9b4
Signed-off-by: Ittay Stern <ittay.stern@att.com>
diff --git a/features.properties.md b/features.properties.md
index 4ebf9f1..ec9e2f8 100644
--- a/features.properties.md
+++ b/features.properties.md
@@ -271,19 +271,26 @@
   When toggled off, the only way to configure VID's value is by manually setting a value in the DB.
   See https://jira.onap.org/browse/VID-801 
   
-  * FLAG_2006_NEW_VIEW_EDIT_BUTTON_IN_INSTANTIATION_STATUS
   
-    When flag is true the "New view/edit" button will appear in context menu of chosen service in Instantiation Status window. 
-    The click on that button will open the service instance in drawing board (new screens).
+* FLAG_2006_NEW_VIEW_EDIT_BUTTON_IN_INSTANTIATION_STATUS
+
+  When flag is true the "New view/edit" button will appear in context menu of chosen service in Instantiation Status window. 
+  The click on that button will open the service instance in drawing board (new screens).
+  
+  
+* FLAG_2006_PORT_MIRRORING_LET_SELECTING_SOURCE_SUBSCRIBER
+
+  When flag is true the "Source Subscriber Name" drop down will be added for the source VNF
+  on the PMC (Port Mirroring Configuration) instantiation form.
+
+
+* FLAG_2006_PAUSE_VFMODULE_INSTANTIATION_CREATION
+  
+  When flag is true, pause upon creation capability for vfmodule is enabled on 
+  the new view edit screen
     
-  * FLAG_2006_PORT_MIRRORING_LET_SELECTING_SOURCE_SUBSCRIBER
-  
-    When flag is true the "Source Subscriber Name" drop down will be added for the source VNF
-    on the PMC (Port Mirroring Configuration) instantiation form.
- 
-  * FLAG_2006_PAUSE_VFMODULE_INSTANTIATION_CREATION
-  
-    When flag is true, pause upon creation capability for vfmodule is enabled on 
-    the new view edit screen 
- 
- 
\ No newline at end of file
+    
+* FLAG_GUILIN_CHANGEMG_SUBMIT_TO_SO
+
+  When toggled on, Change Management flows are submitted directly to SO. When toggled off, VID will use Scheduler.
+
diff --git a/vid-app-common/src/main/java/org/onap/vid/properties/Features.java b/vid-app-common/src/main/java/org/onap/vid/properties/Features.java
index c8c4c73..63aac31 100644
--- a/vid-app-common/src/main/java/org/onap/vid/properties/Features.java
+++ b/vid-app-common/src/main/java/org/onap/vid/properties/Features.java
@@ -97,6 +97,7 @@
     FLAG_2006_PORT_MIRRORING_LET_SELECTING_SOURCE_SUBSCRIBER,
     FLAG_2006_PAUSE_VFMODULE_INSTANTIATION_CREATION,
     FLAG_GUILIN_CONFIG_PORTAL_APP_PASSWORD,
+    FLAG_GUILIN_CHANGEMG_SUBMIT_TO_SO,
 
     ;
 
diff --git a/vid-app-common/src/main/webapp/WEB-INF/conf/dev.features.properties b/vid-app-common/src/main/webapp/WEB-INF/conf/dev.features.properties
index 2a0cb5b..92be1c7 100644
--- a/vid-app-common/src/main/webapp/WEB-INF/conf/dev.features.properties
+++ b/vid-app-common/src/main/webapp/WEB-INF/conf/dev.features.properties
@@ -33,3 +33,4 @@
 FLAG_SHOW_ORCHESTRATION_TYPE = false
 FLAG_1911_INSTANTIATION_ORDER_BUTTON_IN_ASYNC_ALACARTE = false
 FLAG_2002_ANY_ALACARTE_BESIDES_EXCLUDED_NEW_INSTANTIATION_UI = false
+FLAG_GUILIN_CHANGEMG_SUBMIT_TO_SO = true
diff --git a/vid-app-common/src/main/webapp/WEB-INF/conf/guilin.features.properties b/vid-app-common/src/main/webapp/WEB-INF/conf/guilin.features.properties
index e842256..d9d8088 100644
--- a/vid-app-common/src/main/webapp/WEB-INF/conf/guilin.features.properties
+++ b/vid-app-common/src/main/webapp/WEB-INF/conf/guilin.features.properties
@@ -14,6 +14,7 @@
 FLAG_CREATE_ERROR_REPORTS = true
 FLAG_SHOW_ORCHESTRATION_TYPE = false
 FLAG_DISABLE_HOMING = true
+FLAG_GUILIN_CHANGEMG_SUBMIT_TO_SO = true
 
 FLAG_ENABLE_WEBPACK_MODERN_UI = true
 FLAG_NETWORK_TO_ASYNC_INSTANTIATION = false
diff --git a/vid-app-common/src/main/webapp/WEB-INF/conf/onap.features.properties b/vid-app-common/src/main/webapp/WEB-INF/conf/onap.features.properties
index 58f677a..f6bc4e5 100644
--- a/vid-app-common/src/main/webapp/WEB-INF/conf/onap.features.properties
+++ b/vid-app-common/src/main/webapp/WEB-INF/conf/onap.features.properties
@@ -14,6 +14,7 @@
 FLAG_HANDLE_SO_WORKFLOWS = true
 FLAG_CREATE_ERROR_REPORTS = true
 FLAG_SHOW_ORCHESTRATION_TYPE = false
+FLAG_GUILIN_CHANGEMG_SUBMIT_TO_SO = true
 
 # Modern UI (Drawing-Board; View/Edit)
 # - - - - - - - - - - - - - - - - - -
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/constants/componentConstants.js b/vid-app-common/src/main/webapp/app/vid/scripts/constants/componentConstants.js
index 0e2c6cd..478f98b 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/constants/componentConstants.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/constants/componentConstants.js
@@ -267,6 +267,7 @@
       FLAG_SHOW_ORCHESTRATION_TYPE: "FLAG_SHOW_ORCHESTRATION_TYPE",
       FLAG_2004_INSTANTIATION_TEMPLATES_POPUP : "FLAG_2004_INSTANTIATION_TEMPLATES_POPUP",
       FLAG_2006_USER_PERMISSIONS_BY_OWNING_ENTITY: "FLAG_2006_USER_PERMISSIONS_BY_OWNING_ENTITY",
+      FLAG_GUILIN_CHANGEMG_SUBMIT_TO_SO: "FLAG_GUILIN_CHANGEMG_SUBMIT_TO_SO",
       FLAG_2006_PORT_MIRRORING_LET_SELECTING_SOURCE_SUBSCRIBER: "FLAG_2006_PORT_MIRRORING_LET_SELECTING_SOURCE_SUBSCRIBER"
     }
 
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/controller/change-management.controller.js b/vid-app-common/src/main/webapp/app/vid/scripts/controller/change-management.controller.js
index d58bf49..e4e3e80 100644
--- a/vid-app-common/src/main/webapp/app/vid/scripts/controller/change-management.controller.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/controller/change-management.controller.js
@@ -21,13 +21,13 @@
 (function () {
     'use strict';
 
-    appDS2.controller("changeManagementController", ["$uibModal", "changeManagementService", "_", "$log",  "SchedulerService", "$filter", "VIDCONFIGURATION", changeManagementController]);
+    appDS2.controller("changeManagementController", ["$uibModal", "changeManagementService", "_", "$log",  "SchedulerService", "$filter", "VIDCONFIGURATION", "COMPONENT", "featureFlags", changeManagementController]);
 
-    function changeManagementController($uibModal, changeManagementService, _, $log, SchedulerService, $filter, VIDCONFIGURATION) {
+    function changeManagementController($uibModal, changeManagementService, _, $log, SchedulerService, $filter, VIDCONFIGURATION, COMPONENT, featureFlags) {
         var vm = this;
 
         vm.lastTimeUpdated = "";
-        vm.hasScheduler = !!VIDCONFIGURATION.SCHEDULER_PORTAL_URL;
+        vm.hasScheduler = !featureFlags.isOn(COMPONENT.FEATURE_FLAGS.FLAG_GUILIN_CHANGEMG_SUBMIT_TO_SO);
         vm.currModal = null;
 
         vm.init = function() {
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.js b/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.js
index a4bdb36..08791b2 100644
--- a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.js
@@ -28,7 +28,7 @@
 
 
         var vm = this;
-        vm.hasScheduler = !!VIDCONFIGURATION.SCHEDULER_PORTAL_URL;
+        vm.hasScheduler = !featureFlags.isOn(COMPONENT.FEATURE_FLAGS.FLAG_GUILIN_CHANGEMG_SUBMIT_TO_SO);
         vm.errorMsg = '';
 
         vm.isSearchedVNF = false;
diff --git a/vid-webpack-master/cypress/integration/iFrames/changeManagement.e2e.ts b/vid-webpack-master/cypress/integration/iFrames/changeManagement.e2e.ts
index dda88d4..c2f7c85 100644
--- a/vid-webpack-master/cypress/integration/iFrames/changeManagement.e2e.ts
+++ b/vid-webpack-master/cypress/integration/iFrames/changeManagement.e2e.ts
@@ -137,6 +137,7 @@
           "FLAG_HANDLE_SO_WORKFLOWS": true,
           "FLAG_DISABLE_HOMING": true,
           "FLAG_ADD_MSO_TESTAPI_FIELD": true,
+          "FLAG_GUILIN_CHANGEMG_SUBMIT_TO_SO": true,
         })
       .as('initFlags');