Skip to content

Commit c6e316b

Browse files
refactor(homepage): add wrapper for rhdh plugin
Signed-off-by: Christoph Jerolimov <[email protected]>
1 parent a145550 commit c6e316b

File tree

11 files changed

+231
-5
lines changed

11 files changed

+231
-5
lines changed

.ibm/pipelines/value_files/values_showcase-rbac.yaml

+4-2
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,13 @@ global:
9696
disabled: false
9797
- package: ./dynamic-plugins/dist/red-hat-developer-hub-backstage-plugin-bulk-import
9898
disabled: false
99+
- package: ./dynamic-plugins/dist/red-hat-developer-hub-backstage-plugin-dynamic-home-page
100+
disabled: true
99101
# Enable tech-radar plugin.
100102
- package: ./dynamic-plugins/dist/backstage-community-plugin-tech-radar
101103
disabled: false
102-
- package: ./dynamic-plugins/dist/backstage-community-plugin-tech-radar-backend-dynamic
103-
disabled: true
104+
- package: ./dynamic-plugins/dist/backstage-community-plugin-tech-radar-backend-dynamic
105+
disabled: true
104106
- package: ./dynamic-plugins/dist/backstage-community-plugin-rbac
105107
disabled: false
106108
- package: ./dynamic-plugins/dist/backstage-community-plugin-analytics-provider-segment

.rhdh/docker/Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ COPY $EXTERNAL_SOURCE_NESTED/dynamic-plugins/wrappers/roadiehq-backstage-plugin-
7575
COPY $EXTERNAL_SOURCE_NESTED/dynamic-plugins/wrappers/roadiehq-backstage-plugin-argo-cd/package.json ./dynamic-plugins/wrappers/roadiehq-backstage-plugin-argo-cd/package.json
7676
COPY $EXTERNAL_SOURCE_NESTED/dynamic-plugins/wrappers/roadiehq-backstage-plugin-argo-cd-backend-dynamic/package.json ./dynamic-plugins/wrappers/roadiehq-backstage-plugin-argo-cd-backend-dynamic/package.json
7777
COPY $EXTERNAL_SOURCE_NESTED/dynamic-plugins/wrappers/roadiehq-backstage-plugin-argo-cd-backend-dynamic/dist-dynamic/package.json ./dynamic-plugins/wrappers/roadiehq-backstage-plugin-argo-cd-backend-dynamic/dist-dynamic/package.json
78+
COPY $EXTERNAL_SOURCE_NESTED/dynamic-plugins/wrappers/red-hat-developer-hub-backstage-plugin-dynamic-home-page/package.json ./dynamic-plugins/wrappers/red-hat-developer-hub-backstage-plugin-dynamic-home-page/package.json
7879
COPY $EXTERNAL_SOURCE_NESTED/dynamic-plugins/wrappers/red-hat-developer-hub-backstage-plugin-bulk-import/package.json ./dynamic-plugins/wrappers/red-hat-developer-hub-backstage-plugin-bulk-import/package.json
7980
COPY $EXTERNAL_SOURCE_NESTED/dynamic-plugins/wrappers/red-hat-developer-hub-backstage-plugin-bulk-import-backend-dynamic/package.json ./dynamic-plugins/wrappers/red-hat-developer-hub-backstage-plugin-bulk-import-backend-dynamic/package.json
8081
COPY $EXTERNAL_SOURCE_NESTED/dynamic-plugins/wrappers/red-hat-developer-hub-backstage-plugin-bulk-import-backend-dynamic/dist-dynamic/package.json ./dynamic-plugins/wrappers/red-hat-developer-hub-backstage-plugin-bulk-import-backend-dynamic/dist-dynamic/package.json

app-config.dynamic-plugins.yaml

+35
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,41 @@ dynamicPlugins:
251251
menuItem:
252252
icon: bulkImportIcon
253253
text: Bulk import
254+
red-hat-developer-hub.backstage-plugin-dynamic-home-page:
255+
dynamicRoutes:
256+
- path: /
257+
importName: DynamicHomePage
258+
mountPoints:
259+
- mountPoint: home.page/cards
260+
importName: SearchBar
261+
config:
262+
layouts:
263+
xl: { w: 10, h: 1, x: 1 }
264+
lg: { w: 10, h: 1, x: 1 }
265+
md: { w: 10, h: 1, x: 1 }
266+
sm: { w: 10, h: 1, x: 1 }
267+
xs: { w: 12, h: 1 }
268+
xxs: { w: 12, h: 1 }
269+
- mountPoint: home.page/cards
270+
importName: QuickAccessCard
271+
config:
272+
layouts:
273+
xl: { w: 7, h: 8 }
274+
lg: { w: 7, h: 8 }
275+
md: { w: 7, h: 8 }
276+
sm: { w: 12, h: 8 }
277+
xs: { w: 12, h: 8 }
278+
xxs: { w: 12, h: 8 }
279+
- mountPoint: home.page/cards
280+
importName: CatalogStarredEntitiesCard
281+
config:
282+
layouts:
283+
xl: { w: 5, h: 4, x: 7 }
284+
lg: { w: 5, h: 4, x: 7 }
285+
md: { w: 5, h: 4, x: 7 }
286+
sm: { w: 12, h: 4 }
287+
xs: { w: 12, h: 4 }
288+
xxs: { w: 12, h: 4 }
254289
backstage-community.plugin-tekton:
255290
mountPoints:
256291
- mountPoint: entity.page.ci/cards

docker/Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ COPY $EXTERNAL_SOURCE_NESTED/dynamic-plugins/wrappers/roadiehq-backstage-plugin-
7676
COPY $EXTERNAL_SOURCE_NESTED/dynamic-plugins/wrappers/roadiehq-backstage-plugin-argo-cd/package.json ./dynamic-plugins/wrappers/roadiehq-backstage-plugin-argo-cd/package.json
7777
COPY $EXTERNAL_SOURCE_NESTED/dynamic-plugins/wrappers/roadiehq-backstage-plugin-argo-cd-backend-dynamic/package.json ./dynamic-plugins/wrappers/roadiehq-backstage-plugin-argo-cd-backend-dynamic/package.json
7878
COPY $EXTERNAL_SOURCE_NESTED/dynamic-plugins/wrappers/roadiehq-backstage-plugin-argo-cd-backend-dynamic/dist-dynamic/package.json ./dynamic-plugins/wrappers/roadiehq-backstage-plugin-argo-cd-backend-dynamic/dist-dynamic/package.json
79+
COPY $EXTERNAL_SOURCE_NESTED/dynamic-plugins/wrappers/red-hat-developer-hub-backstage-plugin-dynamic-home-page/package.json ./dynamic-plugins/wrappers/red-hat-developer-hub-backstage-plugin-dynamic-home-page/package.json
7980
COPY $EXTERNAL_SOURCE_NESTED/dynamic-plugins/wrappers/red-hat-developer-hub-backstage-plugin-bulk-import/package.json ./dynamic-plugins/wrappers/red-hat-developer-hub-backstage-plugin-bulk-import/package.json
8081
COPY $EXTERNAL_SOURCE_NESTED/dynamic-plugins/wrappers/red-hat-developer-hub-backstage-plugin-bulk-import-backend-dynamic/package.json ./dynamic-plugins/wrappers/red-hat-developer-hub-backstage-plugin-bulk-import-backend-dynamic/package.json
8182
COPY $EXTERNAL_SOURCE_NESTED/dynamic-plugins/wrappers/red-hat-developer-hub-backstage-plugin-bulk-import-backend-dynamic/dist-dynamic/package.json ./dynamic-plugins/wrappers/red-hat-developer-hub-backstage-plugin-bulk-import-backend-dynamic/dist-dynamic/package.json

dynamic-plugins.default.yaml

+42
Original file line numberDiff line numberDiff line change
@@ -523,6 +523,48 @@ plugins:
523523
icon: bulkImportIcon
524524
text: Bulk import
525525

526+
# Homepage
527+
- package: ./dynamic-plugins/dist/red-hat-developer-hub-backstage-plugin-dynamic-home-page
528+
disabled: false
529+
pluginConfig:
530+
dynamicPlugins:
531+
frontend:
532+
red-hat-developer-hub.backstage-plugin-dynamic-home-page:
533+
dynamicRoutes:
534+
- path: /
535+
importName: DynamicHomePage
536+
mountPoints:
537+
- mountPoint: home.page/cards
538+
importName: SearchBar
539+
config:
540+
layouts:
541+
xl: { w: 10, h: 1, x: 1 }
542+
lg: { w: 10, h: 1, x: 1 }
543+
md: { w: 10, h: 1, x: 1 }
544+
sm: { w: 10, h: 1, x: 1 }
545+
xs: { w: 12, h: 1 }
546+
xxs: { w: 12, h: 1 }
547+
- mountPoint: home.page/cards
548+
importName: QuickAccessCard
549+
config:
550+
layouts:
551+
xl: { w: 7, h: 8 }
552+
lg: { w: 7, h: 8 }
553+
md: { w: 7, h: 8 }
554+
sm: { w: 12, h: 8 }
555+
xs: { w: 12, h: 8 }
556+
xxs: { w: 12, h: 8 }
557+
- mountPoint: home.page/cards
558+
importName: CatalogStarredEntitiesCard
559+
config:
560+
layouts:
561+
xl: { w: 5, h: 4, x: 7 }
562+
lg: { w: 5, h: 4, x: 7 }
563+
md: { w: 5, h: 4, x: 7 }
564+
sm: { w: 12, h: 4 }
565+
xs: { w: 12, h: 4 }
566+
xxs: { w: 12, h: 4 }
567+
526568
# Techdocs
527569
- package: ./dynamic-plugins/dist/backstage-plugin-techdocs-backend-dynamic
528570
disabled: false
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
{
2+
"name": "red-hat-developer-hub-backstage-plugin-dynamic-home-page",
3+
"version": "1.0.0",
4+
"main": "src/index.ts",
5+
"types": "src/index.ts",
6+
"license": "Apache-2.0",
7+
"publishConfig": {
8+
"access": "public",
9+
"main": "dist/index.cjs.js",
10+
"types": "dist/index.d.ts"
11+
},
12+
"backstage": {
13+
"role": "frontend-plugin",
14+
"supported-versions": "1.32.5",
15+
"pluginId": "red-hat-developer-hub-backstage-plugin-dynamic-home-page",
16+
"pluginPackages": [
17+
"red-hat-developer-hub-backstage-plugin-dynamic-home-page"
18+
]
19+
},
20+
"sideEffects": false,
21+
"scripts": {
22+
"tsc": "tsc",
23+
"build": "backstage-cli package build",
24+
"lint": "backstage-cli package lint",
25+
"test": "backstage-cli package test --passWithNoTests --coverage",
26+
"clean": "backstage-cli package clean",
27+
"export-dynamic": "janus-cli package export-dynamic-plugin --in-place",
28+
"export-dynamic:clean": "janus-cli package export-dynamic-plugin --in-place --clean"
29+
},
30+
"dependencies": {
31+
"@red-hat-developer-hub/backstage-plugin-dynamic-home-page": "^1.0.0"
32+
},
33+
"devDependencies": {
34+
"@backstage/cli": "0.28.2",
35+
"@janus-idp/cli": "1.17.0",
36+
"typescript": "^5.6.3"
37+
},
38+
"files": [
39+
"dist",
40+
"dist-scalprum"
41+
],
42+
"scalprum": {
43+
"name": "red-hat-developer-hub.backstage-plugin-dynamic-home-page",
44+
"exposedModules": {
45+
"PluginRoot": "./src/index.ts"
46+
}
47+
},
48+
"repository": {
49+
"type": "git",
50+
"url": "https://github.com/janus-idp/backstage-showcase",
51+
"directory": "dynamic-plugins/wrappers/red-hat-developer-hub-backstage-plugin-dynamic-home-page"
52+
},
53+
"maintainers": [
54+
"@janus-idp/maintainers-showcase"
55+
],
56+
"author": "Red Hat",
57+
"homepage": "https://red.ht/rhdh",
58+
"bugs": "https://issues.redhat.com/browse/RHIDP",
59+
"keywords": [
60+
"support:production",
61+
"lifecycle:active"
62+
]
63+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export * from '@red-hat-developer-hub/backstage-plugin-dynamic-home-page';
2+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"extends": "@backstage/cli/config/tsconfig.json",
3+
"include": ["src", "dev", "migrations"],
4+
"exclude": ["node_modules"],
5+
"compilerOptions": {
6+
"outDir": "../../../dist-types/dynamic-plugins/wrappers/red-hat-developer-hub-backstage-plugin-dynamic-home-page",
7+
"rootDir": "."
8+
}
9+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"extends": ["//"],
3+
"tasks": {
4+
"tsc": {
5+
"outputs": [
6+
"../../../dist-types/dynamic-plugins/wrappers/red-hat-developer-hub-backstage-plugin-dynamic-home-page/**"
7+
]
8+
}
9+
}
10+
}

plugins/dynamic-plugins-info/src/components/InternalPluginsMap.ts

+2
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ export const InternalPluginsMap: Record<string, string> = {
6363
'./dynamic-plugins/dist/red-hat-developer-hub-backstage-plugin-bulk-import-backend-dynamic',
6464
'red-hat-developer-hub-backstage-plugin-bulk-import':
6565
'./dynamic-plugins/dist/red-hat-developer-hub-backstage-plugin-bulk-import',
66+
'red-hat-developer-hub-backstage-plugin-dynamic-home-page':
67+
'./dynamic-plugins/dist/red-hat-developer-hub-backstage-plugin-dynamic-home-page',
6668
'backstage-plugin-techdocs-backend-dynamic':
6769
'./dynamic-plugins/dist/backstage-plugin-techdocs-backend-dynamic',
6870
'backstage-plugin-techdocs':

yarn.lock

+62-3
Original file line numberDiff line numberDiff line change
@@ -6790,7 +6790,7 @@ __metadata:
67906790
languageName: node
67916791
linkType: hard
67926792

6793-
"@backstage/plugin-home-react@npm:^0.1.15, @backstage/plugin-home-react@npm:^0.1.16, @backstage/plugin-home-react@npm:^0.1.18":
6793+
"@backstage/plugin-home-react@npm:0.1.18, @backstage/plugin-home-react@npm:^0.1.15, @backstage/plugin-home-react@npm:^0.1.16, @backstage/plugin-home-react@npm:^0.1.18":
67946794
version: 0.1.18
67956795
resolution: "@backstage/plugin-home-react@npm:0.1.18"
67966796
dependencies:
@@ -6811,7 +6811,7 @@ __metadata:
68116811
languageName: node
68126812
linkType: hard
68136813

6814-
"@backstage/plugin-home@npm:^0.8.0":
6814+
"@backstage/plugin-home@npm:0.8.0, @backstage/plugin-home@npm:^0.8.0":
68156815
version: 0.8.0
68166816
resolution: "@backstage/plugin-home@npm:0.8.0"
68176817
dependencies:
@@ -15755,6 +15755,30 @@ __metadata:
1575515755
languageName: node
1575615756
linkType: hard
1575715757

15758+
"@red-hat-developer-hub/backstage-plugin-dynamic-home-page@npm:^1.0.0":
15759+
version: 1.0.0
15760+
resolution: "@red-hat-developer-hub/backstage-plugin-dynamic-home-page@npm:1.0.0"
15761+
dependencies:
15762+
"@backstage/core-components": 0.15.1
15763+
"@backstage/core-plugin-api": 1.10.0
15764+
"@backstage/plugin-catalog-react": 1.14.0
15765+
"@backstage/plugin-home": 0.8.0
15766+
"@backstage/plugin-home-react": 0.1.18
15767+
"@backstage/plugin-search-react": 1.8.1
15768+
"@backstage/theme": 0.6.0
15769+
"@mui/material": 5.16.7
15770+
"@mui/styles": 5.16.7
15771+
"@scalprum/react-core": 0.8.0
15772+
react-grid-layout: 1.4.4
15773+
react-use: 17.5.1
15774+
tss-react: 4.9.12
15775+
peerDependencies:
15776+
react: 16.13.1 || ^17.0.0 || ^18.2.0
15777+
react-router-dom: 6.26.2
15778+
checksum: 7b36cce6a50b60d80f8e3e957fd31051453d1de5d805e9d838ba4b36f8a7a95b26b63eed6e379e8d63fbdb9ca34ca46f99548d2c53568c69386eae4aa772adb7
15779+
languageName: node
15780+
linkType: hard
15781+
1575815782
"@redhat-developer/red-hat-developer-hub-theme@npm:0.4.0":
1575915783
version: 0.4.0
1576015784
resolution: "@redhat-developer/red-hat-developer-hub-theme@npm:0.4.0"
@@ -28310,6 +28334,13 @@ __metadata:
2831028334
languageName: node
2831128335
linkType: hard
2831228336

28337+
"fast-equals@npm:^4.0.3":
28338+
version: 4.0.3
28339+
resolution: "fast-equals@npm:4.0.3"
28340+
checksum: 3d5935b757f9f2993e59b5164a7a9eeda0de149760495375cde14a4ed725186a7e6c1c0d58f7d42d2f91deb97f3fce1e0aad5591916ef0984278199a85c87c87
28341+
languageName: node
28342+
linkType: hard
28343+
2831328344
"fast-fifo@npm:^1.1.0, fast-fifo@npm:^1.2.0":
2831428345
version: 1.3.2
2831528346
resolution: "fast-fifo@npm:1.3.2"
@@ -39153,7 +39184,7 @@ __metadata:
3915339184
languageName: node
3915439185
linkType: hard
3915539186

39156-
"react-draggable@npm:^4.0.0, react-draggable@npm:^4.0.3":
39187+
"react-draggable@npm:^4.0.0, react-draggable@npm:^4.0.3, react-draggable@npm:^4.4.5":
3915739188
version: 4.4.6
3915839189
resolution: "react-draggable@npm:4.4.6"
3915939190
dependencies:
@@ -39227,6 +39258,23 @@ __metadata:
3922739258
languageName: node
3922839259
linkType: hard
3922939260

39261+
"react-grid-layout@npm:1.4.4":
39262+
version: 1.4.4
39263+
resolution: "react-grid-layout@npm:1.4.4"
39264+
dependencies:
39265+
clsx: ^2.0.0
39266+
fast-equals: ^4.0.3
39267+
prop-types: ^15.8.1
39268+
react-draggable: ^4.4.5
39269+
react-resizable: ^3.0.5
39270+
resize-observer-polyfill: ^1.5.1
39271+
peerDependencies:
39272+
react: ">= 16.3.0"
39273+
react-dom: ">= 16.3.0"
39274+
checksum: 0d1d27d6ca58d5b7e9bf778f5d74e5a6353737980f86652b6a799a83b8683735d333f2a0d9b48e3186879da3eefd7f53a7db05a5149dfba27d9d124e5cd3f138
39275+
languageName: node
39276+
linkType: hard
39277+
3923039278
"react-helmet@npm:6.1.0":
3923139279
version: 6.1.0
3923239280
resolution: "react-helmet@npm:6.1.0"
@@ -39782,6 +39830,17 @@ __metadata:
3978239830
languageName: unknown
3978339831
linkType: soft
3978439832

39833+
"red-hat-developer-hub-backstage-plugin-dynamic-home-page@workspace:dynamic-plugins/wrappers/red-hat-developer-hub-backstage-plugin-dynamic-home-page":
39834+
version: 0.0.0-use.local
39835+
resolution: "red-hat-developer-hub-backstage-plugin-dynamic-home-page@workspace:dynamic-plugins/wrappers/red-hat-developer-hub-backstage-plugin-dynamic-home-page"
39836+
dependencies:
39837+
"@backstage/cli": 0.28.2
39838+
"@janus-idp/cli": 1.17.0
39839+
"@red-hat-developer-hub/backstage-plugin-dynamic-home-page": ^1.0.0
39840+
typescript: ^5.6.3
39841+
languageName: unknown
39842+
linkType: soft
39843+
3978539844
"redent@npm:^3.0.0":
3978639845
version: 3.0.0
3978739846
resolution: "redent@npm:3.0.0"

0 commit comments

Comments
 (0)