diff options
author | Sébastien Determe <sebastien.determe@intl.att.com> | 2019-04-05 13:35:24 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-04-05 13:35:24 +0000 |
commit | d994b259592d70862d0e0b6c7bd9bf764cbf6ea4 (patch) | |
tree | e3fd19d57021448c09bea5435d646721454bfbc9 /src | |
parent | 3ae0ad2234422c6660ae4fbdcf37e8e78dbf7e61 (diff) | |
parent | b2239894be073a68d18f96bbc7ee9fa1ebcf2456 (diff) |
Merge "E2E Automation"
Diffstat (limited to 'src')
3 files changed, 74 insertions, 18 deletions
diff --git a/src/main/resources/META-INF/resources/designer/partials/portfolios/operational_policy_window.html b/src/main/resources/META-INF/resources/designer/partials/portfolios/operational_policy_window.html index cf9382bf8..53f1d94e1 100644 --- a/src/main/resources/META-INF/resources/designer/partials/portfolios/operational_policy_window.html +++ b/src/main/resources/META-INF/resources/designer/partials/portfolios/operational_policy_window.html @@ -158,7 +158,9 @@ label { <label class="col-sm-4 control-label" for="recipe">Recipe</label> <div class="col-sm-8"> <select class="form-control" name="recipe" id="recipe" - enableFilter="true" ng-click="updateGuardRecipe($event)"> + enableFilter="true" + ng-click="updateGuardRecipe($event);initTargetResourceId()" + ng-model="recipe"> <option value="Restart">Restart</option> <option value="Rebuild">Rebuild</option> <option value="Migrate">Migrate</option> @@ -195,8 +197,8 @@ label { <option value="APPC">APPC</option> <option value="SO">SO</option> <option value="VFC">VFC</option> - <option value="SDNC">SDNC</option>° - <option value="SDNR">SDNR</option>° + <option value="SDNC">SDNC</option>° + <option value="SDNR">SDNR</option>° </select> </div> @@ -267,7 +269,8 @@ label { <label for="type" class="col-sm-4 control-label"> Target Type</label> <div class="col-sm-8"> - <select class="form-control" name="type" id="type"> + <select class="form-control" name="type" id="type" + ng-click="initTargetResourceId()" ng-model="type"> <option value="VFC">VFC</option> <option value="VM">VM</option> <option value="VNF">VNF</option> @@ -279,7 +282,9 @@ label { Target ResourceId</label> <div class="col-sm-8"> <select class="form-control" name="resourceId" id="resourceId" - enableFilter="true"> + enableFilter="true" ng-model="resourceId"> + <option value=""></option> + <option value="Other:">Other:</option> </select> </div> </div> diff --git a/src/main/resources/META-INF/resources/designer/scripts/OperationalPolicyCtrl.js b/src/main/resources/META-INF/resources/designer/scripts/OperationalPolicyCtrl.js index 5a1ac538b..922220b10 100644 --- a/src/main/resources/META-INF/resources/designer/scripts/OperationalPolicyCtrl.js +++ b/src/main/resources/META-INF/resources/designer/scripts/OperationalPolicyCtrl.js @@ -54,17 +54,7 @@ app } console.log("No active formId found !"); } - function initTargetResourceId() { - if (vf_Services !== null && vf_Services !== undefined) { - // Set all the Resource Invariant UUID in the target resource ID - // list (+Empty and other) - Object.keys(vf_Services["shared"]["byVf"]).forEach(function(key) { - - $("#targetResourceId").append($('<option></option>').val(key).html(key)); - }); - } - } function add_one_more() { console.log("add one more"); @@ -212,6 +202,59 @@ app }); }); } + + $scope.initTargetResourceId = function() { + + var recipe = $(event.target).val(); + + var type = $(event.target).val(); + + $('#resourceId').empty(); + $("#resourceId") + .append( + $('<option></option>').val("") + .html("")); + $("#resourceId").append( + $('<option></option>').val("Other:") + .html("Other:")); + + var resourceVnf = getResourceDetailsProperty(); + if (type == "VNF" + && (null !== resourceVnf || undefined !== resourceVnf)) { + for ( var prop in resourceVnf) { + var name = resourceVnf[prop]["name"]; + $("#resourceId").append( + $('<option></option>') + .val(name).html(name)); + } + + } + var resourceVfc = getResourceDetailsVfcProperty(); + if (type == "VFC" + && (null !== resourceVfc || undefined !== resourceVfc)) { + if (recipe == 'VF Module Create' + || recipe == 'VF Module Delete') { + for ( var prop in resourceVfc) { + if (resourceVfc[prop]["isBase"] == false) { + var name = resourceVfc[prop]["name"]; + $("#resourceId").append( + $('<option></option>') + .val(name) + .html(name)); + } + } + } + else + { + for ( var prop in resourceVfc) { + var name = resourceVfc[prop]["name"]; + $("#resourceId").append( + $('<option></option>') + .val(name).html(name)); + } + } + } + $scope.changeGuardPolicyType = function() { @@ -264,7 +307,6 @@ app angular.element(document.getElementById('formSpan')).scope().submitForm(allPolicies); $("#close_button").click(); }); - initTargetResourceId(); }); } $scope.init(); @@ -302,4 +344,4 @@ app }); }; - } ]);
\ No newline at end of file + } ]); diff --git a/src/main/resources/META-INF/resources/designer/scripts/propertyController.js b/src/main/resources/META-INF/resources/designer/scripts/propertyController.js index 507d6bc80..75c64f308 100644 --- a/src/main/resources/META-INF/resources/designer/scripts/propertyController.js +++ b/src/main/resources/META-INF/resources/designer/scripts/propertyController.js @@ -113,4 +113,13 @@ function getDeploymentStatusURL() { function setDeploymentStatusURL(deploymentStatusURL) { cl_props["dcaeDeploymentStatusUrl"] = deploymentStatusURL; } -module.exports = { getOperationalPolicyProperty,getGlobalProperty,getMsProperty,getMsUI,getLastUpdatedStatus,getDeploymentID,getDeploymentStatusURL };
\ No newline at end of file + +function getResourceDetailsProperty() { + return cl_props["modelPropertiesJson"]["resourceDetails"]["VF"]; +} + +function getResourceDetailsVfcProperty() { + return cl_props["modelPropertiesJson"]["resourceDetails"]["VFC"]; +} + +module.exports = { getOperationalPolicyProperty,getGlobalProperty,getMsProperty,getMsUI,getLastUpdatedStatus,getDeploymentID,getDeploymentStatusURL,getResourceDetailsProperty,getResourceDetailsVfcProperty };
\ No newline at end of file |