diff options
author | chenjiankun <chenjiankun1@huawei.com> | 2018-03-08 12:18:27 +0000 |
---|---|---|
committer | chenjiankun <chenjiankun1@huawei.com> | 2018-03-08 12:18:27 +0000 |
commit | 1d2acc900a695bee5c1d83d7631725e4d8b18df0 (patch) | |
tree | 249fcd77d191eaca713d7dc5f3c309e8322c6546 /gui/app/scripts/controllers/projectDetail.controller.js | |
parent | 58dd0e8514518e4c266713c1d54ba735b400a5d8 (diff) |
Supporting user config task parameters in GUI
JIRA: YARDSTICK-981
We need to add function to enable user to config task parameters in GUI.
The way to config must be more friendly.
Change-Id: I8746149084f1d554b48ed392f2fef4748e279dfb
Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
Diffstat (limited to 'gui/app/scripts/controllers/projectDetail.controller.js')
-rw-r--r-- | gui/app/scripts/controllers/projectDetail.controller.js | 34 |
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); } |