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
dd5e9f74
Commit
dd5e9f74
authored
Aug 03, 2021
by
mgandres
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add view pipeline button in pipeline editor
Changelog: added
parent
0f763bf8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
57 additions
and
31 deletions
+57
-31
app/assets/javascripts/pipeline_editor/components/header/pipeline_status.vue
...pts/pipeline_editor/components/header/pipeline_status.vue
+47
-30
locale/gitlab.pot
locale/gitlab.pot
+3
-0
spec/frontend/pipeline_editor/components/header/pipeline_status_spec.js
...pipeline_editor/components/header/pipeline_status_spec.js
+7
-1
No files found.
app/assets/javascripts/pipeline_editor/components/header/pipeline_status.vue
View file @
dd5e9f74
<
script
>
import
{
GlIcon
,
GlLink
,
GlLoadingIcon
,
GlSprintf
}
from
'
@gitlab/ui
'
;
import
{
Gl
Button
,
Gl
Icon
,
GlLink
,
GlLoadingIcon
,
GlSprintf
}
from
'
@gitlab/ui
'
;
import
{
getIdFromGraphQLId
}
from
'
~/graphql_shared/utils
'
;
import
{
truncateSha
}
from
'
~/lib/utils/text_utility
'
;
import
{
s__
}
from
'
~/locale
'
;
...
...
@@ -19,12 +19,14 @@ export const i18n = {
pipelineInfo
:
s__
(
`Pipeline|Pipeline %{idStart}#%{idEnd} %{statusStart}%{statusEnd} for %{commitStart}%{commitEnd}`
,
),
viewBtn
:
s__
(
'
Pipeline|View pipeline
'
),
};
export
default
{
i18n
,
components
:
{
CiIcon
,
GlButton
,
GlIcon
,
GlLink
,
GlLoadingIcon
,
...
...
@@ -98,7 +100,9 @@ export default {
</
script
>
<
template
>
<div
class=
"gl-white-space-nowrap gl-max-w-full"
>
<div
class=
"gl-display-flex gl-justify-content-space-between gl-align-items-center gl-white-space-nowrap gl-max-w-full"
>
<template
v-if=
"showLoadingState"
>
<gl-loading-icon
class=
"gl-mr-auto gl-display-inline-block"
size=
"sm"
/>
<span
data-testid=
"pipeline-loading-msg"
>
{{
$options
.
i18n
.
fetchLoading
}}
</span>
...
...
@@ -108,34 +112,47 @@ export default {
<span
data-testid=
"pipeline-error-msg"
>
{{
$options
.
i18n
.
fetchError
}}
</span>
</
template
>
<
template
v-else
>
<a
:href=
"status.detailsPath"
class=
"gl-mr-auto"
>
<ci-icon
:status=
"status"
:size=
"16"
/>
</a>
<span
class=
"gl-font-weight-bold"
>
<gl-sprintf
:message=
"$options.i18n.pipelineInfo"
>
<template
#id
="
{ content }">
<gl-link
:href=
"status.detailsPath"
class=
"pipeline-id gl-font-weight-normal pipeline-number"
target=
"_blank"
data-testid=
"pipeline-id"
>
{{
content
}}{{
pipelineId
}}
</gl-link
>
</
template
>
<
template
#status
>
{{
status
.
text
}}
</
template
>
<
template
#commit
>
<gl-link
:href=
"pipeline.commitPath"
class=
"commit-sha gl-font-weight-normal"
target=
"_blank"
data-testid=
"pipeline-commit"
>
{{
shortSha
}}
</gl-link>
</
template
>
</gl-sprintf>
</span>
<div>
<a
:href=
"status.detailsPath"
class=
"gl-mr-auto"
>
<ci-icon
:status=
"status"
:size=
"16"
/>
</a>
<span
class=
"gl-font-weight-bold"
>
<gl-sprintf
:message=
"$options.i18n.pipelineInfo"
>
<template
#id
="
{ content }">
<gl-link
:href=
"status.detailsPath"
class=
"pipeline-id gl-font-weight-normal pipeline-number"
target=
"_blank"
data-testid=
"pipeline-id"
>
{{
content
}}{{
pipelineId
}}
</gl-link
>
</
template
>
<
template
#status
>
{{
status
.
text
}}
</
template
>
<
template
#commit
>
<gl-link
:href=
"pipeline.commitPath"
class=
"commit-sha gl-font-weight-normal"
target=
"_blank"
data-testid=
"pipeline-commit"
>
{{
shortSha
}}
</gl-link>
</
template
>
</gl-sprintf>
</span>
</div>
<div>
<gl-button
target=
"_blank"
category=
"secondary"
variant=
"confirm"
:href=
"status.detailsPath"
data-testid=
"pipeline-view-btn"
>
{{ $options.i18n.viewBtn }}
</gl-button>
</div>
</template>
</div>
</template>
locale/gitlab.pot
View file @
dd5e9f74
...
...
@@ -24630,6 +24630,9 @@ msgstr ""
msgid "Pipeline|Variables"
msgstr ""
msgid "Pipeline|View pipeline"
msgstr ""
msgid "Pipeline|We are currently unable to fetch pipeline data"
msgstr ""
...
...
spec/frontend/pipeline_editor/components/header/pipeline_status_spec.js
View file @
dd5e9f74
...
...
@@ -44,6 +44,7 @@ describe('Pipeline Status', () => {
const
findPipelineCommit
=
()
=>
wrapper
.
find
(
'
[data-testid="pipeline-commit"]
'
);
const
findPipelineErrorMsg
=
()
=>
wrapper
.
find
(
'
[data-testid="pipeline-error-msg"]
'
);
const
findPipelineLoadingMsg
=
()
=>
wrapper
.
find
(
'
[data-testid="pipeline-loading-msg"]
'
);
const
findPipelineViewBtn
=
()
=>
wrapper
.
find
(
'
[data-testid="pipeline-view-btn"]
'
);
beforeEach
(()
=>
{
mockPipelineQuery
=
jest
.
fn
();
...
...
@@ -96,11 +97,15 @@ describe('Pipeline Status', () => {
});
it
(
'
renders pipeline data
'
,
()
=>
{
const
{
id
}
=
mockProjectPipeline
.
pipeline
;
const
{
id
,
detailedStatus
:
{
detailsPath
},
}
=
mockProjectPipeline
.
pipeline
;
expect
(
findCiIcon
().
exists
()).
toBe
(
true
);
expect
(
findPipelineId
().
text
()).
toBe
(
`#
${
id
.
match
(
/
\d
+/g
)[
0
]}
`
);
expect
(
findPipelineCommit
().
text
()).
toBe
(
mockCommitSha
);
expect
(
findPipelineViewBtn
().
attributes
(
'
href
'
)).
toBe
(
detailsPath
);
});
});
...
...
@@ -121,6 +126,7 @@ describe('Pipeline Status', () => {
expect
(
findCiIcon
().
exists
()).
toBe
(
false
);
expect
(
findPipelineId
().
exists
()).
toBe
(
false
);
expect
(
findPipelineCommit
().
exists
()).
toBe
(
false
);
expect
(
findPipelineViewBtn
().
exists
()).
toBe
(
false
);
});
});
});
...
...
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