Expand rows for panels in collapsed rows
This commit is contained in:
@@ -120,7 +120,12 @@ export class DashboardPage extends PureComponent<Props, State> {
|
|||||||
onEnterFullscreen() {
|
onEnterFullscreen() {
|
||||||
const { dashboard, urlEdit, urlFullscreen, urlPanelId } = this.props;
|
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) {
|
if (panel) {
|
||||||
dashboard.setViewMode(panel, urlFullscreen, urlEdit);
|
dashboard.setViewMode(panel, urlFullscreen, urlEdit);
|
||||||
|
|||||||
@@ -59,7 +59,13 @@ export class SoloPanelPage extends Component<Props, State> {
|
|||||||
|
|
||||||
// we just got the dashboard!
|
// we just got the dashboard!
|
||||||
if (!prevProps.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) {
|
if (!panel) {
|
||||||
this.setState({ notFound: true });
|
this.setState({ notFound: true });
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -904,4 +904,18 @@ export class DashboardModel {
|
|||||||
this.processRepeats();
|
this.processRepeats();
|
||||||
this.events.emit('template-variable-value-updated');
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user