Merge pull request #30526 from backstage/blam/catalog-pagination

catalog: pagination on by default in nfs
This commit is contained in:
Ben Lambert
2025-07-15 10:37:14 +02:00
committed by GitHub
3 changed files with 44 additions and 2 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-catalog': patch
---
Turn on `pagination` by default in new frontend system, and also make configurable
+17
View File
@@ -1012,9 +1012,26 @@ const _default: FrontendPlugin<
}>;
'page:catalog': ExtensionDefinition<{
config: {
pagination:
| boolean
| {
mode: 'offset' | 'cursor';
offset?: number | undefined;
limit?: number | undefined;
};
} & {
path: string | undefined;
};
configInput: {
pagination?:
| boolean
| {
mode: 'offset' | 'cursor';
offset?: number | undefined;
limit?: number | undefined;
}
| undefined;
} & {
path?: string | undefined;
};
output:
+22 -2
View File
@@ -41,7 +41,22 @@ export const catalogPage = PageBlueprint.makeWithOverrides({
inputs: {
filters: createExtensionInput([coreExtensionData.reactElement]),
},
factory(originalFactory, { inputs }) {
config: {
schema: {
pagination: z =>
z
.union([
z.boolean(),
z.object({
mode: z.enum(['cursor', 'offset']),
limit: z.number().optional(),
offset: z.number().optional(),
}),
])
.default(true),
},
},
factory(originalFactory, { inputs, config }) {
return originalFactory({
defaultPath: '/catalog',
routeRef: convertLegacyRouteRef(rootRouteRef),
@@ -50,7 +65,12 @@ export const catalogPage = PageBlueprint.makeWithOverrides({
const filters = inputs.filters.map(filter =>
filter.get(coreExtensionData.reactElement),
);
return compatWrapper(<BaseCatalogPage filters={<>{filters}</>} />);
return compatWrapper(
<BaseCatalogPage
filters={<>{filters}</>}
pagination={config.pagination}
/>,
);
},
});
},