Skip to content

Commit 8751f81

Browse files
fix(bulk-import): use rhdhThemeModule in NFS app and fix changeset to minor (#2568)
Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com>
1 parent 9508c9a commit 8751f81

7 files changed

Lines changed: 22 additions & 44 deletions

File tree

workspaces/bulk-import/.changeset/itchy-geckos-change.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
'@red-hat-developer-hub/backstage-plugin-bulk-import': patch
2+
'@red-hat-developer-hub/backstage-plugin-bulk-import': minor
33
'@red-hat-developer-hub/backstage-plugin-bulk-import-common': patch
44
'@red-hat-developer-hub/backstage-plugin-bulk-import-backend': patch
55
---
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-bulk-import': patch
3+
---
4+
5+
Updated NFS app and dev harness to use `rhdhThemeModule` from `@red-hat-developer-hub/backstage-plugin-theme/alpha` instead of manually constructing ThemeBlueprint extensions

workspaces/bulk-import/packages/app/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
"@mui/material": "5.18.0",
5757
"@mui/styles": "5.18.0",
5858
"@red-hat-developer-hub/backstage-plugin-bulk-import": "workspace:^",
59-
"@red-hat-developer-hub/backstage-plugin-theme": "^0.12.0",
59+
"@red-hat-developer-hub/backstage-plugin-theme": "^0.13.0",
6060
"react": "^18.0.2",
6161
"react-dom": "^18.0.2",
6262
"react-router-dom": "^6.3.0"
@@ -72,7 +72,7 @@
7272
"@backstage/dev-utils": "^1.1.19",
7373
"@backstage/test-utils": "^1.7.14",
7474
"@playwright/test": "1.57.0",
75-
"@red-hat-developer-hub/backstage-plugin-theme": "^0.11.0",
75+
"@red-hat-developer-hub/backstage-plugin-theme": "^0.13.0",
7676
"@spotify/prettier-config": "^15.0.0",
7777
"@testing-library/dom": "^10.0.0",
7878
"@testing-library/jest-dom": "^6.0.0",

workspaces/bulk-import/packages/app/src/App.tsx

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,12 @@
1717
import { createApp } from '@backstage/frontend-defaults';
1818
import {
1919
SignInPageBlueprint,
20-
ThemeBlueprint,
2120
createFrontendModule,
2221
githubAuthApiRef,
2322
gitlabAuthApiRef,
2423
} from '@backstage/frontend-plugin-api';
2524
import { SignInPage } from '@backstage/core-components';
26-
import { getThemes } from '@red-hat-developer-hub/backstage-plugin-theme';
25+
import { rhdhThemeModule } from '@red-hat-developer-hub/backstage-plugin-theme/alpha';
2726

2827
import { navModule } from './modules/nav';
2928

@@ -70,23 +69,6 @@ const signInModule = createFrontendModule({
7069
extensions: [signInPageExtension],
7170
});
7271

73-
// Create theme extensions from RHDH themes
74-
const rhdhThemes = getThemes();
75-
const themeExtensions = rhdhThemes.map(theme =>
76-
ThemeBlueprint.make({
77-
name: theme.id,
78-
params: {
79-
theme: theme,
80-
},
81-
}),
82-
);
83-
84-
// Wrap themes in a module
85-
const themesModule = createFrontendModule({
86-
pluginId: 'app',
87-
extensions: themeExtensions,
88-
});
89-
9072
/**
9173
* NFS app: A Backstage app using the New Frontend System (NFS)
9274
*
@@ -108,8 +90,8 @@ const app = createApp({
10890
userSettingsPlugin,
10991
// Sign-in module with GitHub and GitLab providers
11092
signInModule,
111-
// RHDH themes (light/dark modes)
112-
themesModule,
93+
// RHDH themes
94+
rhdhThemeModule,
11395
// Translations module (language selector configured via app-config.yaml)
11496
bulkImportTranslationsModule,
11597
// Custom sidebar with logo

workspaces/bulk-import/plugins/bulk-import/dev/index.tsx

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,7 @@ import {
3939
ApiBlueprint,
4040
createFrontendModule,
4141
} from '@backstage/frontend-plugin-api';
42-
import {
43-
NavContentBlueprint,
44-
ThemeBlueprint,
45-
} from '@backstage/plugin-app-react';
42+
import { NavContentBlueprint } from '@backstage/plugin-app-react';
4643
import { catalogApiRef } from '@backstage/plugin-catalog-react';
4744
import { permissionApiRef } from '@backstage/plugin-permission-react';
4845
import { mockApis } from '@backstage/test-utils';
@@ -53,7 +50,7 @@ import Menu from '@material-ui/core/Menu';
5350
import MenuItem from '@material-ui/core/MenuItem';
5451
import AutoIcon from '@mui/icons-material/BrightnessAuto';
5552

56-
import { getAllThemes } from '@red-hat-developer-hub/backstage-plugin-theme';
53+
import { rhdhThemeModule } from '@red-hat-developer-hub/backstage-plugin-theme/alpha';
5754

5855
import bulkImportPlugin, { bulkImportTranslationsModule } from '../src/alpha';
5956
import {
@@ -207,16 +204,9 @@ const devSidebarContent = NavContentBlueprint.make({
207204
},
208205
});
209206

210-
const themeExtensions = getAllThemes().map(theme =>
211-
ThemeBlueprint.make({
212-
name: theme.id,
213-
params: { theme },
214-
}),
215-
);
216-
217207
const devNavModule = createFrontendModule({
218208
pluginId: 'app',
219-
extensions: [devSidebarContent, ...themeExtensions],
209+
extensions: [devSidebarContent],
220210
});
221211

222212
const defaultPage = '/bulk-import';
@@ -226,6 +216,7 @@ const app = createApp({
226216
bulkImportPlugin,
227217
bulkImportTranslationsModule,
228218
bulkImportDevModule,
219+
rhdhThemeModule,
229220
devNavModule,
230221
],
231222
});

workspaces/bulk-import/plugins/bulk-import/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
"@backstage/ui": "^0.11.2",
8585
"@material-ui/core": "^4.12.4",
8686
"@playwright/test": "1.57.0",
87-
"@red-hat-developer-hub/backstage-plugin-theme": "^0.12.0",
87+
"@red-hat-developer-hub/backstage-plugin-theme": "^0.13.0",
8888
"@spotify/prettier-config": "^15.0.0",
8989
"@testing-library/dom": "^10.0.0",
9090
"@testing-library/jest-dom": "^6.0.0",

workspaces/bulk-import/yarn.lock

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12350,7 +12350,7 @@ __metadata:
1235012350
"@mui/styles": "npm:5.18.0"
1235112351
"@playwright/test": "npm:1.57.0"
1235212352
"@red-hat-developer-hub/backstage-plugin-bulk-import-common": "workspace:^"
12353-
"@red-hat-developer-hub/backstage-plugin-theme": "npm:^0.12.0"
12353+
"@red-hat-developer-hub/backstage-plugin-theme": "npm:^0.13.0"
1235412354
"@spotify/prettier-config": "npm:^15.0.0"
1235512355
"@tanstack/react-query": "npm:^4.29.21"
1235612356
"@testing-library/dom": "npm:^10.0.0"
@@ -12570,9 +12570,9 @@ __metadata:
1257012570
languageName: node
1257112571
linkType: hard
1257212572

12573-
"@red-hat-developer-hub/backstage-plugin-theme@npm:^0.12.0":
12574-
version: 0.12.1
12575-
resolution: "@red-hat-developer-hub/backstage-plugin-theme@npm:0.12.1"
12573+
"@red-hat-developer-hub/backstage-plugin-theme@npm:^0.13.0":
12574+
version: 0.13.0
12575+
resolution: "@red-hat-developer-hub/backstage-plugin-theme@npm:0.13.0"
1257612576
dependencies:
1257712577
"@mui/icons-material": "npm:^5.17.1"
1257812578
peerDependencies:
@@ -12582,7 +12582,7 @@ __metadata:
1258212582
"@mui/icons-material": ^5.17.1
1258312583
"@mui/material": ^5.0.0
1258412584
react: ^16.13.1 || ^17.0.0 || ^18.0.0
12585-
checksum: 10c0/99506cde84cf8ad35c367a9625ea19e453685f0067f8ba6e058e90daf427e11b009e2c83f06b3a0ab23bd2395116ef9005262128553b098db97ef48b187fd06b
12585+
checksum: 10c0/561c04203e9047f4df3fd9a0c29eb0e6b578740899dc3da07870f807a4c3324fb6880e2501f168b60d9a121521eb1f6a9d65d9d837e803f469415e2c0f526053
1258612586
languageName: node
1258712587
linkType: hard
1258812588

@@ -17293,7 +17293,7 @@ __metadata:
1729317293
"@mui/styles": "npm:5.18.0"
1729417294
"@playwright/test": "npm:1.57.0"
1729517295
"@red-hat-developer-hub/backstage-plugin-bulk-import": "workspace:^"
17296-
"@red-hat-developer-hub/backstage-plugin-theme": "npm:^0.11.0"
17296+
"@red-hat-developer-hub/backstage-plugin-theme": "npm:^0.13.0"
1729717297
"@spotify/prettier-config": "npm:^15.0.0"
1729817298
"@testing-library/dom": "npm:^10.0.0"
1729917299
"@testing-library/jest-dom": "npm:^6.0.0"

0 commit comments

Comments
 (0)