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
adf7d0c8
Commit
adf7d0c8
authored
Dec 12, 2018
by
Sam Beckham
Committed by
Phil Hughes
Dec 12, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Resolve "Empty state shown when the group security dashboard request fails"
parent
98141f84
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
2 deletions
+46
-2
ee/app/assets/javascripts/security_dashboard/components/security_dashboard_table.vue
...ecurity_dashboard/components/security_dashboard_table.vue
+16
-2
ee/changelogs/unreleased/8704-empty-state-shown-when-the-group-security-dashboard-request-fails.yml
...shown-when-the-group-security-dashboard-request-fails.yml
+5
-0
ee/spec/javascripts/security_dashboard/components/security_dashboard_table_spec.js
...ity_dashboard/components/security_dashboard_table_spec.js
+25
-0
No files found.
ee/app/assets/javascripts/security_dashboard/components/security_dashboard_table.vue
View file @
adf7d0c8
...
@@ -22,8 +22,22 @@ export default {
...
@@ -22,8 +22,22 @@ export default {
},
},
},
},
computed
:
{
computed
:
{
...
mapState
(
'
vulnerabilities
'
,
[
'
vulnerabilities
'
,
'
pageInfo
'
,
'
isLoadingVulnerabilities
'
]),
...
mapState
(
'
vulnerabilities
'
,
[
'
errorLoadingVulnerabilities
'
,
'
errorLoadingVulnerabilitiesCount
'
,
'
isLoadingVulnerabilities
'
,
'
pageInfo
'
,
'
vulnerabilities
'
,
]),
...
mapGetters
(
'
vulnerabilities
'
,
[
'
dashboardListError
'
]),
...
mapGetters
(
'
vulnerabilities
'
,
[
'
dashboardListError
'
]),
showEmptyState
()
{
return
(
this
.
vulnerabilities
&&
!
this
.
vulnerabilities
.
length
&&
!
this
.
errorLoadingVulnerabilities
&&
!
this
.
errorLoadingVulnerabilitiesCount
);
},
showPagination
()
{
showPagination
()
{
return
this
.
pageInfo
&&
this
.
pageInfo
.
total
;
return
this
.
pageInfo
&&
this
.
pageInfo
.
total
;
},
},
...
@@ -72,7 +86,7 @@ export default {
...
@@ -72,7 +86,7 @@ export default {
/>
/>
<empty-state
<empty-state
v-if=
"
!vulnerabilities.length
"
v-if=
"
showEmptyState
"
:svg-path=
"emptyStateSvgPath"
:svg-path=
"emptyStateSvgPath"
:link=
"dashboardDocumentation"
:link=
"dashboardDocumentation"
/>
/>
...
...
ee/changelogs/unreleased/8704-empty-state-shown-when-the-group-security-dashboard-request-fails.yml
0 → 100644
View file @
adf7d0c8
---
title
:
Prevents the empty state from showing when the dashboard errors
merge_request
:
8703
author
:
type
:
fixed
ee/spec/javascripts/security_dashboard/components/security_dashboard_table_spec.js
View file @
adf7d0c8
...
@@ -78,4 +78,29 @@ describe('Security Dashboard Table', () => {
...
@@ -78,4 +78,29 @@ describe('Security Dashboard Table', () => {
.
catch
(
done
.
fail
);
.
catch
(
done
.
fail
);
});
});
});
});
describe
(
'
on error
'
,
()
=>
{
beforeEach
(()
=>
{
mock
.
onGet
(
vulnerabilitiesEndpoint
).
replyOnce
(
404
,
[]);
vm
=
mountComponentWithStore
(
Component
,
{
store
,
props
});
});
it
(
'
should not render the empty state
'
,
done
=>
{
waitForPromises
()
.
then
(()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.empty-state
'
)).
toBeNull
();
done
();
})
.
catch
(
done
.
fail
);
});
it
(
'
should render the error alert
'
,
done
=>
{
waitForPromises
()
.
then
(()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.flash-alert
'
)).
not
.
toBeNull
();
done
();
})
.
catch
(
done
.
fail
);
});
});
});
});
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