aboutsummaryrefslogtreecommitdiffstats
path: root/gui/app/scripts/controllers/projectDetail.controller.js
diff options
context:
space:
mode:
authorJack Chan <chenjiankun1@huawei.com>2018-03-16 09:01:07 +0000
committerGerrit Code Review <gerrit@opnfv.org>2018-03-16 09:01:07 +0000
commita6a54f115cb55a4cf91df24e9b894f89b232dae8 (patch)
treea18847a270f64710d5daefd73cfdb5622134c3e6 /gui/app/scripts/controllers/projectDetail.controller.js
parent8fe2c9fd13783fc5aa0f3b488274b5f892f2f260 (diff)
parent1d2acc900a695bee5c1d83d7631725e4d8b18df0 (diff)
Merge "Supporting user config task parameters in GUI"
Diffstat (limited to 'gui/app/scripts/controllers/projectDetail.controller.js')
-rw-r--r--gui/app/scripts/controllers/projectDetail.controller.js34
1 files changed, 28 insertions, 6 deletions
diff --git a/gui/app/scripts/controllers/projectDetail.controller.js b/gui/app/scripts/controllers/projectDetail.controller.js
index e8468045d..353e02bcf 100644
--- a/gui/app/scripts/controllers/projectDetail.controller.js
+++ b/gui/app/scripts/controllers/projectDetail.controller.js
@@ -439,15 +439,36 @@ angular.module('yardStickGui2App')
$scope.displayTable = false;
$scope.contentInfo = response.result.testcase;
+ $scope.optionalParams = response.result.args;
}
}, function(error) {
- toaster.pop({
- type: 'error',
- title: 'fail',
- body: 'unknow error',
- timeout: 3000
- });
+ mainFactory.errorHandler2(error);
+ })
+ }
+
+
+ function addParamsToTask(){
+ var params = {}
+ angular.forEach($scope.optionalParams, function(value, name){
+ if(value.value){
+ params[name] = value.value;
+ }
+ });
+
+ mainFactory.taskAddParams().put({
+ 'taskId': $scope.newUUID,
+ 'action': 'add_params',
+ 'args': {
+ 'params': params
+ }
+ }).$promise.then(function(resp) {
+ if (resp.status == 1) {
+ } else {
+ mainFactory.errorHandler1(resp);
+ }
+ }, function(error) {
+ mainFactory.errorHandler2(error);
})
}
@@ -530,6 +551,7 @@ angular.module('yardStickGui2App')
function confirmAddCaseOrSuite(content) {
if ($scope.selectType.name == "Test Case") {
addCasetoTask(content);
+ addParamsToTask();
} else {
addSuitetoTask(content);
}