Skip to content

Commit 3e90ea7

Browse files
committed
migrate homepage to NFS
1 parent 8465dbf commit 3e90ea7

50 files changed

Lines changed: 5281 additions & 1858 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/app-config.yaml

Lines changed: 88 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,93 @@
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+
# Comment out the following lines to remove the default homepage and catalog pages, and set the homepage to a custom plugin page
16+
- page:catalog:
17+
config:
18+
path: /
19+
20+
# Uncomment the following lines to set the homepage to a custom plugin page, and configure the path for the homepage
21+
# - page:home:
22+
# config:
23+
# path: /
24+
- home-page-layout:home/dynamic-homepage-layout:
25+
config:
26+
customizable: true # false for read-only homepage layout
27+
widgetLayout:
28+
RhdhTemplateSection:
29+
priority: 300
30+
breakpoints:
31+
xl:
32+
w: 12
33+
h: 5
34+
lg:
35+
w: 12
36+
h: 5
37+
md:
38+
w: 12
39+
h: 5
40+
sm:
41+
w: 12
42+
h: 5
43+
xs:
44+
w: 12
45+
h: 7.5
46+
xxs:
47+
w: 12
48+
h: 13.5
49+
RhdhEntitySection:
50+
priority: 200
51+
breakpoints:
52+
xl:
53+
w: 12
54+
h: 7
55+
lg:
56+
w: 12
57+
h: 7
58+
md:
59+
w: 12
60+
h: 8
61+
sm:
62+
w: 12
63+
h: 9
64+
xs:
65+
w: 12
66+
h: 11
67+
xxs:
68+
w: 12
69+
h: 15
70+
RhdhOnboardingSection:
71+
priority: 100
72+
breakpoints:
73+
xl:
74+
w: 12
75+
h: 6
76+
lg:
77+
w: 12
78+
h: 6
79+
md:
80+
w: 12
81+
h: 7
82+
sm:
83+
w: 12
84+
h: 8
85+
xs:
86+
w: 12
87+
h: 9
88+
xxs:
89+
w: 12
90+
h: 14
491

592
organization:
693
name: My Company

workspaces/homepage/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@
2323
"fix": "backstage-cli repo fix",
2424
"lint": "backstage-cli repo lint --since origin/main",
2525
"lint:all": "backstage-cli repo lint",
26-
"test:e2e": "playwright test",
26+
"test:legacy": "APP_MODE=legacy playwright test",
27+
"test:nfs": "APP_MODE=nfs playwright test",
28+
"test:e2e:ci": "yarn test:legacy && yarn test:nfs",
29+
"playwright": "sh -c 'if [ \"$1\" = test ] && [ $# -eq 1 ]; then yarn test:e2e:ci; else exec playwright \"$@\"; fi' _",
2730
"prettier:check": "prettier --check .",
2831
"prettier:fix": "prettier --write .",
2932
"new": "backstage-cli new --scope @red-hat-developer-hub",

workspaces/homepage/packages/app-legacy/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@
3838
"@backstage/plugin-scaffolder": "^1.34.3",
3939
"@backstage/plugin-search": "^1.5.0",
4040
"@backstage/plugin-search-react": "^1.10.0",
41-
"@backstage/plugin-techdocs": "^1.16.0",
42-
"@backstage/plugin-techdocs-module-addons-contrib": "^1.1.30",
43-
"@backstage/plugin-techdocs-react": "^1.3.5",
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",
4444
"@backstage/plugin-user-settings": "^0.8.29",
4545
"@backstage/theme": "^0.7.0",
4646
"@backstage/ui": "^0.9.1",
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);
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*
2+
* Copyright 2020 The Backstage Authors
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
import { test, expect } from '@playwright/test';
18+
19+
test('App should render the welcome page', async ({ page }) => {
20+
await page.goto('/');
21+
22+
const enterButton = page.getByRole('button', { name: 'Enter' });
23+
await expect(enterButton).toBeVisible();
24+
await enterButton.click();
25+
26+
await expect(page.getByText('My Company Catalog')).toBeVisible();
27+
});
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
{
2+
"name": "app",
3+
"version": "0.0.0",
4+
"private": true,
5+
"bundled": true,
6+
"backstage": {
7+
"role": "frontend"
8+
},
9+
"scripts": {
10+
"start": "backstage-cli package start",
11+
"build": "backstage-cli package build",
12+
"clean": "backstage-cli package clean",
13+
"test": "backstage-cli package test",
14+
"lint": "backstage-cli package lint"
15+
},
16+
"dependencies": {
17+
"@backstage/cli": "^0.35.4",
18+
"@backstage/core-compat-api": "^0.5.8",
19+
"@backstage/core-components": "^0.18.7",
20+
"@backstage/core-plugin-api": "^1.12.3",
21+
"@backstage/frontend-defaults": "^0.4.0",
22+
"@backstage/frontend-plugin-api": "^0.14.0",
23+
"@backstage/integration-react": "^1.2.15",
24+
"@backstage/plugin-api-docs": "^0.13.4",
25+
"@backstage/plugin-app-react": "^0.2.0",
26+
"@backstage/plugin-app-visualizer": "^0.2.0",
27+
"@backstage/plugin-catalog": "^1.33.0",
28+
"@backstage/plugin-catalog-graph": "^0.5.7",
29+
"@backstage/plugin-catalog-import": "^0.13.10",
30+
"@backstage/plugin-home": "^0.9.2",
31+
"@backstage/plugin-kubernetes": "^0.12.16",
32+
"@backstage/plugin-notifications": "^0.5.14",
33+
"@backstage/plugin-org": "^0.6.49",
34+
"@backstage/plugin-scaffolder": "^1.35.3",
35+
"@backstage/plugin-search": "^1.6.0",
36+
"@backstage/plugin-signals": "^0.0.28",
37+
"@backstage/plugin-techdocs": "^1.17.0",
38+
"@backstage/plugin-techdocs-module-addons-contrib": "^1.1.33",
39+
"@backstage/plugin-user-settings": "^0.9.0",
40+
"@backstage/ui": "^0.12.0",
41+
"@material-ui/core": "^4.12.2",
42+
"@material-ui/icons": "^4.9.1",
43+
"@red-hat-developer-hub/backstage-plugin-dynamic-home-page": "workspace:^",
44+
"react": "^18.0.2",
45+
"react-dom": "^18.0.2",
46+
"react-router": "^6.30.2",
47+
"react-router-dom": "^6.30.2"
48+
},
49+
"devDependencies": {
50+
"@backstage/frontend-test-utils": "^0.5.0",
51+
"@playwright/test": "^1.32.3",
52+
"@testing-library/dom": "^9.0.0",
53+
"@testing-library/jest-dom": "^6.0.0",
54+
"@testing-library/react": "^14.0.0",
55+
"@testing-library/user-event": "^14.0.0",
56+
"@types/react-dom": "*",
57+
"cross-env": "^7.0.0"
58+
},
59+
"browserslist": {
60+
"production": [
61+
">0.2%",
62+
"not dead",
63+
"not op_mini all"
64+
],
65+
"development": [
66+
"last 1 chrome version",
67+
"last 1 firefox version",
68+
"last 1 safari version"
69+
]
70+
},
71+
"files": [
72+
"dist"
73+
]
74+
}
13.3 KB
Loading
12.3 KB
Loading

0 commit comments

Comments
 (0)