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
d5ced6cb
Commit
d5ced6cb
authored
Nov 20, 2019
by
Paul Gascou-Vaillancourt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use gl-sprintf in security reports app
parent
aaa9e5e4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
33 deletions
+26
-33
ee/app/assets/javascripts/vue_shared/security_reports/card_security_reports_app.vue
...vue_shared/security_reports/card_security_reports_app.vue
+25
-22
ee/spec/frontend/vue_shared/security_reports/card_security_reports_app_spec.js
...shared/security_reports/card_security_reports_app_spec.js
+0
-10
locale/gitlab.pot
locale/gitlab.pot
+1
-1
No files found.
ee/app/assets/javascripts/vue_shared/security_reports/card_security_reports_app.vue
View file @
d5ced6cb
<
script
>
import
{
isUndefined
}
from
'
underscore
'
;
import
{
s__
,
sprintf
}
from
'
~/locale
'
;
import
{
GlEmptyState
}
from
'
@gitlab/ui
'
;
import
{
s__
}
from
'
~/locale
'
;
import
{
GlEmptyState
,
GlSprintf
}
from
'
@gitlab/ui
'
;
import
Icon
from
'
~/vue_shared/components/icon.vue
'
;
import
UserAvatarLink
from
'
~/vue_shared/components/user_avatar/user_avatar_link.vue
'
;
import
TimeagoTooltip
from
'
~/vue_shared/components/time_ago_tooltip.vue
'
;
...
...
@@ -10,6 +10,7 @@ import SecurityDashboardApp from 'ee/security_dashboard/components/app.vue';
export
default
{
components
:
{
GlEmptyState
,
GlSprintf
,
UserAvatarLink
,
Icon
,
TimeagoTooltip
,
...
...
@@ -83,15 +84,6 @@ export default {
},
},
computed
:
{
headline
()
{
return
sprintf
(
s__
(
'
SecurityDashboard|Pipeline %{pipelineLink} triggered
'
),
{
pipelineLink
:
`<a href="
${
this
.
pipeline
.
path
}
">#
${
this
.
pipeline
.
id
}
</a>`
,
},
false
,
);
},
emptyStateDescription
()
{
return
s__
(
`SecurityDashboard|
...
...
@@ -108,17 +100,28 @@ export default {
<div
class=
"card security-dashboard prepend-top-default"
>
<div
class=
"card-header border-bottom-0"
>
<span
class=
"js-security-dashboard-left"
>
<span
v-html=
"headline"
></span>
<timeago-tooltip
:time=
"pipeline.created"
/>
{{
__
(
'
by
'
)
}}
<user-avatar-link
:link-href=
"triggeredBy.path"
:img-src=
"triggeredBy.avatarPath"
:img-alt=
"triggeredBy.name"
:img-size=
"24"
:username=
"triggeredBy.name"
class=
"avatar-image-container"
/>
<gl-sprintf
:message=
"
s__('SecurityDashboard|Pipeline %
{pipelineLink} triggered %{timeago} by %{user}')
"
>
<template
#pipelineLink
>
<a
:href=
"pipeline.path"
>
#
{{
pipeline
.
id
}}
</a>
</
template
>
<
template
#timeago
>
<timeago-tooltip
:time=
"pipeline.created"
/>
</
template
>
<
template
#user
>
<user-avatar-link
:link-href=
"triggeredBy.path"
:img-src=
"triggeredBy.avatarPath"
:img-alt=
"triggeredBy.name"
:img-size=
"24"
:username=
"triggeredBy.name"
class=
"avatar-image-container"
/>
</
template
>
</gl-sprintf>
</span>
<span
class=
"js-security-dashboard-right pull-right"
>
<icon
name=
"branch"
/>
...
...
ee/spec/frontend/vue_shared/security_reports/card_security_reports_app_spec.js
View file @
d5ced6cb
...
...
@@ -72,16 +72,6 @@ describe('Card security reports app', () => {
mock
.
restore
();
});
describe
(
'
computed properties
'
,
()
=>
{
describe
(
'
headline
'
,
()
=>
{
it
(
'
renders `Pipeline <link> triggered`
'
,
()
=>
{
expect
(
wrapper
.
vm
.
headline
).
toBe
(
`Pipeline <a href="
${
TEST_HOST
}
/pipeline">#55</a> triggered`
,
);
});
});
});
describe
(
'
Headline renders
'
,
()
=>
{
it
(
'
renders pipeline metadata information
'
,
()
=>
{
const
element
=
wrapper
.
find
(
'
.card-header .js-security-dashboard-left
'
);
...
...
locale/gitlab.pot
View file @
d5ced6cb
...
...
@@ -15291,7 +15291,7 @@ msgstr ""
msgid "SecurityDashboard|More information"
msgstr ""
msgid "SecurityDashboard|Pipeline %{pipelineLink} triggered"
msgid "SecurityDashboard|Pipeline %{pipelineLink} triggered
%{timeago} by %{user}
"
msgstr ""
msgid "SecurityDashboard|Project"
...
...
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