summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorRegis <boudinot.regis@yahoo.com>2017-05-04 07:24:47 -0600
committerRegis <boudinot.regis@yahoo.com>2017-05-04 07:24:47 -0600
commit082b868ecda0b30193a93b32d9614aef1f204484 (patch)
treeb54caadb28cd951871ee52d89355b4bd0c1b1c9c /app
parent3af533f7b62c6b94f230f66e9cbd3bbd775d969f (diff)
downloadgitlab-ce-082b868ecda0b30193a93b32d9614aef1f204484.tar.gz
fix js specs
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/issue_show/actions/tasks.js24
1 files changed, 12 insertions, 12 deletions
diff --git a/app/assets/javascripts/issue_show/actions/tasks.js b/app/assets/javascripts/issue_show/actions/tasks.js
index 654d6d64f0f..719b604a865 100644
--- a/app/assets/javascripts/issue_show/actions/tasks.js
+++ b/app/assets/javascripts/issue_show/actions/tasks.js
@@ -1,26 +1,26 @@
-export default (apiData, tasks) => {
+export default (newStateData, tasks) => {
const $tasks = $('#task_status');
const $tasksShort = $('#task_status_short');
const $issueableHeader = $('.issuable-header');
- const tasksStates = { api: null, tasks: null };
+ const tasksStates = { newState: null, currentState: null };
if ($tasks.length === 0) {
- if (!(apiData.task_status.indexOf('0 of 0') === 0)) {
- $issueableHeader.append(`<span id="task_status">${apiData.task_status}</span>`);
+ if (!(newStateData.task_status.indexOf('0 of 0') === 0)) {
+ $issueableHeader.append(`<span id="task_status">${newStateData.task_status}</span>`);
} else {
$issueableHeader.append('<span id="task_status"></span>');
}
} else {
- tasksStates.api = apiData.task_status.indexOf('0 of 0') === 0;
- tasksStates.tasks = tasks.indexOf('0 of 0') === 0;
+ tasksStates.newState = newStateData.task_status.indexOf('0 of 0') === 0;
+ tasksStates.currentState = tasks.indexOf('0 of 0') === 0;
}
- if ($tasks && !tasksStates.api) {
- $tasks.text(apiData.task_status);
- $tasksShort.text(apiData.task_status);
- } else if (tasksStates.tasks) {
- $issueableHeader.append(`<span id="task_status">${apiData.task_status}</span>`);
- } else if (tasksStates.api) {
+ if ($tasks && !tasksStates.newState) {
+ $tasks.text(newStateData.task_status);
+ $tasksShort.text(newStateData.task_status);
+ } else if (tasksStates.currentState) {
+ $issueableHeader.append(`<span id="task_status">${newStateData.task_status}</span>`);
+ } else if (tasksStates.newState) {
$tasks.remove();
$tasksShort.remove();
}