Sfoglia il codice sorgente

[FE] After merge fixes

Azat Mutigullin 4 anni fa
parent
commit
effe0603d6

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

@@ -4,7 +4,7 @@ import { v4 } from 'uuid';
 
 import MetricsWrapper from 'components/common/Dashboard/MetricsWrapper';
 import Indicator from 'components/common/Dashboard/Indicator';
-import { Cluster } from 'redux/interfaces';
+import { Cluster } from 'generated-sources';
 import ClusterWidget from './ClusterWidget';
 
 interface Props {
@@ -67,7 +67,7 @@ const ClustersWidget: React.FC<Props> = ({
       {clusterList.map((chunkItem) => (
         <div className="columns" key={chunkItem.id}>
           {chunkItem.data.map((cluster) => (
-            <ClusterWidget cluster={cluster} key={cluster.id} />
+            <ClusterWidget cluster={cluster} key={cluster.name} />
           ))}
         </div>
       ))}

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

@@ -1,8 +1,4 @@
-import { Cluster as InputCLuster } from 'generated-sources';
-
-export interface Cluster extends InputCLuster {
-  id: string;
-}
+import { Cluster } from 'generated-sources';
 
 export type ClusterName = Cluster['name'];
 

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

@@ -1,5 +1,5 @@
-import { v4 } from 'uuid';
-import { Action, Cluster } from 'redux/interfaces';
+import { Action } from 'redux/interfaces';
+import { Cluster } from 'generated-sources';
 import ActionType from 'redux/actionType';
 
 export const initialState: Cluster[] = [];
@@ -7,7 +7,7 @@ export const initialState: Cluster[] = [];
 const reducer = (state = initialState, action: Action): Cluster[] => {
   switch (action.type) {
     case ActionType.GET_CLUSTERS__SUCCESS:
-      return action.payload.map((cluster) => ({ id: v4(), ...cluster }));
+      return action.payload;
     default:
       return state;
   }

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

@@ -1,7 +1,7 @@
 import { createSelector } from 'reselect';
-import { RootState, FetchStatus, Cluster } from 'redux/interfaces';
+import { RootState, FetchStatus } from 'redux/interfaces';
 import { createFetchingSelector } from 'redux/reducers/loader/selectors';
-import { ServerStatus } from 'generated-sources';
+import { Cluster, ServerStatus } from 'generated-sources';
 
 const clustersState = ({ clusters }: RootState): Cluster[] => clusters;