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
390abbf0
Commit
390abbf0
authored
Oct 26, 2018
by
Winnie Hellmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add placeholder for remaining time in delayed job tooltips
parent
d0c58a97
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
30 deletions
+7
-30
lib/gitlab/ci/status/build/scheduled.rb
lib/gitlab/ci/status/build/scheduled.rb
+2
-11
locale/gitlab.pot
locale/gitlab.pot
+1
-1
spec/features/projects/jobs_spec.rb
spec/features/projects/jobs_spec.rb
+1
-1
spec/lib/gitlab/ci/status/build/scheduled_spec.rb
spec/lib/gitlab/ci/status/build/scheduled_spec.rb
+3
-17
No files found.
lib/gitlab/ci/status/build/scheduled.rb
View file @
390abbf0
...
@@ -9,7 +9,7 @@ module Gitlab
...
@@ -9,7 +9,7 @@ module Gitlab
{
{
image:
'illustrations/illustrations_scheduled-job_countdown.svg'
,
image:
'illustrations/illustrations_scheduled-job_countdown.svg'
,
size:
'svg-394'
,
size:
'svg-394'
,
title:
_
(
"This is a delayed
to run in "
)
+
"
#{
execute_in
}
"
,
title:
_
(
"This is a delayed
job to run in %{remainingTime}"
)
,
content:
_
(
"This job will automatically run after it's timer finishes. "
\
content:
_
(
"This job will automatically run after it's timer finishes. "
\
"Often they are used for incremental roll-out deploys "
\
"Often they are used for incremental roll-out deploys "
\
"to production environments. When unscheduled it converts "
\
"to production environments. When unscheduled it converts "
\
...
@@ -18,21 +18,12 @@ module Gitlab
...
@@ -18,21 +18,12 @@ module Gitlab
end
end
def
status_tooltip
def
status_tooltip
"delayed manual action (
#{
execute_in
}
)"
"delayed manual action (
%{remainingTime
})"
end
end
def
self
.
matches?
(
build
,
user
)
def
self
.
matches?
(
build
,
user
)
build
.
scheduled?
&&
build
.
scheduled_at
build
.
scheduled?
&&
build
.
scheduled_at
end
end
private
include
TimeHelper
def
execute_in
remaining_seconds
=
[
0
,
subject
.
scheduled_at
-
Time
.
now
].
max
duration_in_numbers
(
remaining_seconds
)
end
end
end
end
end
end
end
...
...
locale/gitlab.pot
View file @
390abbf0
...
@@ -6188,7 +6188,7 @@ msgstr ""
...
@@ -6188,7 +6188,7 @@ msgstr ""
msgid "This is a confidential issue."
msgid "This is a confidential issue."
msgstr ""
msgstr ""
msgid "This is a delayed
to run in
"
msgid "This is a delayed
job to run in %{remainingTime}
"
msgstr ""
msgstr ""
msgid "This is the author's first Merge Request to this project."
msgid "This is the author's first Merge Request to this project."
...
...
spec/features/projects/jobs_spec.rb
View file @
390abbf0
...
@@ -595,7 +595,7 @@ describe 'Jobs', :clean_gitlab_redis_shared_state do
...
@@ -595,7 +595,7 @@ describe 'Jobs', :clean_gitlab_redis_shared_state do
end
end
it
'shows delayed job'
,
:js
do
it
'shows delayed job'
,
:js
do
expect
(
page
).
to
have_content
(
'This is a delayed to run in'
)
expect
(
page
).
to
have_content
(
'This is a delayed
job
to run in'
)
expect
(
page
).
to
have_content
(
"This job will automatically run after it's timer finishes."
)
expect
(
page
).
to
have_content
(
"This job will automatically run after it's timer finishes."
)
expect
(
page
).
to
have_link
(
'Unschedule job'
)
expect
(
page
).
to
have_link
(
'Unschedule job'
)
end
end
...
...
spec/lib/gitlab/ci/status/build/scheduled_spec.rb
View file @
390abbf0
...
@@ -13,24 +13,10 @@ describe Gitlab::Ci::Status::Build::Scheduled do
...
@@ -13,24 +13,10 @@ describe Gitlab::Ci::Status::Build::Scheduled do
end
end
describe
'#status_tooltip'
do
describe
'#status_tooltip'
do
context
'when scheduled_at is not expired'
do
let
(
:build
)
{
create
(
:ci_build
,
scheduled_at:
1
.
minute
.
since
,
project:
project
)
}
let
(
:build
)
{
create
(
:ci_build
,
scheduled_at:
1
.
minute
.
since
,
project:
project
)
}
it
'shows execute_in of the scheduled job'
do
it
'has a placeholder for the remaining time'
do
Timecop
.
freeze
(
Time
.
now
.
change
(
usec:
0
))
do
expect
(
subject
.
status_tooltip
).
to
include
(
'%{remainingTime}'
)
expect
(
subject
.
status_tooltip
).
to
include
(
'00:01:00'
)
end
end
end
context
'when scheduled_at is expired'
do
let
(
:build
)
{
create
(
:ci_build
,
:expired_scheduled
,
project:
project
)
}
it
'shows 00:00'
do
Timecop
.
freeze
do
expect
(
subject
.
status_tooltip
).
to
include
(
'00:00'
)
end
end
end
end
end
end
...
...
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