Skip to content

Commit 29fd2da

Browse files
chore(topology): add already used Material UI v4 and mobx-react dependency to resolve linter issues (#8359)
Signed-off-by: Christoph Jerolimov <jerolimov+git@redhat.com>
1 parent 0586f2a commit 29fd2da

7 files changed

Lines changed: 18 additions & 20 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@backstage-community/plugin-topology': patch
3+
---
4+
5+
Add (already used) Material UI v4 and mobx-react dependency to resolve linter issues.

workspaces/topology/plugins/topology/knip-report.md

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,6 @@
44

55
| Name | Location | Severity |
66
| :----------- | :---------------- | :------- |
7-
| style-inject | package.json:73:6 | error |
8-
| victory | package.json:74:6 | error |
9-
10-
## Unlisted dependencies (3)
11-
12-
| Name | Location | Severity |
13-
| :---------------- | :------------------------------------------ | :------- |
14-
| @material-ui/core | src/components/common/StatusIconAndText.tsx | error |
15-
| mobx-react | src/components/Graph/EdgeConnect.tsx | error |
16-
| @material-ui/core | src/components/common/Status.tsx | error |
7+
| style-inject | package.json:75:6 | error |
8+
| victory | package.json:76:6 | error |
179

workspaces/topology/plugins/topology/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
"@backstage/plugin-permission-react": "^0.4.41",
5757
"@backstage/theme": "^0.7.2",
5858
"@kubernetes/client-node": "1.4.0",
59+
"@material-ui/core": "^4.12.4",
5960
"@mui/icons-material": "5.18.0",
6061
"@mui/lab": "5.0.0-alpha.177",
6162
"@mui/material": "^5.15.17",
@@ -69,6 +70,7 @@
6970
"git-url-parse": "^13.1.0",
7071
"js-yaml": "^4.1.0",
7172
"lodash": "^4.17.21",
73+
"mobx-react": "^7.6.0",
7274
"react-use": "^17.4.0",
7375
"style-inject": "^0.3.0",
7476
"victory": "^37.3.6"

workspaces/topology/plugins/topology/src/components/Graph/decorators/Decorator.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
import * as React from 'react';
1716
import { Link } from 'react-router-dom';
1817

1918
import { Decorator as PfDecorator } from '@patternfly/react-topology';

workspaces/topology/plugins/topology/src/components/Topology/TopologySideBar/PodLogs/PodLogsDialog.tsx

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
import { useState } from 'react';
17-
18-
import * as React from 'react';
16+
import { useContext, useEffect, useState } from 'react';
1917

2018
import { ErrorBoundary } from '@backstage/core-components';
2119
import { RequirePermission } from '@backstage/plugin-permission-react';
@@ -50,7 +48,7 @@ type ViewLogsProps = {
5048
};
5149

5250
const ViewLogs = ({ podData, onClose }: ViewLogsProps) => {
53-
const { clusters, selectedCluster } = React.useContext(K8sResourcesContext);
51+
const { clusters, selectedCluster } = useContext(K8sResourcesContext);
5452
const [logText, setLogText] = useState<string>('');
5553

5654
const curCluster =
@@ -63,8 +61,8 @@ const ViewLogs = ({ podData, onClose }: ViewLogsProps) => {
6361
(containersList?.length && (containersList?.[0].name ?? '')) || '';
6462

6563
const [containerSelected, setContainerSelected] =
66-
React.useState<string>(curContainer);
67-
const [podScope, setPodScope] = React.useState<ContainerScope>({
64+
useState<string>(curContainer);
65+
const [podScope, setPodScope] = useState<ContainerScope>({
6866
containerName: curContainer,
6967
podName,
7068
podNamespace: podNamespace,
@@ -75,7 +73,7 @@ const ViewLogs = ({ podData, onClose }: ViewLogsProps) => {
7573
setContainerSelected(event.target.value);
7674
};
7775

78-
React.useEffect(() => {
76+
useEffect(() => {
7977
if (containerSelected) {
8078
setPodScope(ps => ({
8179
...ps,
@@ -146,7 +144,7 @@ const ViewLogs = ({ podData, onClose }: ViewLogsProps) => {
146144

147145
export const PodLogsDialog = ({ podData }: PodLogsDialogProps) => {
148146
const { t } = useTranslation();
149-
const { clusters, selectedCluster } = React.useContext(K8sResourcesContext);
147+
const { clusters, selectedCluster } = useContext(K8sResourcesContext);
150148
const [open, setOpen] = useState<boolean>(false);
151149

152150
const curCluster =

workspaces/topology/plugins/topology/src/components/common/Status.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import {
2424
StatusWarning,
2525
} from '@backstage/core-components';
2626

27-
import { createStyles, makeStyles, Theme } from '@material-ui/core';
27+
import { createStyles, makeStyles, Theme } from '@material-ui/core/styles';
2828
import OffIcon from '@mui/icons-material/DoNotDisturbOnOutlined';
2929
import UnknownIcon from '@mui/icons-material/HelpOutline';
3030
import AngleDoubleRightIcon from '@mui/icons-material/KeyboardDoubleArrowRight';

workspaces/topology/yarn.lock

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1414,6 +1414,7 @@ __metadata:
14141414
"@backstage/test-utils": "npm:^1.7.16"
14151415
"@backstage/theme": "npm:^0.7.2"
14161416
"@kubernetes/client-node": "npm:1.4.0"
1417+
"@material-ui/core": "npm:^4.12.4"
14171418
"@mui/icons-material": "npm:5.18.0"
14181419
"@mui/lab": "npm:5.0.0-alpha.177"
14191420
"@mui/material": "npm:^5.15.17"
@@ -1435,6 +1436,7 @@ __metadata:
14351436
glob: "npm:^13.0.0"
14361437
js-yaml: "npm:^4.1.0"
14371438
lodash: "npm:^4.17.21"
1439+
mobx-react: "npm:^7.6.0"
14381440
react: "npm:^18.3.1"
14391441
react-dom: "npm:^18.3.1"
14401442
react-router-dom: "npm:^6.26.2"

0 commit comments

Comments
 (0)