diff options
Diffstat (limited to 'vid-app-common/src/main/webapp/app/vid/scripts/modals')
3 files changed, 42 insertions, 18 deletions
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-test-environment/new-test-environment.controller.js b/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-test-environment/new-test-environment.controller.js index 84ad2d58c..53111950c 100644 --- a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-test-environment/new-test-environment.controller.js +++ b/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-test-environment/new-test-environment.controller.js @@ -22,11 +22,12 @@ 'use strict'; appDS2.controller("newTestEnvironmentModalController", ["$uibModalInstance", "$uibModal", "AaiService", "TestEnvironmentsService","OwningEntityService", - "$log", "$scope", "_", "COMPONENT","$rootScope", newTestEnvironmentsModalController]); + "$log", "$scope", "_", "COMPONENT","$rootScope", "featureFlags", newTestEnvironmentsModalController]); - function newTestEnvironmentsModalController($uibModalInstance, $uibModal, AaiService, TestEnvironmentsService,OwningEntityService, $log, $scope, _, COMPONENT, $rootScope) { + function newTestEnvironmentsModalController($uibModalInstance, $uibModal, AaiService, TestEnvironmentsService, OwningEntityService, $log, $scope, _, COMPONENT, $rootScope, featureFlags ) { var vm = this; vm.newEnvironment = {}; + vm.releaseVersions = {}; var init = function () { vm.newEnvironment.operationalEnvironmentType = "VNF"; @@ -35,7 +36,7 @@ }; var loadEcompEnvironmentsList = function () { - TestEnvironmentsService.loadAAIestEnvironments("ECOMP") + TestEnvironmentsService.loadAAIestEnvironments("ONAP") .then(function(response) { vm.environments = response.operationalEnvironment; }) @@ -47,10 +48,12 @@ var loadCategoryParameters = function () { OwningEntityService.getOwningEntityProperties(function(response){ - vm.environmentsTypesList = response["operational-environment-type"].map(function (x){ - return x.name;}); - vm.workloadContextList = response["workload-context"].map(function (x){ - return x.name;}); + vm.environmentsTypesList = response["operational-environment-type"].map(function (environmentType){ + return environmentType.name;}); + vm.workloadContextList = response["workload-context"].map(function (context){ + return context.name;}); + vm.releaseVersions = response["release"].map(function (releaseOptions){ + return releaseOptions.name;}); },COMPONENT.TENANT_ISOLATION_FAMILY); } @@ -68,8 +71,8 @@ vm.createEnvironment = function () { if($scope.newTestEnvironment.$valid) { - vm.newEnvironment.workloadContext = vm.newEnvironment.operationalEnvironmentType + '_' + vm.newEnvironment.workloadContext; var requestDetails = vm.newEnvironment; + delete vm.newEnvironment['release']; $rootScope.$broadcast(COMPONENT.MSO_CREATE_ENVIRONMENT, { url : COMPONENT.OPERATIONAL_ENVIRONMENT_CREATE, requestDetails : requestDetails @@ -78,7 +81,9 @@ } }; - + vm.isShowReleaseEnabled = function () { + return featureFlags.isOn(COMPONENT.FEATURE_FLAGS.FLAG_1908_RELEASE_TENANT_ISOLATION) + }; init(); } diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-test-environment/new-test-environment.html b/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-test-environment/new-test-environment.html index ca51a8def..241148dc8 100644 --- a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-test-environment/new-test-environment.html +++ b/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-test-environment/new-test-environment.html @@ -51,11 +51,18 @@ <option data-tests-id="environment-type-option" class="environmentTypeOption" ng-repeat="item in vm.environmentsTypesList" ng-value="item">{{item}}</option> </select> </div> + <div class="form-group" ng-if="vm.isShowReleaseEnabled()"> + <label class="control-label" for="operationalEnvironmentType">Release</label> + <select class="form-control" ng-class="{'grayedOut': !vm.newEnvironment.operationalEnvironmentType}" ng-model="vm.newEnvironment.release" name="operationalEnvironmentType" id="operationalRelease" data-tests-id="operational-release" required> + <option value="" disabled selected hidden>Select release</option> + <option data-tests-id="environment-type-option" class="environmentTypeOption" ng-repeat="item in vm.releaseVersions" ng-value="item">{{item}}</option> + </select> + </div> <div class="form-group"> <label class="control-label" for="workloadContext">Workload Context</label> - <select class="form-control" ng-class="{'grayedOut': !vm.newEnvironment.workloadContext}" ng-model="vm.newEnvironment.workloadContext" name="workloadContext" id="workloadContext" data-tests-id="workload-context" required> + <select class="form-control" ng-class="{'grayedOut': !vm.newEnvironment.workloadContext}" ng-disabled="vm.isShowReleaseEnabled() && !vm.newEnvironment.release" ng-model="vm.newEnvironment.workloadContext" name="workloadContext" id="workloadContext" data-tests-id="workload-context" required> <option value="" disabled selected hidden>Select workload context</option> - <option data-tests-id="workload-context-option" class="workloadContextOption" ng-repeat="item in vm.workloadContextList" ng-value="item">{{vm.newEnvironment.operationalEnvironmentType + '_' + item}}</option> + <option data-tests-id="workload-context-option" class="workloadContextOption" ng-repeat="item in vm.workloadContextList" ng-value="item">{{vm.isShowReleaseEnabled() ? vm.newEnvironment.operationalEnvironmentType + '_' + item + '_' + vm.newEnvironment.release : vm.newEnvironment.operationalEnvironmentType + '_' + item }}</option> </select> </div> <div data-tests-id="test-new-environment-error" class="connect-error" ng-if="vm.aaiConnectError">{{vm.aaiConnectError}}</div> diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/vf-module-homing-data-action/vf-module-homing-data-action.controller.js b/vid-app-common/src/main/webapp/app/vid/scripts/modals/vf-module-homing-data-action/vf-module-homing-data-action.controller.js index 956ae1db5..87f0f301d 100644 --- a/vid-app-common/src/main/webapp/app/vid/scripts/modals/vf-module-homing-data-action/vf-module-homing-data-action.controller.js +++ b/vid-app-common/src/main/webapp/app/vid/scripts/modals/vf-module-homing-data-action/vf-module-homing-data-action.controller.js @@ -20,7 +20,7 @@ "use strict"; -var vfModuleActionModalController = function(COMPONENT, $scope, $uibModal, CreationService, +var vfModuleActionModalController = function(COMPONENT, FIELD, $scope, $uibModal, CreationService, MsoService, AaiService, DeleteResumeService, DataService, $uibModalInstance, action, vfModule, featureFlags) { @@ -28,11 +28,12 @@ var vfModuleActionModalController = function(COMPONENT, $scope, $uibModal, Creat $scope.action = action; $scope.vfModuleName = vfModule.name; + $scope.volumeGroups = vfModule.volumeGroups; $scope.lcpAndTenant = null; $scope.regionSelection = {lcpRegion: null, legacyRegion: null, tenant: null}; $scope.lcpRegionList = null; $scope.isHomingData = false; - $scope.megaRegion = ['AAIAIC25', 'rdm3', 'rdm5a']; + $scope.megaRegion = ['AAIAIC25']; $scope.isSoftDeleteEnabled = vfModule.nodeStatus.toLowerCase() !== 'assigned' && action === COMPONENT.DELETE; $scope.isResumeEnabled = action === COMPONENT.RESUME; @@ -49,6 +50,7 @@ var vfModuleActionModalController = function(COMPONENT, $scope, $uibModal, Creat $scope.lcpAndTenant = response; $scope.isFeatureFlagCloudOwner = featureFlags.isOn(COMPONENT.FEATURE_FLAGS.FLAG_1810_CR_ADD_CLOUD_OWNER_TO_MSO_REQUEST); $scope.lcpRegionList = _.uniqBy(response, 'cloudRegionId'); + $scope.vendorInCloudOwnerRegex = /^[^-]*-/; }); } @@ -83,8 +85,8 @@ var vfModuleActionModalController = function(COMPONENT, $scope, $uibModal, Creat $scope.deleteOrResume = function() { - var regionSelectionList = [({id: "lcpRegion", value: getLcpRegionId()})]; - regionSelectionList.push({id: "tenant", value: $scope.regionSelection.tenant}); + var msoParameterList = [({id: "lcpRegion", value: getLcpRegionId()})]; + msoParameterList.push({id: "tenant", value: $scope.regionSelection.tenant}); var requestParams = {}; var requestDetails; @@ -93,14 +95,24 @@ var vfModuleActionModalController = function(COMPONENT, $scope, $uibModal, Creat CreationService.initializeComponent(COMPONENT.VF_MODULE); CreationService.setInventoryInfo(); - requestDetails = CreationService.getMsoRequestDetails(regionSelectionList); + var availableVolumeGroupList = $scope.volumeGroups; + + if (availableVolumeGroupList && availableVolumeGroupList.length > 0) { + var volumeGroupList = FIELD.PARAMETER.AVAILABLE_VOLUME_GROUP; + volumeGroupList.value = _.map(availableVolumeGroupList, function (volumeGroup) { + return volumeGroup.name; + }); + msoParameterList.push(volumeGroupList); + } + + requestDetails = CreationService.getMsoRequestDetails(msoParameterList); requestParams.url = CreationService.getMsoUrl(); msoType = COMPONENT.MSO_CREATE_REQ; } else { DeleteResumeService.initializeComponent(COMPONENT.VF_MODULE); - requestDetails = DeleteResumeService.getMsoRequestDetails(regionSelectionList); + requestDetails = DeleteResumeService.getMsoRequestDetails(msoParameterList); if(DeleteResumeService.isMacro === true) { requestDetails.requestParameters.aLaCarte = false; } @@ -137,6 +149,6 @@ var vfModuleActionModalController = function(COMPONENT, $scope, $uibModal, Creat }; -appDS2.controller("vfModuleActionModalController", [ "COMPONENT", "$scope", "$uibModal", "CreationService", +appDS2.controller("vfModuleActionModalController", [ "COMPONENT", "FIELD", "$scope", "$uibModal", "CreationService", "MsoService", "AaiService", "DeleteResumeService", "DataService", "$uibModalInstance", "action", "vfModule", "featureFlags", vfModuleActionModalController ]); |