File tree Expand file tree Collapse file tree 4 files changed +8
-12
lines changed
components/Dashboard/ClustersWidget Expand file tree Collapse file tree 4 files changed +8
-12
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import { v4 } from 'uuid';
44
55import MetricsWrapper from 'components/common/Dashboard/MetricsWrapper' ;
66import Indicator from 'components/common/Dashboard/Indicator' ;
7- import { Cluster } from 'redux/interfaces ' ;
7+ import { Cluster } from 'generated-sources ' ;
88import ClusterWidget from './ClusterWidget' ;
99
1010interface 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 ) ) }
Original file line number Diff line number Diff line change 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
73export type ClusterName = Cluster [ 'name' ] ;
84
Original file line number Diff line number Diff line change 1- import { v4 } from 'uuid ' ;
2- import { Action , Cluster } from 'redux/interfaces ' ;
1+ import { Action } from 'redux/interfaces ' ;
2+ import { Cluster } from 'generated-sources ' ;
33import ActionType from 'redux/actionType' ;
44
55export const initialState : Cluster [ ] = [ ] ;
66
77const 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 }
Original file line number Diff line number Diff line change 11import { createSelector } from 'reselect' ;
2- import { RootState , FetchStatus , Cluster } from 'redux/interfaces' ;
2+ import { RootState , FetchStatus } from 'redux/interfaces' ;
33import { createFetchingSelector } from 'redux/reducers/loader/selectors' ;
4- import { ServerStatus } from 'generated-sources' ;
4+ import { Cluster , ServerStatus } from 'generated-sources' ;
55
66const clustersState = ( { clusters } : RootState ) : Cluster [ ] => clusters ;
77
You can’t perform that action at this time.
0 commit comments