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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
e50a17dd
Commit
e50a17dd
authored
Jul 15, 2020
by
Dimitrie Hoekstra
Committed by
Dimitrie Hoekstra
Aug 03, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace <gl-deprecated-button> with <gl-button> for linked pipelines
parent
d8429213
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
24 deletions
+21
-24
app/assets/javascripts/pipelines/components/graph/linked_pipeline.vue
...avascripts/pipelines/components/graph/linked_pipeline.vue
+7
-13
changelogs/unreleased/dimitrieh-master-patch-74834.yml
changelogs/unreleased/dimitrieh-master-patch-74834.yml
+5
-0
spec/frontend/pipelines/graph/linked_pipeline_spec.js
spec/frontend/pipelines/graph/linked_pipeline_spec.js
+9
-11
No files found.
app/assets/javascripts/pipelines/components/graph/linked_pipeline.vue
View file @
e50a17dd
<
script
>
import
{
Gl
LoadingIcon
,
GlTooltipDirective
,
GlDeprecated
Button
}
from
'
@gitlab/ui
'
;
import
{
Gl
TooltipDirective
,
Gl
Button
}
from
'
@gitlab/ui
'
;
import
CiStatus
from
'
~/vue_shared/components/ci_icon.vue
'
;
import
{
__
,
sprintf
}
from
'
~/locale
'
;
...
...
@@ -9,8 +9,7 @@ export default {
},
components
:
{
CiStatus
,
GlLoadingIcon
,
GlDeprecatedButton
,
GlButton
,
},
props
:
{
pipeline
:
{
...
...
@@ -95,26 +94,21 @@ export default {
@mouseover="onDownstreamHovered"
@mouseleave="onDownstreamHoverLeave"
>
<gl-
deprecated-
button
<gl-button
:id=
"buttonId"
v-gl-tooltip
:title=
"tooltipText"
class=
"
js-linked-pipeline-content
linked-pipeline-content"
class=
"linked-pipeline-content"
data-qa-selector=
"linked_pipeline_button"
:class=
"`js-pipeline-expand-$
{pipeline.id}`"
:loading="pipeline.isLoading"
@click="onClickLinkedPipeline"
>
<gl-loading-icon
v-if=
"pipeline.isLoading"
class=
"js-linked-pipeline-loading d-inline"
/>
<ci-status
v-else
:status=
"pipelineStatus"
css-classes=
"position-top-0"
class=
"js-linked-pipeline-status"
/>
<ci-status
v-if=
"!pipeline.isLoading"
:status=
"pipelineStatus"
css-classes=
"gl-top-0"
/>
<span
class=
"str-truncated"
>
{{
downstreamTitle
}}
•
#
{{
pipeline
.
id
}}
</span>
<div
class=
"gl-pt-2"
>
<span
class=
"badge badge-primary"
data-testid=
"downstream-pipeline-label"
>
{{
label
}}
</span>
</div>
</gl-
deprecated-
button>
</gl-button>
</li>
</
template
>
changelogs/unreleased/dimitrieh-master-patch-74834.yml
0 → 100644
View file @
e50a17dd
---
title
:
Replace <gl-deprecated-button> with <gl-button> in app/assets/javascripts/pipelines/components/graph/linked_pipeline.vue
merge_request
:
36968
author
:
type
:
other
spec/frontend/pipelines/graph/linked_pipeline_spec.js
View file @
e50a17dd
import
{
mount
}
from
'
@vue/test-utils
'
;
import
{
GlButton
}
from
'
@gitlab/ui
'
;
import
LinkedPipelineComponent
from
'
~/pipelines/components/graph/linked_pipeline.vue
'
;
import
CiStatus
from
'
~/vue_shared/components/ci_icon.vue
'
;
...
...
@@ -12,7 +13,7 @@ const invalidTriggeredPipelineId = mockPipeline.project.id + 5;
describe
(
'
Linked pipeline
'
,
()
=>
{
let
wrapper
;
const
findButton
=
()
=>
wrapper
.
find
(
'
button
'
);
const
findButton
=
()
=>
wrapper
.
find
(
GlButton
);
const
findPipelineLabel
=
()
=>
wrapper
.
find
(
'
[data-testid="downstream-pipeline-label"]
'
);
const
findLinkedPipeline
=
()
=>
wrapper
.
find
({
ref
:
'
linkedPipeline
'
});
...
...
@@ -42,9 +43,7 @@ describe('Linked pipeline', () => {
});
it
(
'
should render a button
'
,
()
=>
{
const
linkElement
=
wrapper
.
find
(
'
.js-linked-pipeline-content
'
);
expect
(
linkElement
.
exists
()).
toBe
(
true
);
expect
(
findButton
().
exists
()).
toBe
(
true
);
});
it
(
'
should render the project name
'
,
()
=>
{
...
...
@@ -62,7 +61,7 @@ describe('Linked pipeline', () => {
});
it
(
'
should have a ci-status child component
'
,
()
=>
{
expect
(
wrapper
.
find
(
'
.js-linked-pipeline-status
'
).
exists
()).
toBe
(
true
);
expect
(
wrapper
.
find
(
CiStatus
).
exists
()).
toBe
(
true
);
});
it
(
'
should render the pipeline id
'
,
()
=>
{
...
...
@@ -77,15 +76,14 @@ describe('Linked pipeline', () => {
});
it
(
'
should render the tooltip text as the title attribute
'
,
()
=>
{
const
tooltipRef
=
wrapper
.
find
(
'
.js-linked-pipeline-content
'
);
const
titleAttr
=
tooltipRef
.
attributes
(
'
title
'
);
const
titleAttr
=
findButton
().
attributes
(
'
title
'
);
expect
(
titleAttr
).
toContain
(
mockPipeline
.
project
.
name
);
expect
(
titleAttr
).
toContain
(
mockPipeline
.
details
.
status
.
label
);
});
it
(
'
does not render the loading icon when isLoading is
false
'
,
()
=>
{
expect
(
wrapper
.
find
(
'
.js-linked-pipeline-loading
'
).
exists
(
)).
toBe
(
false
);
it
(
'
sets the loading prop to
false
'
,
()
=>
{
expect
(
findButton
().
props
(
'
loading
'
)).
toBe
(
false
);
});
it
(
'
should display multi-project label when pipeline project id is not the same as triggered pipeline project id
'
,
()
=>
{
...
...
@@ -132,8 +130,8 @@ describe('Linked pipeline', () => {
createWrapper
(
props
);
});
it
(
'
renders a loading icon
'
,
()
=>
{
expect
(
wrapper
.
find
(
'
.js-linked-pipeline-loading
'
).
exists
(
)).
toBe
(
true
);
it
(
'
sets the loading prop to true
'
,
()
=>
{
expect
(
findButton
().
props
(
'
loading
'
)).
toBe
(
true
);
});
});
...
...
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