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
839057dc
Commit
839057dc
authored
Oct 30, 2018
by
Johannes Schill
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wip: Add "Share" to the react panels
parent
bf8703ed
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
4 deletions
+25
-4
public/app/features/dashboard/dashgrid/PanelHeader/PanelHeaderMenu.tsx
+25
-4
No files found.
public/app/features/dashboard/dashgrid/PanelHeader/PanelHeaderMenu.tsx
View file @
839057dc
...
...
@@ -4,6 +4,7 @@ import { PanelHeaderMenuItem, PanelHeaderMenuItemTypes } from './PanelHeaderMenu
import
{
store
}
from
'app/store/configureStore'
;
import
{
updateLocation
}
from
'app/core/actions'
;
import
{
removePanel
}
from
'app/features/dashboard/utils/panel'
;
import
appEvents
from
'app/core/app_events'
;
export
interface
PanelHeaderMenuProps
{
panelId
:
number
;
...
...
@@ -11,6 +12,13 @@ export interface PanelHeaderMenuProps {
}
export
class
PanelHeaderMenu
extends
PureComponent
<
PanelHeaderMenuProps
,
any
>
{
getPanel
=
()
=>
{
// Pass in panel as prop instead?
const
{
panelId
,
dashboard
}
=
this
.
props
;
const
panelInfo
=
dashboard
.
getPanelInfoById
(
panelId
);
return
panelInfo
.
panel
;
};
onEditPanel
=
()
=>
{
store
.
dispatch
(
updateLocation
({
...
...
@@ -36,9 +44,22 @@ export class PanelHeaderMenu extends PureComponent<PanelHeaderMenuProps, any> {
};
onRemovePanel
=
()
=>
{
const
{
panelId
,
dashboard
}
=
this
.
props
;
const
panelInfo
=
dashboard
.
getPanelInfoById
(
panelId
);
removePanel
(
dashboard
,
panelInfo
.
panel
,
true
);
const
{
dashboard
}
=
this
.
props
;
const
panel
=
this
.
getPanel
();
removePanel
(
dashboard
,
panel
,
true
);
};
onSharePanel
=
()
=>
{
const
{
dashboard
}
=
this
.
props
;
const
panel
=
this
.
getPanel
();
appEvents
.
emit
(
'show-modal'
,
{
src
:
'public/app/features/dashboard/partials/shareModal.html'
,
model
:
{
panel
:
panel
,
dashboard
:
dashboard
,
},
});
};
render
()
{
...
...
@@ -63,7 +84,7 @@ export class PanelHeaderMenu extends PureComponent<PanelHeaderMenuProps, any> {
type=
{
PanelHeaderMenuItemTypes
.
Link
}
text=
"Share"
iconClassName=
"fa fa-fw fa-share"
handleClick=
{
()
=>
{}
}
handleClick=
{
this
.
onSharePanel
}
shortcut=
"p s"
/>
<
PanelHeaderMenuItem
...
...
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