diff --git a/kafka-ui-react-app/src/components/Topics/Details/Messages/MessagesTable.tsx b/kafka-ui-react-app/src/components/Topics/Details/Messages/MessagesTable.tsx index 5073673f86..e6e8e7bee1 100644 --- a/kafka-ui-react-app/src/components/Topics/Details/Messages/MessagesTable.tsx +++ b/kafka-ui-react-app/src/components/Topics/Details/Messages/MessagesTable.tsx @@ -1,8 +1,6 @@ import React from 'react'; import { TopicMessage } from 'generated-sources'; -import CustomParamButton, { - CustomParamButtonType, -} from '../../shared/Form/CustomParams/CustomParamButton'; +import CustomParamButton from 'components/Topics/shared/Form/CustomParams/CustomParamButton'; import MessageItem from './MessageItem'; interface MessagesTableProp { @@ -44,7 +42,7 @@ const MessagesTable: React.FC = ({ messages, onNext }) => {
diff --git a/kafka-ui-react-app/src/components/Topics/shared/Form/CustomParams/CustomParamAction.tsx b/kafka-ui-react-app/src/components/Topics/shared/Form/CustomParams/CustomParamAction.tsx index c97c3f194d..a6909024a9 100644 --- a/kafka-ui-react-app/src/components/Topics/shared/Form/CustomParams/CustomParamAction.tsx +++ b/kafka-ui-react-app/src/components/Topics/shared/Form/CustomParams/CustomParamAction.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import CustomParamButton, { CustomParamButtonType } from './CustomParamButton'; +import CustomParamButton from './CustomParamButton'; interface Props { index: string; @@ -11,7 +11,7 @@ const CustomParamAction: React.FC = ({ index, onRemove }) => ( onRemove(index)} /> diff --git a/kafka-ui-react-app/src/components/Topics/shared/Form/CustomParams/CustomParamButton.tsx b/kafka-ui-react-app/src/components/Topics/shared/Form/CustomParams/CustomParamButton.tsx index 0276beabc1..27e1f6dc60 100644 --- a/kafka-ui-react-app/src/components/Topics/shared/Form/CustomParams/CustomParamButton.tsx +++ b/kafka-ui-react-app/src/components/Topics/shared/Form/CustomParams/CustomParamButton.tsx @@ -1,15 +1,9 @@ import React from 'react'; -export enum CustomParamButtonType { - plus = 'fa-plus', - minus = 'fa-minus', - chevronRight = 'fa-chevron-right', -} - interface Props { onClick: (event: React.MouseEvent) => void; className: string; - type: CustomParamButtonType; + type: 'fa-plus' | 'fa-minus' | 'fa-chevron-right'; btnText?: string; } diff --git a/kafka-ui-react-app/src/components/Topics/shared/Form/CustomParams/CustomParams.tsx b/kafka-ui-react-app/src/components/Topics/shared/Form/CustomParams/CustomParams.tsx index e11c3dbd63..6f84a7b372 100644 --- a/kafka-ui-react-app/src/components/Topics/shared/Form/CustomParams/CustomParams.tsx +++ b/kafka-ui-react-app/src/components/Topics/shared/Form/CustomParams/CustomParams.tsx @@ -7,7 +7,7 @@ import { TopicConfigByName, TopicConfigParams, } from 'redux/interfaces'; -import CustomParamButton, { CustomParamButtonType } from './CustomParamButton'; +import CustomParamButton from './CustomParamButton'; import CustomParamField from './CustomParamField'; export const INDEX_PREFIX = 'customParams'; @@ -79,7 +79,7 @@ const CustomParams: React.FC = ({ isSubmitting, config }) => {
diff --git a/kafka-ui-react-app/src/redux/actionType.ts b/kafka-ui-react-app/src/redux/actionType.ts deleted file mode 100644 index 7df9b142e0..0000000000 --- a/kafka-ui-react-app/src/redux/actionType.ts +++ /dev/null @@ -1,55 +0,0 @@ -enum ActionType { - GET_CLUSTERS__REQUEST = 'GET_CLUSTERS__REQUEST', - GET_CLUSTERS__SUCCESS = 'GET_CLUSTERS__SUCCESS', - GET_CLUSTERS__FAILURE = 'GET_CLUSTERS__FAILURE', - - GET_CLUSTER_STATS__REQUEST = 'GET_CLUSTER_STATUS__REQUEST', - GET_CLUSTER_STATS__SUCCESS = 'GET_CLUSTER_STATUS__SUCCESS', - GET_CLUSTER_STATS__FAILURE = 'GET_CLUSTER_STATUS__FAILURE', - - GET_CLUSTER_METRICS__REQUEST = 'GET_CLUSTER_METRICS__REQUEST', - GET_CLUSTER_METRICS__SUCCESS = 'GET_CLUSTER_METRICS__SUCCESS', - GET_CLUSTER_METRICS__FAILURE = 'GET_CLUSTER_METRICS__FAILURE', - - GET_BROKERS__REQUEST = 'GET_BROKERS__REQUEST', - GET_BROKERS__SUCCESS = 'GET_BROKERS__SUCCESS', - GET_BROKERS__FAILURE = 'GET_BROKERS__FAILURE', - - GET_BROKER_METRICS__REQUEST = 'GET_BROKER_METRICS__REQUEST', - GET_BROKER_METRICS__SUCCESS = 'GET_BROKER_METRICS__SUCCESS', - GET_BROKER_METRICS__FAILURE = 'GET_BROKER_METRICS__FAILURE', - - GET_TOPICS__REQUEST = 'GET_TOPICS__REQUEST', - GET_TOPICS__SUCCESS = 'GET_TOPICS__SUCCESS', - GET_TOPICS__FAILURE = 'GET_TOPICS__FAILURE', - - GET_TOPIC_MESSAGES__REQUEST = 'GET_TOPIC_MESSAGES__REQUEST', - GET_TOPIC_MESSAGES__SUCCESS = 'GET_TOPIC_MESSAGES__SUCCESS', - GET_TOPIC_MESSAGES__FAILURE = 'GET_TOPIC_MESSAGES__FAILURE', - - GET_TOPIC_DETAILS__REQUEST = 'GET_TOPIC_DETAILS__REQUEST', - GET_TOPIC_DETAILS__SUCCESS = 'GET_TOPIC_DETAILS__SUCCESS', - GET_TOPIC_DETAILS__FAILURE = 'GET_TOPIC_DETAILS__FAILURE', - - GET_TOPIC_CONFIG__REQUEST = 'GET_TOPIC_CONFIG__REQUEST', - GET_TOPIC_CONFIG__SUCCESS = 'GET_TOPIC_CONFIG__SUCCESS', - GET_TOPIC_CONFIG__FAILURE = 'GET_TOPIC_CONFIG__FAILURE', - - POST_TOPIC__REQUEST = 'POST_TOPIC__REQUEST', - POST_TOPIC__SUCCESS = 'POST_TOPIC__SUCCESS', - POST_TOPIC__FAILURE = 'POST_TOPIC__FAILURE', - - PATCH_TOPIC__REQUEST = 'PATCH_TOPIC__REQUEST', - PATCH_TOPIC__SUCCESS = 'PATCH_TOPIC__SUCCESS', - PATCH_TOPIC__FAILURE = 'PATCH_TOPIC__FAILURE', - - GET_CONSUMER_GROUPS__REQUEST = 'GET_CONSUMER_GROUPS__REQUEST', - GET_CONSUMER_GROUPS__SUCCESS = 'GET_CONSUMER_GROUPS__SUCCESS', - GET_CONSUMER_GROUPS__FAILURE = 'GET_CONSUMER_GROUPS__FAILURE', - - GET_CONSUMER_GROUP_DETAILS__REQUEST = 'GET_CONSUMER_GROUP_DETAILS__REQUEST', - GET_CONSUMER_GROUP_DETAILS__SUCCESS = 'GET_CONSUMER_GROUP_DETAILS__SUCCESS', - GET_CONSUMER_GROUP_DETAILS__FAILURE = 'GET_CONSUMER_GROUP_DETAILS__FAILURE', -} - -export default ActionType; diff --git a/kafka-ui-react-app/src/redux/actions/actions.ts b/kafka-ui-react-app/src/redux/actions/actions.ts index 679cbd93c1..747c1e6365 100644 --- a/kafka-ui-react-app/src/redux/actions/actions.ts +++ b/kafka-ui-react-app/src/redux/actions/actions.ts @@ -1,5 +1,4 @@ import { createAsyncAction } from 'typesafe-actions'; -import ActionType from 'redux/actionType'; import { TopicName, ConsumerGroupID } from 'redux/interfaces'; import { @@ -17,81 +16,81 @@ import { } from 'generated-sources'; export const fetchClusterStatsAction = createAsyncAction( - ActionType.GET_CLUSTER_STATS__REQUEST, - ActionType.GET_CLUSTER_STATS__SUCCESS, - ActionType.GET_CLUSTER_STATS__FAILURE + 'GET_CLUSTER_STATUS__REQUEST', + 'GET_CLUSTER_STATUS__SUCCESS', + 'GET_CLUSTER_STATUS__FAILURE' )(); export const fetchClusterMetricsAction = createAsyncAction( - ActionType.GET_CLUSTER_METRICS__REQUEST, - ActionType.GET_CLUSTER_METRICS__SUCCESS, - ActionType.GET_CLUSTER_METRICS__FAILURE + 'GET_CLUSTER_METRICS__REQUEST', + 'GET_CLUSTER_METRICS__SUCCESS', + 'GET_CLUSTER_METRICS__FAILURE' )(); export const fetchBrokersAction = createAsyncAction( - ActionType.GET_BROKERS__REQUEST, - ActionType.GET_BROKERS__SUCCESS, - ActionType.GET_BROKERS__FAILURE + 'GET_BROKERS__REQUEST', + 'GET_BROKERS__SUCCESS', + 'GET_BROKERS__FAILURE' )(); export const fetchBrokerMetricsAction = createAsyncAction( - ActionType.GET_BROKER_METRICS__REQUEST, - ActionType.GET_BROKER_METRICS__SUCCESS, - ActionType.GET_BROKER_METRICS__FAILURE + 'GET_BROKER_METRICS__REQUEST', + 'GET_BROKER_METRICS__SUCCESS', + 'GET_BROKER_METRICS__FAILURE' )(); export const fetchClusterListAction = createAsyncAction( - ActionType.GET_CLUSTERS__REQUEST, - ActionType.GET_CLUSTERS__SUCCESS, - ActionType.GET_CLUSTERS__FAILURE + 'GET_CLUSTERS__REQUEST', + 'GET_CLUSTERS__SUCCESS', + 'GET_CLUSTERS__FAILURE' )(); export const fetchTopicsListAction = createAsyncAction( - ActionType.GET_TOPICS__REQUEST, - ActionType.GET_TOPICS__SUCCESS, - ActionType.GET_TOPICS__FAILURE + 'GET_TOPICS__REQUEST', + 'GET_TOPICS__SUCCESS', + 'GET_TOPICS__FAILURE' )(); export const fetchTopicMessagesAction = createAsyncAction( - ActionType.GET_TOPIC_MESSAGES__REQUEST, - ActionType.GET_TOPIC_MESSAGES__SUCCESS, - ActionType.GET_TOPIC_MESSAGES__FAILURE + 'GET_TOPIC_MESSAGES__REQUEST', + 'GET_TOPIC_MESSAGES__SUCCESS', + 'GET_TOPIC_MESSAGES__FAILURE' )(); export const fetchTopicDetailsAction = createAsyncAction( - ActionType.GET_TOPIC_DETAILS__REQUEST, - ActionType.GET_TOPIC_DETAILS__SUCCESS, - ActionType.GET_TOPIC_DETAILS__FAILURE + 'GET_TOPIC_DETAILS__REQUEST', + 'GET_TOPIC_DETAILS__SUCCESS', + 'GET_TOPIC_DETAILS__FAILURE' )(); export const fetchTopicConfigAction = createAsyncAction( - ActionType.GET_TOPIC_CONFIG__REQUEST, - ActionType.GET_TOPIC_CONFIG__SUCCESS, - ActionType.GET_TOPIC_CONFIG__FAILURE + 'GET_TOPIC_CONFIG__REQUEST', + 'GET_TOPIC_CONFIG__SUCCESS', + 'GET_TOPIC_CONFIG__FAILURE' )(); export const createTopicAction = createAsyncAction( - ActionType.POST_TOPIC__REQUEST, - ActionType.POST_TOPIC__SUCCESS, - ActionType.POST_TOPIC__FAILURE + 'POST_TOPIC__REQUEST', + 'POST_TOPIC__SUCCESS', + 'POST_TOPIC__FAILURE' )(); export const updateTopicAction = createAsyncAction( - ActionType.PATCH_TOPIC__REQUEST, - ActionType.PATCH_TOPIC__SUCCESS, - ActionType.PATCH_TOPIC__FAILURE + 'PATCH_TOPIC__REQUEST', + 'PATCH_TOPIC__SUCCESS', + 'PATCH_TOPIC__FAILURE' )(); export const fetchConsumerGroupsAction = createAsyncAction( - ActionType.GET_CONSUMER_GROUPS__REQUEST, - ActionType.GET_CONSUMER_GROUPS__SUCCESS, - ActionType.GET_CONSUMER_GROUPS__FAILURE + 'GET_CONSUMER_GROUPS__REQUEST', + 'GET_CONSUMER_GROUPS__SUCCESS', + 'GET_CONSUMER_GROUPS__FAILURE' )(); export const fetchConsumerGroupDetailsAction = createAsyncAction( - ActionType.GET_CONSUMER_GROUP_DETAILS__REQUEST, - ActionType.GET_CONSUMER_GROUP_DETAILS__SUCCESS, - ActionType.GET_CONSUMER_GROUP_DETAILS__FAILURE + 'GET_CONSUMER_GROUP_DETAILS__REQUEST', + 'GET_CONSUMER_GROUP_DETAILS__SUCCESS', + 'GET_CONSUMER_GROUP_DETAILS__FAILURE' )< undefined, { consumerGroupID: ConsumerGroupID; details: ConsumerGroupDetails }, diff --git a/kafka-ui-react-app/src/redux/interfaces/index.ts b/kafka-ui-react-app/src/redux/interfaces/index.ts index 8a54d01f25..56055cbed7 100644 --- a/kafka-ui-react-app/src/redux/interfaces/index.ts +++ b/kafka-ui-react-app/src/redux/interfaces/index.ts @@ -16,13 +16,6 @@ export * from './broker'; export * from './consumerGroup'; export * from './loader'; -export enum FetchStatus { - notFetched = 'notFetched', - fetching = 'fetching', - fetched = 'fetched', - errorFetching = 'errorFetching', -} - export interface RootState { topics: TopicsState; clusters: ClusterState; diff --git a/kafka-ui-react-app/src/redux/interfaces/loader.ts b/kafka-ui-react-app/src/redux/interfaces/loader.ts index 559a5e01fe..048e695e76 100644 --- a/kafka-ui-react-app/src/redux/interfaces/loader.ts +++ b/kafka-ui-react-app/src/redux/interfaces/loader.ts @@ -1,5 +1,3 @@ -import { FetchStatus } from 'redux/interfaces/index'; - export interface LoaderState { - [key: string]: FetchStatus; + [key: string]: 'notFetched' | 'fetching' | 'fetched' | 'errorFetching'; } diff --git a/kafka-ui-react-app/src/redux/reducers/brokers/reducer.ts b/kafka-ui-react-app/src/redux/reducers/brokers/reducer.ts index cab60d2e25..3df9597129 100644 --- a/kafka-ui-react-app/src/redux/reducers/brokers/reducer.ts +++ b/kafka-ui-react-app/src/redux/reducers/brokers/reducer.ts @@ -1,6 +1,5 @@ import { Action, BrokersState, ZooKeeperStatus } from 'redux/interfaces'; import { ClusterStats } from 'generated-sources'; -import ActionType from 'redux/actionType'; export const initialState: BrokersState = { items: [], @@ -36,14 +35,14 @@ const updateBrokerSegmentSize = ( const reducer = (state = initialState, action: Action): BrokersState => { switch (action.type) { - case ActionType.GET_BROKERS__REQUEST: + case 'GET_BROKERS__REQUEST': return initialState; - case ActionType.GET_BROKERS__SUCCESS: + case 'GET_BROKERS__SUCCESS': return { ...state, items: action.payload, }; - case ActionType.GET_CLUSTER_STATS__SUCCESS: + case 'GET_CLUSTER_STATUS__SUCCESS': return updateBrokerSegmentSize(state, action.payload); default: return state; diff --git a/kafka-ui-react-app/src/redux/reducers/brokers/selectors.ts b/kafka-ui-react-app/src/redux/reducers/brokers/selectors.ts index eab6d08b50..3c6ef947dd 100644 --- a/kafka-ui-react-app/src/redux/reducers/brokers/selectors.ts +++ b/kafka-ui-react-app/src/redux/reducers/brokers/selectors.ts @@ -1,5 +1,5 @@ import { createSelector } from 'reselect'; -import { RootState, FetchStatus, BrokersState } from 'redux/interfaces'; +import { RootState, BrokersState } from 'redux/interfaces'; import { createFetchingSelector } from 'redux/reducers/loader/selectors'; const brokersState = ({ brokers }: RootState): BrokersState => brokers; @@ -8,7 +8,7 @@ const getBrokerListFetchingStatus = createFetchingSelector('GET_BROKERS'); export const getIsBrokerListFetched = createSelector( getBrokerListFetchingStatus, - (status) => status === FetchStatus.fetched + (status) => status === 'fetched' ); export const getBrokerCount = createSelector( diff --git a/kafka-ui-react-app/src/redux/reducers/clusters/reducer.ts b/kafka-ui-react-app/src/redux/reducers/clusters/reducer.ts index 9ce79b7bde..10de9654ff 100644 --- a/kafka-ui-react-app/src/redux/reducers/clusters/reducer.ts +++ b/kafka-ui-react-app/src/redux/reducers/clusters/reducer.ts @@ -1,12 +1,11 @@ import { Action } from 'redux/interfaces'; import { Cluster } from 'generated-sources'; -import ActionType from 'redux/actionType'; export const initialState: Cluster[] = []; const reducer = (state = initialState, action: Action): Cluster[] => { switch (action.type) { - case ActionType.GET_CLUSTERS__SUCCESS: + case 'GET_CLUSTERS__SUCCESS': return action.payload; default: return state; diff --git a/kafka-ui-react-app/src/redux/reducers/clusters/selectors.ts b/kafka-ui-react-app/src/redux/reducers/clusters/selectors.ts index 592e8ccae9..22bab57baa 100644 --- a/kafka-ui-react-app/src/redux/reducers/clusters/selectors.ts +++ b/kafka-ui-react-app/src/redux/reducers/clusters/selectors.ts @@ -1,5 +1,5 @@ import { createSelector } from 'reselect'; -import { RootState, FetchStatus } from 'redux/interfaces'; +import { RootState } from 'redux/interfaces'; import { createFetchingSelector } from 'redux/reducers/loader/selectors'; import { Cluster, ServerStatus } from 'generated-sources'; @@ -9,7 +9,7 @@ const getClusterListFetchingStatus = createFetchingSelector('GET_CLUSTERS'); export const getIsClusterListFetched = createSelector( getClusterListFetchingStatus, - (status) => status === FetchStatus.fetched + (status) => status === 'fetched' ); export const getClusterList = createSelector( diff --git a/kafka-ui-react-app/src/redux/reducers/consumerGroups/reducer.ts b/kafka-ui-react-app/src/redux/reducers/consumerGroups/reducer.ts index 6776dbcc58..c2cb518650 100644 --- a/kafka-ui-react-app/src/redux/reducers/consumerGroups/reducer.ts +++ b/kafka-ui-react-app/src/redux/reducers/consumerGroups/reducer.ts @@ -1,6 +1,5 @@ import { Action, ConsumerGroupsState } from 'redux/interfaces'; import { ConsumerGroup } from 'generated-sources'; -import ActionType from 'redux/actionType'; export const initialState: ConsumerGroupsState = { byID: {}, @@ -34,9 +33,9 @@ const updateConsumerGroupsList = ( const reducer = (state = initialState, action: Action): ConsumerGroupsState => { switch (action.type) { - case ActionType.GET_CONSUMER_GROUPS__SUCCESS: + case 'GET_CONSUMER_GROUPS__SUCCESS': return updateConsumerGroupsList(state, action.payload); - case ActionType.GET_CONSUMER_GROUP_DETAILS__SUCCESS: + case 'GET_CONSUMER_GROUP_DETAILS__SUCCESS': return { ...state, byID: { diff --git a/kafka-ui-react-app/src/redux/reducers/consumerGroups/selectors.ts b/kafka-ui-react-app/src/redux/reducers/consumerGroups/selectors.ts index 0e298084d6..86459fc6d5 100644 --- a/kafka-ui-react-app/src/redux/reducers/consumerGroups/selectors.ts +++ b/kafka-ui-react-app/src/redux/reducers/consumerGroups/selectors.ts @@ -1,5 +1,5 @@ import { createSelector } from 'reselect'; -import { RootState, FetchStatus } from 'redux/interfaces'; +import { RootState } from 'redux/interfaces'; import { createFetchingSelector } from 'redux/reducers/loader/selectors'; import { ConsumerGroupID, @@ -24,12 +24,12 @@ const getConsumerGroupDetailsFetchingStatus = createFetchingSelector( export const getIsConsumerGroupsListFetched = createSelector( getConsumerGroupsListFetchingStatus, - (status) => status === FetchStatus.fetched + (status) => status === 'fetched' ); export const getIsConsumerGroupDetailsFetched = createSelector( getConsumerGroupDetailsFetchingStatus, - (status) => status === FetchStatus.fetched + (status) => status === 'fetched' ); export const getConsumerGroupsList = createSelector( diff --git a/kafka-ui-react-app/src/redux/reducers/loader/reducer.ts b/kafka-ui-react-app/src/redux/reducers/loader/reducer.ts index e847decd3f..37892542fa 100644 --- a/kafka-ui-react-app/src/redux/reducers/loader/reducer.ts +++ b/kafka-ui-react-app/src/redux/reducers/loader/reducer.ts @@ -1,4 +1,4 @@ -import { FetchStatus, Action, LoaderState } from 'redux/interfaces'; +import { Action, LoaderState } from 'redux/interfaces'; export const initialState: LoaderState = {}; @@ -15,17 +15,17 @@ const reducer = (state = initialState, action: Action): LoaderState => { case 'REQUEST': return { ...state, - [requestName]: FetchStatus.fetching, + [requestName]: 'fetching', }; case 'SUCCESS': return { ...state, - [requestName]: FetchStatus.fetched, + [requestName]: 'fetched', }; case 'FAILURE': return { ...state, - [requestName]: FetchStatus.errorFetching, + [requestName]: 'errorFetching', }; default: return state; diff --git a/kafka-ui-react-app/src/redux/reducers/loader/selectors.ts b/kafka-ui-react-app/src/redux/reducers/loader/selectors.ts index c43355b577..fcab9e731d 100644 --- a/kafka-ui-react-app/src/redux/reducers/loader/selectors.ts +++ b/kafka-ui-react-app/src/redux/reducers/loader/selectors.ts @@ -1,4 +1,4 @@ -import { RootState, FetchStatus } from 'redux/interfaces'; +import { RootState } from 'redux/interfaces'; export const createFetchingSelector = (action: string) => (state: RootState) => - state.loader[action] || FetchStatus.notFetched; + state.loader[action] || 'notFetched'; diff --git a/kafka-ui-react-app/src/redux/reducers/topics/reducer.ts b/kafka-ui-react-app/src/redux/reducers/topics/reducer.ts index 6a11485172..d457e9de7f 100644 --- a/kafka-ui-react-app/src/redux/reducers/topics/reducer.ts +++ b/kafka-ui-react-app/src/redux/reducers/topics/reducer.ts @@ -1,7 +1,6 @@ import { v4 } from 'uuid'; import { Topic, TopicMessage } from 'generated-sources'; import { Action, TopicsState } from 'redux/interfaces'; -import ActionType from 'redux/actionType'; export const initialState: TopicsState = { byName: {}, @@ -68,9 +67,9 @@ const transformTopicMessages = ( const reducer = (state = initialState, action: Action): TopicsState => { switch (action.type) { - case ActionType.GET_TOPICS__SUCCESS: + case 'GET_TOPICS__SUCCESS': return updateTopicList(state, action.payload); - case ActionType.GET_TOPIC_DETAILS__SUCCESS: + case 'GET_TOPIC_DETAILS__SUCCESS': return { ...state, byName: { @@ -81,9 +80,9 @@ const reducer = (state = initialState, action: Action): TopicsState => { }, }, }; - case ActionType.GET_TOPIC_MESSAGES__SUCCESS: + case 'GET_TOPIC_MESSAGES__SUCCESS': return transformTopicMessages(state, action.payload); - case ActionType.GET_TOPIC_CONFIG__SUCCESS: + case 'GET_TOPIC_CONFIG__SUCCESS': return { ...state, byName: { @@ -97,7 +96,7 @@ const reducer = (state = initialState, action: Action): TopicsState => { }, }, }; - case ActionType.POST_TOPIC__SUCCESS: + case 'POST_TOPIC__SUCCESS': return addToTopicList(state, action.payload); default: return state; diff --git a/kafka-ui-react-app/src/redux/reducers/topics/selectors.ts b/kafka-ui-react-app/src/redux/reducers/topics/selectors.ts index f215821f0e..b767c80432 100644 --- a/kafka-ui-react-app/src/redux/reducers/topics/selectors.ts +++ b/kafka-ui-react-app/src/redux/reducers/topics/selectors.ts @@ -2,7 +2,6 @@ import { createSelector } from 'reselect'; import { RootState, TopicName, - FetchStatus, TopicsState, TopicConfigByName, } from 'redux/interfaces'; @@ -29,32 +28,32 @@ const getTopicUpdateStatus = createFetchingSelector('PATCH_TOPIC'); export const getIsTopicListFetched = createSelector( getTopicListFetchingStatus, - (status) => status === FetchStatus.fetched + (status) => status === 'fetched' ); export const getIsTopicDetailsFetched = createSelector( getTopicDetailsFetchingStatus, - (status) => status === FetchStatus.fetched + (status) => status === 'fetched' ); export const getIsTopicMessagesFetched = createSelector( getTopicMessagesFetchingStatus, - (status) => status === FetchStatus.fetched + (status) => status === 'fetched' ); export const getTopicConfigFetched = createSelector( getTopicConfigFetchingStatus, - (status) => status === FetchStatus.fetched + (status) => status === 'fetched' ); export const getTopicCreated = createSelector( getTopicCreationStatus, - (status) => status === FetchStatus.fetched + (status) => status === 'fetched' ); export const getTopicUpdated = createSelector( getTopicUpdateStatus, - (status) => status === FetchStatus.fetched + (status) => status === 'fetched' ); export const getTopicList = createSelector(