summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/pipelines/components
diff options
context:
space:
mode:
authorWinnie Hellmann <winnie@gitlab.com>2018-10-05 09:34:08 +0200
committerWinnie Hellmann <winnie@gitlab.com>2018-10-05 09:34:31 +0200
commitc5dead78558e552801205bf6e0a9b78f1e88711d (patch)
tree50c154441209bbbc71aa69f4fe9f8b2e78dde496 /app/assets/javascripts/pipelines/components
parente8f14ef8859c2b6f870090666331f538702c40b9 (diff)
downloadgitlab-ce-c5dead78558e552801205bf6e0a9b78f1e88711d.tar.gz
Make sure remaining time of scheduled jobs is positive in pipelines list
Diffstat (limited to 'app/assets/javascripts/pipelines/components')
-rw-r--r--app/assets/javascripts/pipelines/components/pipelines_actions.vue9
1 files changed, 7 insertions, 2 deletions
diff --git a/app/assets/javascripts/pipelines/components/pipelines_actions.vue b/app/assets/javascripts/pipelines/components/pipelines_actions.vue
index 743d241ee7a..16e69759091 100644
--- a/app/assets/javascripts/pipelines/components/pipelines_actions.vue
+++ b/app/assets/javascripts/pipelines/components/pipelines_actions.vue
@@ -26,7 +26,12 @@ export default {
methods: {
onClickAction(action) {
if (action.scheduled_at) {
- const confirmationMessage = sprintf(s__("DelayedJobs|Are you sure you want to run %{jobName} immediately? This job will run automatically after it's timer finishes."), { jobName: action.name });
+ const confirmationMessage = sprintf(
+ s__(
+ "DelayedJobs|Are you sure you want to run %{jobName} immediately? This job will run automatically after it's timer finishes.",
+ ),
+ { jobName: action.name },
+ );
// https://gitlab.com/gitlab-org/gitlab-ce/issues/52156
// eslint-disable-next-line no-alert
if (!window.confirm(confirmationMessage)) {
@@ -49,7 +54,7 @@ export default {
remainingTime(action) {
const remainingMilliseconds = new Date(action.scheduled_at).getTime() - Date.now();
- return formatTime(remainingMilliseconds);
+ return formatTime(Math.max(0, remainingMilliseconds));
},
},
};