aboutsummaryrefslogtreecommitdiffstats
path: root/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.js
diff options
context:
space:
mode:
authorgolabek <tomasz.golabek@nokia.com>2019-02-14 15:13:04 +0100
committergolabek <tomasz.golabek@nokia.com>2019-02-22 12:30:24 +0100
commit3c6a1844083f02796e67fd185306a8d0cdd7da07 (patch)
tree4ce0ecaaf6e2c513f88e384d42dc0ce5aa824d22 /vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.js
parentf5f3e8ee869ab0359dd4768f4b6bf554b5cc1371 (diff)
Introduced dynamic workflow properties in VID FE
VID FE will get workflows from SO API (mocked at this moment),then call SO for the parameters and dynamically render those parameters on the page. (contains PR of @Wojciech Sliwka about mocked parameters API from SO) Change-Id: If2cd156cd96a120e79746a4da44d4926f8d6cbcf Issue-ID: VID-398 Signed-off-by: Tomasz Golabek <tomasz.golabek@nokia.com>
Diffstat (limited to 'vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.js')
-rw-r--r--vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.js41
1 files changed, 34 insertions, 7 deletions
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 11f5cd6e5..c85f0fc55 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
@@ -43,6 +43,7 @@
var init = function () {
vm.changeManagement = {};
+ vm.changeManagement.workflowParameters = new Map();
loadServicesCatalog();
fetchAttUid().then(registerVNFNamesWatcher);
@@ -619,11 +620,13 @@
vm.loadWorkFlows = function () {
// Should be corrected when VID-397 will be closed. At the moment there is a need
// to merge local and remote workflows not to broke current functionality.
- return vm.loadLocalWorkFlows()
- .then(vm.loadRemoteWorkFlows)
- .then(function () {
- vm.workflows = vm.localWorkflows.concat(vm.remoteWorkflows.map(item => item.name));
- });
+ return vm.loadLocalWorkFlows()
+ .then(vm.loadRemoteWorkFlows)
+ .then(function () {
+ vm.workflows = vm.localWorkflows.concat(vm.remoteWorkflows.map(item => item.name));
+ }).then(function () {
+ vm.loadRemoteWorkFlowsParameters();
+ });
};
vm.loadLocalWorkFlows = function () {
@@ -645,6 +648,30 @@
});
};
+ vm.loadRemoteWorkFlowsParameters = function () {
+ vm.remoteWorkflowsParameters = new Map();
+ vm.remoteWorkflows.forEach(function(workflow) {
+ vm.loadRemoteWorkFlowParameters(workflow);
+ });
+ };
+
+ vm.loadRemoteWorkFlowParameters = function (workflow) {
+ changeManagementService.getSOWorkflowParameter(workflow.id)
+ .then(function (response) {
+ vm.remoteWorkflowsParameters.set(workflow.name, response.data.parameterDefinitions);
+ })
+ .catch(function (error) {
+ $log.error(error);
+ });
+ };
+
+ vm.getRemoteWorkFlowParameters = function (workflow) {
+ if (workflow && vm.remoteWorkflowsParameters.has(workflow)) {
+ return vm.remoteWorkflowsParameters.get(workflow)
+ }
+ return [];
+ };
+
//Must be $scope because we bind to the onchange of the html (cannot attached to vm variable).
$scope.selectFileForVNFName = function (fileInput) {
if (fileInput && fileInput.id) {
@@ -669,11 +696,11 @@
vm.isConfigUpdate = function () {
return vm.changeManagement.workflow === COMPONENT.WORKFLOWS.vnfConfigUpdate;
- }
+ };
vm.isScaleOut = function () {
return vm.changeManagement.workflow === COMPONENT.WORKFLOWS.vnfScaleOut;
- }
+ };
vm.shouldShowVnfInPlaceFields = function () {
return vm.changeManagement.workflow === COMPONENT.WORKFLOWS.vnfInPlace;