DashboardScene: move overlay out from each edit view (#81852)

This commit is contained in:
Torkel Ödegaard 2024-02-05 11:17:33 +01:00 committed by GitHub
parent ddf124de9d
commit 6e3048c6fa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 7 additions and 5 deletions

View File

@ -22,7 +22,12 @@ export function DashboardSceneRenderer({ model }: SceneComponentProps<DashboardS
const navModel = getNavModel(navIndex, 'dashboards/browse');
if (editview) {
return <editview.Component model={editview} />;
return (
<>
<editview.Component model={editview} />
{overlay && <overlay.Component model={overlay} />}
</>
);
}
return (

View File

@ -124,7 +124,6 @@ interface EditLinkViewProps {
function EditLinkView({ pageNav, link, navModel, dashboard, onChange, onGoBack }: EditLinkViewProps) {
const parentTab = pageNav.children!.find((p) => p.active)!;
parentTab.parentItem = pageNav;
const { overlay } = dashboard.useState();
const editLinkPageNav = {
text: 'Edit link',
@ -135,7 +134,6 @@ function EditLinkView({ pageNav, link, navModel, dashboard, onChange, onGoBack }
<Page navModel={navModel} pageNav={editLinkPageNav} layout={PageLayoutType.Standard}>
<NavToolbarActions dashboard={dashboard} />
<DashboardLinkForm link={link!} onUpdate={onChange} onGoBack={onGoBack} />
{overlay && <overlay.Component model={overlay} />}
</Page>
);
}

View File

@ -148,7 +148,7 @@ export class GeneralSettingsEditView
static Component = ({ model }: SceneComponentProps<GeneralSettingsEditView>) => {
const { navModel, pageNav } = useDashboardEditPageNav(model.getDashboard(), model.getUrlKey());
const { title, description, tags, meta, editable, overlay } = model.getDashboard().useState();
const { title, description, tags, meta, editable } = model.getDashboard().useState();
const { sync: graphTooltip } = model.getCursorSync()?.useState() || {};
const { timeZone, weekStart, UNSAFE_nowDelay: nowDelay } = model.getTimeRange().useState();
const { intervals } = model.getRefreshPicker()?.useState() || {};
@ -260,7 +260,6 @@ export class GeneralSettingsEditView
<Box marginTop={3}>{meta.canDelete && <DeleteDashboardButton />}</Box>
</div>
{overlay && <overlay.Component model={overlay} />}
</Page>
);
};