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
93b4cb56
Commit
93b4cb56
authored
Nov 07, 2018
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed issues introduced by changing to PureComponent
parent
37eb7ca6
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
13 deletions
+11
-13
public/app/features/dashboard/dashboard_model.ts
+0
-5
public/app/features/dashboard/dashgrid/DashboardGrid.tsx
+6
-2
public/app/features/dashboard/dashgrid/DashboardPanel.tsx
+4
-3
public/app/features/panel/viz_tab.ts
+1
-3
No files found.
public/app/features/dashboard/dashboard_model.ts
View file @
93b4cb56
...
...
@@ -232,11 +232,6 @@ export class DashboardModel {
return
this
.
meta
.
fullscreen
&&
!
panel
.
fullscreen
;
}
changePanelType
(
panel
:
PanelModel
,
pluginId
:
string
)
{
panel
.
changeType
(
pluginId
);
this
.
events
.
emit
(
'panel-type-changed'
,
panel
);
}
private
ensureListExist
(
data
)
{
if
(
!
data
)
{
data
=
{};
...
...
public/app/features/dashboard/dashgrid/DashboardGrid.tsx
View file @
93b4cb56
...
...
@@ -83,7 +83,6 @@ export class DashboardGrid extends React.Component<DashboardGridProps, any> {
dashboard
.
on
(
'view-mode-changed'
,
this
.
onViewModeChanged
.
bind
(
this
));
dashboard
.
on
(
'row-collapsed'
,
this
.
triggerForceUpdate
.
bind
(
this
));
dashboard
.
on
(
'row-expanded'
,
this
.
triggerForceUpdate
.
bind
(
this
));
dashboard
.
on
(
'panel-type-changed'
,
this
.
triggerForceUpdate
.
bind
(
this
));
}
buildLayout
()
{
...
...
@@ -176,7 +175,12 @@ export class DashboardGrid extends React.Component<DashboardGridProps, any> {
const
panelClasses
=
classNames
({
panel
:
true
,
'panel--fullscreen'
:
panel
.
fullscreen
});
panelElements
.
push
(
<
div
key=
{
panel
.
id
.
toString
()
}
className=
{
panelClasses
}
id=
{
`panel-${panel.id}`
}
>
<
DashboardPanel
panel=
{
panel
}
dashboard=
{
this
.
props
.
dashboard
}
panelType=
{
panel
.
type
}
/>
<
DashboardPanel
panel=
{
panel
}
dashboard=
{
this
.
props
.
dashboard
}
isEditing=
{
panel
.
isEditing
}
isFullscreen=
{
panel
.
fullscreen
}
/>
</
div
>
);
}
...
...
public/app/features/dashboard/dashgrid/DashboardPanel.tsx
View file @
93b4cb56
...
...
@@ -11,9 +11,10 @@ import { PanelChrome } from './PanelChrome';
import
{
PanelEditor
}
from
'./PanelEditor'
;
export
interface
Props
{
panelType
:
string
;
panel
:
PanelModel
;
dashboard
:
DashboardModel
;
isEditing
:
boolean
;
isFullscreen
:
boolean
;
}
export
interface
State
{
...
...
@@ -113,8 +114,8 @@ export class DashboardPanel extends PureComponent<Props, State> {
renderReactPanel
()
{
const
{
pluginExports
}
=
this
.
state
;
const
containerClass
=
this
.
props
.
panel
.
isEditing
?
'panel-editor-container'
:
'panel-height-helper'
;
const
panelWrapperClass
=
this
.
props
.
panel
.
isEditing
?
'panel-editor-container__panel'
:
'panel-height-helper'
;
const
containerClass
=
this
.
props
.
isEditing
?
'panel-editor-container'
:
'panel-height-helper'
;
const
panelWrapperClass
=
this
.
props
.
isEditing
?
'panel-editor-container__panel'
:
'panel-height-helper'
;
// this might look strange with these classes that change when edit, but
// I want to try to keep markup (parents) for panel the same in edit mode to avoide unmount / new mount of panel
return
(
...
...
public/app/features/panel/viz_tab.ts
View file @
93b4cb56
...
...
@@ -16,9 +16,7 @@ export class VizTabCtrl {
$scope
.
ctrl
=
this
;
}
onTypeChanged
=
(
plugin
:
PanelPlugin
)
=>
{
this
.
dashboard
.
changePanelType
(
this
.
panelCtrl
.
panel
,
plugin
.
id
);
};
onTypeChanged
=
(
plugin
:
PanelPlugin
)
=>
{};
}
const
template
=
`
...
...
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