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
384491a7
Commit
384491a7
authored
Oct 14, 2021
by
David Pisek
Committed by
Kushal Pandya
Oct 14, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make issue vulnerability popover less subtle
parent
f736f85c
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
11 deletions
+28
-11
ee/app/assets/javascripts/vulnerabilities/components/issue_link.vue
...ets/javascripts/vulnerabilities/components/issue_link.vue
+12
-6
ee/spec/frontend/vulnerabilities/issue_link_spec.js
ee/spec/frontend/vulnerabilities/issue_link_spec.js
+13
-5
locale/gitlab.pot
locale/gitlab.pot
+3
-0
No files found.
ee/app/assets/javascripts/vulnerabilities/components/issue_link.vue
View file @
384491a7
<
script
>
import
jiraLogo
from
'
@gitlab/svgs/dist/illustrations/logos/jira.svg
'
;
import
{
GlIcon
,
GlLink
,
GlTooltipDirective
,
GlSafeHtmlDirective
}
from
'
@gitlab/ui
'
;
import
{
GlIcon
,
GlLink
,
GlTooltipDirective
,
GlSafeHtmlDirective
,
GlSprintf
}
from
'
@gitlab/ui
'
;
export
default
{
components
:
{
GlIcon
,
GlLink
,
GlSprintf
,
},
directives
:
{
GlTooltip
:
GlTooltipDirective
,
...
...
@@ -23,11 +24,13 @@ export default {
},
computed
:
{
iconName
()
{
return
this
.
issue
.
state
===
this
.
$options
.
STATE_OPENED
?
'
issue-open-m
'
:
'
issue-close
'
;
return
this
.
issueIsClosed
?
'
issue-closed
'
:
'
issues
'
;
},
issueIsClosed
()
{
return
this
.
issue
.
state
===
'
closed
'
;
},
},
jiraLogo
,
STATE_OPENED
:
'
opened
'
,
};
</
script
>
<
template
>
...
...
@@ -45,11 +48,14 @@ export default {
></span>
<gl-icon
v-else
class=
"gl-mr-
1
"
:class=
"
{ 'gl-text-green-600':
issue.state === $options.STATE_OPENED
}"
class=
"gl-mr-
2
"
:class=
"
{ 'gl-text-green-600':
!issueIsClosed
}"
:name="iconName"
/>
#
{{
issue
.
iid
}}
<gl-sprintf
v-if=
"issueIsClosed"
:message=
"__('#%
{issueIid} (closed)')">
<template
#issueIid
>
{{
issue
.
iid
}}
</
template
>
</gl-sprintf>
<span
v-else
>
#{{ issue.iid }}
</span>
<gl-icon
v-if=
"isJira"
:size=
"12"
name=
"external-link"
class=
"gl-ml-1"
/>
</gl-link>
</template>
ee/spec/frontend/vulnerabilities/issue_link_spec.js
View file @
384491a7
import
{
GlIcon
,
GlLink
}
from
'
@gitlab/ui
'
;
import
{
GlIcon
,
GlLink
,
GlSprintf
}
from
'
@gitlab/ui
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
IssueLink
from
'
ee/vulnerabilities/components/issue_link.vue
'
;
import
{
getBinding
,
createMockDirective
}
from
'
helpers/vue_mock_directive
'
;
...
...
@@ -21,6 +21,8 @@ describe('IssueLink component', () => {
directives
:
{
GlTooltip
:
createMockDirective
(),
},
// this allows us to retrieve the rendered text
stubs
:
{
GlSprintf
},
}),
);
};
...
...
@@ -53,10 +55,10 @@ describe('IssueLink component', () => {
describe
(
'
internal issues
'
,
()
=>
{
describe
.
each
`
state | icon
${
'
opened
'
}
|
${
'
issue
-open-m
'
}
${
'
closed
'
}
|
${
'
issue-close
'
}
`
(
'
with state "$state"
'
,
({
state
,
icon
})
=>
{
state | icon
| shouldContainClosedText
${
'
opened
'
}
|
${
'
issue
s
'
}
|
${
false
}
${
'
closed
'
}
|
${
'
issue-close
d
'
}
|
${
true
}
`
(
'
with state "$state"
'
,
({
state
,
icon
,
shouldContainClosedText
})
=>
{
beforeEach
(()
=>
{
wrapper
=
createWrapper
({
propsData
:
{
issue
:
createIssue
({
state
})
}
});
});
...
...
@@ -64,6 +66,12 @@ describe('IssueLink component', () => {
it
(
'
should contain the correct issue icon
'
,
()
=>
{
expect
(
findIcon
().
attributes
(
'
name
'
)).
toBe
(
icon
);
});
it
(
`
${
shouldContainClosedText
?
'
should
'
:
'
should not
'
}
contain a text that marks it as closed`
,
()
=>
{
expect
(
findIssueLink
().
text
().
includes
(
'
closed
'
)).
toBe
(
shouldContainClosedText
);
});
});
});
...
...
locale/gitlab.pot
View file @
384491a7
...
...
@@ -86,6 +86,9 @@ msgstr ""
msgid "\"el\" parameter is required for createInstance()"
msgstr ""
msgid "#%{issueIid} (closed)"
msgstr ""
msgid "#general, #development"
msgstr ""
...
...
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