BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
5e468137
Unverified
Commit
5e468137
authored
Dec 11, 2017
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check for null in job tooltip title
parent
4ccbd556
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
11 deletions
+61
-11
job_component.vue
.../javascripts/pipelines/components/graph/job_component.vue
+30
-11
job_component_spec.js
spec/javascripts/pipelines/graph/job_component_spec.js
+31
-0
No files found.
app/assets/javascripts/pipelines/components/graph/job_component.vue
View file @
5e468137
...
@@ -59,8 +59,26 @@
...
@@ -59,8 +59,26 @@
},
},
computed
:
{
computed
:
{
status
()
{
return
this
.
job
&&
this
.
job
.
status
?
this
.
job
.
status
:
{};
},
tooltipText
()
{
tooltipText
()
{
return
`
${
this
.
job
.
name
}
-
${
this
.
job
.
status
.
label
}
`
;
const
textBuilder
=
[];
if
(
this
.
job
.
name
)
{
textBuilder
.
push
(
this
.
job
.
name
);
}
if
(
this
.
job
.
name
&&
this
.
status
.
label
)
{
textBuilder
.
push
(
'-'
);
}
if
(
this
.
status
.
label
)
{
textBuilder
.
push
(
`
${
this
.
job
.
status
.
label
}
`
);
}
return
textBuilder
.
join
(
' '
);
},
},
/**
/**
...
@@ -78,8 +96,8 @@
...
@@ -78,8 +96,8 @@
<div
class=
"ci-job-component"
>
<div
class=
"ci-job-component"
>
<a
<a
v-tooltip
v-tooltip
v-if=
"
job.
status.has_details"
v-if=
"status.has_details"
:href=
"
job.
status.details_path"
:href=
"status.details_path"
:title=
"tooltipText"
:title=
"tooltipText"
:class=
"cssClassJobName"
:class=
"cssClassJobName"
data-container=
"body"
data-container=
"body"
...
@@ -95,6 +113,7 @@
...
@@ -95,6 +113,7 @@
<div
<div
v-else
v-else
v-tooltip
v-tooltip
class=
"js-job-component-tooltip"
:title=
"tooltipText"
:title=
"tooltipText"
:class=
"cssClassJobName"
:class=
"cssClassJobName"
data-container=
"body"
data-container=
"body"
...
@@ -108,18 +127,18 @@
...
@@ -108,18 +127,18 @@
<action-component
<action-component
v-if=
"hasAction && !isDropdown"
v-if=
"hasAction && !isDropdown"
:tooltip-text=
"
job.
status.action.title"
:tooltip-text=
"status.action.title"
:link=
"
job.
status.action.path"
:link=
"status.action.path"
:action-icon=
"
job.
status.action.icon"
:action-icon=
"status.action.icon"
:action-method=
"
job.
status.action.method"
:action-method=
"status.action.method"
/>
/>
<dropdown-action-component
<dropdown-action-component
v-if=
"hasAction && isDropdown"
v-if=
"hasAction && isDropdown"
:tooltip-text=
"
job.
status.action.title"
:tooltip-text=
"status.action.title"
:link=
"
job.
status.action.path"
:link=
"status.action.path"
:action-icon=
"
job.
status.action.icon"
:action-icon=
"status.action.icon"
:action-method=
"
job.
status.action.method"
:action-method=
"status.action.method"
/>
/>
</div>
</div>
</
template
>
</
template
>
spec/javascripts/pipelines/graph/job_component_spec.js
View file @
5e468137
...
@@ -113,4 +113,35 @@ describe('pipeline graph job component', () => {
...
@@ -113,4 +113,35 @@ describe('pipeline graph job component', () => {
component
.
$el
.
querySelector
(
'a'
).
classList
.
contains
(
'css-class-job-name'
),
component
.
$el
.
querySelector
(
'a'
).
classList
.
contains
(
'css-class-job-name'
),
).
toBe
(
true
);
).
toBe
(
true
);
});
});
describe
(
'status label'
,
()
=>
{
it
(
'should not render status label when it is not provided'
,
()
=>
{
component
=
mountComponent
(
JobComponent
,
{
job
:
{
id
:
4256
,
name
:
'test'
,
status
:
{
icon
:
'icon_status_success'
,
},
},
});
expect
(
component
.
$el
.
querySelector
(
'.js-job-component-tooltip'
).
getAttribute
(
'data-original-title'
)).
toEqual
(
'test'
);
});
it
(
'should not render status label when it is provided'
,
()
=>
{
component
=
mountComponent
(
JobComponent
,
{
job
:
{
id
:
4256
,
name
:
'test'
,
status
:
{
icon
:
'icon_status_success'
,
label
:
'success'
,
},
},
});
expect
(
component
.
$el
.
querySelector
(
'.js-job-component-tooltip'
).
getAttribute
(
'data-original-title'
)).
toEqual
(
'test - success'
);
});
});
});
});
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