Skip to content

Commit 9d09302

Browse files
Merge pull request #14680 from TheRealJon/OCPBUGS-30973
OCPBUGS-30973: Update @types/react-redux
2 parents c77cf3f + 32f833e commit 9d09302

73 files changed

Lines changed: 161 additions & 358 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

frontend/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@
198198
"react-measure": "^2.2.6",
199199
"react-modal": "^3.12.1",
200200
"react-monaco-editor": "0.46.x",
201-
"react-redux": "7.2.2",
201+
"react-redux": "7.2.9",
202202
"react-router": "5.3.x",
203203
"react-router-dom": "5.3.x",
204204
"react-router-dom-v5-compat": "^6.11.2",
@@ -255,7 +255,6 @@
255255
"@types/react-helmet": "5.x",
256256
"@types/react-jsonschema-form": "^1.3.8",
257257
"@types/react-measure": "^2.0.6",
258-
"@types/react-redux": "6.0.2",
259258
"@types/react-router": "^5.1.20",
260259
"@types/react-router-dom": "5.3.x",
261260
"@types/react-transition-group": "2.x",

frontend/packages/console-app/src/components/admission-webhook-warnings/AdmissionWebhookWarningNotifications.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
11
import * as React from 'react';
22
import { AlertVariant } from '@patternfly/react-core';
3+
import { Map } from 'immutable';
34
import { useTranslation } from 'react-i18next';
4-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
5-
// @ts-ignore: FIXME out-of-sync @types/react-redux version as new types cause many build errors
65
import { useDispatch, useSelector } from 'react-redux';
76
import {
87
AdmissionWebhookWarning,
9-
CoreState,
108
getAdmissionWebhookWarnings,
119
removeAdmissionWebhookWarning,
10+
SDKStoreState,
1211
} from '@console/dynamic-plugin-sdk/src';
1312
import { documentationURLs, getDocumentationURL } from '@console/internal/components/utils';
1413
import { useToast } from '@console/shared/src';
1514

1615
type UseAdmissionWebhookWarnings = () => Map<string, AdmissionWebhookWarning>;
1716
const useAdmissionWebhookWarnings: UseAdmissionWebhookWarnings = () =>
18-
useSelector<CoreState, Map<string, AdmissionWebhookWarning>>(getAdmissionWebhookWarnings);
17+
useSelector<SDKStoreState, Map<string, AdmissionWebhookWarning>>(getAdmissionWebhookWarnings);
1918

2019
export const AdmissionWebhookWarningNotifications = () => {
2120
const { t } = useTranslation();

frontend/packages/console-app/src/components/detect-namespace/__tests__/namespace.spec.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import * as React from 'react';
22
import { act } from 'react-dom/test-utils';
3-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
4-
// @ts-ignore: FIXME out-of-sync @types/react-redux version as new types cause many build errors
53
import { useDispatch } from 'react-redux';
64
import { useLocation } from 'react-router-dom-v5-compat';
75
import { k8sGet } from '@console/dynamic-plugin-sdk/src/utils/k8s';

frontend/packages/console-app/src/components/detect-namespace/namespace.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
import * as React from 'react';
2-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
3-
// @ts-ignore: FIXME out-of-sync @types/react-redux version as new types cause many build errors
42
import { useDispatch } from 'react-redux';
53
import { useLocation, useNavigate } from 'react-router-dom-v5-compat';
64
import {

frontend/packages/console-app/src/components/nodes/NodesPage.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ import { sortable } from '@patternfly/react-table';
33
import { TFunction } from 'i18next';
44
import * as _ from 'lodash';
55
import { useTranslation } from 'react-i18next';
6-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
7-
// @ts-ignore: FIXME out-of-sync @types/react-redux version as new types cause many build errors
86
import { useSelector, useDispatch } from 'react-redux';
97
import {
108
ListPageBody,
@@ -45,6 +43,7 @@ import {
4543
referenceFor,
4644
Selector,
4745
} from '@console/internal/module/k8s';
46+
import { RootState } from '@console/internal/redux';
4847
import {
4948
getName,
5049
getUID,
@@ -258,7 +257,7 @@ const NodesTableRow: React.FC<RowProps<NodeKind, GetNodeStatusExtensions>> = ({
258257
rowData,
259258
}) => {
260259
const { t } = useTranslation();
261-
const metrics = useSelector(({ UI }) => UI.getIn(['metrics', 'node']));
260+
const metrics = useSelector<RootState, NodeMetrics>(({ UI }) => UI.getIn(['metrics', 'node']));
262261
const nodeName = getName(node);
263262
const nodeUID = getUID(node);
264263
const usedMem = metrics?.usedMemory?.[nodeName];

frontend/packages/console-app/src/components/tour/tour-context.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ import {
99
useCallback,
1010
} from 'react';
1111
import { pick, union, isEqual } from 'lodash';
12-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
13-
// @ts-ignore: FIXME out-of-sync @types/react-redux version as new types cause many build errors
1412
import { useSelector } from 'react-redux';
1513
import { createSelector } from 'reselect';
1614
import { useActivePerspective } from '@console/dynamic-plugin-sdk';

frontend/packages/console-dynamic-plugin-sdk/src/api/internal-types.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,11 @@ export type UseDashboardResources = ({
273273
}) => {
274274
urlResults: RequestMap<any>;
275275
prometheusResults: RequestMap<PrometheusResponse>;
276-
notificationAlerts: { alerts: Alert[]; loaded: boolean; loadError: Error };
276+
notificationAlerts: {
277+
alerts: Alert[];
278+
loaded: boolean;
279+
loadError: Error;
280+
};
277281
};
278282

279283
export type QuickStartsLoaderProps = {

frontend/packages/console-dynamic-plugin-sdk/src/app/useReduxStore.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
import * as React from 'react';
2-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
3-
// @ts-ignore: FIXME out-of-sync @types/react-redux version as new types cause many build errors
42
import { useStore } from 'react-redux';
53
import { applyMiddleware, combineReducers, createStore, compose, Store } from 'redux';
64
import thunk from 'redux-thunk';

frontend/packages/console-dynamic-plugin-sdk/src/utils/flags.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
2-
// @ts-ignore: FIXME out-of-sync @types/react-redux version as new types cause many build errors
31
import { useSelector } from 'react-redux';
42
import { FeatureSubStore } from '../app/features';
53

frontend/packages/console-dynamic-plugin-sdk/src/utils/k8s/hooks/useK8sModel.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
2-
// @ts-ignore: FIXME out-of-sync @types/react-redux version as new types cause many build errors
31
import { useSelector } from 'react-redux';
42
import { K8sModel } from '../../../api/common-types';
3+
import { SDKStoreState } from '../../../app/redux-types';
54
import {
65
UseK8sModel,
76
K8sResourceKindReference,
@@ -33,6 +32,6 @@ export const getK8sModel = (
3332
* ```
3433
*/
3534
export const useK8sModel: UseK8sModel = (k8sGroupVersionKind) => [
36-
useSelector(({ k8s }) => getK8sModel(k8s, k8sGroupVersionKind)),
37-
useSelector(({ k8s }) => k8s.getIn(['RESOURCES', 'inFlight']) ?? false),
35+
useSelector<SDKStoreState, K8sModel>(({ k8s }) => getK8sModel(k8s, k8sGroupVersionKind)),
36+
useSelector<SDKStoreState, boolean>(({ k8s }) => k8s.getIn(['RESOURCES', 'inFlight']) ?? false),
3837
];

0 commit comments

Comments
 (0)