Skip to content

Commit 2465411

Browse files
chore(adoption-insights): migrate from Material UI v4 to MUI v5 (#3399)
* chore(adoption-insights): migrate from Material UI v4 to MUI v5 * add NFS github signin module * fix e2e
1 parent 43e0722 commit 2465411

25 files changed

Lines changed: 363 additions & 292 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@red-hat-developer-hub/backstage-plugin-analytics-module-adoption-insights': patch
3+
'@red-hat-developer-hub/backstage-plugin-adoption-insights': patch
4+
---
5+
6+
Replace Material UI v4 imports with MUI v5

workspaces/adoption-insights/app-config.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,18 @@ techdocs:
7474
type: 'local' # Alternatives - 'googleGcs' or 'awsS3'. Read documentation for using alternatives.
7575

7676
auth:
77+
environment: development
7778
# see https://backstage.io/docs/auth/ to learn about auth providers
7879
providers:
7980
# See https://backstage.io/docs/auth/guest/provider
8081
guest: {}
82+
github:
83+
development:
84+
clientId: ${GITHUB_CLIENT_ID}
85+
clientSecret: ${GITHUB_CLIENT_SECRET}
86+
signIn:
87+
resolvers:
88+
- resolver: usernameMatchingUserEntityName
8189

8290
scaffolder:
8391
# see https://backstage.io/docs/features/software-templates/configuration for software template options
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 adoption-insights workspace.
38+
*/
39+
module.exports = packageDir =>
40+
require('@backstage/cli/config/eslint-factory')(
41+
packageDir,
42+
materialUiMigrationEslintConfig,
43+
);
Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,18 @@
1-
module.exports = require('@backstage/cli/config/eslint-factory')(__dirname);
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+
// eslint-disable-next-line @backstage/no-relative-monorepo-imports -- workspace ESLint shared config
18+
module.exports = require('../../eslint.frontend-shared.cjs')(__dirname);

workspaces/adoption-insights/packages/app-legacy/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,12 @@
4444
"@backstage/plugin-user-settings": "^0.9.1",
4545
"@backstage/theme": "^0.7.2",
4646
"@backstage/ui": "^0.13.2",
47-
"@material-ui/core": "^4.12.2",
48-
"@material-ui/icons": "^4.9.1",
4947
"@mui/icons-material": "5.18.0",
48+
"@mui/material": "5.18.0",
49+
"@mui/styles": "5.18.0",
5050
"@red-hat-developer-hub/backstage-plugin-adoption-insights": "workspace:^",
5151
"@red-hat-developer-hub/backstage-plugin-analytics-module-adoption-insights": "workspace:^",
52+
"@red-hat-developer-hub/backstage-plugin-theme": "^0.14.0",
5253
"react": "^18.0.2",
5354
"react-dom": "^18.0.2",
5455
"react-router": "^6.3.0",

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

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

0 commit comments

Comments
 (0)