frontend-plugin-api: added noHeader param for page blueprint
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -1757,6 +1757,7 @@ export const PageBlueprint: ExtensionBlueprint_2<{
|
||||
icon?: IconElement;
|
||||
loader?: () => Promise<JSX.Element>;
|
||||
routeRef?: RouteRef;
|
||||
noHeader?: boolean;
|
||||
};
|
||||
output:
|
||||
| ExtensionDataRef_2<string, 'core.routing.path', {}>
|
||||
@@ -1840,6 +1841,8 @@ export interface PageLayoutProps {
|
||||
// (undocumented)
|
||||
icon?: IconElement;
|
||||
// (undocumented)
|
||||
noHeader?: boolean;
|
||||
// (undocumented)
|
||||
tabs?: PageTab[];
|
||||
// (undocumented)
|
||||
title?: string;
|
||||
|
||||
@@ -77,6 +77,10 @@ export const PageBlueprint = createExtensionBlueprint({
|
||||
icon?: IconElement;
|
||||
loader?: () => Promise<JSX.Element>;
|
||||
routeRef?: RouteRef;
|
||||
/**
|
||||
* Hide the default plugin page header, making the page fill up all available space.
|
||||
*/
|
||||
noHeader?: boolean;
|
||||
},
|
||||
{ config, node, inputs },
|
||||
) {
|
||||
@@ -87,6 +91,7 @@ export const PageBlueprint = createExtensionBlueprint({
|
||||
node.spec.plugin.pluginId;
|
||||
const icon = params.icon ?? node.spec.plugin.icon;
|
||||
const pluginId = node.spec.plugin.pluginId;
|
||||
const noHeader = params.noHeader ?? false;
|
||||
|
||||
yield coreExtensionData.routePath(config.path ?? params.path);
|
||||
if (params.loader) {
|
||||
@@ -94,7 +99,12 @@ export const PageBlueprint = createExtensionBlueprint({
|
||||
const PageContent = () => {
|
||||
const headerActions = useHeaderActions(pluginId);
|
||||
return (
|
||||
<PageLayout title={title} icon={icon} headerActions={headerActions}>
|
||||
<PageLayout
|
||||
title={title}
|
||||
icon={icon}
|
||||
noHeader={noHeader}
|
||||
headerActions={headerActions}
|
||||
>
|
||||
{ExtensionBoundary.lazy(node, loader)}
|
||||
</PageLayout>
|
||||
);
|
||||
|
||||
@@ -37,6 +37,7 @@ export interface PageTab {
|
||||
export interface PageLayoutProps {
|
||||
title?: string;
|
||||
icon?: IconElement;
|
||||
noHeader?: boolean;
|
||||
headerActions?: ReactNode;
|
||||
tabs?: PageTab[];
|
||||
children?: ReactNode;
|
||||
|
||||
Reference in New Issue
Block a user