Commit a5a1846
feat(homepage): add permission-aware default cards backend (#2855)
* chore(homepage): create backend plugin
Signed-off-by: Christoph Jerolimov <jerolimov+git@redhat.com>
* chore(homepage): remove upstream patch
Signed-off-by: Christoph Jerolimov <jerolimov+git@redhat.com>
* chore(homepage): update theme, use RHDH icon and include RBAC plugin
Signed-off-by: Christoph Jerolimov <jerolimov+git@redhat.com>
* feat(homepage): add permission-aware default cards backend with frontend client
Add a default-cards feature that reads a recursive card tree from app-config.yaml,
evaluates per-node visibility rules (users, groups, permissions — OR semantics),
and returns the filtered leaf cards to the frontend. Adds a homepage-common
package for shared types, a DefaultCardsApiClient in the frontend plugin and
registers it in both the legacy and NFS extension systems.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Christoph Jerolimov <jerolimov+git@redhat.com>
* chore(homepage): update package.json
Signed-off-by: Christoph Jerolimov <jerolimov+git@redhat.com>
* chore(homepage): update report apis
Signed-off-by: Christoph Jerolimov <jerolimov+git@redhat.com>
* feat(homepage): add titleKey/descriptionKey and rename visibility to if
Add i18n support fields (titleKey, descriptionKey) to CardNode and
VisibleCard, and rename the visibility field to if to align with
Backstage API conventions.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Christoph Jerolimov <jerolimov+git@redhat.com>
* feat(homepage): add resource-based permission for default cards
Add a dedicated homepage-default-card resource type with a HAS_CARD_ID
rule so that RBAC policies can apply conditions to individual cards.
Register via addResourceType instead of addPermissions.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Christoph Jerolimov <jerolimov+git@redhat.com>
* chore(homepage): add dist-dynamic to .prettierignore
Signed-off-by: Christoph Jerolimov <jerolimov+git@redhat.com>
* chore(homepage): add *.local.json to .gitignore
Signed-off-by: Christoph Jerolimov <jerolimov+git@redhat.com>
* refactor(homepage): rename defaultCards to defaultWidgets and simplify card config
- Rename defaultCards → defaultWidgets across config, types, API, backend
service, routes, permissions, and tests
- Remove label, title, titleKey, description, descriptionKey, priority
from card/widget node config; replace with generic props attribute
- Add debug pages for viewing available and default widgets
- Switch from js-yaml to yaml package
- Export defaultWidgetsApiRef from the dynamic-home-page plugin
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Christoph Jerolimov <jerolimov+git@redhat.com>
* refactor(homepage): make ref required and rename Card types to DefaultWidget
Add `ref` as optional string on DefaultWidgetNode and required string on
VisibleDefaultWidget. Rename CardVisibility to DefaultWidgetVisibility,
CardNode to DefaultWidgetNode, and VisibleCard to VisibleDefaultWidget
to align naming with the defaultWidgets domain.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Christoph Jerolimov <jerolimov+git@redhat.com>
* chore(homepage): fix unit tests
Signed-off-by: Christoph Jerolimov <jerolimov+git@redhat.com>
* refactor(homepage): remove customizable flag and rename layouts to layout
Drop the `customizable` config option and its plumbing through the
backend service, types, and tests. Also add `ref` field and rename
`layouts` to `layout` in the app-config for consistency.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Christoph Jerolimov <jerolimov+git@redhat.com>
* feat(homepage): load default widgets from backend API
Add API-driven grid components that fetch default widget configuration
from the backend when configured in app-config, falling back to
mount-point-only behavior when no default widgets are configured.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Christoph Jerolimov <jerolimov+git@redhat.com>
* refactor(homepage): rename card to widget in permission resources
Rename homepageDefaultCardPermissionResourceRef to
homepageDefaultWidgetPermissionResourceRef and hasCardId rule to
hasWidgetId for consistency with the widget terminology.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Christoph Jerolimov <jerolimov+git@redhat.com>
* chore(homepage): remove homepage customizable
Signed-off-by: Christoph Jerolimov <jerolimov+git@redhat.com>
* chore(homepage): update knip-reports
Signed-off-by: Christoph Jerolimov <jerolimov+git@redhat.com>
* fix customizable card rendering and e2e tests
---------
Signed-off-by: Christoph Jerolimov <jerolimov+git@redhat.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Karthik <karthik.jk11@gmail.com>1 parent d9df5b8 commit a5a1846
72 files changed
Lines changed: 5090 additions & 639 deletions
File tree
- workspaces/homepage
- .changeset
- .yarn/patches
- packages
- app-legacy
- src
- components
- Root
- homepage
- app
- e2e-tests
- pages
- backend
- src
- plugins
- dynamic-home-page
- src
- alpha
- extensions
- api
- components
- hooks
- utils
- homepage-backend
- dev
- src
- defaultWidgets
- permissions
- services
- homepage-common
- src
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
Lines changed: 0 additions & 13 deletions
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
| 3 | + | |
| 4 | + | |
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
84 | 144 | | |
85 | 145 | | |
86 | 146 | | |
| |||
184 | 244 | | |
185 | 245 | | |
186 | 246 | | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
| |||
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
61 | | - | |
62 | | - | |
| 62 | + | |
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
9 | 8 | | |
10 | | - | |
| 9 | + | |
11 | 10 | | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
18 | 18 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
51 | | - | |
| 52 | + | |
52 | 53 | | |
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
56 | | - | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
57 | 60 | | |
58 | 61 | | |
59 | 62 | | |
| |||
0 commit comments