diff --git a/workspaces/adoption-insights/.changeset/shiny-friends-end.md b/workspaces/adoption-insights/.changeset/shiny-friends-end.md new file mode 100644 index 0000000000..7bf7d148c0 --- /dev/null +++ b/workspaces/adoption-insights/.changeset/shiny-friends-end.md @@ -0,0 +1,6 @@ +--- +'@red-hat-developer-hub/backstage-plugin-analytics-module-adoption-insights': patch +'@red-hat-developer-hub/backstage-plugin-adoption-insights': patch +--- + +Replace Material UI v4 imports with MUI v5 diff --git a/workspaces/adoption-insights/app-config.yaml b/workspaces/adoption-insights/app-config.yaml index eb4b833211..ab2d33e491 100644 --- a/workspaces/adoption-insights/app-config.yaml +++ b/workspaces/adoption-insights/app-config.yaml @@ -74,10 +74,18 @@ techdocs: type: 'local' # Alternatives - 'googleGcs' or 'awsS3'. Read documentation for using alternatives. auth: + environment: development # see https://backstage.io/docs/auth/ to learn about auth providers providers: # See https://backstage.io/docs/auth/guest/provider guest: {} + github: + development: + clientId: ${GITHUB_CLIENT_ID} + clientSecret: ${GITHUB_CLIENT_SECRET} + signIn: + resolvers: + - resolver: usernameMatchingUserEntityName scaffolder: # see https://backstage.io/docs/features/software-templates/configuration for software template options diff --git a/workspaces/adoption-insights/eslint.frontend-shared.cjs b/workspaces/adoption-insights/eslint.frontend-shared.cjs new file mode 100644 index 0000000000..f7f545a070 --- /dev/null +++ b/workspaces/adoption-insights/eslint.frontend-shared.cjs @@ -0,0 +1,43 @@ +/* + * Copyright Red Hat, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +const materialUiMigrationEslintConfig = { + restrictedImports: [ + { + name: '@material-ui/core', + message: 'Use @mui/material instead of Material UI v4.', + }, + { + name: '@material-ui/lab', + message: 'Use @mui/material instead of Material UI v4.', + }, + { + name: '@material-ui/styles', + message: + 'Use @mui/styles, @mui/material (sx/styled), or Backstage UI instead of Material UI v4.', + }, + ], + restrictedImportPatterns: ['@material-ui/*'], +}; + +/** + * Shared ESLint config for frontend packages in the adoption-insights workspace. + */ +module.exports = packageDir => + require('@backstage/cli/config/eslint-factory')( + packageDir, + materialUiMigrationEslintConfig, + ); diff --git a/workspaces/adoption-insights/packages/app-legacy/.eslintrc.js b/workspaces/adoption-insights/packages/app-legacy/.eslintrc.js index e2a53a6ad2..493ce7565d 100644 --- a/workspaces/adoption-insights/packages/app-legacy/.eslintrc.js +++ b/workspaces/adoption-insights/packages/app-legacy/.eslintrc.js @@ -1 +1,18 @@ -module.exports = require('@backstage/cli/config/eslint-factory')(__dirname); +/* + * Copyright Red Hat, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// eslint-disable-next-line @backstage/no-relative-monorepo-imports -- workspace ESLint shared config +module.exports = require('../../eslint.frontend-shared.cjs')(__dirname); diff --git a/workspaces/adoption-insights/packages/app-legacy/package.json b/workspaces/adoption-insights/packages/app-legacy/package.json index 963cece578..a888753e5e 100644 --- a/workspaces/adoption-insights/packages/app-legacy/package.json +++ b/workspaces/adoption-insights/packages/app-legacy/package.json @@ -44,11 +44,12 @@ "@backstage/plugin-user-settings": "^0.9.1", "@backstage/theme": "^0.7.2", "@backstage/ui": "^0.13.2", - "@material-ui/core": "^4.12.2", - "@material-ui/icons": "^4.9.1", "@mui/icons-material": "5.18.0", + "@mui/material": "5.18.0", + "@mui/styles": "5.18.0", "@red-hat-developer-hub/backstage-plugin-adoption-insights": "workspace:^", "@red-hat-developer-hub/backstage-plugin-analytics-module-adoption-insights": "workspace:^", + "@red-hat-developer-hub/backstage-plugin-theme": "^0.14.0", "react": "^18.0.2", "react-dom": "^18.0.2", "react-router": "^6.3.0", diff --git a/workspaces/adoption-insights/packages/app-legacy/src/components/Root/LogoFull.tsx b/workspaces/adoption-insights/packages/app-legacy/src/components/Root/LogoFull.tsx deleted file mode 100644 index d30f1c4d94..0000000000 --- a/workspaces/adoption-insights/packages/app-legacy/src/components/Root/LogoFull.tsx +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright Red Hat, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { makeStyles } from '@material-ui/core'; - -const useStyles = makeStyles({ - svg: { - width: 'auto', - height: 30, - }, - path: { - fill: '#7df3e1', - }, -}); -const LogoFull = () => { - const classes = useStyles(); - - return ( - - - - ); -}; - -export default LogoFull; diff --git a/workspaces/adoption-insights/packages/app-legacy/src/components/Root/LogoIcon.tsx b/workspaces/adoption-insights/packages/app-legacy/src/components/Root/LogoIcon.tsx deleted file mode 100644 index 66be748f8e..0000000000 --- a/workspaces/adoption-insights/packages/app-legacy/src/components/Root/LogoIcon.tsx +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright Red Hat, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { makeStyles } from '@material-ui/core'; - -const useStyles = makeStyles({ - svg: { - width: 'auto', - height: 28, - }, - path: { - fill: '#7df3e1', - }, -}); - -const LogoIcon = () => { - const classes = useStyles(); - - return ( - - - - ); -}; - -export default LogoIcon; diff --git a/workspaces/adoption-insights/packages/app-legacy/src/components/Root/Root.tsx b/workspaces/adoption-insights/packages/app-legacy/src/components/Root/Root.tsx index 8c6a46ce66..112eb68e75 100644 --- a/workspaces/adoption-insights/packages/app-legacy/src/components/Root/Root.tsx +++ b/workspaces/adoption-insights/packages/app-legacy/src/components/Root/Root.tsx @@ -14,14 +14,19 @@ * limitations under the License. */ import { PropsWithChildren } from 'react'; -import { makeStyles } from '@material-ui/core'; -import HomeIcon from '@material-ui/icons/Home'; -import ExtensionIcon from '@material-ui/icons/Extension'; -import LibraryBooks from '@material-ui/icons/LibraryBooks'; -import CreateComponentIcon from '@material-ui/icons/AddCircleOutline'; +import Box from '@mui/material/Box'; +import HomeIcon from '@mui/icons-material/Home'; +import ExtensionIcon from '@mui/icons-material/Extension'; +import LibraryBooks from '@mui/icons-material/LibraryBooks'; +import CreateComponentIcon from '@mui/icons-material/AddCircleOutline'; import QueryStatsIcon from '@mui/icons-material/QueryStats'; -import LogoFull from './LogoFull'; -import LogoIcon from './LogoIcon'; +import MenuIcon from '@mui/icons-material/Menu'; +import SearchIcon from '@mui/icons-material/Search'; +import GroupIcon from '@mui/icons-material/People'; +import { + LogoFull, + LogoIcon, +} from '@red-hat-developer-hub/backstage-plugin-theme'; import { Settings as SidebarSettings, UserSettingsSignInAvatar, @@ -39,36 +44,34 @@ import { useSidebarOpenState, Link, } from '@backstage/core-components'; -import MenuIcon from '@material-ui/icons/Menu'; -import SearchIcon from '@material-ui/icons/Search'; import { MyGroupsSidebarItem } from '@backstage/plugin-org'; -import GroupIcon from '@material-ui/icons/People'; - -const useSidebarLogoStyles = makeStyles({ - root: { - width: sidebarConfig.drawerWidthClosed, - height: 3 * sidebarConfig.logoHeight, - display: 'flex', - flexFlow: 'row nowrap', - alignItems: 'center', - marginBottom: -14, - }, - link: { - width: sidebarConfig.drawerWidthClosed, - marginLeft: 24, - }, -}); const SidebarLogo = () => { - const classes = useSidebarLogoStyles(); const { isOpen } = useSidebarOpenState(); return ( -
- + + {isOpen ? : } -
+ ); }; diff --git a/workspaces/adoption-insights/packages/app-legacy/src/components/catalog/EntityPage.tsx b/workspaces/adoption-insights/packages/app-legacy/src/components/catalog/EntityPage.tsx index 62b06daefb..9028f366f2 100644 --- a/workspaces/adoption-insights/packages/app-legacy/src/components/catalog/EntityPage.tsx +++ b/workspaces/adoption-insights/packages/app-legacy/src/components/catalog/EntityPage.tsx @@ -13,7 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { Button, Grid } from '@material-ui/core'; +import Button from '@mui/material/Button'; +import Grid from '@mui/material/Grid'; import { EntityApiDefinitionCard, EntityConsumedApisCard, diff --git a/workspaces/adoption-insights/packages/app-legacy/src/components/search/SearchPage.tsx b/workspaces/adoption-insights/packages/app-legacy/src/components/search/SearchPage.tsx index 5d651901f0..3b881427bc 100644 --- a/workspaces/adoption-insights/packages/app-legacy/src/components/search/SearchPage.tsx +++ b/workspaces/adoption-insights/packages/app-legacy/src/components/search/SearchPage.tsx @@ -13,40 +13,35 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { makeStyles, Theme, Grid, Paper } from '@material-ui/core'; +import { + CatalogIcon, + Content, + DocsIcon, + Header, + Page, +} from '@backstage/core-components'; +import { useApi } from '@backstage/core-plugin-api'; import { CatalogSearchResultListItem } from '@backstage/plugin-catalog'; import { - catalogApiRef, CATALOG_FILTER_EXISTS, + catalogApiRef, } from '@backstage/plugin-catalog-react'; -import { TechDocsSearchResultListItem } from '@backstage/plugin-techdocs'; - import { SearchType } from '@backstage/plugin-search'; import { SearchBar, SearchFilter, - SearchResult, SearchPagination, + SearchResult, useSearch, } from '@backstage/plugin-search-react'; -import { - CatalogIcon, - Content, - DocsIcon, - Header, - Page, -} from '@backstage/core-components'; -import { useApi } from '@backstage/core-plugin-api'; +import { TechDocsSearchResultListItem } from '@backstage/plugin-techdocs'; +import Grid from '@mui/material/Grid'; +import Paper from '@mui/material/Paper'; +import { Theme } from '@mui/material/styles'; +import { makeStyles } from '@mui/styles'; const useStyles = makeStyles((theme: Theme) => ({ - bar: { - padding: theme.spacing(1, 0), - }, - filters: { - padding: theme.spacing(2), - marginTop: theme.spacing(2), - }, filter: { '& + &': { marginTop: theme.spacing(2.5), @@ -65,7 +60,11 @@ const SearchPage = () => { - + @@ -86,14 +85,18 @@ const SearchPage = () => { }, ]} /> - + {types.includes('techdocs') && ( { - // Return a list of entities which are documented. const { items } = await catalogApi.getEntities({ fields: ['metadata.name'], filter: { diff --git a/workspaces/adoption-insights/packages/app/.eslintrc.js b/workspaces/adoption-insights/packages/app/.eslintrc.js index e2a53a6ad2..493ce7565d 100644 --- a/workspaces/adoption-insights/packages/app/.eslintrc.js +++ b/workspaces/adoption-insights/packages/app/.eslintrc.js @@ -1 +1,18 @@ -module.exports = require('@backstage/cli/config/eslint-factory')(__dirname); +/* + * Copyright Red Hat, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// eslint-disable-next-line @backstage/no-relative-monorepo-imports -- workspace ESLint shared config +module.exports = require('../../eslint.frontend-shared.cjs')(__dirname); diff --git a/workspaces/adoption-insights/packages/app/package.json b/workspaces/adoption-insights/packages/app/package.json index 55ca0d5d3c..8915706802 100644 --- a/workspaces/adoption-insights/packages/app/package.json +++ b/workspaces/adoption-insights/packages/app/package.json @@ -31,10 +31,11 @@ "@backstage/plugin-search": "^1.7.0", "@backstage/plugin-user-settings": "^0.9.1", "@backstage/ui": "^0.13.2", - "@material-ui/core": "^4.12.2", - "@material-ui/icons": "^4.9.1", + "@mui/icons-material": "^5.18.0", + "@mui/material": "^5.18.0", "@red-hat-developer-hub/backstage-plugin-adoption-insights": "workspace:^", "@red-hat-developer-hub/backstage-plugin-analytics-module-adoption-insights": "workspace:^", + "@red-hat-developer-hub/backstage-plugin-theme": "^0.14.0", "react": "^18.0.2", "react-dom": "^18.0.2", "react-router": "^6.3.0", diff --git a/workspaces/adoption-insights/packages/app/src/App.tsx b/workspaces/adoption-insights/packages/app/src/App.tsx index 5e45b4cb40..277ab7b3b5 100644 --- a/workspaces/adoption-insights/packages/app/src/App.tsx +++ b/workspaces/adoption-insights/packages/app/src/App.tsx @@ -21,6 +21,7 @@ import adoptionInsightsPlugin, { } from '@red-hat-developer-hub/backstage-plugin-adoption-insights/alpha'; import adoptionInsightsAnalyticsPlugin from '@red-hat-developer-hub/backstage-plugin-analytics-module-adoption-insights/alpha'; import { navModule } from './modules/nav'; +import { signInModule } from './modules/signIn'; export default createApp({ features: [ @@ -30,5 +31,6 @@ export default createApp({ adoptionInsightsTranslationsModule, adoptionInsightsAnalyticsPlugin, navModule, + signInModule, ], }); diff --git a/workspaces/adoption-insights/packages/app/src/modules/nav/LogoFull.tsx b/workspaces/adoption-insights/packages/app/src/modules/nav/LogoFull.tsx deleted file mode 100644 index 6b6a1bd8c1..0000000000 --- a/workspaces/adoption-insights/packages/app/src/modules/nav/LogoFull.tsx +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright Red Hat, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { makeStyles } from '@material-ui/core'; - -const useStyles = makeStyles({ - svg: { - width: 'auto', - height: 30, - }, - path: { - fill: '#7df3e1', - }, -}); - -export const LogoFull = () => { - const classes = useStyles(); - - return ( - - - - ); -}; diff --git a/workspaces/adoption-insights/packages/app/src/modules/nav/LogoIcon.tsx b/workspaces/adoption-insights/packages/app/src/modules/nav/LogoIcon.tsx deleted file mode 100644 index 87024b08c2..0000000000 --- a/workspaces/adoption-insights/packages/app/src/modules/nav/LogoIcon.tsx +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright Red Hat, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { makeStyles } from '@material-ui/core'; - -const useStyles = makeStyles({ - svg: { - width: 'auto', - height: 28, - }, - path: { - fill: '#7df3e1', - }, -}); - -export const LogoIcon = () => { - const classes = useStyles(); - - return ( - - - - ); -}; diff --git a/workspaces/adoption-insights/packages/app/src/modules/nav/Sidebar.tsx b/workspaces/adoption-insights/packages/app/src/modules/nav/Sidebar.tsx index 305675e9f2..cb9c8fc468 100644 --- a/workspaces/adoption-insights/packages/app/src/modules/nav/Sidebar.tsx +++ b/workspaces/adoption-insights/packages/app/src/modules/nav/Sidebar.tsx @@ -22,25 +22,53 @@ import { SidebarSpace, } from '@backstage/core-components'; import { NavContentBlueprint } from '@backstage/plugin-app-react'; +import { + UserSettingsSignInAvatar, + Settings as SidebarSettings, +} from '@backstage/plugin-user-settings'; +import type { IconComponent } from '@backstage/core-plugin-api'; import { SidebarLogo } from './SidebarLogo'; -import MenuIcon from '@material-ui/icons/Menu'; +import MenuIcon from '@mui/icons-material/Menu'; + +type NavItem = { to: string; text: string; icon: IconComponent; title: string }; export const SidebarContent = NavContentBlueprint.make({ params: { - component: ({ navItems }) => { - const nav = navItems.withComponent(item => ( - item.icon} to={item.href} text={item.title} /> - )); + component: ({ items }) => { + const mainItems = (items as NavItem[]).filter( + item => !item.to.includes('/settings'), + ); + const footerItems = (items as NavItem[]).filter(item => + item.to.includes('/settings'), + ); return ( }> - {nav.rest({ sortBy: 'title' })} + {mainItems.map(item => ( + + ))} + {footerItems.length > 0 && ( + <> + + } + > + + + + )} ); }, diff --git a/workspaces/adoption-insights/packages/app/src/modules/nav/SidebarLogo.tsx b/workspaces/adoption-insights/packages/app/src/modules/nav/SidebarLogo.tsx index 0085b75fce..8bfa1e9aeb 100644 --- a/workspaces/adoption-insights/packages/app/src/modules/nav/SidebarLogo.tsx +++ b/workspaces/adoption-insights/packages/app/src/modules/nav/SidebarLogo.tsx @@ -18,34 +18,37 @@ import { sidebarConfig, useSidebarOpenState, } from '@backstage/core-components'; -import { makeStyles } from '@material-ui/core'; -import { LogoFull } from './LogoFull'; -import { LogoIcon } from './LogoIcon'; - -const useSidebarLogoStyles = makeStyles({ - root: { - width: sidebarConfig.drawerWidthClosed, - height: 3 * sidebarConfig.logoHeight, - display: 'flex', - flexFlow: 'row nowrap', - alignItems: 'center', - marginBottom: -14, - }, - link: { - width: sidebarConfig.drawerWidthClosed, - marginLeft: 24, - }, -}); +import Box from '@mui/material/Box'; +import { + LogoFull, + LogoIcon, +} from '@red-hat-developer-hub/backstage-plugin-theme'; export const SidebarLogo = () => { - const classes = useSidebarLogoStyles(); const { isOpen } = useSidebarOpenState(); return ( -
- + + {isOpen ? : } -
+ ); }; diff --git a/workspaces/adoption-insights/packages/app/src/modules/signIn/SignInPageComponent.tsx b/workspaces/adoption-insights/packages/app/src/modules/signIn/SignInPageComponent.tsx new file mode 100644 index 0000000000..4ffd1f7924 --- /dev/null +++ b/workspaces/adoption-insights/packages/app/src/modules/signIn/SignInPageComponent.tsx @@ -0,0 +1,29 @@ +/* + * Copyright Red Hat, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { SignInPage } from '@backstage/core-components'; +import { githubAuthApiRef } from '@backstage/core-plugin-api'; +import type { SignInPageProps } from '@backstage/plugin-app-react'; + +const githubProvider = { + id: 'github-auth-provider', + title: 'GitHub', + message: 'Sign in using GitHub', + apiRef: githubAuthApiRef, +}; + +export function SignInPageComponent(props: SignInPageProps) { + return ; +} diff --git a/workspaces/adoption-insights/packages/app/src/modules/signIn/index.ts b/workspaces/adoption-insights/packages/app/src/modules/signIn/index.ts new file mode 100644 index 0000000000..08e584256d --- /dev/null +++ b/workspaces/adoption-insights/packages/app/src/modules/signIn/index.ts @@ -0,0 +1,29 @@ +/* + * Copyright Red Hat, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { createFrontendModule } from '@backstage/frontend-plugin-api'; +import { SignInPageBlueprint } from '@backstage/plugin-app-react'; + +export const signInModule = createFrontendModule({ + pluginId: 'app', + extensions: [ + SignInPageBlueprint.make({ + params: { + loader: () => + import('./SignInPageComponent').then(m => m.SignInPageComponent), + }, + }), + ], +}); diff --git a/workspaces/adoption-insights/plugins/adoption-insights/.eslintrc.js b/workspaces/adoption-insights/plugins/adoption-insights/.eslintrc.js index e2a53a6ad2..493ce7565d 100644 --- a/workspaces/adoption-insights/plugins/adoption-insights/.eslintrc.js +++ b/workspaces/adoption-insights/plugins/adoption-insights/.eslintrc.js @@ -1 +1,18 @@ -module.exports = require('@backstage/cli/config/eslint-factory')(__dirname); +/* + * Copyright Red Hat, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// eslint-disable-next-line @backstage/no-relative-monorepo-imports -- workspace ESLint shared config +module.exports = require('../../eslint.frontend-shared.cjs')(__dirname); diff --git a/workspaces/adoption-insights/plugins/adoption-insights/package.json b/workspaces/adoption-insights/plugins/adoption-insights/package.json index 81a76271e4..556391a609 100644 --- a/workspaces/adoption-insights/plugins/adoption-insights/package.json +++ b/workspaces/adoption-insights/plugins/adoption-insights/package.json @@ -59,9 +59,6 @@ "@backstage/plugin-catalog-react": "^2.1.1", "@backstage/plugin-permission-react": "^0.4.41", "@backstage/theme": "^0.7.2", - "@material-ui/core": "^4.12.2", - "@material-ui/icons": "^4.9.1", - "@material-ui/lab": "4.0.0-alpha.61", "@mui/icons-material": "5.18.0", "@mui/lab": "5.0.0-alpha.177", "@mui/material": "5.18.0", diff --git a/workspaces/adoption-insights/plugins/adoption-insights/src/components/ActiveUsers/ActiveUsers.tsx b/workspaces/adoption-insights/plugins/adoption-insights/src/components/ActiveUsers/ActiveUsers.tsx index abb1e1f108..e66a920e9e 100644 --- a/workspaces/adoption-insights/plugins/adoption-insights/src/components/ActiveUsers/ActiveUsers.tsx +++ b/workspaces/adoption-insights/plugins/adoption-insights/src/components/ActiveUsers/ActiveUsers.tsx @@ -39,7 +39,7 @@ import { getGroupingLabel, } from '../../utils/utils'; import { useActiveUsers } from '../../hooks/useActiveUsers'; -import { Typography } from '@material-ui/core'; +import Typography from '@mui/material/Typography'; import ExportCSVButton from './ExportCSVButton'; import EmptyChartState from '../Common/EmptyChartState'; import ChartTooltip from '../Common/ChartTooltip'; diff --git a/workspaces/adoption-insights/plugins/analytics-module-adoption-insights/.eslintrc.js b/workspaces/adoption-insights/plugins/analytics-module-adoption-insights/.eslintrc.js index e2a53a6ad2..493ce7565d 100644 --- a/workspaces/adoption-insights/plugins/analytics-module-adoption-insights/.eslintrc.js +++ b/workspaces/adoption-insights/plugins/analytics-module-adoption-insights/.eslintrc.js @@ -1 +1,18 @@ -module.exports = require('@backstage/cli/config/eslint-factory')(__dirname); +/* + * Copyright Red Hat, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// eslint-disable-next-line @backstage/no-relative-monorepo-imports -- workspace ESLint shared config +module.exports = require('../../eslint.frontend-shared.cjs')(__dirname); diff --git a/workspaces/adoption-insights/plugins/analytics-module-adoption-insights/package.json b/workspaces/adoption-insights/plugins/analytics-module-adoption-insights/package.json index f78944c5f2..e2e2568c0a 100644 --- a/workspaces/adoption-insights/plugins/analytics-module-adoption-insights/package.json +++ b/workspaces/adoption-insights/plugins/analytics-module-adoption-insights/package.json @@ -51,9 +51,6 @@ "@backstage/core-plugin-api": "^1.12.4", "@backstage/frontend-plugin-api": "^0.15.1", "@backstage/theme": "^0.7.2", - "@material-ui/core": "^4.9.13", - "@material-ui/icons": "^4.9.1", - "@material-ui/lab": "^4.0.0-alpha.61", "react-use": "^17.2.4" }, "peerDependencies": { diff --git a/workspaces/adoption-insights/yarn.lock b/workspaces/adoption-insights/yarn.lock index b75c1bc5af..48eac79aa7 100644 --- a/workspaces/adoption-insights/yarn.lock +++ b/workspaces/adoption-insights/yarn.lock @@ -5035,7 +5035,7 @@ __metadata: languageName: node linkType: hard -"@emotion/hash@npm:^0.9.2": +"@emotion/hash@npm:^0.9.1, @emotion/hash@npm:^0.9.2": version: 0.9.2 resolution: "@emotion/hash@npm:0.9.2" checksum: 10c0/0dc254561a3cc0a06a10bbce7f6a997883fd240c8c1928b93713f803a2e9153a257a488537012efe89dbe1246f2abfe2add62cdb3471a13d67137fcb808e81c2 @@ -7306,7 +7306,7 @@ __metadata: languageName: node linkType: hard -"@mui/icons-material@npm:5.18.0, @mui/icons-material@npm:^5.17.1": +"@mui/icons-material@npm:5.18.0, @mui/icons-material@npm:^5.17.1, @mui/icons-material@npm:^5.18.0": version: 5.18.0 resolution: "@mui/icons-material@npm:5.18.0" dependencies: @@ -7351,7 +7351,7 @@ __metadata: languageName: node linkType: hard -"@mui/material@npm:5.18.0, @mui/material@npm:^5.12.2": +"@mui/material@npm:5.18.0, @mui/material@npm:^5.12.2, @mui/material@npm:^5.18.0": version: 5.18.0 resolution: "@mui/material@npm:5.18.0" dependencies: @@ -7423,6 +7423,37 @@ __metadata: languageName: node linkType: hard +"@mui/styles@npm:5.18.0": + version: 5.18.0 + resolution: "@mui/styles@npm:5.18.0" + dependencies: + "@babel/runtime": "npm:^7.23.9" + "@emotion/hash": "npm:^0.9.1" + "@mui/private-theming": "npm:^5.17.1" + "@mui/types": "npm:~7.2.15" + "@mui/utils": "npm:^5.17.1" + clsx: "npm:^2.1.0" + csstype: "npm:^3.1.3" + hoist-non-react-statics: "npm:^3.3.2" + jss: "npm:^10.10.0" + jss-plugin-camel-case: "npm:^10.10.0" + jss-plugin-default-unit: "npm:^10.10.0" + jss-plugin-global: "npm:^10.10.0" + jss-plugin-nested: "npm:^10.10.0" + jss-plugin-props-sort: "npm:^10.10.0" + jss-plugin-rule-value-function: "npm:^10.10.0" + jss-plugin-vendor-prefixer: "npm:^10.10.0" + prop-types: "npm:^15.8.1" + peerDependencies: + "@types/react": ^17.0.0 || ^18.0.0 || ^19.0.0 + react: ^17.0.0 || ^18.0.0 || ^19.0.0 + peerDependenciesMeta: + "@types/react": + optional: true + checksum: 10c0/dbf9f95cb1c035b5080448f8b9ab9414a394ddc787d94be69213a926ac3e0d5ad763b6e73ab369e524db7f2c46ef9e88bf31c1a6b3798630ebf5d64cd5576434 + languageName: node + linkType: hard + "@mui/system@npm:^5.18.0": version: 5.18.0 resolution: "@mui/system@npm:5.18.0" @@ -10968,9 +10999,6 @@ __metadata: "@backstage/plugin-permission-react": "npm:^0.4.41" "@backstage/test-utils": "npm:^1.7.16" "@backstage/theme": "npm:^0.7.2" - "@material-ui/core": "npm:^4.12.2" - "@material-ui/icons": "npm:^4.9.1" - "@material-ui/lab": "npm:4.0.0-alpha.61" "@mui/icons-material": "npm:5.18.0" "@mui/lab": "npm:5.0.0-alpha.177" "@mui/material": "npm:5.18.0" @@ -11003,9 +11031,6 @@ __metadata: "@backstage/frontend-plugin-api": "npm:^0.15.1" "@backstage/test-utils": "npm:^1.7.16" "@backstage/theme": "npm:^0.7.2" - "@material-ui/core": "npm:^4.9.13" - "@material-ui/icons": "npm:^4.9.1" - "@material-ui/lab": "npm:^4.0.0-alpha.61" "@testing-library/jest-dom": "npm:^6.0.0" "@testing-library/react": "npm:^14.0.0" "@testing-library/user-event": "npm:^14.0.0" @@ -15754,12 +15779,13 @@ __metadata: "@backstage/test-utils": "npm:^1.7.16" "@backstage/theme": "npm:^0.7.2" "@backstage/ui": "npm:^0.13.2" - "@material-ui/core": "npm:^4.12.2" - "@material-ui/icons": "npm:^4.9.1" "@mui/icons-material": "npm:5.18.0" + "@mui/material": "npm:5.18.0" + "@mui/styles": "npm:5.18.0" "@playwright/test": "npm:1.60.0" "@red-hat-developer-hub/backstage-plugin-adoption-insights": "workspace:^" "@red-hat-developer-hub/backstage-plugin-analytics-module-adoption-insights": "workspace:^" + "@red-hat-developer-hub/backstage-plugin-theme": "npm:^0.14.0" "@testing-library/dom": "npm:^9.0.0" "@testing-library/jest-dom": "npm:^6.0.0" "@testing-library/react": "npm:^14.0.0" @@ -15796,11 +15822,12 @@ __metadata: "@backstage/plugin-search": "npm:^1.7.0" "@backstage/plugin-user-settings": "npm:^0.9.1" "@backstage/ui": "npm:^0.13.2" - "@material-ui/core": "npm:^4.12.2" - "@material-ui/icons": "npm:^4.9.1" + "@mui/icons-material": "npm:^5.18.0" + "@mui/material": "npm:^5.18.0" "@playwright/test": "npm:1.60.0" "@red-hat-developer-hub/backstage-plugin-adoption-insights": "workspace:^" "@red-hat-developer-hub/backstage-plugin-analytics-module-adoption-insights": "workspace:^" + "@red-hat-developer-hub/backstage-plugin-theme": "npm:^0.14.0" "@testing-library/dom": "npm:^9.0.0" "@testing-library/jest-dom": "npm:^6.0.0" "@testing-library/react": "npm:^14.0.0" @@ -24840,7 +24867,7 @@ __metadata: languageName: node linkType: hard -"jss-plugin-camel-case@npm:^10.5.1": +"jss-plugin-camel-case@npm:^10.10.0, jss-plugin-camel-case@npm:^10.5.1": version: 10.10.0 resolution: "jss-plugin-camel-case@npm:10.10.0" dependencies: @@ -24851,7 +24878,7 @@ __metadata: languageName: node linkType: hard -"jss-plugin-default-unit@npm:^10.5.1": +"jss-plugin-default-unit@npm:^10.10.0, jss-plugin-default-unit@npm:^10.5.1": version: 10.10.0 resolution: "jss-plugin-default-unit@npm:10.10.0" dependencies: @@ -24861,7 +24888,7 @@ __metadata: languageName: node linkType: hard -"jss-plugin-global@npm:^10.5.1": +"jss-plugin-global@npm:^10.10.0, jss-plugin-global@npm:^10.5.1": version: 10.10.0 resolution: "jss-plugin-global@npm:10.10.0" dependencies: @@ -24871,7 +24898,7 @@ __metadata: languageName: node linkType: hard -"jss-plugin-nested@npm:^10.5.1": +"jss-plugin-nested@npm:^10.10.0, jss-plugin-nested@npm:^10.5.1": version: 10.10.0 resolution: "jss-plugin-nested@npm:10.10.0" dependencies: @@ -24882,7 +24909,7 @@ __metadata: languageName: node linkType: hard -"jss-plugin-props-sort@npm:^10.5.1": +"jss-plugin-props-sort@npm:^10.10.0, jss-plugin-props-sort@npm:^10.5.1": version: 10.10.0 resolution: "jss-plugin-props-sort@npm:10.10.0" dependencies: @@ -24892,7 +24919,7 @@ __metadata: languageName: node linkType: hard -"jss-plugin-rule-value-function@npm:^10.5.1": +"jss-plugin-rule-value-function@npm:^10.10.0, jss-plugin-rule-value-function@npm:^10.5.1": version: 10.10.0 resolution: "jss-plugin-rule-value-function@npm:10.10.0" dependencies: @@ -24903,7 +24930,7 @@ __metadata: languageName: node linkType: hard -"jss-plugin-vendor-prefixer@npm:^10.5.1": +"jss-plugin-vendor-prefixer@npm:^10.10.0, jss-plugin-vendor-prefixer@npm:^10.5.1": version: 10.10.0 resolution: "jss-plugin-vendor-prefixer@npm:10.10.0" dependencies: @@ -24914,7 +24941,7 @@ __metadata: languageName: node linkType: hard -"jss@npm:10.10.0, jss@npm:^10.5.1, jss@npm:~10.10.0": +"jss@npm:10.10.0, jss@npm:^10.10.0, jss@npm:^10.5.1, jss@npm:~10.10.0": version: 10.10.0 resolution: "jss@npm:10.10.0" dependencies: