feat(scaffolder): config-driven template groups and swappable TemplateCard (#34147)
* feat(scaffolder): config-driven template groups and swappable TemplateCard Signed-off-by: benjdlambert <ben@blam.sh> * refactor(scaffolder): keep createGroupsWithOther internal Signed-off-by: benjdlambert <ben@blam.sh> * docs(scaffolder): fix sub-page extension ID in changeset Signed-off-by: benjdlambert <ben@blam.sh> * address PR review feedback Signed-off-by: benjdlambert <ben@blam.sh> * split TemplateCard swappable contract from legacy props Signed-off-by: benjdlambert <ben@blam.sh> * address review feedback: dedupe tags, defensive groups copy, doc clarifications Signed-off-by: benjdlambert <ben@blam.sh> * regenerate api reports Signed-off-by: benjdlambert <ben@blam.sh> * align docs and changeset with actual default group titles Signed-off-by: benjdlambert <ben@blam.sh> * regen api reports after rebase Signed-off-by: benjdlambert <ben@blam.sh> --------- Signed-off-by: benjdlambert <ben@blam.sh>
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
---
|
||||
'@backstage/plugin-scaffolder-react': minor
|
||||
---
|
||||
|
||||
The `TemplateCard` component is now a swappable component. Apps using the new
|
||||
frontend system can replace it by registering a `SwappableComponentBlueprint`
|
||||
that targets `TemplateCard`. Components used as the swappable implementation
|
||||
receive `TemplateCardComponentProps`, where `onSelected` is a zero-argument
|
||||
callback bound to the rendered template. Existing usage continues to work
|
||||
unchanged.
|
||||
@@ -0,0 +1,26 @@
|
||||
---
|
||||
'@backstage/plugin-scaffolder': minor
|
||||
---
|
||||
|
||||
The `sub-page:scaffolder/templates` extension now accepts a `groups` config
|
||||
field that lets you define template groups on the template list page. Each group
|
||||
has a `title` and a `filter` predicate. Templates not matched by any
|
||||
configured group fall into an automatically appended "Other Templates" group.
|
||||
With no groups configured, the page renders a single "Templates" group as
|
||||
before.
|
||||
|
||||
Example:
|
||||
|
||||
```yaml
|
||||
app:
|
||||
extensions:
|
||||
- sub-page:scaffolder/templates:
|
||||
config:
|
||||
groups:
|
||||
- title: Recommended Services
|
||||
filter:
|
||||
spec.type: service
|
||||
- title: Documentation
|
||||
filter:
|
||||
spec.type: documentation
|
||||
```
|
||||
Reference in New Issue
Block a user