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
b4ea7144
Commit
b4ea7144
authored
Feb 20, 2018
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changes after review
parent
468a2ed6
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
61 additions
and
56 deletions
+61
-56
app/assets/javascripts/pipelines/components/security_reports/sast_report_summary_widget.vue
...omponents/security_reports/sast_report_summary_widget.vue
+19
-13
app/assets/javascripts/pipelines/pipeline_details_bundle.js
app/assets/javascripts/pipelines/pipeline_details_bundle.js
+4
-2
app/views/projects/pipelines/_info.html.haml
app/views/projects/pipelines/_info.html.haml
+1
-2
app/views/projects/pipelines/_with_tabs.html.haml
app/views/projects/pipelines/_with_tabs.html.haml
+1
-1
ee/app/assets/stylesheets/pages/security_reports.scss
ee/app/assets/stylesheets/pages/security_reports.scss
+36
-38
No files found.
app/assets/javascripts/pipelines/components/security_reports/sast_report_summary_widget.vue
View file @
b4ea7144
<
script
>
import
{
sprintf
,
n__
,
__
}
from
'
~/locale
'
;
import
{
sprintf
,
s
__
}
from
'
~/locale
'
;
import
ciIcon
from
'
~/vue_shared/components/ci_icon.vue
'
;
export
default
{
...
...
@@ -20,21 +20,22 @@
},
computed
:
{
summarySastText
()
{
const
text
=
s__
(
'
ciReport|SAST detected %{link}
'
);
let
link
;
if
(
this
.
unresolvedIssues
.
length
)
{
return
n__
(
sprintf
(
'
SAST detected %{link}
'
,
{
link
:
`<a href=
${
this
.
link
}
class="prepend-left-5">%d security vulnerability</a>`
,
},
false
)
,
sprintf
(
'
SAST detected %{link}
'
,
{
link
:
`<a href=
${
this
.
link
}
class="prepend-left-5">%d security vulnerabilities</a>`
,
},
false
),
this
.
unresolvedIssues
.
length
,
);
link
=
this
.
unresolvedIssues
.
length
>
1
?
this
.
getLink
(
sprintf
(
s__
(
'
ciReport|%{d} security vulnerabilities
'
)
,
{
d
:
this
.
unresolvedIssues
.
length
}
,
true
,
))
:
this
.
getLink
(
s__
(
'
ciReport|1 security vulnerability
'
));
}
else
{
link
=
this
.
getLink
(
s__
(
'
ciReport|no security vulnerabilities
'
)
);
}
return
sprintf
(
__
(
'
SAST detected %{link}
'
),
{
link
:
`<a href=
${
this
.
link
}
class="prepend-left-5">no security vulnerabilities</a>`
,
},
false
);
return
sprintf
(
text
,
{
link
},
false
);
},
statusIcon
()
{
if
(
this
.
unresolvedIssues
)
{
...
...
@@ -49,6 +50,11 @@
};
},
},
methods
:
{
getLink
(
text
)
{
return
`<a href="
${
this
.
link
}
" class="prepend-left-5">
${
text
}
</a>`
;
},
},
};
</
script
>
<
template
>
...
...
app/assets/javascripts/pipelines/pipeline_details_bundle.js
View file @
b4ea7144
...
...
@@ -60,7 +60,7 @@ document.addEventListener('DOMContentLoaded', () => {
postAction
(
action
)
{
this
.
mediator
.
service
.
postAction
(
action
.
path
)
.
then
(()
=>
this
.
mediator
.
refreshPipeline
())
.
catch
(()
=>
Flash
(
'
An error occurred while making the request.
'
));
.
catch
(()
=>
Flash
(
__
(
'
An error occurred while making the request.
'
)
));
},
},
render
(
createElement
)
{
...
...
@@ -89,7 +89,9 @@ document.addEventListener('DOMContentLoaded', () => {
mediator
.
fetchSastReport
(
endpoint
,
blobPath
)
.
then
(()
=>
{
// update the badge
document
.
querySelector
(
'
.js-sast-counter
'
).
textContent
=
mediator
.
store
.
state
.
sast
.
securityReports
.
newIssues
.
length
;
const
badge
=
document
.
querySelector
(
'
.js-sast-counter
'
);
badge
.
textContent
=
mediator
.
store
.
state
.
sast
.
securityReports
.
newIssues
.
length
;
badge
.
classList
.
remove
(
'
hidden
'
);
})
.
catch
(()
=>
{
Flash
(
__
(
'
Something when wrong while fetching SAST.
'
));
...
...
app/views/projects/pipelines/_info.html.haml
View file @
b4ea7144
...
...
@@ -37,5 +37,4 @@
=
clipboard_button
(
text:
@pipeline
.
sha
,
title:
"Copy commit SHA to clipboard"
)
-
if
sast_artifact
.js-sast-summary
{
data:
{
tab_path:
sast_tab_path
}}
\ No newline at end of file
.js-sast-summary
{
data:
{
tab_path:
sast_tab_path
}
}
app/views/projects/pipelines/_with_tabs.html.haml
View file @
b4ea7144
...
...
@@ -21,7 +21,7 @@
%li
.js-security-tab-link
=
link_to
security_project_pipeline_path
(
@project
,
@pipeline
),
data:
{
target:
'#js-tab-security'
,
action:
'security'
,
toggle:
'tab'
},
class:
'security-tab'
do
=
_
(
"Security report"
)
%span
.badge.js-sast-counter
%span
.badge.js-sast-counter
.hidden
.tab-content
#js-tab-pipeline
.tab-pane
...
...
ee/app/assets/stylesheets/pages/security_reports.scss
View file @
b4ea7144
.report-block
{
.report-block-container
{
border-top
:
1px
solid
$gray-darker
;
padding
:
$gl-padding-top
;
background-color
:
$gray-light
;
margin
:
$gl-padding
#{
-
$gl-padding
}
#{
-
$gl-padding
}
;
}
.report-block-container
{
border-top
:
1px
solid
$gray-darker
;
padding
:
$gl-padding-top
;
background-color
:
$gray-light
;
margin
:
$gl-padding
#{
-
$gl-padding
}
#{
-
$gl-padding
}
;
}
.report-block-dast-code
{
margin-left
:
26px
;
}
.report-block-dast-code
{
margin-left
:
26px
;
}
.report-block-list
{
list-style
:
none
;
padding
:
0
1px
;
margin
:
0
;
line-height
:
$code_line_height
;
.report-block-list
{
list-style
:
none
;
padding
:
0
1px
;
margin
:
0
;
line-height
:
$code_line_height
;
.btn-open-modal
{
padding
:
0
5px
4px
;
}
.btn-open-modal
{
padding
:
0
5px
4px
;
}
.report-block-list-item
{
display
:
flex
;
}
.report-block-list-item
{
display
:
flex
;
}
.report-block-list-item-modal
{
display
:
flex
;
flex-wrap
:
wrap
;
}
.report-block-list-item-modal
{
display
:
flex
;
flex-wrap
:
wrap
;
}
.failed
.report-block-icon
{
color
:
$red-500
;
}
.failed
.report-block-icon
{
color
:
$red-500
;
}
.success
.report-block-icon
{
color
:
$green-500
;
}
.success
.report-block-icon
{
color
:
$green-500
;
}
.neutral
.report-block-icon
{
color
:
$theme-gray-700
;
}
.neutral
.report-block-icon
{
color
:
$theme-gray-700
;
}
.report-block-icon
{
margin
:
-5px
4px
0
0
;
fill
:
currentColor
;
}
.report-block-icon
{
margin
:
-5px
4px
0
0
;
fill
:
currentColor
;
}
}
...
...
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