Skip to content

Commit 38e481c

Browse files
checkpoint
1 parent c602459 commit 38e481c

File tree

4 files changed

+46
-17
lines changed

4 files changed

+46
-17
lines changed

public/app/features/dashboard/components/PanelEditor/PanelEditor.tsx

Lines changed: 39 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ const mapStateToProps = (state: StoreState, ownProps: OwnProps) => {
7272
uiState: state.panelEditor.ui,
7373
tableViewEnabled: state.panelEditor.tableViewEnabled,
7474
variables: getVariablesByKey(ownProps.dashboard.uid, state),
75+
isMFEDashboard: state.fnGlobalState.FNDashboard,
76+
isMFECustomDashboard: state.fnGlobalState.isCustomDashboard,
7577
};
7678
};
7779

@@ -431,27 +433,33 @@ export class PanelEditorUnconnected extends PureComponent<Props> {
431433
};
432434

433435
render() {
434-
const { initDone, uiState, theme, sectionNav, pageNav, className, updatePanelEditorUIState } = this.props;
436+
const { initDone, uiState, theme, sectionNav, pageNav, className, updatePanelEditorUIState, isMFECustomDashboard } = this.props;
435437
const styles = getStyles(theme, this.props);
436438

437439
if (!initDone) {
438440
return null;
439441
}
440442

441-
return (
442-
<Page
443-
navModel={sectionNav}
444-
pageNav={pageNav}
445-
data-testid={selectors.components.PanelEditor.General.content}
446-
layout={PageLayoutType.Custom}
447-
className={className}
448-
>
449-
<AppChromeUpdate
443+
console.log('PanelEditor.tsx this.props', {
444+
isPanelOptionVisible: uiState.isPanelOptionsVisible,
445+
isMFECustomDashboard,
446+
modelState: this.state.showSaveLibraryPanelModal,
447+
});
448+
449+
const editPanelContent = (
450+
<>
451+
{
452+
!isMFECustomDashboard ? (
453+
<AppChromeUpdate
450454
actions={<ToolbarButtonRow alignment="right">{this.renderEditorActions()}</ToolbarButtonRow>}
451-
/>
455+
/>
456+
): (
457+
<ToolbarButtonRow alignment="right">{this.renderEditorActions()}</ToolbarButtonRow>
458+
)
459+
}
452460
<div className={styles.wrapper}>
453461
<div className={styles.verticalSplitPanesWrapper}>
454-
{!uiState.isPanelOptionsVisible ? (
462+
{!uiState.isPanelOptionsVisible || isMFECustomDashboard ? (
455463
this.renderPanelAndEditor(uiState, styles)
456464
) : (
457465
<SplitPaneWrapper
@@ -480,7 +488,25 @@ export class PanelEditorUnconnected extends PureComponent<Props> {
480488
/>
481489
)}
482490
</div>
483-
</Page>
491+
</>
492+
)
493+
494+
return (
495+
<>
496+
{
497+
!isMFECustomDashboard ? (
498+
<Page
499+
navModel={sectionNav}
500+
pageNav={pageNav}
501+
data-testid={selectors.components.PanelEditor.General.content}
502+
layout={PageLayoutType.Custom}
503+
className={className}
504+
>
505+
{editPanelContent}
506+
</Page>
507+
): <div>{editPanelContent}</div>
508+
}
509+
</>
484510
);
485511
}
486512
}

public/app/features/dashboard/containers/DashboardPage.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,8 @@ export class UnthemedDashboardPage extends PureComponent<Props, State> {
423423
</Portal>
424424
);
425425

426+
const isPanelEditorVisible = editPanel && sectionNav && pageNav && isFNDashboardEditable
427+
426428
return (
427429
<>
428430
<Page
@@ -431,7 +433,7 @@ export class UnthemedDashboardPage extends PureComponent<Props, State> {
431433
layout={PageLayoutType.Canvas}
432434
className={pageClassName}
433435
onSetScrollRef={this.setScrollRef}
434-
style={{ minHeight: 600 }}
436+
style={{ minHeight: 600, position: 'relative' }}
435437
>
436438
{showToolbar && (
437439
<header data-testid={selectors.pages.Dashboard.DashNav.navV2}>
@@ -497,7 +499,7 @@ export class UnthemedDashboardPage extends PureComponent<Props, State> {
497499

498500
{inspectPanel && isFNDashboardEditable && <PanelInspector dashboard={dashboard} panel={inspectPanel} />}
499501
</Page>
500-
{editPanel && sectionNav && pageNav && isFNDashboardEditable && (
502+
{isPanelEditorVisible && (
501503
<PanelEditor
502504
dashboard={dashboard}
503505
sourcePanel={editPanel}

public/app/fn-app/fn-app-provider.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
navigationLogger,
1212
reportInteraction,
1313
} from '@grafana/runtime';
14-
import { ErrorBoundaryAlert, GlobalStyles } from '@grafana/ui';
14+
import { ErrorBoundaryAlert, GlobalStyles, ModalRoot } from '@grafana/ui';
1515
import { AngularRoot } from 'app/angular/AngularRoot';
1616
import { loadAndInitAngularIfEnabled } from 'app/angular/loadAndInitAngularIfEnabled';
1717
import { AppChrome } from 'app/core/components/AppChrome/AppChrome';
@@ -74,6 +74,7 @@ export const FnAppProvider: FC<PropsWithChildren<FnAppProviderProps>> = (props)
7474
{children}
7575
</AppChrome>
7676
</div>
77+
<ModalRoot />
7778
</ModalsContextProvider>
7879
</CompatRouter>
7980
</LocationServiceProvider>

public/app/fn-app/fn-dashboard-page/fn-dashboard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export const DashboardPortal: FC<FNDashboardComponentProps> = (p) => {
5454

5555
return (
5656
<RenderPortal ID="grafana-portal">
57-
<div className="page-dashboard">{content}</div>
57+
{content}
5858
</RenderPortal>
5959
);
6060
};

0 commit comments

Comments
 (0)