mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Expand rows for panels in collapsed rows
This commit is contained in:
parent
08925ffad8
commit
aa2bf07c71
@ -120,7 +120,12 @@ export class DashboardPage extends PureComponent<Props, State> {
|
||||
onEnterFullscreen() {
|
||||
const { dashboard, urlEdit, urlFullscreen, urlPanelId } = this.props;
|
||||
|
||||
const panel = dashboard.getPanelById(parseInt(urlPanelId, 10));
|
||||
const panelId = parseInt(urlPanelId, 10);
|
||||
|
||||
// need to expand parent row if this panel is inside a row
|
||||
dashboard.expandParentRowFor(panelId);
|
||||
|
||||
const panel = dashboard.getPanelById(panelId);
|
||||
|
||||
if (panel) {
|
||||
dashboard.setViewMode(panel, urlFullscreen, urlEdit);
|
||||
|
@ -59,7 +59,13 @@ export class SoloPanelPage extends Component<Props, State> {
|
||||
|
||||
// we just got the dashboard!
|
||||
if (!prevProps.dashboard) {
|
||||
const panel = dashboard.getPanelById(parseInt(urlPanelId, 10));
|
||||
const panelId = parseInt(urlPanelId, 10);
|
||||
|
||||
// need to expand parent row if this panel is inside a row
|
||||
dashboard.expandParentRowFor(panelId);
|
||||
|
||||
const panel = dashboard.getPanelById(panelId);
|
||||
|
||||
if (!panel) {
|
||||
this.setState({ notFound: true });
|
||||
return;
|
||||
|
@ -904,4 +904,18 @@ export class DashboardModel {
|
||||
this.processRepeats();
|
||||
this.events.emit('template-variable-value-updated');
|
||||
}
|
||||
|
||||
expandParentRowFor(panelId: number) {
|
||||
for (const panel of this.panels) {
|
||||
if (panel.collapsed) {
|
||||
for (const rowPanel of panel.panels) {
|
||||
if (rowPanel.id === panelId) {
|
||||
this.toggleRow(panel);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user