Skip to content

Commit 7e9d91a

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

File tree

11 files changed

+233
-7
lines changed

11 files changed

+233
-7
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

+64-5
Original file line numberDiff line numberDiff line change
@@ -6769,7 +6769,7 @@ __metadata:
67696769
languageName: node
67706770
linkType: hard
67716771

6772-
"@backstage/plugin-home-react@npm:^0.1.15, @backstage/plugin-home-react@npm:^0.1.16, @backstage/plugin-home-react@npm:^0.1.18":
6772+
"@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":
67736773
version: 0.1.18
67746774
resolution: "@backstage/plugin-home-react@npm:0.1.18"
67756775
dependencies:
@@ -6790,7 +6790,7 @@ __metadata:
67906790
languageName: node
67916791
linkType: hard
67926792

6793-
"@backstage/plugin-home@npm:^0.8.0":
6793+
"@backstage/plugin-home@npm:0.8.0, @backstage/plugin-home@npm:^0.8.0":
67946794
version: 0.8.0
67956795
resolution: "@backstage/plugin-home@npm:0.8.0"
67966796
dependencies:
@@ -15593,6 +15593,30 @@ __metadata:
1559315593
languageName: node
1559415594
linkType: hard
1559515595

15596+
"@red-hat-developer-hub/backstage-plugin-dynamic-home-page@npm:^1.0.0":
15597+
version: 1.0.0
15598+
resolution: "@red-hat-developer-hub/backstage-plugin-dynamic-home-page@npm:1.0.0"
15599+
dependencies:
15600+
"@backstage/core-components": 0.15.1
15601+
"@backstage/core-plugin-api": 1.10.0
15602+
"@backstage/plugin-catalog-react": 1.14.0
15603+
"@backstage/plugin-home": 0.8.0
15604+
"@backstage/plugin-home-react": 0.1.18
15605+
"@backstage/plugin-search-react": 1.8.1
15606+
"@backstage/theme": 0.6.0
15607+
"@mui/material": 5.16.7
15608+
"@mui/styles": 5.16.7
15609+
"@scalprum/react-core": 0.8.0
15610+
react-grid-layout: 1.4.4
15611+
react-use: 17.5.1
15612+
tss-react: 4.9.12
15613+
peerDependencies:
15614+
react: 16.13.1 || ^17.0.0 || ^18.2.0
15615+
react-router-dom: 6.26.2
15616+
checksum: 7b36cce6a50b60d80f8e3e957fd31051453d1de5d805e9d838ba4b36f8a7a95b26b63eed6e379e8d63fbdb9ca34ca46f99548d2c53568c69386eae4aa772adb7
15617+
languageName: node
15618+
linkType: hard
15619+
1559615620
"@redhat-developer/red-hat-developer-hub-theme@npm:0.4.0":
1559715621
version: 0.4.0
1559815622
resolution: "@redhat-developer/red-hat-developer-hub-theme@npm:0.4.0"
@@ -27826,6 +27850,13 @@ __metadata:
2782627850
languageName: node
2782727851
linkType: hard
2782827852

27853+
"fast-equals@npm:^4.0.3":
27854+
version: 4.0.3
27855+
resolution: "fast-equals@npm:4.0.3"
27856+
checksum: 3d5935b757f9f2993e59b5164a7a9eeda0de149760495375cde14a4ed725186a7e6c1c0d58f7d42d2f91deb97f3fce1e0aad5591916ef0984278199a85c87c87
27857+
languageName: node
27858+
linkType: hard
27859+
2782927860
"fast-fifo@npm:^1.1.0, fast-fifo@npm:^1.2.0":
2783027861
version: 1.3.2
2783127862
resolution: "fast-fifo@npm:1.3.2"
@@ -38662,7 +38693,7 @@ __metadata:
3866238693
languageName: node
3866338694
linkType: hard
3866438695

38665-
"react-draggable@npm:^4.0.0, react-draggable@npm:^4.0.3":
38696+
"react-draggable@npm:^4.0.0, react-draggable@npm:^4.0.3, react-draggable@npm:^4.4.5":
3866638697
version: 4.4.6
3866738698
resolution: "react-draggable@npm:4.4.6"
3866838699
dependencies:
@@ -38736,6 +38767,23 @@ __metadata:
3873638767
languageName: node
3873738768
linkType: hard
3873838769

38770+
"react-grid-layout@npm:1.4.4":
38771+
version: 1.4.4
38772+
resolution: "react-grid-layout@npm:1.4.4"
38773+
dependencies:
38774+
clsx: ^2.0.0
38775+
fast-equals: ^4.0.3
38776+
prop-types: ^15.8.1
38777+
react-draggable: ^4.4.5
38778+
react-resizable: ^3.0.5
38779+
resize-observer-polyfill: ^1.5.1
38780+
peerDependencies:
38781+
react: ">= 16.3.0"
38782+
react-dom: ">= 16.3.0"
38783+
checksum: 0d1d27d6ca58d5b7e9bf778f5d74e5a6353737980f86652b6a799a83b8683735d333f2a0d9b48e3186879da3eefd7f53a7db05a5149dfba27d9d124e5cd3f138
38784+
languageName: node
38785+
linkType: hard
38786+
3873938787
"react-helmet@npm:6.1.0":
3874038788
version: 6.1.0
3874138789
resolution: "react-helmet@npm:6.1.0"
@@ -39291,6 +39339,17 @@ __metadata:
3929139339
languageName: unknown
3929239340
linkType: soft
3929339341

39342+
"red-hat-developer-hub-backstage-plugin-dynamic-home-page@workspace:dynamic-plugins/wrappers/red-hat-developer-hub-backstage-plugin-dynamic-home-page":
39343+
version: 0.0.0-use.local
39344+
resolution: "red-hat-developer-hub-backstage-plugin-dynamic-home-page@workspace:dynamic-plugins/wrappers/red-hat-developer-hub-backstage-plugin-dynamic-home-page"
39345+
dependencies:
39346+
"@backstage/cli": 0.28.2
39347+
"@janus-idp/cli": 1.17.0
39348+
"@red-hat-developer-hub/backstage-plugin-dynamic-home-page": ^1.0.0
39349+
typescript: ^5.6.3
39350+
languageName: unknown
39351+
linkType: soft
39352+
3929439353
"redent@npm:^3.0.0":
3929539354
version: 3.0.0
3929639355
resolution: "redent@npm:3.0.0"
@@ -43184,7 +43243,7 @@ __metadata:
4318443243
languageName: node
4318543244
linkType: hard
4318643245

43187-
"typescript@npm:5.6.3":
43246+
"typescript@npm:5.6.3, typescript@npm:^5.6.3":
4318843247
version: 5.6.3
4318943248
resolution: "typescript@npm:5.6.3"
4319043249
bin:
@@ -43224,7 +43283,7 @@ __metadata:
4322443283
languageName: node
4322543284
linkType: hard
4322643285

43227-
"typescript@patch:[email protected]#~builtin<compat/typescript>":
43286+
"typescript@patch:[email protected]#~builtin<compat/typescript>, typescript@patch:typescript@^5.6.3#~builtin<compat/typescript>":
4322843287
version: 5.6.3
4322943288
resolution: "typescript@patch:typescript@npm%3A5.6.3#~builtin<compat/typescript>::version=5.6.3&hash=8c6c40"
4323043289
bin:

0 commit comments

Comments
 (0)