aboutsummaryrefslogtreecommitdiffstats
path: root/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management
diff options
context:
space:
mode:
Diffstat (limited to 'vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management')
-rw-r--r--vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.js58
-rw-r--r--vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.html6
2 files changed, 42 insertions, 22 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 e4ff1a06..39182191 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
@@ -2,9 +2,9 @@
'use strict';
appDS2.controller("newChangeManagementModalController", ["$uibModalInstance", "$uibModal",'$q', "AaiService", "changeManagementService", "Upload",
- "$log", "$scope", "_", "COMPONENT", "VIDCONFIGURATION", newChangeManagementModalController]);
+ "$log", "$scope", "_", "COMPONENT", "VIDCONFIGURATION","DataService","featureFlags", newChangeManagementModalController]);
- function newChangeManagementModalController($uibModalInstance, $uibModal,$q, AaiService, changeManagementService, Upload, $log, $scope, _, COMPONENT, VIDCONFIGURATION) {
+ function newChangeManagementModalController($uibModalInstance, $uibModal,$q, AaiService, changeManagementService, Upload, $log, $scope, _, COMPONENT, VIDCONFIGURATION, DataService, featureFlags) {
var vm = this;
vm.hasScheduler = !!VIDCONFIGURATION.SCHEDULER_PORTAL_URL;
@@ -23,11 +23,29 @@
vm.softwareVersionRegex = "[-a-zA-Z0-9\.]+";
+ var attuid;
+
+ function fetchAttUid() {
+ var defer = $q.defer();
+ if (attuid) {
+ defer.resolve(attuid);
+ } else {
+ AaiService.getLoggedInUserID(function (response) {
+ attuid = response.data;
+ defer.resolve(attuid);
+ },
+ function (err) {
+ defer.reject(err);
+ });
+ }
+ return defer.promise;
+ }
+
var init = function () {
vm.changeManagement = {};
loadServicesCatalog();
- registerVNFNamesWatcher();
+ fetchAttUid().then(registerVNFNamesWatcher);
vm.loadSubscribers();
};
@@ -115,14 +133,11 @@
modelCustomizationName: csarVNF.modelCustomizationName,
modelCustomizationId: csarVNF.customizationUuid
},
- cloudConfiguration: {
- lcpCloudRegionId: "mdt1",
- tenantId: "88a6ca3ee0394ade9403f075db23167e"
- },
+ cloudConfiguration: selectionVNF.cloudConfiguration || {},
requestInfo: {
source: "VID",
suppressRollback: false,
- requestorId: "az2016"
+ requestorId: attuid
},
relatedInstanceList: [
{
@@ -161,13 +176,13 @@
return data;
}]
})
- .then(function (configUpdateResponse) {
- vm.changeManagement.configUpdateFile = configUpdateResponse && JSON.parse(configUpdateResponse.data).payload;
- defer.resolve(true);
- })
- .catch(function (error) {
- defer.resolve(false);
- });
+ .then(function (configUpdateResponse) {
+ vm.changeManagement.configUpdateFile = configUpdateResponse && JSON.parse(configUpdateResponse.data).payload;
+ defer.resolve(true);
+ })
+ .catch(function (error) {
+ defer.resolve(false);
+ });
return defer.promise;
};
@@ -350,6 +365,9 @@
vm.changeManagement.policyYN = "Y";
vm.changeManagement.sniroYN = "Y";
+ if (featureFlags.isOn(COMPONENT.FEATURE_FLAGS.FLAG_ADD_MSO_TESTAPI_FIELD)) {
+ vm.changeManagement.testApi = DataService.getMsoRequestParametersTestApi();
+ }
var data = {
widgetName: 'Portal-Common-Scheduler',
widgetData: vm.changeManagement,
@@ -456,11 +474,13 @@
vm.serviceInstancesToGetVersions = [];
var versions = [];
_.forEach(vm.vnfs, function (vnf) {
- if (vnf.properties['nf-role'] === vm.changeManagement['vnfType']) {
-
+ if (vnf.properties['nf-role'] === vm.changeManagement['vnfType']
+ && vnf.properties["model-invariant-id"]
+ && vnf.properties["model-version-id"]) {
vm.serviceInstancesToGetVersions.push({
- "model-invariant-id": vnf.properties["model-invariant-id"],
- "model-version-id": vnf.properties["model-version-id"] }
+ "model-invariant-id": vnf.properties["model-invariant-id"],
+ "model-version-id": vnf.properties["model-version-id"]
+ }
);
versions.push(vnf.properties["model-invariant-id"]);
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.html b/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.html
index 9954d5ae..5679af41 100644
--- a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.html
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.html
@@ -71,15 +71,15 @@
</div>
<div ng-if="vm.shouldShowVnfInPlaceFields()">
<div class="form-group">
- <label class="control-label">operations-timeout</label>
+ <label class="control-label">Operations timeout</label>
<input class="form-control" ng-model="vm.changeManagement.operationTimeout" name="operationTimeout" type="text" id="operations-timeout" pattern="[0-9]+" required>
</div>
<div class="form-group">
- <label class="control-label">existing-software-version</label>
+ <label class="control-label">Existing software version</label>
<input class="form-control" ng-model="vm.changeManagement.existingSoftwareVersion" name="existingSoftwareVersion" type="text" id="existing-software-version" pattern="{{vm.softwareVersionRegex}}" required>
</div>
<div class="form-group">
- <label class="control-label">new-software-version</label>
+ <label class="control-label">New software version</label>
<input class="form-control" ng-model="vm.changeManagement.newSoftwareVersion" name="newSoftwareVersion" type="text" id="new-software-version" pattern="{{vm.softwareVersionRegex}}" required>
</div>