Skip to content

Commit

Permalink
refactor(homepage): add wrapper for rhdh plugin
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph Jerolimov <[email protected]>
  • Loading branch information
christoph-jerolimov committed Nov 19, 2024
1 parent 1b10d48 commit 4f818fa
Show file tree
Hide file tree
Showing 11 changed files with 231 additions and 5 deletions.
6 changes: 4 additions & 2 deletions .ibm/pipelines/value_files/values_showcase-rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,13 @@ global:
disabled: false
- package: ./dynamic-plugins/dist/red-hat-developer-hub-backstage-plugin-bulk-import
disabled: false
- package: ./dynamic-plugins/dist/red-hat-developer-hub-backstage-plugin-dynamic-home-page
disabled: true
# Enable tech-radar plugin.
- package: ./dynamic-plugins/dist/backstage-community-plugin-tech-radar
disabled: false
- package: ./dynamic-plugins/dist/backstage-community-plugin-tech-radar-backend-dynamic
disabled: true
- package: ./dynamic-plugins/dist/backstage-community-plugin-tech-radar-backend-dynamic
disabled: true
- package: ./dynamic-plugins/dist/backstage-community-plugin-rbac
disabled: false
- package: ./dynamic-plugins/dist/backstage-community-plugin-analytics-provider-segment
Expand Down
1 change: 1 addition & 0 deletions .rhdh/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ COPY $EXTERNAL_SOURCE_NESTED/dynamic-plugins/wrappers/roadiehq-backstage-plugin-
COPY $EXTERNAL_SOURCE_NESTED/dynamic-plugins/wrappers/roadiehq-backstage-plugin-argo-cd/package.json ./dynamic-plugins/wrappers/roadiehq-backstage-plugin-argo-cd/package.json
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
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
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
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
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
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
Expand Down
35 changes: 35 additions & 0 deletions app-config.dynamic-plugins.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,41 @@ dynamicPlugins:
menuItem:
icon: bulkImportIcon
text: Bulk import
red-hat-developer-hub.backstage-plugin-dynamic-home-page:
dynamicRoutes:
- path: /
importName: DynamicHomePage
mountPoints:
- mountPoint: home.page/cards
importName: SearchBar
config:
layouts:
xl: { w: 10, h: 1, x: 1 }
lg: { w: 10, h: 1, x: 1 }
md: { w: 10, h: 1, x: 1 }
sm: { w: 10, h: 1, x: 1 }
xs: { w: 12, h: 1 }
xxs: { w: 12, h: 1 }
- mountPoint: home.page/cards
importName: QuickAccessCard
config:
layouts:
xl: { w: 7, h: 8 }
lg: { w: 7, h: 8 }
md: { w: 7, h: 8 }
sm: { w: 12, h: 8 }
xs: { w: 12, h: 8 }
xxs: { w: 12, h: 8 }
- mountPoint: home.page/cards
importName: CatalogStarredEntitiesCard
config:
layouts:
xl: { w: 5, h: 4, x: 7 }
lg: { w: 5, h: 4, x: 7 }
md: { w: 5, h: 4, x: 7 }
sm: { w: 12, h: 4 }
xs: { w: 12, h: 4 }
xxs: { w: 12, h: 4 }
backstage-community.plugin-tekton:
mountPoints:
- mountPoint: entity.page.ci/cards
Expand Down
1 change: 1 addition & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ COPY $EXTERNAL_SOURCE_NESTED/dynamic-plugins/wrappers/roadiehq-backstage-plugin-
COPY $EXTERNAL_SOURCE_NESTED/dynamic-plugins/wrappers/roadiehq-backstage-plugin-argo-cd/package.json ./dynamic-plugins/wrappers/roadiehq-backstage-plugin-argo-cd/package.json
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
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
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
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
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
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
Expand Down
42 changes: 42 additions & 0 deletions dynamic-plugins.default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,48 @@ plugins:
icon: bulkImportIcon
text: Bulk import

# Homepage
- package: ./dynamic-plugins/dist/red-hat-developer-hub-backstage-plugin-dynamic-home-page
disabled: false
pluginConfig:
dynamicPlugins:
frontend:
red-hat-developer-hub.backstage-plugin-dynamic-home-page:
dynamicRoutes:
- path: /
importName: DynamicHomePage
mountPoints:
- mountPoint: home.page/cards
importName: SearchBar
config:
layouts:
xl: { w: 10, h: 1, x: 1 }
lg: { w: 10, h: 1, x: 1 }
md: { w: 10, h: 1, x: 1 }
sm: { w: 10, h: 1, x: 1 }
xs: { w: 12, h: 1 }
xxs: { w: 12, h: 1 }
- mountPoint: home.page/cards
importName: QuickAccessCard
config:
layouts:
xl: { w: 7, h: 8 }
lg: { w: 7, h: 8 }
md: { w: 7, h: 8 }
sm: { w: 12, h: 8 }
xs: { w: 12, h: 8 }
xxs: { w: 12, h: 8 }
- mountPoint: home.page/cards
importName: CatalogStarredEntitiesCard
config:
layouts:
xl: { w: 5, h: 4, x: 7 }
lg: { w: 5, h: 4, x: 7 }
md: { w: 5, h: 4, x: 7 }
sm: { w: 12, h: 4 }
xs: { w: 12, h: 4 }
xxs: { w: 12, h: 4 }

# Techdocs
- package: ./dynamic-plugins/dist/backstage-plugin-techdocs-backend-dynamic
disabled: false
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
"name": "red-hat-developer-hub-backstage-plugin-dynamic-home-page",
"version": "1.0.0",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
"publishConfig": {
"access": "public",
"main": "dist/index.cjs.js",
"types": "dist/index.d.ts"
},
"backstage": {
"role": "frontend-plugin",
"supported-versions": "1.32.5",
"pluginId": "red-hat-developer-hub-backstage-plugin-dynamic-home-page",
"pluginPackages": [
"red-hat-developer-hub-backstage-plugin-dynamic-home-page"
]
},
"sideEffects": false,
"scripts": {
"tsc": "tsc",
"build": "backstage-cli package build",
"lint": "backstage-cli package lint",
"test": "backstage-cli package test --passWithNoTests --coverage",
"clean": "backstage-cli package clean",
"export-dynamic": "janus-cli package export-dynamic-plugin --in-place",
"export-dynamic:clean": "janus-cli package export-dynamic-plugin --in-place --clean"
},
"dependencies": {
"@red-hat-developer-hub/backstage-plugin-dynamic-home-page": "^1.0.0"
},
"devDependencies": {
"@backstage/cli": "0.28.2",
"@janus-idp/cli": "1.17.0",
"typescript": "^5.6.3"
},
"files": [
"dist",
"dist-scalprum"
],
"scalprum": {
"name": "red-hat-developer-hub.backstage-plugin-dynamic-home-page",
"exposedModules": {
"PluginRoot": "./src/index.ts"
}
},
"repository": {
"type": "git",
"url": "https://github.com/janus-idp/backstage-showcase",
"directory": "dynamic-plugins/wrappers/red-hat-developer-hub-backstage-plugin-dynamic-home-page"
},
"maintainers": [
"@janus-idp/maintainers-showcase"
],
"author": "Red Hat",
"homepage": "https://red.ht/rhdh",
"bugs": "https://issues.redhat.com/browse/RHIDP",
"keywords": [
"support:production",
"lifecycle:active"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from '@red-hat-developer-hub/backstage-plugin-dynamic-home-page';

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "@backstage/cli/config/tsconfig.json",
"include": ["src", "dev", "migrations"],
"exclude": ["node_modules"],
"compilerOptions": {
"outDir": "../../../dist-types/dynamic-plugins/wrappers/red-hat-developer-hub-backstage-plugin-dynamic-home-page",
"rootDir": "."
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": ["//"],
"tasks": {
"tsc": {
"outputs": [
"../../../dist-types/dynamic-plugins/wrappers/red-hat-developer-hub-backstage-plugin-dynamic-home-page/**"
]
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ export const InternalPluginsMap: Record<string, string> = {
'./dynamic-plugins/dist/red-hat-developer-hub-backstage-plugin-bulk-import-backend-dynamic',
'red-hat-developer-hub-backstage-plugin-bulk-import':
'./dynamic-plugins/dist/red-hat-developer-hub-backstage-plugin-bulk-import',
'red-hat-developer-hub-backstage-plugin-dynamic-home-page':
'./dynamic-plugins/dist/red-hat-developer-hub-backstage-plugin-dynamic-home-page',
'backstage-plugin-techdocs-backend-dynamic':
'./dynamic-plugins/dist/backstage-plugin-techdocs-backend-dynamic',
'backstage-plugin-techdocs':
Expand Down
65 changes: 62 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6790,7 +6790,7 @@ __metadata:
languageName: node
linkType: hard

"@backstage/plugin-home-react@npm:^0.1.15, @backstage/plugin-home-react@npm:^0.1.16, @backstage/plugin-home-react@npm:^0.1.18":
"@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":
version: 0.1.18
resolution: "@backstage/plugin-home-react@npm:0.1.18"
dependencies:
Expand All @@ -6811,7 +6811,7 @@ __metadata:
languageName: node
linkType: hard

"@backstage/plugin-home@npm:^0.8.0":
"@backstage/plugin-home@npm:0.8.0, @backstage/plugin-home@npm:^0.8.0":
version: 0.8.0
resolution: "@backstage/plugin-home@npm:0.8.0"
dependencies:
Expand Down Expand Up @@ -15755,6 +15755,30 @@ __metadata:
languageName: node
linkType: hard

"@red-hat-developer-hub/backstage-plugin-dynamic-home-page@npm:^1.0.0":
version: 1.0.0
resolution: "@red-hat-developer-hub/backstage-plugin-dynamic-home-page@npm:1.0.0"
dependencies:
"@backstage/core-components": 0.15.1
"@backstage/core-plugin-api": 1.10.0
"@backstage/plugin-catalog-react": 1.14.0
"@backstage/plugin-home": 0.8.0
"@backstage/plugin-home-react": 0.1.18
"@backstage/plugin-search-react": 1.8.1
"@backstage/theme": 0.6.0
"@mui/material": 5.16.7
"@mui/styles": 5.16.7
"@scalprum/react-core": 0.8.0
react-grid-layout: 1.4.4
react-use: 17.5.1
tss-react: 4.9.12
peerDependencies:
react: 16.13.1 || ^17.0.0 || ^18.2.0
react-router-dom: 6.26.2
checksum: 7b36cce6a50b60d80f8e3e957fd31051453d1de5d805e9d838ba4b36f8a7a95b26b63eed6e379e8d63fbdb9ca34ca46f99548d2c53568c69386eae4aa772adb7
languageName: node
linkType: hard

"@redhat-developer/red-hat-developer-hub-theme@npm:0.4.0":
version: 0.4.0
resolution: "@redhat-developer/red-hat-developer-hub-theme@npm:0.4.0"
Expand Down Expand Up @@ -28310,6 +28334,13 @@ __metadata:
languageName: node
linkType: hard

"fast-equals@npm:^4.0.3":
version: 4.0.3
resolution: "fast-equals@npm:4.0.3"
checksum: 3d5935b757f9f2993e59b5164a7a9eeda0de149760495375cde14a4ed725186a7e6c1c0d58f7d42d2f91deb97f3fce1e0aad5591916ef0984278199a85c87c87
languageName: node
linkType: hard

"fast-fifo@npm:^1.1.0, fast-fifo@npm:^1.2.0":
version: 1.3.2
resolution: "fast-fifo@npm:1.3.2"
Expand Down Expand Up @@ -39153,7 +39184,7 @@ __metadata:
languageName: node
linkType: hard

"react-draggable@npm:^4.0.0, react-draggable@npm:^4.0.3":
"react-draggable@npm:^4.0.0, react-draggable@npm:^4.0.3, react-draggable@npm:^4.4.5":
version: 4.4.6
resolution: "react-draggable@npm:4.4.6"
dependencies:
Expand Down Expand Up @@ -39227,6 +39258,23 @@ __metadata:
languageName: node
linkType: hard

"react-grid-layout@npm:1.4.4":
version: 1.4.4
resolution: "react-grid-layout@npm:1.4.4"
dependencies:
clsx: ^2.0.0
fast-equals: ^4.0.3
prop-types: ^15.8.1
react-draggable: ^4.4.5
react-resizable: ^3.0.5
resize-observer-polyfill: ^1.5.1
peerDependencies:
react: ">= 16.3.0"
react-dom: ">= 16.3.0"
checksum: 0d1d27d6ca58d5b7e9bf778f5d74e5a6353737980f86652b6a799a83b8683735d333f2a0d9b48e3186879da3eefd7f53a7db05a5149dfba27d9d124e5cd3f138
languageName: node
linkType: hard

"react-helmet@npm:6.1.0":
version: 6.1.0
resolution: "react-helmet@npm:6.1.0"
Expand Down Expand Up @@ -39782,6 +39830,17 @@ __metadata:
languageName: unknown
linkType: soft

"red-hat-developer-hub-backstage-plugin-dynamic-home-page@workspace:dynamic-plugins/wrappers/red-hat-developer-hub-backstage-plugin-dynamic-home-page":
version: 0.0.0-use.local
resolution: "red-hat-developer-hub-backstage-plugin-dynamic-home-page@workspace:dynamic-plugins/wrappers/red-hat-developer-hub-backstage-plugin-dynamic-home-page"
dependencies:
"@backstage/cli": 0.28.2
"@janus-idp/cli": 1.17.0
"@red-hat-developer-hub/backstage-plugin-dynamic-home-page": ^1.0.0
typescript: ^5.6.3
languageName: unknown
linkType: soft

"redent@npm:^3.0.0":
version: 3.0.0
resolution: "redent@npm:3.0.0"
Expand Down

0 comments on commit 4f818fa

Please sign in to comment.