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
Hide 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
>
<
script
>
import
jiraLogo
from
'
@gitlab/svgs/dist/illustrations/logos/jira.svg
'
;
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
{
export
default
{
components
:
{
components
:
{
GlIcon
,
GlIcon
,
GlLink
,
GlLink
,
GlSprintf
,
},
},
directives
:
{
directives
:
{
GlTooltip
:
GlTooltipDirective
,
GlTooltip
:
GlTooltipDirective
,
...
@@ -23,11 +24,13 @@ export default {
...
@@ -23,11 +24,13 @@ export default {
},
},
computed
:
{
computed
:
{
iconName
()
{
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
,
jiraLogo
,
STATE_OPENED
:
'
opened
'
,
};
};
</
script
>
</
script
>
<
template
>
<
template
>
...
@@ -45,11 +48,14 @@ export default {
...
@@ -45,11 +48,14 @@ export default {
></span>
></span>
<gl-icon
<gl-icon
v-else
v-else
class=
"gl-mr-
1
"
class=
"gl-mr-
2
"
:class=
"
{ 'gl-text-green-600':
issue.state === $options.STATE_OPENED
}"
:class=
"
{ 'gl-text-green-600':
!issueIsClosed
}"
:name="iconName"
: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-icon
v-if=
"isJira"
:size=
"12"
name=
"external-link"
class=
"gl-ml-1"
/>
</gl-link>
</gl-link>
</template>
</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
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
IssueLink
from
'
ee/vulnerabilities/components/issue_link.vue
'
;
import
IssueLink
from
'
ee/vulnerabilities/components/issue_link.vue
'
;
import
{
getBinding
,
createMockDirective
}
from
'
helpers/vue_mock_directive
'
;
import
{
getBinding
,
createMockDirective
}
from
'
helpers/vue_mock_directive
'
;
...
@@ -21,6 +21,8 @@ describe('IssueLink component', () => {
...
@@ -21,6 +21,8 @@ describe('IssueLink component', () => {
directives
:
{
directives
:
{
GlTooltip
:
createMockDirective
(),
GlTooltip
:
createMockDirective
(),
},
},
// this allows us to retrieve the rendered text
stubs
:
{
GlSprintf
},
}),
}),
);
);
};
};
...
@@ -53,10 +55,10 @@ describe('IssueLink component', () => {
...
@@ -53,10 +55,10 @@ describe('IssueLink component', () => {
describe
(
'
internal issues
'
,
()
=>
{
describe
(
'
internal issues
'
,
()
=>
{
describe
.
each
`
describe
.
each
`
state | icon
state | icon
| shouldContainClosedText
${
'
opened
'
}
|
${
'
issue
-open-m
'
}
${
'
opened
'
}
|
${
'
issue
s
'
}
|
${
false
}
${
'
closed
'
}
|
${
'
issue-close
'
}
${
'
closed
'
}
|
${
'
issue-close
d
'
}
|
${
true
}
`
(
'
with state "$state"
'
,
({
state
,
icon
})
=>
{
`
(
'
with state "$state"
'
,
({
state
,
icon
,
shouldContainClosedText
})
=>
{
beforeEach
(()
=>
{
beforeEach
(()
=>
{
wrapper
=
createWrapper
({
propsData
:
{
issue
:
createIssue
({
state
})
}
});
wrapper
=
createWrapper
({
propsData
:
{
issue
:
createIssue
({
state
})
}
});
});
});
...
@@ -64,6 +66,12 @@ describe('IssueLink component', () => {
...
@@ -64,6 +66,12 @@ describe('IssueLink component', () => {
it
(
'
should contain the correct issue icon
'
,
()
=>
{
it
(
'
should contain the correct issue icon
'
,
()
=>
{
expect
(
findIcon
().
attributes
(
'
name
'
)).
toBe
(
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 ""
...
@@ -86,6 +86,9 @@ msgstr ""
msgid "\"el\" parameter is required for createInstance()"
msgid "\"el\" parameter is required for createInstance()"
msgstr ""
msgstr ""
msgid "#%{issueIid} (closed)"
msgstr ""
msgid "#general, #development"
msgid "#general, #development"
msgstr ""
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