Commit Graph

72161 Commits

Author SHA1 Message Date
Patrik Oldsberg 8dda73d806 create-app: fix duplicate search item in next-app
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-03-17 20:13:06 +01:00
Patrik Oldsberg 683e49ca32 Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-03-17 19:41:44 +01:00
Patrik Oldsberg 219490cd92 create-app: Fix E2E test for new default template
Add @backstage/cli-module-new to the version map so that the
next-app template can resolve it during templating, and update
the E2E test to build the dist workspace from the next-app
template since it is now the default.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 16:45:11 +01:00
Patrik Oldsberg 4568618cf1 create-app: fix next-app e2e sign-in assertion
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 16:18:02 +01:00
Patrik Oldsberg d0a2b0b7dc e2e-test: preserve next-app styles in React 17 bootstrap
Keep the generated app stylesheet import when rewriting the new frontend app entrypoint for React 17 so the E2E app boots with the same UI setup.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 16:18:01 +01:00
Patrik Oldsberg 2dce1f23eb e2e-test: fix React 17 app bootstrap for new frontend apps
Use the generated app root API when switching the scaffolded app to React 17 so the new frontend app still type-checks in E2E.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 16:18:00 +01:00
Patrik Oldsberg 9603f9c6c0 cli: fix frontend plugin template dev dependency
Add the missing frontend dev utils package so newly scaffolded frontend plugins compile in the create-app E2E flow.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 16:17:59 +01:00
Patrik Oldsberg 7cd15e7c90 create-app: fix next-app template formatting
Align the next-app template output with the scaffolded app Prettier config so the default app E2E checks pass.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 16:17:18 +01:00
Patrik Oldsberg 35686dc9f7 cli: add frontend template filtering coverage
Clarify the legacy frontend plugin template label and lock in template selection behavior for legacy and new frontend system apps.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 16:17:18 +01:00
Patrik Oldsberg 08d9770715 cli: Rename frontend plugin templates and add auto-detection
Renamed the CLI templates for frontend plugins:
- new-frontend-plugin → frontend-plugin
- new-frontend-plugin-module → frontend-plugin-module
- frontend-plugin (legacy) → legacy-frontend-plugin

Added auto-detection logic that checks packages/app/package.json to
determine which frontend system the app uses. When using default
templates, only the appropriate frontend plugin template is shown:
- Apps with @backstage/frontend-defaults see the new system templates
- Apps with @backstage/app-defaults see the legacy template

Both templates display as "frontend-plugin" to users, so existing
workflows are preserved while automatically using the correct template.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-03-17 16:17:17 +01:00
Patrik Oldsberg a6735c33b1 create-app: Make new frontend system the default
The new frontend system is now the default template when creating a new
Backstage app. The previous `--next` flag has been replaced with a
`--legacy` flag that can be used to create an app using the old frontend
system instead.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-03-17 16:12:27 +01:00
Patrik Oldsberg 97411ebb0c Merge pull request #32542 from backstage/bui-toast
feat: Introduce ToastApi for rich notifications in the new frontend system
2026-03-17 15:34:16 +01:00
Johan Persson c548a0ff86 refactor(catalog,api-docs): migrate entity table cards to BUI (#33260)
* feat(catalog-react): add EntityDataTable and EntityRelationCard components

Add EntityDataTable (BUI Table wrapper for entity data) and
EntityRelationCard (card shell + data fetching + table) as shared
building blocks for entity relation table cards. Includes BUI column
factories, column presets for common entity types, and a new
translation key for the empty state help link.

Signed-off-by: Johan Persson <johanopersson@gmail.com>

* refactor(catalog): migrate 8 entity table cards to EntityRelationCard

Rewrite HasComponentsCard, HasResourcesCard, HasSubcomponentsCard,
HasSubdomainsCard, HasSystemsCard, DependsOnComponentsCard,
DependsOnResourcesCard, and DependencyOfComponentsCard as thin
wrappers around EntityRelationCard from catalog-react. Remove variant
and tableOptions props.

Signed-off-by: Johan Persson <johanopersson@gmail.com>

* refactor(api-docs): migrate 5 entity table cards to EntityRelationCard

Rewrite ConsumedApisCard, ProvidedApisCard, HasApisCard,
ConsumingComponentsCard, and ProvidingComponentsCard to use
EntityRelationCard from catalog-react. Add BUI column presets for
API-specific columns alongside existing MUI presets. Remove variant
and tableOptions props.

Signed-off-by: Johan Persson <johanopersson@gmail.com>

* chore: add API reports and changesets for entity table card migration

Signed-off-by: Johan Persson <johanopersson@gmail.com>

* fix(catalog-react,api-docs): refine entity card migration

Use BUI Alert for error states and BUI Link for empty state help
links in EntityRelationCard instead of core-components. Replace MUI
ToggleButton with BUI ButtonIcon for the API definition column.
Add trailing periods to empty state translation messages. Fix tests
asserting on removed external link icon SVG.

Signed-off-by: Johan Persson <johanopersson@gmail.com>

* feat(catalog-react): add column sorting to EntityDataTable

Introduce EntityColumnConfig extending ColumnConfig with an optional
sortValue getter. EntityDataTable now uses useTable with a sortFn
that reads sortValue from each column, restoring the per-column
sorting that the old core-components Table provided by default. All
built-in column factories set isSortable and sortValue.

Signed-off-by: Johan Persson <johanopersson@gmail.com>

* fix(api-docs): use dynamic entity kind in empty state messages

Restore entity.kind interpolation in ConsumedApisCard, ProvidedApisCard,
and HasApisCard empty state translations instead of hardcoded strings.

Signed-off-by: Johan Persson <johanopersson@gmail.com>

* fix(catalog-react): use data length for useTable pageSize

Replace pageSize: Infinity with tableData.length to avoid potential
edge cases in pagination math.

Signed-off-by: Johan Persson <johanopersson@gmail.com>

* fix(catalog-react): avoid this binding in column factories

Use columnFactories.createEntityRelationColumn instead of
this.createEntityRelationColumn so the methods work when
destructured.

Signed-off-by: Johan Persson <johanopersson@gmail.com>

* chore: update alpha API reports

Signed-off-by: Johan Persson <johanopersson@gmail.com>

* fix(create-app): remove variant prop from migrated entity cards in template

The create-app template EntityPage still passed variant="gridItem"
to cards that no longer accept it.

Signed-off-by: Johan Persson <johanopersson@gmail.com>

* test(catalog-react): add tests for EntityDataTable and EntityRelationCard

Cover rendering with data, empty state, error state, and column
sorting for EntityDataTable. Cover title rendering, empty state
with help link, related entity display, and error state for
EntityRelationCard.

Signed-off-by: Johan Persson <johanopersson@gmail.com>

* refactor(catalog,api-docs): add backwards compatibility for legacy props

Support both old (variant, columns, tableOptions) and new (columnConfig)
props via a discriminated union type. When legacy props are detected the
old MUI-based implementation is used; otherwise the new BUI-based
EntityRelationCard renders. This avoids immediate breaking changes and
provides a migration path. Changesets downgraded from major/minor to
minor/patch accordingly.

Signed-off-by: Johan Persson <johanopersson@gmail.com>

* refactor(catalog-react,catalog,api-docs): address review feedback

Remove BaseProps types and use inline union in component signatures.
Move EntityDataTable, EntityRelationCard, and related types to alpha
exports. Group column presets and help links into entityColumnPresets
object. Update all consumers and API reports.

Signed-off-by: Johan Persson <johanopersson@gmail.com>

---------

Signed-off-by: Johan Persson <johanopersson@gmail.com>
2026-03-17 14:33:45 +00:00
Patrik Oldsberg 8e559b427d Merge pull request #33393 from backstage/rugvip/move-cli-new-templates
cli-module-new: move yarn new templates from @backstage/cli
2026-03-17 15:32:09 +01:00
Patrik Oldsberg c374ed33e5 frontend-plugin-api: refresh API report after rebase
Regenerate the frontend plugin API report after rebasing so the deprecated AlertApi ref annotations match the current extracted public API.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 14:54:58 +01:00
Patrik Oldsberg 305f4edf00 Fix toast surface tokens for current BUI theme
Update the toast surface and interaction styles to use the current overlay token set so notifications render with the intended background and focus treatment after the BUI token changes.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 14:45:23 +01:00
Patrik Oldsberg c7201754af Merge master and update toastApiRef to new ApiRef pattern
Resolve merge conflicts from master introducing the new ApiRef_2 type
pattern with `.with()` builder. Update toastApiRef to use the same
`createApiRef<T>().with({ id, pluginId })` pattern as all other API
refs, and regenerate API reports.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 14:45:22 +01:00
Patrik Oldsberg b3466f6f78 Merge pull request #33356 from backstage/conditional-extensions
frontend-app-api: add phased app preparation
2026-03-17 14:44:00 +01:00
Patrik Oldsberg 35cd7a20b2 Fix typos in templates documentation
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 14:43:31 +01:00
Patrik Oldsberg 094cee6a40 repo: refresh remaining API reports
Check in the remaining generated API report updates after the rebase so verify sees the current exported surfaces and generated ordering.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 14:03:17 +01:00
Patrik Oldsberg 3860435f6c core-components: refresh alpha API report
Update the generated core-components alpha API report after the rebase so verify sees the current translation key ordering.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 13:49:09 +01:00
Johan Persson a91000018a fix(ui): improve screen reader output for Checkbox and Table selection
Added aria-hidden to the Checkbox indicator div to prevent screen
readers from announcing decorative icons. Added aria-label to the
Table header selection column wrapper.

Signed-off-by: Johan Persson <johanopersson@gmail.com>
2026-03-17 13:40:58 +01:00
Johan Persson 1f9682bf28 fix(ui): make Table row a bg consumer for correct hover/selection states
Table rows now participate in the bg provider/consumer system, using
the appropriate neutral token level based on their container background.
On a neutral-1 surface (e.g. inside a Card), rows step up to neutral-2
tokens for hover, selected, pressed, and disabled states.

Signed-off-by: Johan Persson <johanopersson@gmail.com>
2026-03-17 13:40:58 +01:00
Johan Persson 545129a9d8 fix(ui): use aria-label for Table selection checkboxes
Updated Table selection checkboxes to use aria-label instead of
empty fragment children, improving accessibility and removing the
unnecessary label gap in the selection cells.

Signed-off-by: Johan Persson <johanopersson@gmail.com>
2026-03-17 13:40:58 +01:00
Johan Persson a6b84e13ec fix(ui): make Checkbox children optional with a11y warning
Made children optional and only render the label wrapper div when
children are provided. When used without children, a dev warning is
shown if no aria-label or aria-labelledby is set.

Signed-off-by: Johan Persson <johanopersson@gmail.com>
2026-03-17 13:40:58 +01:00
Patrik Oldsberg 11328fc31b frontend-plugin-api: fix alpha API report exports
Re-export the PluginWrapperBlueprint support types from the alpha entrypoint and regenerate the affected API reports so verify passes after the rebase.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 13:37:17 +01:00
Patrik Oldsberg d6742bb1fe Exclude templates from lint in cli-module-new
The templates directory was excluded from linting in the @backstage/cli
package but the ignore pattern was not carried over to cli-module-new.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 13:28:10 +01:00
Patrik Oldsberg 7ffb61b703 frontend-app-api: fix rebased test type import
Remove a stale createSpecializedApp test import that started failing repository type checking after the rebase.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 13:19:10 +01:00
Patrik Oldsberg 2df91cd745 Update API reports after rebase
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 13:14:42 +01:00
Patrik Oldsberg 3b9973c7df Fix E2E test template path after move to cli-module-new
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 13:10:24 +01:00
Patrik Oldsberg ea90ab0590 Move yarn new templates from @backstage/cli to @backstage/cli-module-new
The built-in templates used by `yarn new` are moved from `packages/cli/templates/`
to `packages/cli-module-new/templates/`, colocating them with the code that
consumes them.

A backwards compatibility rewrite in the template resolution ensures that
existing `@backstage/cli/templates/*` references in root `package.json`
configurations continue to work by transparently resolving them to
`@backstage/cli-module-new/templates/*`.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 13:10:24 +01:00
Patrik Oldsberg 46b530378d frontend-app-api: revert predicate traversal cleanup
Restore the more defensive predicate traversal implementation after the narrowing cleanup turned out not to be worth the type fallout.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 13:06:21 +01:00
Patrik Oldsberg 0d6596f4e7 frontend-app-api: apply review follow-up cleanup
Tighten a few small follow-up details from review by improving stack traces in permission batching, simplifying synthetic child refs, and making predicate traversal narrowing more direct.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 13:06:21 +01:00
Patrik Oldsberg c6d96e7426 frontend-app-api: address remaining review feedback
Move the deprecated createSpecializedApp API holder option back under advanced and disable DataLoader caching in IdentityPermissionApi so batching stays limited to same-tick requests.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 13:06:21 +01:00
Patrik Oldsberg d7ed46b83c frontend-app-api: follow up phased app review feedback
Fix utility API resolution for falsy values and clarify how phased app finalization is owned between onFinalized and finalize.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 13:06:20 +01:00
Patrik Oldsberg da11157729 frontend-app-api: move session reuse to prepare time
Remove the late-bound finalize session override so prepared apps accept reusable session state in one place. This keeps bootstrap and finalization semantics aligned and simplifies the prepared app API.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 13:06:20 +01:00
Patrik Oldsberg e04955b861 frontend-app-api: split prepared app wiring helpers
Extract the prepared app tree and API factory lifecycle helpers so prepareSpecializedApp reads as orchestration, while keeping the finalization flow documented and behaviorally unchanged.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 13:06:11 +01:00
Patrik Oldsberg 65805c8117 frontend-app-api: split prepared app session loading
Separate direct and callback-driven finalization by keeping async session loading inside onFinalized and simplifying the shared finalization helpers.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 13:06:11 +01:00
Patrik Oldsberg 4a1a3496f2 frontend-app-api: separate prepared app finalization modes
Make prepared apps choose either onFinalized or finalize so the async and direct finalization flows can no longer be mixed on the same instance.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 13:06:11 +01:00
Patrik Oldsberg a5017f7951 frontend-app-api: extract prepare app finalizers
Move the session-state and bootstrap-error finalization flows into same-file helpers with explicit inputs so the local state updates remain visible at the call sites.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 13:06:11 +01:00
Patrik Oldsberg 0ce78c110c frontend-app-api: simplify prepare app finalization flow
Keep the sign-in finalization path local to the identity callback and use safer error normalization while preserving the finalized bootstrap error flow.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 13:06:10 +01:00
Patrik Oldsberg 217de172dc frontend-app-api: finalize bootstrap failures through app root
Resolve async finalization failures by building a finalized app that throws from app/root.children, and simplify the identity proxy target callback to a synchronous fire-and-forget hook.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 13:06:10 +01:00
Patrik Oldsberg 89fd91eaf8 frontend-app-api: store bootstrap errors for app root
Route bootstrap finalization failures through an external store that re-enters React at app/root.children, and simplify prepared app finalization to use a success-only callback.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 13:06:10 +01:00
Patrik Oldsberg 12f809015f frontend-app-api: restore local prepare app state
Replace the consolidated runtime state object in prepareSpecializedApp with local variables so the control flow stays easier to follow while preserving the extracted helper modules.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 13:06:10 +01:00
Patrik Oldsberg d30aba815a frontend-app-api: extract prepared app phase apis
Move the phase-specific API proxies and tree initialization helpers out of prepareSpecializedApp so the remaining file can stay focused on bootstrap and finalization flow.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 13:06:10 +01:00
Patrik Oldsberg ca24aa2da9 frontend-app-api: extract prepared app predicates
Move predicate reference collection and predicate context loading out of prepareSpecializedApp so the session and finalization flow can focus on lifecycle state.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 13:06:10 +01:00
Patrik Oldsberg 01f5660fe7 frontend-app-api: split prepare and create app wiring
Move the phased specialized app lifecycle into prepareSpecializedApp.tsx and leave createSpecializedApp.tsx as the deprecated wrapper so the public entry points and their related types live alongside their own implementations.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 13:06:10 +01:00
Patrik Oldsberg 756e84eb9a frontend-app-api: capture sign-in through identity proxy
Let prepared apps observe sign-in completion through the bootstrap identity proxy instead of overriding the sign-in page component, and surface finalization failures back through the default app root.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 13:06:10 +01:00
Patrik Oldsberg ab3f15f3b3 frontend-app-api: share subtree instantiation logic
Move detached API discovery over to the same subtree instantiation traversal that powers the app tree so predicate handling and attachment traversal stay aligned in one place.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 13:05:46 +01:00
Patrik Oldsberg d7a44138d2 frontend-app-api: freeze materialized bootstrap APIs
Keep deferred API overrides only for bootstrap APIs that were never materialized, while reporting and ignoring overrides of implementations that were already used during bootstrap.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 13:05:39 +01:00