Fix linter (#452)
This commit is contained in:
parent
98fcc90c6b
commit
b60ff8acf6
14 changed files with 465 additions and 473 deletions
|
@ -18,9 +18,8 @@ const mapStateToProps = (state: RootState) => ({
|
||||||
isFetching: getIsSchemaListFetching(state),
|
isFetching: getIsSchemaListFetching(state),
|
||||||
schemas: getSchemaList(state),
|
schemas: getSchemaList(state),
|
||||||
globalSchemaCompatibilityLevel: getGlobalSchemaCompatibilityLevel(state),
|
globalSchemaCompatibilityLevel: getGlobalSchemaCompatibilityLevel(state),
|
||||||
isGlobalSchemaCompatibilityLevelFetched: getGlobalSchemaCompatibilityLevelFetched(
|
isGlobalSchemaCompatibilityLevelFetched:
|
||||||
state
|
getGlobalSchemaCompatibilityLevelFetched(state),
|
||||||
),
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const mapDispatchToProps = {
|
const mapDispatchToProps = {
|
||||||
|
|
|
@ -23,10 +23,8 @@ const ListItem: React.FC<ListItemProps> = ({
|
||||||
clusterName,
|
clusterName,
|
||||||
clearTopicMessages,
|
clearTopicMessages,
|
||||||
}) => {
|
}) => {
|
||||||
const [
|
const [isDeleteTopicConfirmationVisible, setDeleteTopicConfirmationVisible] =
|
||||||
isDeleteTopicConfirmationVisible,
|
React.useState(false);
|
||||||
setDeleteTopicConfirmationVisible,
|
|
||||||
] = React.useState(false);
|
|
||||||
|
|
||||||
const outOfSyncReplicas = React.useMemo(() => {
|
const outOfSyncReplicas = React.useMemo(() => {
|
||||||
if (partitions === undefined || partitions.length === 0) {
|
if (partitions === undefined || partitions.length === 0) {
|
||||||
|
|
|
@ -33,10 +33,8 @@ const Details: React.FC<Props> = ({
|
||||||
}) => {
|
}) => {
|
||||||
const history = useHistory();
|
const history = useHistory();
|
||||||
const { isReadOnly } = React.useContext(ClusterContext);
|
const { isReadOnly } = React.useContext(ClusterContext);
|
||||||
const [
|
const [isDeleteTopicConfirmationVisible, setDeleteTopicConfirmationVisible] =
|
||||||
isDeleteTopicConfirmationVisible,
|
React.useState(false);
|
||||||
setDeleteTopicConfirmationVisible,
|
|
||||||
] = React.useState(false);
|
|
||||||
const deleteTopicHandler = React.useCallback(() => {
|
const deleteTopicHandler = React.useCallback(() => {
|
||||||
deleteTopic(clusterName, topicName);
|
deleteTopic(clusterName, topicName);
|
||||||
history.push(clusterTopicsPath(clusterName));
|
history.push(clusterTopicsPath(clusterName));
|
||||||
|
|
|
@ -50,9 +50,8 @@ const Messages: React.FC<Props> = ({
|
||||||
fetchTopicMessages,
|
fetchTopicMessages,
|
||||||
}) => {
|
}) => {
|
||||||
const [searchQuery, setSearchQuery] = React.useState<string>('');
|
const [searchQuery, setSearchQuery] = React.useState<string>('');
|
||||||
const [searchTimestamp, setSearchTimestamp] = React.useState<Date | null>(
|
const [searchTimestamp, setSearchTimestamp] =
|
||||||
null
|
React.useState<Date | null>(null);
|
||||||
);
|
|
||||||
const [filterProps, setFilterProps] = React.useState<FilterProps[]>([]);
|
const [filterProps, setFilterProps] = React.useState<FilterProps[]>([]);
|
||||||
const [selectedSeekType, setSelectedSeekType] = React.useState<SeekType>(
|
const [selectedSeekType, setSelectedSeekType] = React.useState<SeekType>(
|
||||||
SeekType.OFFSET
|
SeekType.OFFSET
|
||||||
|
|
|
@ -39,9 +39,8 @@ const CustomParamSelect: React.FC<CustomParamSelectProps> = ({
|
||||||
return valid || 'Custom Parameter must be unique';
|
return valid || 'Custom Parameter must be unique';
|
||||||
};
|
};
|
||||||
|
|
||||||
const onChange = (inputName: string) => (
|
const onChange =
|
||||||
event: React.ChangeEvent<HTMLSelectElement>
|
(inputName: string) => (event: React.ChangeEvent<HTMLSelectElement>) => {
|
||||||
) => {
|
|
||||||
trigger(inputName);
|
trigger(inputName);
|
||||||
onNameChange(index, event.target.value);
|
onNameChange(index, event.target.value);
|
||||||
};
|
};
|
||||||
|
|
|
@ -35,10 +35,8 @@ const CustomParams: React.FC<Props> = ({ isSubmitting, config }) => {
|
||||||
)
|
)
|
||||||
: {};
|
: {};
|
||||||
|
|
||||||
const [
|
const [formCustomParams, setFormCustomParams] =
|
||||||
formCustomParams,
|
React.useState<TopicFormCustomParams>({
|
||||||
setFormCustomParams,
|
|
||||||
] = React.useState<TopicFormCustomParams>({
|
|
||||||
byIndex,
|
byIndex,
|
||||||
allIndexes: Object.keys(byIndex),
|
allIndexes: Object.keys(byIndex),
|
||||||
});
|
});
|
||||||
|
|
|
@ -235,9 +235,8 @@ export const updateConnectorConfigAction = createAsyncAction(
|
||||||
'PATCH_CONNECTOR_CONFIG__FAILURE'
|
'PATCH_CONNECTOR_CONFIG__FAILURE'
|
||||||
)<undefined, { connector: Connector }, { alert?: FailurePayload }>();
|
)<undefined, { connector: Connector }, { alert?: FailurePayload }>();
|
||||||
|
|
||||||
export const setTopicsSearchAction = createAction(
|
export const setTopicsSearchAction =
|
||||||
'SET_TOPICS_SEARCH'
|
createAction('SET_TOPICS_SEARCH')<string>();
|
||||||
)<string>();
|
|
||||||
|
|
||||||
export const setTopicsOrderByAction = createAction(
|
export const setTopicsOrderByAction = createAction(
|
||||||
'SET_TOPICS_ORDER_BY'
|
'SET_TOPICS_ORDER_BY'
|
||||||
|
|
|
@ -6,9 +6,9 @@ import * as actions from 'redux/actions/actions';
|
||||||
const apiClientConf = new Configuration(BASE_PARAMS);
|
const apiClientConf = new Configuration(BASE_PARAMS);
|
||||||
export const brokersApiClient = new BrokersApi(apiClientConf);
|
export const brokersApiClient = new BrokersApi(apiClientConf);
|
||||||
|
|
||||||
export const fetchBrokers = (
|
export const fetchBrokers =
|
||||||
clusterName: ClusterName
|
(clusterName: ClusterName): PromiseThunkResult =>
|
||||||
): PromiseThunkResult => async (dispatch) => {
|
async (dispatch) => {
|
||||||
dispatch(actions.fetchBrokersAction.request());
|
dispatch(actions.fetchBrokersAction.request());
|
||||||
try {
|
try {
|
||||||
const payload = await brokersApiClient.getBrokers({ clusterName });
|
const payload = await brokersApiClient.getBrokers({ clusterName });
|
||||||
|
@ -18,10 +18,9 @@ export const fetchBrokers = (
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const fetchBrokerMetrics = (
|
export const fetchBrokerMetrics =
|
||||||
clusterName: ClusterName,
|
(clusterName: ClusterName, brokerId: BrokerId): PromiseThunkResult =>
|
||||||
brokerId: BrokerId
|
async (dispatch) => {
|
||||||
): PromiseThunkResult => async (dispatch) => {
|
|
||||||
dispatch(actions.fetchBrokerMetricsAction.request());
|
dispatch(actions.fetchBrokerMetricsAction.request());
|
||||||
try {
|
try {
|
||||||
const payload = await brokersApiClient.getBrokersMetrics({
|
const payload = await brokersApiClient.getBrokersMetrics({
|
||||||
|
|
|
@ -16,9 +16,9 @@ export const fetchClustersList = (): PromiseThunkResult => async (dispatch) => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const fetchClusterStats = (
|
export const fetchClusterStats =
|
||||||
clusterName: ClusterName
|
(clusterName: ClusterName): PromiseThunkResult =>
|
||||||
): PromiseThunkResult => async (dispatch) => {
|
async (dispatch) => {
|
||||||
dispatch(actions.fetchClusterStatsAction.request());
|
dispatch(actions.fetchClusterStatsAction.request());
|
||||||
try {
|
try {
|
||||||
const payload = await clustersApiClient.getClusterStats({ clusterName });
|
const payload = await clustersApiClient.getClusterStats({ clusterName });
|
||||||
|
@ -28,9 +28,9 @@ export const fetchClusterStats = (
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const fetchClusterMetrics = (
|
export const fetchClusterMetrics =
|
||||||
clusterName: ClusterName
|
(clusterName: ClusterName): PromiseThunkResult =>
|
||||||
): PromiseThunkResult => async (dispatch) => {
|
async (dispatch) => {
|
||||||
dispatch(actions.fetchClusterMetricsAction.request());
|
dispatch(actions.fetchClusterMetricsAction.request());
|
||||||
try {
|
try {
|
||||||
const payload = await clustersApiClient.getClusterMetrics({
|
const payload = await clustersApiClient.getClusterMetrics({
|
||||||
|
|
|
@ -10,9 +10,9 @@ import * as actions from 'redux/actions/actions';
|
||||||
const apiClientConf = new Configuration(BASE_PARAMS);
|
const apiClientConf = new Configuration(BASE_PARAMS);
|
||||||
export const consumerGroupsApiClient = new ConsumerGroupsApi(apiClientConf);
|
export const consumerGroupsApiClient = new ConsumerGroupsApi(apiClientConf);
|
||||||
|
|
||||||
export const fetchConsumerGroupsList = (
|
export const fetchConsumerGroupsList =
|
||||||
clusterName: ClusterName
|
(clusterName: ClusterName): PromiseThunkResult =>
|
||||||
): PromiseThunkResult => async (dispatch) => {
|
async (dispatch) => {
|
||||||
dispatch(actions.fetchConsumerGroupsAction.request());
|
dispatch(actions.fetchConsumerGroupsAction.request());
|
||||||
try {
|
try {
|
||||||
const consumerGroups = await consumerGroupsApiClient.getConsumerGroups({
|
const consumerGroups = await consumerGroupsApiClient.getConsumerGroups({
|
||||||
|
@ -24,18 +24,19 @@ export const fetchConsumerGroupsList = (
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const fetchConsumerGroupDetails = (
|
export const fetchConsumerGroupDetails =
|
||||||
|
(
|
||||||
clusterName: ClusterName,
|
clusterName: ClusterName,
|
||||||
consumerGroupID: ConsumerGroupID
|
consumerGroupID: ConsumerGroupID
|
||||||
): PromiseThunkResult => async (dispatch) => {
|
): PromiseThunkResult =>
|
||||||
|
async (dispatch) => {
|
||||||
dispatch(actions.fetchConsumerGroupDetailsAction.request());
|
dispatch(actions.fetchConsumerGroupDetailsAction.request());
|
||||||
try {
|
try {
|
||||||
const consumerGroupDetails = await consumerGroupsApiClient.getConsumerGroup(
|
const consumerGroupDetails =
|
||||||
{
|
await consumerGroupsApiClient.getConsumerGroup({
|
||||||
clusterName,
|
clusterName,
|
||||||
id: consumerGroupID,
|
id: consumerGroupID,
|
||||||
}
|
});
|
||||||
);
|
|
||||||
dispatch(
|
dispatch(
|
||||||
actions.fetchConsumerGroupDetailsAction.success({
|
actions.fetchConsumerGroupDetailsAction.success({
|
||||||
consumerGroupID,
|
consumerGroupID,
|
||||||
|
|
|
@ -20,9 +20,9 @@ import { isEqual } from 'lodash';
|
||||||
const apiClientConf = new Configuration(BASE_PARAMS);
|
const apiClientConf = new Configuration(BASE_PARAMS);
|
||||||
export const schemasApiClient = new SchemasApi(apiClientConf);
|
export const schemasApiClient = new SchemasApi(apiClientConf);
|
||||||
|
|
||||||
export const fetchSchemasByClusterName = (
|
export const fetchSchemasByClusterName =
|
||||||
clusterName: ClusterName
|
(clusterName: ClusterName): PromiseThunkResult<void> =>
|
||||||
): PromiseThunkResult<void> => async (dispatch) => {
|
async (dispatch) => {
|
||||||
dispatch(actions.fetchSchemasByClusterNameAction.request());
|
dispatch(actions.fetchSchemasByClusterNameAction.request());
|
||||||
try {
|
try {
|
||||||
const schemas = await schemasApiClient.getSchemas({ clusterName });
|
const schemas = await schemasApiClient.getSchemas({ clusterName });
|
||||||
|
@ -32,10 +32,9 @@ export const fetchSchemasByClusterName = (
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const fetchSchemaVersions = (
|
export const fetchSchemaVersions =
|
||||||
clusterName: ClusterName,
|
(clusterName: ClusterName, subject: SchemaName): PromiseThunkResult<void> =>
|
||||||
subject: SchemaName
|
async (dispatch) => {
|
||||||
): PromiseThunkResult<void> => async (dispatch) => {
|
|
||||||
if (!subject) return;
|
if (!subject) return;
|
||||||
dispatch(actions.fetchSchemaVersionsAction.request());
|
dispatch(actions.fetchSchemaVersionsAction.request());
|
||||||
try {
|
try {
|
||||||
|
@ -49,9 +48,9 @@ export const fetchSchemaVersions = (
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const fetchGlobalSchemaCompatibilityLevel = (
|
export const fetchGlobalSchemaCompatibilityLevel =
|
||||||
clusterName: ClusterName
|
(clusterName: ClusterName): PromiseThunkResult<void> =>
|
||||||
): PromiseThunkResult<void> => async (dispatch) => {
|
async (dispatch) => {
|
||||||
dispatch(actions.fetchGlobalSchemaCompatibilityLevelAction.request());
|
dispatch(actions.fetchGlobalSchemaCompatibilityLevelAction.request());
|
||||||
try {
|
try {
|
||||||
const result = await schemasApiClient.getGlobalSchemaCompatibilityLevel({
|
const result = await schemasApiClient.getGlobalSchemaCompatibilityLevel({
|
||||||
|
@ -67,10 +66,12 @@ export const fetchGlobalSchemaCompatibilityLevel = (
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const updateGlobalSchemaCompatibilityLevel = (
|
export const updateGlobalSchemaCompatibilityLevel =
|
||||||
|
(
|
||||||
clusterName: ClusterName,
|
clusterName: ClusterName,
|
||||||
compatibilityLevel: CompatibilityLevelCompatibilityEnum
|
compatibilityLevel: CompatibilityLevelCompatibilityEnum
|
||||||
): PromiseThunkResult<void> => async (dispatch) => {
|
): PromiseThunkResult<void> =>
|
||||||
|
async (dispatch) => {
|
||||||
dispatch(actions.updateGlobalSchemaCompatibilityLevelAction.request());
|
dispatch(actions.updateGlobalSchemaCompatibilityLevelAction.request());
|
||||||
try {
|
try {
|
||||||
await schemasApiClient.updateGlobalSchemaCompatibilityLevel({
|
await schemasApiClient.updateGlobalSchemaCompatibilityLevel({
|
||||||
|
@ -87,10 +88,12 @@ export const updateGlobalSchemaCompatibilityLevel = (
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const createSchema = (
|
export const createSchema =
|
||||||
|
(
|
||||||
clusterName: ClusterName,
|
clusterName: ClusterName,
|
||||||
newSchemaSubject: NewSchemaSubject
|
newSchemaSubject: NewSchemaSubject
|
||||||
): PromiseThunkResult => async (dispatch) => {
|
): PromiseThunkResult =>
|
||||||
|
async (dispatch) => {
|
||||||
dispatch(actions.createSchemaAction.request());
|
dispatch(actions.createSchemaAction.request());
|
||||||
try {
|
try {
|
||||||
const schema: SchemaSubject = await schemasApiClient.createNewSchema({
|
const schema: SchemaSubject = await schemasApiClient.createNewSchema({
|
||||||
|
@ -110,14 +113,16 @@ export const createSchema = (
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const updateSchema = (
|
export const updateSchema =
|
||||||
|
(
|
||||||
latestSchema: SchemaSubject,
|
latestSchema: SchemaSubject,
|
||||||
newSchema: string,
|
newSchema: string,
|
||||||
newSchemaType: SchemaType,
|
newSchemaType: SchemaType,
|
||||||
newCompatibilityLevel: CompatibilityLevelCompatibilityEnum,
|
newCompatibilityLevel: CompatibilityLevelCompatibilityEnum,
|
||||||
clusterName: string,
|
clusterName: string,
|
||||||
subject: string
|
subject: string
|
||||||
): PromiseThunkResult => async (dispatch) => {
|
): PromiseThunkResult =>
|
||||||
|
async (dispatch) => {
|
||||||
dispatch(actions.updateSchemaAction.request());
|
dispatch(actions.updateSchemaAction.request());
|
||||||
try {
|
try {
|
||||||
let schema: SchemaSubject = latestSchema;
|
let schema: SchemaSubject = latestSchema;
|
||||||
|
@ -156,10 +161,9 @@ export const updateSchema = (
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
export const deleteSchema = (
|
export const deleteSchema =
|
||||||
clusterName: ClusterName,
|
(clusterName: ClusterName, subject: string): PromiseThunkResult =>
|
||||||
subject: string
|
async (dispatch) => {
|
||||||
): PromiseThunkResult => async (dispatch) => {
|
|
||||||
dispatch(actions.deleteSchemaAction.request());
|
dispatch(actions.deleteSchemaAction.request());
|
||||||
try {
|
try {
|
||||||
await schemasApiClient.deleteSchema({
|
await schemasApiClient.deleteSchema({
|
||||||
|
|
|
@ -36,9 +36,9 @@ export interface FetchTopicsListParams {
|
||||||
orderBy?: TopicColumnsToSort;
|
orderBy?: TopicColumnsToSort;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const fetchTopicsList = (
|
export const fetchTopicsList =
|
||||||
params: FetchTopicsListParams
|
(params: FetchTopicsListParams): PromiseThunkResult =>
|
||||||
): PromiseThunkResult => async (dispatch, getState) => {
|
async (dispatch, getState) => {
|
||||||
dispatch(actions.fetchTopicsListAction.request());
|
dispatch(actions.fetchTopicsListAction.request());
|
||||||
try {
|
try {
|
||||||
const { topics, pageCount } = await topicsApiClient.getTopics(params);
|
const { topics, pageCount } = await topicsApiClient.getTopics(params);
|
||||||
|
@ -67,11 +67,13 @@ export const fetchTopicsList = (
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const fetchTopicMessages = (
|
export const fetchTopicMessages =
|
||||||
|
(
|
||||||
clusterName: ClusterName,
|
clusterName: ClusterName,
|
||||||
topicName: TopicName,
|
topicName: TopicName,
|
||||||
queryParams: Partial<TopicMessageQueryParams>
|
queryParams: Partial<TopicMessageQueryParams>
|
||||||
): PromiseThunkResult => async (dispatch) => {
|
): PromiseThunkResult =>
|
||||||
|
async (dispatch) => {
|
||||||
dispatch(actions.fetchTopicMessagesAction.request());
|
dispatch(actions.fetchTopicMessagesAction.request());
|
||||||
try {
|
try {
|
||||||
const messages = await messagesApiClient.getTopicMessages({
|
const messages = await messagesApiClient.getTopicMessages({
|
||||||
|
@ -85,11 +87,13 @@ export const fetchTopicMessages = (
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const clearTopicMessages = (
|
export const clearTopicMessages =
|
||||||
|
(
|
||||||
clusterName: ClusterName,
|
clusterName: ClusterName,
|
||||||
topicName: TopicName,
|
topicName: TopicName,
|
||||||
partitions?: number[]
|
partitions?: number[]
|
||||||
): PromiseThunkResult => async (dispatch) => {
|
): PromiseThunkResult =>
|
||||||
|
async (dispatch) => {
|
||||||
dispatch(actions.clearMessagesTopicAction.request());
|
dispatch(actions.clearMessagesTopicAction.request());
|
||||||
try {
|
try {
|
||||||
await messagesApiClient.deleteTopicMessages({
|
await messagesApiClient.deleteTopicMessages({
|
||||||
|
@ -109,10 +113,9 @@ export const clearTopicMessages = (
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const fetchTopicDetails = (
|
export const fetchTopicDetails =
|
||||||
clusterName: ClusterName,
|
(clusterName: ClusterName, topicName: TopicName): PromiseThunkResult =>
|
||||||
topicName: TopicName
|
async (dispatch, getState) => {
|
||||||
): PromiseThunkResult => async (dispatch, getState) => {
|
|
||||||
dispatch(actions.fetchTopicDetailsAction.request());
|
dispatch(actions.fetchTopicDetailsAction.request());
|
||||||
try {
|
try {
|
||||||
const topicDetails = await topicsApiClient.getTopicDetails({
|
const topicDetails = await topicsApiClient.getTopicDetails({
|
||||||
|
@ -136,10 +139,9 @@ export const fetchTopicDetails = (
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const fetchTopicConfig = (
|
export const fetchTopicConfig =
|
||||||
clusterName: ClusterName,
|
(clusterName: ClusterName, topicName: TopicName): PromiseThunkResult =>
|
||||||
topicName: TopicName
|
async (dispatch, getState) => {
|
||||||
): PromiseThunkResult => async (dispatch, getState) => {
|
|
||||||
dispatch(actions.fetchTopicConfigAction.request());
|
dispatch(actions.fetchTopicConfigAction.request());
|
||||||
try {
|
try {
|
||||||
const config = await topicsApiClient.getTopicConfigs({
|
const config = await topicsApiClient.getTopicConfigs({
|
||||||
|
@ -233,10 +235,9 @@ const formatTopicUpdate = (form: TopicFormDataRaw): TopicUpdate => {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
export const createTopic = (
|
export const createTopic =
|
||||||
clusterName: ClusterName,
|
(clusterName: ClusterName, form: TopicFormDataRaw): PromiseThunkResult =>
|
||||||
form: TopicFormDataRaw
|
async (dispatch, getState) => {
|
||||||
): PromiseThunkResult => async (dispatch, getState) => {
|
|
||||||
dispatch(actions.createTopicAction.request());
|
dispatch(actions.createTopicAction.request());
|
||||||
try {
|
try {
|
||||||
const topic: Topic = await topicsApiClient.createTopic({
|
const topic: Topic = await topicsApiClient.createTopic({
|
||||||
|
@ -268,11 +269,13 @@ export const createTopic = (
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const updateTopic = (
|
export const updateTopic =
|
||||||
|
(
|
||||||
clusterName: ClusterName,
|
clusterName: ClusterName,
|
||||||
topicName: TopicName,
|
topicName: TopicName,
|
||||||
form: TopicFormDataRaw
|
form: TopicFormDataRaw
|
||||||
): PromiseThunkResult => async (dispatch, getState) => {
|
): PromiseThunkResult =>
|
||||||
|
async (dispatch, getState) => {
|
||||||
dispatch(actions.updateTopicAction.request());
|
dispatch(actions.updateTopicAction.request());
|
||||||
try {
|
try {
|
||||||
const topic: Topic = await topicsApiClient.updateTopic({
|
const topic: Topic = await topicsApiClient.updateTopic({
|
||||||
|
@ -299,10 +302,9 @@ export const updateTopic = (
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const deleteTopic = (
|
export const deleteTopic =
|
||||||
clusterName: ClusterName,
|
(clusterName: ClusterName, topicName: TopicName): PromiseThunkResult =>
|
||||||
topicName: TopicName
|
async (dispatch) => {
|
||||||
): PromiseThunkResult => async (dispatch) => {
|
|
||||||
dispatch(actions.deleteTopicAction.request());
|
dispatch(actions.deleteTopicAction.request());
|
||||||
try {
|
try {
|
||||||
await topicsApiClient.deleteTopic({
|
await topicsApiClient.deleteTopic({
|
||||||
|
|
|
@ -18,12 +18,10 @@ export const getTopicListTotalPages = (state: RootState) =>
|
||||||
topicsState(state).totalPages;
|
topicsState(state).totalPages;
|
||||||
|
|
||||||
const getTopicListFetchingStatus = createFetchingSelector('GET_TOPICS');
|
const getTopicListFetchingStatus = createFetchingSelector('GET_TOPICS');
|
||||||
const getTopicDetailsFetchingStatus = createFetchingSelector(
|
const getTopicDetailsFetchingStatus =
|
||||||
'GET_TOPIC_DETAILS'
|
createFetchingSelector('GET_TOPIC_DETAILS');
|
||||||
);
|
const getTopicMessagesFetchingStatus =
|
||||||
const getTopicMessagesFetchingStatus = createFetchingSelector(
|
createFetchingSelector('GET_TOPIC_MESSAGES');
|
||||||
'GET_TOPIC_MESSAGES'
|
|
||||||
);
|
|
||||||
const getTopicConfigFetchingStatus = createFetchingSelector('GET_TOPIC_CONFIG');
|
const getTopicConfigFetchingStatus = createFetchingSelector('GET_TOPIC_CONFIG');
|
||||||
const getTopicCreationStatus = createFetchingSelector('POST_TOPIC');
|
const getTopicCreationStatus = createFetchingSelector('POST_TOPIC');
|
||||||
const getTopicUpdateStatus = createFetchingSelector('PATCH_TOPIC');
|
const getTopicUpdateStatus = createFetchingSelector('PATCH_TOPIC');
|
||||||
|
|
|
@ -6,9 +6,7 @@ import { RootState, Action } from 'redux/interfaces';
|
||||||
const middlewares: Array<Middleware> = [thunk];
|
const middlewares: Array<Middleware> = [thunk];
|
||||||
type DispatchExts = ThunkDispatch<RootState, undefined, Action>;
|
type DispatchExts = ThunkDispatch<RootState, undefined, Action>;
|
||||||
|
|
||||||
const mockStoreCreator: MockStoreCreator<
|
const mockStoreCreator: MockStoreCreator<RootState, DispatchExts> =
|
||||||
RootState,
|
configureMockStore<RootState, DispatchExts>(middlewares);
|
||||||
DispatchExts
|
|
||||||
> = configureMockStore<RootState, DispatchExts>(middlewares);
|
|
||||||
|
|
||||||
export default mockStoreCreator();
|
export default mockStoreCreator();
|
||||||
|
|
Loading…
Add table
Reference in a new issue