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
05e37e92
Unverified
Commit
05e37e92
authored
Jan 20, 2021
by
Torkel Ödegaard
Committed by
GitHub
Jan 20, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PanelModel: Make sure the angular options are passed to react panel type changed handler (#30441)
parent
b9fd4dba
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
11 deletions
+4
-11
public/app/features/dashboard/state/PanelModel.ts
+4
-11
No files found.
public/app/features/dashboard/state/PanelModel.ts
View file @
05e37e92
...
...
@@ -364,13 +364,13 @@ export class PanelModel implements DataConfigSource {
changePlugin
(
newPlugin
:
PanelPlugin
)
{
const
pluginId
=
newPlugin
.
meta
.
id
;
const
oldOptions
:
any
=
this
.
getOptionsToRemember
();
const
old
FieldConfig
=
this
.
fieldConfig
;
const
prev
FieldConfig
=
this
.
fieldConfig
;
const
oldPluginId
=
this
.
type
;
const
wasAngular
=
this
.
isAngularPlugin
();
this
.
cachedPluginOptions
[
oldPluginId
]
=
{
properties
:
oldOptions
,
fieldConfig
:
old
FieldConfig
,
fieldConfig
:
prev
FieldConfig
,
};
this
.
clearPropertiesBeforePluginChange
();
...
...
@@ -378,15 +378,8 @@ export class PanelModel implements DataConfigSource {
// Let panel plugins inspect options from previous panel and keep any that it can use
if
(
newPlugin
.
onPanelTypeChanged
)
{
let
oldOptions
:
any
=
{};
if
(
wasAngular
)
{
oldOptions
=
{
angular
:
oldOptions
};
}
else
if
(
oldOptions
&&
oldOptions
.
options
)
{
oldOptions
=
oldOptions
.
options
;
}
Object
.
assign
(
this
.
options
,
newPlugin
.
onPanelTypeChanged
(
this
,
oldPluginId
,
oldOptions
,
oldFieldConfig
));
const
prevOptions
=
wasAngular
?
{
angular
:
oldOptions
}
:
oldOptions
.
options
;
Object
.
assign
(
this
.
options
,
newPlugin
.
onPanelTypeChanged
(
this
,
oldPluginId
,
prevOptions
,
prevFieldConfig
));
}
// switch
...
...
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