Skip to content

Commit 3f96765

Browse files
feat(orchestrator): migrate from Material UI v4 to MUI v5 (#3195)
* feat(orchestrator): migrate from Material UI v4 to MUI v5 Replace @material-ui imports with @mui across the orchestrator plugin and app shells, add StylesProvider with orchestrator JSS seed, shared ESLint ban on v4 imports, and fix sidebar logo spacing plus workflow table action icon sizing in NFS and legacy apps. Co-authored-by: Cursor <cursoragent@cursor.com> * chore(orchestrator): add changesets for form-react and form-widgets Co-authored-by: Cursor <cursoragent@cursor.com> * refactor(orchestrator): use MUI Box sx for sidebar logo styling Replace inline styles with Box and sx on sidebar logo wrappers and SVG logos in NFS app, legacy app, and plugin dev shell per review feedback. Co-authored-by: Cursor <cursoragent@cursor.com> * refactor(orchestrator): move shared ESLint config to workspace root Centralize frontend ESLint rules in eslint.frontend-shared.cjs and wire packages via relative require with documented no-relative-monorepo-imports exceptions. Remove plugin package export and form-package devDependencies. Co-authored-by: Cursor <cursoragent@cursor.com> * fix(orchestrator): use RHDH logos from backstage-plugin-theme Import LogoFull and LogoIcon from @red-hat-developer-hub/backstage-plugin-theme (requires ^0.14.0) and remove local Backstage SVG copies in app shells. Co-authored-by: Cursor <cursoragent@cursor.com> * fix(orchestrator): avoid clipping in run variables values Keep TextCodeBlock content from being clipped by RHDH Paper rounded-child styles and align app/dev wiring updates for the run variables dialog rendering path. Co-authored-by: Cursor <cursoragent@cursor.com> * fix(orchestrator): prefix MUI v5 class names to avoid RHDH theme collisions Configure ClassNameGenerator with the v5- prefix so RHDH MuiPaper overrides do not strip Alert severity styles inside Backstage v4 InfoCard shells. Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent de6cc96 commit 3f96765

31 files changed

Lines changed: 264 additions & 312 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@red-hat-developer-hub/backstage-plugin-orchestrator': patch
3+
'@red-hat-developer-hub/backstage-plugin-orchestrator-form-react': patch
4+
'@red-hat-developer-hub/backstage-plugin-orchestrator-form-widgets': patch
5+
---
6+
7+
Replace Material UI v4 imports with MUI v5 and scope JSS class names to prevent style collisions.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/*
2+
* Copyright Red Hat, Inc.
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+
const materialUiMigrationEslintConfig = {
18+
restrictedImports: [
19+
{
20+
name: '@material-ui/core',
21+
message: 'Use @mui/material instead of Material UI v4.',
22+
},
23+
{
24+
name: '@material-ui/lab',
25+
message: 'Use @mui/material instead of Material UI v4.',
26+
},
27+
{
28+
name: '@material-ui/styles',
29+
message:
30+
'Use @mui/styles, @mui/material (sx/styled), or Backstage UI instead of Material UI v4.',
31+
},
32+
],
33+
restrictedImportPatterns: ['@material-ui/*'],
34+
};
35+
36+
/**
37+
* Shared ESLint config for frontend packages in the orchestrator workspace.
38+
*/
39+
module.exports = packageDir =>
40+
require('@backstage/cli/config/eslint-factory')(
41+
packageDir,
42+
materialUiMigrationEslintConfig,
43+
);

workspaces/orchestrator/packages/app-legacy/.eslintrc.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@
1414
* limitations under the License.
1515
*/
1616

17-
module.exports = require('@backstage/cli/config/eslint-factory')(__dirname);
17+
// eslint-disable-next-line @backstage/no-relative-monorepo-imports -- workspace ESLint shared config
18+
module.exports = require('../../eslint.frontend-shared.cjs')(__dirname);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
"@mui/styles": "5.18.0",
5353
"@red-hat-developer-hub/backstage-plugin-orchestrator": "workspace:^",
5454
"@red-hat-developer-hub/backstage-plugin-orchestrator-form-widgets": "workspace:^",
55-
"@red-hat-developer-hub/backstage-plugin-theme": "^0.12.0",
55+
"@red-hat-developer-hub/backstage-plugin-theme": "^0.14.0",
5656
"custom-authentication-provider-module": "workspace:^",
5757
"history": "^5.3.0",
5858
"react": "^18.0.2",

workspaces/orchestrator/packages/app-legacy/src/components/Root/LogoFull.tsx

Lines changed: 0 additions & 45 deletions
This file was deleted.

workspaces/orchestrator/packages/app-legacy/src/components/Root/LogoIcon.tsx

Lines changed: 0 additions & 46 deletions
This file was deleted.

0 commit comments

Comments
 (0)