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
3d04f7e9
Commit
3d04f7e9
authored
Sep 22, 2020
by
Savas Vedova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move created issues in the activity column
- Update tests - Add changelog
parent
55798eff
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
131 additions
and
9 deletions
+131
-9
ee/app/assets/javascripts/security_dashboard/components/issues_badge.vue
...avascripts/security_dashboard/components/issues_badge.vue
+41
-0
ee/app/assets/javascripts/security_dashboard/components/vulnerability_list.vue
...ipts/security_dashboard/components/vulnerability_list.vue
+8
-7
ee/app/assets/javascripts/security_dashboard/graphql/vulnerability.fragment.graphql
...security_dashboard/graphql/vulnerability.fragment.graphql
+2
-1
ee/app/assets/javascripts/vulnerabilities/components/issue_link.vue
...ets/javascripts/vulnerabilities/components/issue_link.vue
+1
-1
ee/changelogs/unreleased/230381-activity-colum-display-issues.yml
...elogs/unreleased/230381-activity-colum-display-issues.yml
+5
-0
ee/spec/frontend/security_dashboard/components/issues_badge_spec.js
...ontend/security_dashboard/components/issues_badge_spec.js
+63
-0
ee/spec/frontend/security_dashboard/components/vulnerability_list_spec.js
.../security_dashboard/components/vulnerability_list_spec.js
+6
-0
locale/gitlab.pot
locale/gitlab.pot
+5
-0
No files found.
ee/app/assets/javascripts/security_dashboard/components/issues_badge.vue
0 → 100644
View file @
3d04f7e9
<
script
>
import
{
GlIcon
,
GlPopover
,
GlBadge
}
from
'
@gitlab/ui
'
;
import
IssueLink
from
'
ee/vulnerabilities/components/issue_link.vue
'
;
export
default
{
components
:
{
GlIcon
,
GlBadge
,
GlPopover
,
IssueLink
,
},
props
:
{
issues
:
{
type
:
Array
,
required
:
true
,
},
},
computed
:
{
numberOfIssues
()
{
return
this
.
issues
.
length
;
},
},
};
</
script
>
<
template
>
<div
class=
"gl-display-inline-block"
>
<gl-badge
ref=
"issueBadge"
class=
"gl-px-3"
>
<gl-icon
name=
"issues"
class=
"gl-mr-2"
/>
{{
numberOfIssues
}}
</gl-badge>
<gl-popover
ref=
"popover"
:target=
"() => $refs.issueBadge.$el"
triggers=
"hover"
placement=
"top"
>
<template
#title
>
{{
n__
(
'
1 Issue
'
,
'
%d Issues
'
,
numberOfIssues
)
}}
</
template
>
<div
v-for=
"{ issue } in issues"
:key=
"issue.iid"
>
<issue-link
:issue=
"issue"
/>
</div>
</gl-popover>
</div>
</template>
ee/app/assets/javascripts/security_dashboard/components/vulnerability_list.vue
View file @
3d04f7e9
...
...
@@ -13,7 +13,6 @@ import FiltersProducedNoResults from 'ee/security_dashboard/components/empty_sta
import
DashboardHasNoVulnerabilities
from
'
ee/security_dashboard/components/empty_states/dashboard_has_no_vulnerabilities.vue
'
;
import
SeverityBadge
from
'
ee/vue_shared/security_reports/components/severity_badge.vue
'
;
import
VulnerabilityCommentIcon
from
'
ee/security_dashboard/components/vulnerability_comment_icon.vue
'
;
import
IssueLink
from
'
ee/vulnerabilities/components/issue_link.vue
'
;
import
convertReportType
from
'
ee/vue_shared/security_reports/store/utils/convert_report_type
'
;
import
getPrimaryIdentifier
from
'
ee/vue_shared/security_reports/store/utils/get_primary_identifier
'
;
import
SecurityScannerAlert
from
'
./security_scanner_alert.vue
'
;
...
...
@@ -21,6 +20,7 @@ import LocalStorageSync from '~/vue_shared/components/local_storage_sync.vue';
import
{
formatDate
}
from
'
~/lib/utils/datetime_utility
'
;
import
{
s__
,
__
,
sprintf
}
from
'
~/locale
'
;
import
SelectionSummary
from
'
./selection_summary.vue
'
;
import
IssuesBadge
from
'
./issues_badge.vue
'
;
import
{
VULNERABILITIES_PER_PAGE
}
from
'
../store/constants
'
;
export
const
SCANNER_ALERT_DISMISSED_LOCAL_STORAGE_KEY
=
...
...
@@ -33,7 +33,7 @@ export default {
GlSkeletonLoading
,
GlSprintf
,
GlTable
,
Issue
Link
,
Issue
sBadge
,
LocalStorageSync
,
RemediatedBadge
,
SecurityScannerAlert
,
...
...
@@ -168,7 +168,6 @@ export default {
key
:
'
activity
'
,
label
:
s__
(
'
Vulnerability|Activity
'
),
thClass
:
'
gl-text-right
'
,
tdClass
:
'
gl-text-right
'
,
},
];
...
...
@@ -259,8 +258,8 @@ export default {
this
.
$set
(
this
.
selectedVulnerabilities
,
`
${
vulnerability
.
id
}
`
,
vulnerability
);
}
},
issue
(
item
)
{
return
item
.
issueLinks
?.
nodes
[
0
]?.
issue
;
issue
s
(
item
)
{
return
item
.
issueLinks
?.
nodes
||
[]
;
},
formatDate
(
item
)
{
return
formatDate
(
item
.
detectedAt
,
'
yyyy-mm-dd
'
);
...
...
@@ -367,7 +366,6 @@ export default {
>
{{
item
.
title
}}
</gl-link>
<issue-link
v-if=
"issue(item)"
:issue=
"issue(item)"
/>
<vulnerability-comment-icon
v-if=
"hasComments(item)"
:vulnerability=
"item"
/>
</div>
<div
...
...
@@ -415,7 +413,10 @@ export default {
</
template
>
<
template
#cell(activity)=
"{ item }"
>
<remediated-badge
v-if=
"item.resolvedOnDefaultBranch"
class=
"gl-ml-3"
/>
<div
class=
"gl-display-flex gl-justify-content-end"
>
<issues-badge
:issues=
"issues(item)"
/>
<remediated-badge
v-if=
"item.resolvedOnDefaultBranch"
class=
"gl-ml-3"
/>
</div>
</
template
>
<
template
#table-busy
>
...
...
ee/app/assets/javascripts/security_dashboard/graphql/vulnerability.fragment.graphql
View file @
3d04f7e9
...
...
@@ -7,11 +7,12 @@ fragment Vulnerability on Vulnerability {
vulnerabilityPath
resolvedOnDefaultBranch
userNotesCount
issueLinks
(
linkType
:
CREATED
)
{
issueLinks
{
nodes
{
issue
{
iid
webUrl
webPath
title
state
}
...
...
ee/app/assets/javascripts/vulnerabilities/components/issue_link.vue
View file @
3d04f7e9
...
...
@@ -23,7 +23,7 @@ export default {
v-gl-tooltip=
"issue.title"
:href=
"issue.webUrl"
:data-testid=
"`issue-link-$
{issue.iid}`"
class="d-inline-flex align-items-center
ml-2
gl-flex-shrink-0"
class="d-inline-flex align-items-center gl-flex-shrink-0"
>
<gl-icon
class=
"mr-1"
...
...
ee/changelogs/unreleased/230381-activity-colum-display-issues.yml
0 → 100644
View file @
3d04f7e9
---
title
:
Move created issues in the activity column
merge_request
:
43016
author
:
type
:
changed
ee/spec/frontend/security_dashboard/components/issues_badge_spec.js
0 → 100644
View file @
3d04f7e9
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
GlIcon
,
GlPopover
}
from
'
@gitlab/ui
'
;
import
IssuesBadge
from
'
ee/security_dashboard/components/issues_badge.vue
'
;
import
IssueLink
from
'
ee/vulnerabilities/components/issue_link.vue
'
;
describe
(
'
Remediated badge component
'
,
()
=>
{
const
issues
=
[{
issue
:
{
iid
:
41
}
},
{
issue
:
{
iid
:
591
}
}];
let
wrapper
;
const
findIcon
=
()
=>
wrapper
.
find
(
GlIcon
);
const
findIssueLink
=
()
=>
wrapper
.
findAll
(
IssueLink
);
const
findPopover
=
()
=>
wrapper
.
find
(
GlPopover
);
const
createWrapper
=
({
propsData
})
=>
{
return
shallowMount
(
IssuesBadge
,
{
propsData
,
stubs
:
{
GlPopover
}
});
};
afterEach
(()
=>
{
wrapper
.
destroy
();
wrapper
=
null
;
});
describe
(
'
when there are multiple issues
'
,
()
=>
{
beforeEach
(()
=>
{
wrapper
=
createWrapper
({
propsData
:
{
issues
}
});
});
it
(
'
displays the correct icon
'
,
()
=>
{
expect
(
findIcon
().
props
(
'
name
'
)).
toBe
(
'
issues
'
);
});
it
(
'
links the badge and the popover
'
,
()
=>
{
const
{
popover
}
=
wrapper
.
vm
.
$refs
;
expect
(
popover
.
$attrs
.
target
()).
toEqual
(
findIcon
().
element
.
parentNode
);
});
it
(
'
displays the issues
'
,
()
=>
{
expect
(
findIssueLink
().
length
).
toBe
(
issues
.
length
);
});
it
(
'
displays the correct number of issues in the badge
'
,
()
=>
{
expect
(
wrapper
.
text
()).
toContain
(
'
2
'
);
});
it
(
'
displays the correct number of issues in the popover title
'
,
()
=>
{
expect
(
findPopover
().
text
()).
toContain
(
'
2 Issues
'
);
});
});
describe
(
'
when there are no issues
'
,
()
=>
{
beforeEach
(()
=>
{
wrapper
=
createWrapper
({
propsData
:
{
issues
:
[]
}
});
});
it
(
'
displays the correct number of issues in the badge
'
,
()
=>
{
expect
(
wrapper
.
text
()).
toContain
(
'
0
'
);
});
it
(
'
displays the correct number of issues in the popover title
'
,
()
=>
{
expect
(
findPopover
().
text
()).
toContain
(
'
0 Issues
'
);
});
});
});
ee/spec/frontend/security_dashboard/components/vulnerability_list_spec.js
View file @
3d04f7e9
...
...
@@ -2,6 +2,7 @@ import { mount } from '@vue/test-utils';
import
{
GlDeprecatedSkeletonLoading
as
GlSkeletonLoading
,
GlTable
}
from
'
@gitlab/ui
'
;
import
{
useLocalStorageSpy
}
from
'
helpers/local_storage_helper
'
;
import
RemediatedBadge
from
'
ee/vulnerabilities/components/remediated_badge.vue
'
;
import
IssuesBadge
from
'
ee/security_dashboard/components/issues_badge.vue
'
;
import
SecurityScannerAlert
from
'
ee/security_dashboard/components/security_scanner_alert.vue
'
;
import
SelectionSummary
from
'
ee/security_dashboard/components/selection_summary.vue
'
;
import
VulnerabilityCommentIcon
from
'
ee/security_dashboard/components/vulnerability_comment_icon.vue
'
;
...
...
@@ -42,6 +43,7 @@ describe('Vulnerability list component', () => {
const
findSortableColumn
=
()
=>
wrapper
.
find
(
'
[aria-sort="descending"]
'
);
const
findCell
=
label
=>
wrapper
.
find
(
`.js-
${
label
}
`
);
const
findRow
=
(
index
=
0
)
=>
wrapper
.
findAll
(
'
tbody tr
'
).
at
(
index
);
const
findIssuesBadge
=
()
=>
wrapper
.
find
(
IssuesBadge
);
const
findRemediatedBadge
=
()
=>
wrapper
.
find
(
RemediatedBadge
);
const
findSecurityScannerAlert
=
()
=>
wrapper
.
find
(
SecurityScannerAlert
);
const
findDismissalButton
=
()
=>
findSecurityScannerAlert
().
find
(
'
button[aria-label="Dismiss"]
'
);
...
...
@@ -87,6 +89,10 @@ describe('Vulnerability list component', () => {
expect
(
cell
.
text
()).
toBe
(
newVulnerabilities
[
0
].
title
);
});
it
(
'
should display the issues badge
'
,
()
=>
{
expect
(
findIssuesBadge
().
exists
()).
toBe
(
true
);
});
it
(
'
should display the remediated badge
'
,
()
=>
{
expect
(
findRemediatedBadge
().
exists
()).
toBe
(
true
);
});
...
...
locale/gitlab.pot
View file @
3d04f7e9
...
...
@@ -1009,6 +1009,11 @@ msgid_plural "%d Days"
msgstr[0] ""
msgstr[1] ""
msgid "1 Issue"
msgid_plural "%d Issues"
msgstr[0] ""
msgstr[1] ""
msgid "1 closed issue"
msgid_plural "%{issues} closed issues"
msgstr[0] ""
...
...
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