Skip to content

Commit effe060

Browse files
committed
[FE] After merge fixes
1 parent 058c156 commit effe060

File tree

4 files changed

+8
-12
lines changed

4 files changed

+8
-12
lines changed

kafka-ui-react-app/src/components/Dashboard/ClustersWidget/ClustersWidget.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { v4 } from 'uuid';
44

55
import MetricsWrapper from 'components/common/Dashboard/MetricsWrapper';
66
import Indicator from 'components/common/Dashboard/Indicator';
7-
import { Cluster } from 'redux/interfaces';
7+
import { Cluster } from 'generated-sources';
88
import ClusterWidget from './ClusterWidget';
99

1010
interface Props {
@@ -67,7 +67,7 @@ const ClustersWidget: React.FC<Props> = ({
6767
{clusterList.map((chunkItem) => (
6868
<div className="columns" key={chunkItem.id}>
6969
{chunkItem.data.map((cluster) => (
70-
<ClusterWidget cluster={cluster} key={cluster.id} />
70+
<ClusterWidget cluster={cluster} key={cluster.name} />
7171
))}
7272
</div>
7373
))}

kafka-ui-react-app/src/redux/interfaces/cluster.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
import { Cluster as InputCLuster } from 'generated-sources';
2-
3-
export interface Cluster extends InputCLuster {
4-
id: string;
5-
}
1+
import { Cluster } from 'generated-sources';
62

73
export type ClusterName = Cluster['name'];
84

kafka-ui-react-app/src/redux/reducers/clusters/reducer.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
import { v4 } from 'uuid';
2-
import { Action, Cluster } from 'redux/interfaces';
1+
import { Action } from 'redux/interfaces';
2+
import { Cluster } from 'generated-sources';
33
import ActionType from 'redux/actionType';
44

55
export const initialState: Cluster[] = [];
66

77
const reducer = (state = initialState, action: Action): Cluster[] => {
88
switch (action.type) {
99
case ActionType.GET_CLUSTERS__SUCCESS:
10-
return action.payload.map((cluster) => ({ id: v4(), ...cluster }));
10+
return action.payload;
1111
default:
1212
return state;
1313
}

kafka-ui-react-app/src/redux/reducers/clusters/selectors.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { createSelector } from 'reselect';
2-
import { RootState, FetchStatus, Cluster } from 'redux/interfaces';
2+
import { RootState, FetchStatus } from 'redux/interfaces';
33
import { createFetchingSelector } from 'redux/reducers/loader/selectors';
4-
import { ServerStatus } from 'generated-sources';
4+
import { Cluster, ServerStatus } from 'generated-sources';
55

66
const clustersState = ({ clusters }: RootState): Cluster[] => clusters;
77

0 commit comments

Comments
 (0)