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
fb41b14e
Commit
fb41b14e
authored
Oct 23, 2020
by
Savas Vedova
Committed by
Alexander Turinske
Oct 26, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Integrate the status badge
- Update tests - Add changelog
parent
19599c16
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
4 deletions
+47
-4
ee/app/assets/javascripts/security_dashboard/components/project_pipeline_status.vue
...security_dashboard/components/project_pipeline_status.vue
+14
-1
ee/app/assets/javascripts/security_dashboard/first_class_init.js
...assets/javascripts/security_dashboard/first_class_init.js
+3
-1
ee/changelogs/unreleased/241061-integrate-pipeline-failed-widget.yml
...gs/unreleased/241061-integrate-pipeline-failed-widget.yml
+5
-0
ee/spec/frontend/security_dashboard/components/project_pipeline_status_spec.js
...rity_dashboard/components/project_pipeline_status_spec.js
+25
-2
No files found.
ee/app/assets/javascripts/security_dashboard/components/project_pipeline_status.vue
View file @
fb41b14e
...
...
@@ -2,15 +2,25 @@
import
{
GlLink
}
from
'
@gitlab/ui
'
;
import
{
__
}
from
'
~/locale
'
;
import
TimeAgoTooltip
from
'
~/vue_shared/components/time_ago_tooltip.vue
'
;
import
PipelineStatusBadge
from
'
./pipeline_status_badge.vue
'
;
export
default
{
components
:
{
GlLink
,
TimeAgoTooltip
,
PipelineStatusBadge
,
},
props
:
{
pipeline
:
{
type
:
Object
,
required
:
true
},
},
inject
:
{
pipelineSecurityBuildsFailedCount
:
{
type
:
Number
,
default
:
0
},
},
computed
:
{
shouldShowPipelineStatusBadge
()
{
return
this
.
pipelineSecurityBuildsFailedCount
>
0
;
},
},
i18n
:
{
title
:
__
(
'
The Security Dashboard shows the results of the last successful pipeline run on the default branch.
'
,
...
...
@@ -23,10 +33,13 @@ export default {
<
template
>
<div>
<h6
class=
"gl-font-weight-normal"
>
{{
$options
.
i18n
.
title
}}
</h6>
<div
class=
"gl-border-solid gl-border-1 gl-border-gray-100 gl-p-6"
>
<div
class=
"gl-display-flex gl-align-items-center gl-border-solid gl-border-1 gl-border-gray-100 gl-p-6"
>
<span
class=
"gl-font-weight-bold"
>
{{
$options
.
i18n
.
label
}}
</span>
<time-ago-tooltip
class=
"gl-px-3"
:time=
"pipeline.createdAt"
/>
<gl-link
:href=
"pipeline.path"
target=
"_blank"
>
#
{{
pipeline
.
id
}}
</gl-link>
<pipeline-status-badge
v-if=
"shouldShowPipelineStatusBadge"
class=
"gl-ml-3"
/>
</div>
</div>
</
template
>
ee/app/assets/javascripts/security_dashboard/first_class_init.js
View file @
fb41b14e
...
...
@@ -45,8 +45,10 @@ export default (el, dashboardType) => {
props
.
pipeline
=
{
createdAt
,
id
,
path
};
props
.
projectFullPath
=
el
.
dataset
.
projectFullPath
;
provide
.
autoFixDocumentation
=
el
.
dataset
.
autoFixDocumentation
;
provide
.
pipelineSecurityBuildsFailedCount
=
el
.
dataset
.
pipelineSecurityBuildsFailedCount
;
provide
.
pipelineSecurityBuildsFailedPath
=
el
.
dataset
.
pipelineSecurityBuildsFailedPath
;
provide
.
pipelineSecurityBuildsFailedCount
=
Number
(
el
.
dataset
.
pipelineSecurityBuildsFailedCount
,
);
}
else
if
(
dashboardType
===
DASHBOARD_TYPES
.
GROUP
)
{
component
=
FirstClassGroupSecurityDashboard
;
props
.
groupFullPath
=
el
.
dataset
.
groupFullPath
;
...
...
ee/changelogs/unreleased/241061-integrate-pipeline-failed-widget.yml
0 → 100644
View file @
fb41b14e
---
title
:
Integrate the status badge in the pipeline widget
merge_request
:
45987
author
:
type
:
added
ee/spec/frontend/security_dashboard/components/project_pipeline_status_spec.js
View file @
fb41b14e
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
GlLink
}
from
'
@gitlab/ui
'
;
import
ProjectPipelineStatus
from
'
ee/security_dashboard/components/project_pipeline_status.vue
'
;
import
PipelineStatusBadge
from
'
ee/security_dashboard/components/pipeline_status_badge.vue
'
;
import
TimeAgoTooltip
from
'
~/vue_shared/components/time_ago_tooltip.vue
'
;
describe
(
'
Project Pipeline Status Component
'
,
()
=>
{
...
...
@@ -14,12 +15,14 @@ describe('Project Pipeline Status Component', () => {
},
};
const
find
Link
=
()
=>
wrapper
.
find
(
GlLink
);
const
find
PipelineStatusBadge
=
()
=>
wrapper
.
find
(
PipelineStatusBadge
);
const
findTimeAgoTooltip
=
()
=>
wrapper
.
find
(
TimeAgoTooltip
);
const
findLink
=
()
=>
wrapper
.
find
(
GlLink
);
const
createWrapper
=
()
=>
{
const
createWrapper
=
options
=>
{
return
shallowMount
(
ProjectPipelineStatus
,
{
propsData
,
...
options
,
});
};
...
...
@@ -50,4 +53,24 @@ describe('Project Pipeline Status Component', () => {
expect
(
GlLinkComponent
.
attributes
(
'
href
'
)).
toBe
(
propsData
.
pipeline
.
path
);
});
});
describe
(
'
when there are more than 0 failed jobs
'
,
()
=>
{
beforeEach
(()
=>
{
wrapper
=
createWrapper
({
provide
:
{
pipelineSecurityBuildsFailedCount
:
5
}
});
});
it
(
'
should show the pipeline status badge
'
,
()
=>
{
expect
(
findPipelineStatusBadge
().
exists
()).
toBe
(
true
);
});
});
describe
(
'
when there are 0 failed jobs
'
,
()
=>
{
beforeEach
(()
=>
{
wrapper
=
createWrapper
({
provide
:
{
pipelineSecurityBuildsFailedCount
:
0
}
});
});
it
(
'
should show the pipeline status badge
'
,
()
=>
{
expect
(
findPipelineStatusBadge
().
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