Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
806dd3f6
Unverified
Commit
806dd3f6
authored
Apr 18, 2020
by
Ryan McKinley
Committed by
GitHub
Apr 18, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
QueryEditors: include error when no data is returned (#23632)
parent
f30074c7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
0 deletions
+20
-0
public/app/features/dashboard/panel_editor/QueryEditorRow.test.ts
+13
-0
public/app/features/dashboard/panel_editor/QueryEditorRow.tsx
+7
-0
No files found.
public/app/features/dashboard/panel_editor/QueryEditorRow.test.ts
View file @
806dd3f6
...
@@ -43,4 +43,17 @@ describe('filterPanelDataToQuery', () => {
...
@@ -43,4 +43,17 @@ describe('filterPanelDataToQuery', () => {
expect
(
panelData
?.
series
[
0
].
refId
).
toBe
(
'B'
);
expect
(
panelData
?.
series
[
0
].
refId
).
toBe
(
'B'
);
expect
(
panelData
?.
error
!
.
refId
).
toBe
(
'B'
);
expect
(
panelData
?.
error
!
.
refId
).
toBe
(
'B'
);
});
});
it
(
'should include errors when missing data'
,
()
=>
{
const
withError
=
({
series
:
[],
error
:
{
message
:
'Error!!'
,
},
}
as
unknown
)
as
PanelData
;
const
panelData
=
filterPanelDataToQuery
(
withError
,
'B'
);
expect
(
panelData
.
state
).
toBe
(
LoadingState
.
Error
);
expect
(
panelData
.
error
).
toBe
(
withError
.
error
);
});
});
});
public/app/features/dashboard/panel_editor/QueryEditorRow.tsx
View file @
806dd3f6
...
@@ -335,6 +335,13 @@ export function filterPanelDataToQuery(data: PanelData, refId: string): PanelDat
...
@@ -335,6 +335,13 @@ export function filterPanelDataToQuery(data: PanelData, refId: string): PanelDat
// No matching series
// No matching series
if
(
!
series
.
length
)
{
if
(
!
series
.
length
)
{
// If there was an error with no data, pass it to the QueryEditors
if
(
data
.
error
&&
!
data
.
series
.
length
)
{
return
{
...
data
,
state
:
LoadingState
.
Error
,
};
}
return
undefined
;
return
undefined
;
}
}
...
...
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