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
23d555a5
Commit
23d555a5
authored
Jul 10, 2020
by
Olena Horal-Koretska
Committed by
Nicolò Maria Mezzopera
Jul 10, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix dashboard validation warning logic
parent
1eee0c41
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
1 deletion
+25
-1
app/assets/javascripts/monitoring/stores/actions.js
app/assets/javascripts/monitoring/stores/actions.js
+1
-1
changelogs/unreleased/223159-fix-dahsboard-warning-logic.yml
changelogs/unreleased/223159-fix-dahsboard-warning-logic.yml
+5
-0
spec/frontend/monitoring/store/actions_spec.js
spec/frontend/monitoring/store/actions_spec.js
+19
-0
No files found.
app/assets/javascripts/monitoring/stores/actions.js
View file @
23d555a5
...
...
@@ -375,7 +375,7 @@ export const fetchDashboardValidationWarnings = ({ state, dispatch }) => {
})
.
then
(
resp
=>
resp
.
data
?.
project
?.
environments
?.
nodes
?.[
0
]?.
metricsDashboard
)
.
then
(({
schemaValidationWarnings
}
=
{})
=>
{
const
hasWarnings
=
schemaValidationWarnings
?
.
length
!==
0
;
const
hasWarnings
=
schemaValidationWarnings
&&
schemaValidationWarnings
.
length
!==
0
;
/**
* The payload of the dispatch is a boolean, because at the moment a standard
* warning message is shown instead of the warnings the BE returns
...
...
changelogs/unreleased/223159-fix-dahsboard-warning-logic.yml
0 → 100644
View file @
23d555a5
---
title
:
Fix dashboard schema validation issue
merge_request
:
36577
author
:
type
:
fixed
spec/frontend/monitoring/store/actions_spec.js
View file @
23d555a5
...
...
@@ -948,6 +948,25 @@ describe('Monitoring store actions', () => {
);
});
it
(
'
dispatches receiveDashboardValidationWarningsSuccess with false payload when the response is empty
'
,
()
=>
{
mockMutate
.
mockResolvedValue
({
data
:
{
project
:
null
,
},
});
return
testAction
(
fetchDashboardValidationWarnings
,
null
,
state
,
[],
[{
type
:
'
receiveDashboardValidationWarningsSuccess
'
,
payload
:
false
}],
()
=>
{
expect
(
mockMutate
).
toHaveBeenCalledWith
(
mutationVariables
);
},
);
});
it
(
'
dispatches receiveDashboardValidationWarningsFailure if the warnings API call fails
'
,
()
=>
{
mockMutate
.
mockRejectedValue
({});
...
...
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