Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
557cf4fa
Commit
557cf4fa
authored
Oct 26, 2018
by
Winnie Hellmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add dynamic timer for delayed jobs in pipelines list
parent
91765b80
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
8 deletions
+13
-8
app/assets/javascripts/pipelines/components/pipelines_actions.vue
...ts/javascripts/pipelines/components/pipelines_actions.vue
+3
-7
changelogs/unreleased/winh-pipeline-actions-dynamic-timer.yml
...gelogs/unreleased/winh-pipeline-actions-dynamic-timer.yml
+5
-0
spec/javascripts/pipelines/pipelines_actions_spec.js
spec/javascripts/pipelines/pipelines_actions_spec.js
+5
-1
No files found.
app/assets/javascripts/pipelines/components/pipelines_actions.vue
View file @
557cf4fa
<
script
>
<
script
>
import
{
s__
,
sprintf
}
from
'
~/locale
'
;
import
{
s__
,
sprintf
}
from
'
~/locale
'
;
import
{
formatTime
}
from
'
~/lib/utils/datetime_utility
'
;
import
eventHub
from
'
../event_hub
'
;
import
eventHub
from
'
../event_hub
'
;
import
icon
from
'
../../vue_shared/components/icon.vue
'
;
import
icon
from
'
../../vue_shared/components/icon.vue
'
;
import
tooltip
from
'
../../vue_shared/directives/tooltip
'
;
import
tooltip
from
'
../../vue_shared/directives/tooltip
'
;
import
GlCountdown
from
'
~/vue_shared/components/gl_countdown.vue
'
;
export
default
{
export
default
{
directives
:
{
directives
:
{
...
@@ -11,6 +11,7 @@ export default {
...
@@ -11,6 +11,7 @@ export default {
},
},
components
:
{
components
:
{
icon
,
icon
,
GlCountdown
,
},
},
props
:
{
props
:
{
actions
:
{
actions
:
{
...
@@ -51,11 +52,6 @@ export default {
...
@@ -51,11 +52,6 @@ export default {
return
!
action
.
playable
;
return
!
action
.
playable
;
},
},
remainingTime
(
action
)
{
const
remainingMilliseconds
=
new
Date
(
action
.
scheduled_at
).
getTime
()
-
Date
.
now
();
return
formatTime
(
Math
.
max
(
0
,
remainingMilliseconds
));
},
},
},
};
};
</
script
>
</
script
>
...
@@ -100,7 +96,7 @@ export default {
...
@@ -100,7 +96,7 @@ export default {
class=
"pull-right"
class=
"pull-right"
>
>
<icon
name=
"clock"
/>
<icon
name=
"clock"
/>
{{
remainingTime
(
action
)
}}
<gl-countdown
:end-date-string=
"action.scheduled_at"
/>
</span>
</span>
</button>
</button>
</li>
</li>
...
...
changelogs/unreleased/winh-pipeline-actions-dynamic-timer.yml
0 → 100644
View file @
557cf4fa
---
title
:
Add dynamic timer for delayed jobs in pipelines list
merge_request
:
22621
author
:
type
:
changed
spec/javascripts/pipelines/pipelines_actions_spec.js
View file @
557cf4fa
...
@@ -62,9 +62,13 @@ describe('Pipelines Actions dropdown', () => {
...
@@ -62,9 +62,13 @@ describe('Pipelines Actions dropdown', () => {
);
);
};
};
beforeEach
(
()
=>
{
beforeEach
(
done
=>
{
spyOn
(
Date
,
'
now
'
).
and
.
callFake
(()
=>
new
Date
(
'
2063-04-04T00:42:00Z
'
).
getTime
());
spyOn
(
Date
,
'
now
'
).
and
.
callFake
(()
=>
new
Date
(
'
2063-04-04T00:42:00Z
'
).
getTime
());
vm
=
mountComponent
(
Component
,
{
actions
:
[
scheduledJobAction
,
expiredJobAction
]
});
vm
=
mountComponent
(
Component
,
{
actions
:
[
scheduledJobAction
,
expiredJobAction
]
});
Vue
.
nextTick
()
.
then
(
done
)
.
catch
(
done
.
fail
);
});
});
it
(
'
emits postAction event after confirming
'
,
()
=>
{
it
(
'
emits postAction event after confirming
'
,
()
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment