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
77ef9abe
Unverified
Commit
77ef9abe
authored
Jan 19, 2021
by
Torkel Ödegaard
Committed by
GitHub
Jan 19, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PanelEvents: Isolate more for old angular query editors (#30379)
parent
086c77f5
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
9 deletions
+7
-9
public/app/features/dashboard/state/PanelModel.ts
+1
-4
public/app/features/query/components/QueryEditorRow.tsx
+6
-5
No files found.
public/app/features/dashboard/state/PanelModel.ts
View file @
77ef9abe
...
...
@@ -14,12 +14,10 @@ import {
fieldColorModeRegistry
,
FieldConfigProperty
,
FieldConfigSource
,
PanelEvents
,
PanelPlugin
,
ScopedVars
,
ThresholdsConfig
,
ThresholdsMode
,
EventBusExtended
,
EventBusSrv
,
DataFrameDTO
,
urlUtil
,
...
...
@@ -154,7 +152,7 @@ export class PanelModel implements DataConfigSource {
isInView
:
boolean
;
hasRefreshed
:
boolean
;
events
:
EventBus
Extended
;
events
:
EventBus
Srv
;
cacheTimeout
?:
any
;
cachedPluginOptions
?:
any
;
legend
?:
{
show
:
boolean
;
sort
?:
string
;
sortDesc
?:
boolean
};
...
...
@@ -479,7 +477,6 @@ export class PanelModel implements DataConfigSource {
}
destroy
()
{
this
.
events
.
emit
(
PanelEvents
.
panelTeardown
);
this
.
events
.
removeAllListeners
();
if
(
this
.
queryRunner
)
{
...
...
public/app/features/query/components/QueryEditorRow.tsx
View file @
77ef9abe
...
...
@@ -17,6 +17,7 @@ import {
toLegacyResponseData
,
EventBusExtended
,
DataSourceInstanceSettings
,
EventBusSrv
,
}
from
'@grafana/data'
;
import
{
QueryEditorRowTitle
}
from
'./QueryEditorRowTitle'
;
import
{
...
...
@@ -88,7 +89,7 @@ export class QueryEditorRow extends PureComponent<Props, State> {
onRunQuery
();
},
render
:
()
=>
()
=>
console
.
log
(
'legacy render function called, it does nothing'
),
events
:
panel
.
events
,
events
:
new
EventBusSrv
()
,
range
:
getTimeSrv
().
timeRange
(),
};
}
...
...
@@ -128,7 +129,7 @@ export class QueryEditorRow extends PureComponent<Props, State> {
}
if
(
this
.
angularQueryEditor
)
{
notifyAngularQueryEditorsOfData
(
this
.
angularScope
?.
panel
!
,
data
,
this
.
angularQueryEditor
);
notifyAngularQueryEditorsOfData
(
this
.
angularScope
!
,
data
,
this
.
angularQueryEditor
);
}
}
...
...
@@ -322,7 +323,7 @@ export class QueryEditorRow extends PureComponent<Props, State> {
// So we can check if we already emitted this legacy data event
let
globalLastPanelDataCache
:
PanelData
|
null
=
null
;
function
notifyAngularQueryEditorsOfData
(
panel
:
PanelModel
,
data
:
PanelData
,
editor
:
AngularComponent
)
{
function
notifyAngularQueryEditorsOfData
(
scope
:
AngularQueryComponentScope
,
data
:
PanelData
,
editor
:
AngularComponent
)
{
if
(
data
===
globalLastPanelDataCache
)
{
return
;
}
...
...
@@ -331,9 +332,9 @@ function notifyAngularQueryEditorsOfData(panel: PanelModel, data: PanelData, edi
if
(
data
.
state
===
LoadingState
.
Done
)
{
const
legacy
=
data
.
series
.
map
(
v
=>
toLegacyResponseData
(
v
));
panel
.
events
.
emit
(
PanelEvents
.
dataReceived
,
legacy
);
scope
.
events
.
emit
(
PanelEvents
.
dataReceived
,
legacy
);
}
else
if
(
data
.
state
===
LoadingState
.
Error
)
{
panel
.
events
.
emit
(
PanelEvents
.
dataError
,
data
.
error
);
scope
.
events
.
emit
(
PanelEvents
.
dataError
,
data
.
error
);
}
// Some query controllers listen to data error events and need a digest
...
...
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