Skip to content

Commit abc7289

Browse files
debsmita1HusneShabbir
andauthored
feat(homepage): migrate dynamic homepage to nfs (#2423)
* move homepage app to app-legacy * migrate homepage to NFS * feat(homepage): e2e for legacy and NFS, CI runs both, a11y filter, cleanup - Run e2e on both apps: APP_MODE-based login URL (nfs=/, legacy=/customizable) - CI: playwright script runs test:e2e:all (legacy then nfs); testDir at root - NFS a11y: ignore 'list' rule in runAccessibilityTests when APP_MODE=nfs - Scripts: test:e2e, test:e2e:legacy, test:e2e:nfs, test:e2e:all (adoption-insights style) - Reports/output: e2e-test-report-{mode}, e2e-test-results-{mode}; .gitignore e2e-test-report*/ - Timeout 120s; fixture param cleanup in homepageCustomizable tests * use the rhdhThemeModule * Skip resize test until backstage#33317 is fixed Made-with: Cursor * Consolidate e2e: remove app-legacy tests, use single suite for both modes Made-with: Cursor * add rhdhThemeModule to the new app * addressed review comments --------- Co-authored-by: HusneShabbir <husneshabbir447@gmail.com>
1 parent 0d64361 commit abc7289

65 files changed

Lines changed: 6702 additions & 3279 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@red-hat-developer-hub/backstage-plugin-dynamic-home-page': minor
3+
---
4+
5+
Migrate dynamic homepage to NFS

workspaces/homepage/.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,5 @@ site
5050
# vscode database functionality support files
5151
*.session.sql
5252

53-
# E2E test reports
54-
e2e-test-report/
53+
# E2E test reports (legacy, nfs, etc.)
54+
e2e-test-report*/

workspaces/homepage/.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@ coverage
44
.vscode
55
.eslintrc.js
66
report.api.md
7+
report-alpha.api.md
78
knip-report.md
89

workspaces/homepage/app-config.yaml

Lines changed: 82 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,87 @@
11
app:
2-
title: Scaffolded Backstage App
2+
title: Homepage Backstage App
33
baseUrl: http://localhost:3000
4+
packages: all
5+
extensions:
6+
- api:app/app-language:
7+
config:
8+
availableLanguages: ['en', 'de', 'fr', 'it', 'es', 'ja']
9+
defaultLanguage: 'en'
10+
# Disable the nav items that we're manually rendering in packages/app/src/modules/nav/Sidebar.tsx
11+
- nav-item:search: false
12+
- nav-item:user-settings: false
13+
- api:home/visits: true
14+
- app-root-element:home/visit-listener: true
15+
- page:home:
16+
config:
17+
path: /
18+
- home-page-layout:home/dynamic-homepage-layout:
19+
config:
20+
customizable: true # false for read-only homepage layout
21+
widgetLayout:
22+
RhdhTemplateSection:
23+
priority: 300
24+
breakpoints:
25+
xl:
26+
w: 12
27+
h: 5
28+
lg:
29+
w: 12
30+
h: 5
31+
md:
32+
w: 12
33+
h: 5
34+
sm:
35+
w: 12
36+
h: 5
37+
xs:
38+
w: 12
39+
h: 7.5
40+
xxs:
41+
w: 12
42+
h: 13.5
43+
RhdhEntitySection:
44+
priority: 200
45+
breakpoints:
46+
xl:
47+
w: 12
48+
h: 7
49+
lg:
50+
w: 12
51+
h: 7
52+
md:
53+
w: 12
54+
h: 8
55+
sm:
56+
w: 12
57+
h: 9
58+
xs:
59+
w: 12
60+
h: 11
61+
xxs:
62+
w: 12
63+
h: 15
64+
RhdhOnboardingSection:
65+
priority: 100
66+
breakpoints:
67+
xl:
68+
w: 12
69+
h: 6
70+
lg:
71+
w: 12
72+
h: 6
73+
md:
74+
w: 12
75+
h: 7
76+
sm:
77+
w: 12
78+
h: 8
79+
xs:
80+
w: 12
81+
h: 9
82+
xxs:
83+
w: 12
84+
h: 14
485

586
organization:
687
name: My Company

workspaces/homepage/package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
},
88
"scripts": {
99
"start": "backstage-cli repo start",
10+
"start:legacy": "yarn start app-legacy backend",
1011
"start-backend": "yarn workspace backend start",
1112
"build:backend": "yarn workspace backend build",
1213
"tsc": "tsc",
@@ -22,7 +23,11 @@
2223
"fix": "backstage-cli repo fix",
2324
"lint": "backstage-cli repo lint --since origin/main",
2425
"lint:all": "backstage-cli repo lint",
25-
"test:e2e": "playwright test",
26+
"test:e2e": "yarn test:e2e:all",
27+
"test:e2e:legacy": "APP_MODE=legacy playwright test",
28+
"test:e2e:nfs": "APP_MODE=nfs playwright test",
29+
"test:e2e:all": "yarn test:e2e:legacy && yarn test:e2e:nfs",
30+
"playwright": "bash -c 'if [[ \"$*\" == \"test\" ]]; then yarn test:e2e:all; else npx playwright \"$@\"; fi' _",
2631
"prettier:check": "prettier --check .",
2732
"prettier:fix": "prettier --write .",
2833
"new": "backstage-cli new --scope @red-hat-developer-hub",
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
public
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require('@backstage/cli/config/eslint-factory')(__dirname);
File renamed without changes.
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
{
2+
"name": "app-legacy",
3+
"version": "0.0.0",
4+
"private": true,
5+
"bundled": true,
6+
"repository": {
7+
"type": "git",
8+
"url": "https://github.com/redhat-developer/rhdh-plugins",
9+
"directory": "workspaces/homepage/packages/app-legacy"
10+
},
11+
"backstage": {
12+
"role": "frontend"
13+
},
14+
"scripts": {
15+
"start": "backstage-cli package start",
16+
"build": "backstage-cli package build",
17+
"clean": "backstage-cli package clean",
18+
"test": "backstage-cli package test",
19+
"lint": "backstage-cli package lint"
20+
},
21+
"dependencies": {
22+
"@backstage/app-defaults": "^1.7.2",
23+
"@backstage/catalog-model": "^1.7.6",
24+
"@backstage/cli": "^0.34.5",
25+
"@backstage/core-app-api": "^1.19.2",
26+
"@backstage/core-components": "^0.18.3",
27+
"@backstage/core-plugin-api": "^1.12.0",
28+
"@backstage/integration-react": "^1.2.12",
29+
"@backstage/plugin-api-docs": "^0.13.1",
30+
"@backstage/plugin-catalog": "^1.32.0",
31+
"@backstage/plugin-catalog-common": "^1.1.7",
32+
"@backstage/plugin-catalog-graph": "^0.5.3",
33+
"@backstage/plugin-catalog-import": "^0.13.7",
34+
"@backstage/plugin-catalog-react": "^1.21.3",
35+
"@backstage/plugin-kubernetes": "^0.12.13",
36+
"@backstage/plugin-org": "^0.6.46",
37+
"@backstage/plugin-permission-react": "^0.4.38",
38+
"@backstage/plugin-scaffolder": "^1.34.3",
39+
"@backstage/plugin-search": "^1.5.0",
40+
"@backstage/plugin-search-react": "^1.10.0",
41+
"@backstage/plugin-techdocs": "^1.17.0",
42+
"@backstage/plugin-techdocs-module-addons-contrib": "^1.1.33",
43+
"@backstage/plugin-techdocs-react": "^1.3.8",
44+
"@backstage/plugin-user-settings": "^0.8.29",
45+
"@backstage/theme": "^0.7.0",
46+
"@backstage/ui": "^0.9.1",
47+
"@material-ui/core": "^4.12.2",
48+
"@material-ui/icons": "^4.9.1",
49+
"@openshift/dynamic-plugin-sdk": "^5.0.1",
50+
"@red-hat-developer-hub/backstage-plugin-dynamic-home-page": "workspace:^",
51+
"@red-hat-developer-hub/backstage-plugin-theme": "^0.12.0",
52+
"@scalprum/react-core": "0.11.1",
53+
"react": "^18.0.2",
54+
"react-dom": "^18.0.2",
55+
"react-router": "^6.3.0",
56+
"react-router-dom": "^6.3.0"
57+
},
58+
"devDependencies": {
59+
"@axe-core/playwright": "^4.10.0",
60+
"@backstage/frontend-test-utils": "^0.5.0",
61+
"@playwright/test": "^1.32.3",
62+
"@testing-library/dom": "^9.0.0",
63+
"@testing-library/jest-dom": "^6.0.0",
64+
"@testing-library/react": "^14.0.0",
65+
"@testing-library/user-event": "^14.0.0",
66+
"@types/react-dom": "*",
67+
"cross-env": "^7.0.0"
68+
},
69+
"browserslist": {
70+
"production": [
71+
">0.2%",
72+
"not dead",
73+
"not op_mini all"
74+
],
75+
"development": [
76+
"last 1 chrome version",
77+
"last 1 firefox version",
78+
"last 1 safari version"
79+
]
80+
},
81+
"files": [
82+
"dist"
83+
]
84+
}
13.3 KB
Loading

0 commit comments

Comments
 (0)