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
Léo-Paul Géneau
gitlab-ce
Commits
de76dfad
Commit
de76dfad
authored
Aug 09, 2018
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Creates vue component for warning block about stuck runners
Regenerate pot files
parent
91795dcd
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
155 additions
and
0 deletions
+155
-0
app/assets/javascripts/jobs/components/stuck_block.vue
app/assets/javascripts/jobs/components/stuck_block.vue
+63
-0
changelogs/unreleased/50101-stuck-component.yml
changelogs/unreleased/50101-stuck-component.yml
+5
-0
locale/gitlab.pot
locale/gitlab.pot
+6
-0
spec/javascripts/jobs/stuck_block_spec.js
spec/javascripts/jobs/stuck_block_spec.js
+81
-0
No files found.
app/assets/javascripts/jobs/components/stuck_block.vue
0 → 100644
View file @
de76dfad
<
script
>
/**
* Renders Stuck Runners block for job's view.
*/
export
default
{
props
:
{
hasNoRunnersForProject
:
{
type
:
Boolean
,
required
:
true
,
},
tags
:
{
type
:
Array
,
required
:
false
,
default
:
()
=>
[],
},
runnersPath
:
{
type
:
String
,
required
:
true
,
},
},
};
</
script
>
<
template
>
<div
class=
"bs-callout bs-callout-warning"
>
<p
v-if=
"hasNoRunnersForProject"
class=
"js-stuck-no-runners"
>
{{
s__
(
`Job|This job is stuck, because the project
doesn't have any runners online assigned to it.`
)
}}
</p>
<p
v-else-if=
"tags.length"
class=
"js-stuck-with-tags"
>
{{
s__
(
`This job is stuck, because you don't have
any active runners online with any of these tags assigned to them:`
)
}}
<span
v-for=
"(tag, index) in tags"
:key=
"index"
class=
"badge badge-primary"
>
{{
tag
}}
</span>
</p>
<p
v-else
class=
"js-stuck-no-active-runner"
>
{{
s__
(
`This job is stuck, because you don't
have any active runners that can run this job.`
)
}}
</p>
{{
__
(
"
Go to
"
)
}}
<a
v-if=
"runnersPath"
:href=
"runnersPath"
class=
"js-runners-path"
>
{{
__
(
"
Runners page
"
)
}}
</a>
</div>
</
template
>
changelogs/unreleased/50101-stuck-component.yml
0 → 100644
View file @
de76dfad
---
title
:
Creates Vvue component for warning block about stuck runners
merge_request
:
author
:
type
:
other
locale/gitlab.pot
View file @
de76dfad
...
...
@@ -2729,6 +2729,9 @@ msgstr ""
msgid "Go back"
msgstr ""
msgid "Go to"
msgstr ""
msgid "Go to %{link_to_google_takeout}."
msgstr ""
...
...
@@ -4630,6 +4633,9 @@ msgstr ""
msgid "Runners can be placed on separate users, servers, and even on your local machine."
msgstr ""
msgid "Runners page"
msgstr ""
msgid "Running"
msgstr ""
...
...
spec/javascripts/jobs/stuck_block_spec.js
0 → 100644
View file @
de76dfad
import
Vue
from
'
vue
'
;
import
component
from
'
~/jobs/components/stuck_block.vue
'
;
import
mountComponent
from
'
../helpers/vue_mount_component_helper
'
;
describe
(
'
Stuck Block Job component
'
,
()
=>
{
const
Component
=
Vue
.
extend
(
component
);
let
vm
;
afterEach
(()
=>
{
vm
.
$destroy
();
});
describe
(
'
with no runners for project
'
,
()
=>
{
beforeEach
(()
=>
{
vm
=
mountComponent
(
Component
,
{
hasNoRunnersForProject
:
true
,
runnersPath
:
'
/root/project/runners#js-runners-settings
'
,
});
});
it
(
'
renders only information about project not having runners
'
,
()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.js-stuck-no-runners
'
)).
not
.
toBeNull
();
expect
(
vm
.
$el
.
querySelector
(
'
.js-stuck-with-tags
'
)).
toBeNull
();
expect
(
vm
.
$el
.
querySelector
(
'
.js-stuck-no-active-runner
'
)).
toBeNull
();
});
it
(
'
renders link to runners page
'
,
()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.js-runners-path
'
).
getAttribute
(
'
href
'
)).
toEqual
(
'
/root/project/runners#js-runners-settings
'
,
);
});
});
describe
(
'
with tags
'
,
()
=>
{
beforeEach
(()
=>
{
vm
=
mountComponent
(
Component
,
{
hasNoRunnersForProject
:
false
,
tags
:
[
'
docker
'
,
'
gitlab-org
'
],
runnersPath
:
'
/root/project/runners#js-runners-settings
'
,
});
});
it
(
'
renders information about the tags not being set
'
,
()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.js-stuck-no-runners
'
)).
toBeNull
();
expect
(
vm
.
$el
.
querySelector
(
'
.js-stuck-with-tags
'
)).
not
.
toBeNull
();
expect
(
vm
.
$el
.
querySelector
(
'
.js-stuck-no-active-runner
'
)).
toBeNull
();
});
it
(
'
renders tags
'
,
()
=>
{
expect
(
vm
.
$el
.
textContent
).
toContain
(
'
docker
'
);
expect
(
vm
.
$el
.
textContent
).
toContain
(
'
gitlab-org
'
);
});
it
(
'
renders link to runners page
'
,
()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.js-runners-path
'
).
getAttribute
(
'
href
'
)).
toEqual
(
'
/root/project/runners#js-runners-settings
'
,
);
});
});
describe
(
'
without active runners
'
,
()
=>
{
beforeEach
(()
=>
{
vm
=
mountComponent
(
Component
,
{
hasNoRunnersForProject
:
false
,
runnersPath
:
'
/root/project/runners#js-runners-settings
'
,
});
});
it
(
'
renders information about project not having runners
'
,
()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.js-stuck-no-runners
'
)).
toBeNull
();
expect
(
vm
.
$el
.
querySelector
(
'
.js-stuck-with-tags
'
)).
toBeNull
();
expect
(
vm
.
$el
.
querySelector
(
'
.js-stuck-no-active-runner
'
)).
not
.
toBeNull
();
});
it
(
'
renders link to runners page
'
,
()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.js-runners-path
'
).
getAttribute
(
'
href
'
)).
toEqual
(
'
/root/project/runners#js-runners-settings
'
,
);
});
});
});
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