Repository: provectus/kafka-ui
Issue: Recreate Topic is not functional
Labels: type/bug
good first issue
scope/frontend
status/accepted
status/confirmed

**Describe the bug**
Not possIble to recreate Topic from both: Topics page and Topic profile

**Set up**
https://www.kafka-ui.provectus.io/

**Steps to Reproduce**
Steps to reproduce the behavior:

1. Navigate to Topics
2. Press menu icon
3. Select Recreate Topic

**Expected behavior**

- Success message should appear about recreating
- The Topic should be recreated

**Screenshots**

https://user-images.githubusercontent.com/104780608/171245147-a8e2ff0e-9ad4-4474-abaf-6472515a5041.mov



linked to https://github.com/provectus/kafka-ui/issues/1879


Issue comments:

Pull request review comments:

Patch that resolved the issue:
diff --git a/kafka-ui-react-app/src/components/common/Icons/DropdownArrowIcon.tsx b/kafka-ui-react-app/src/components/common/Icons/DropdownArrowIcon.tsx
index 22c783ac55a..f19a9b45ad2 100644
--- a/kafka-ui-react-app/src/components/common/Icons/DropdownArrowIcon.tsx
+++ b/kafka-ui-react-app/src/components/common/Icons/DropdownArrowIcon.tsx
@@ -13,6 +13,7 @@ const DropdownArrowIcon: React.FC<Props> = ({ isOpen }) => {
       width="24"
       height="24"
       fill="none"
+      style={{ position: 'absolute', right: '5px' }}
       stroke="currentColor"
       strokeWidth="2"
       color={theme.icons.dropdownArrowIcon}
diff --git a/kafka-ui-react-app/src/redux/reducers/topics/__test__/reducer.spec.ts b/kafka-ui-react-app/src/redux/reducers/topics/__test__/reducer.spec.ts
index 70d85d46dc4..9a3bc5c8db2 100644
--- a/kafka-ui-react-app/src/redux/reducers/topics/__test__/reducer.spec.ts
+++ b/kafka-ui-react-app/src/redux/reducers/topics/__test__/reducer.spec.ts
@@ -585,6 +585,18 @@ describe('topics Slice', () => {
 
         expect(getTypeAndPayload(store)).toEqual([
           { type: recreateTopic.pending.type },
+          { type: showSuccessAlert.pending.type },
+          {
+            type: alertAdded.type,
+            payload: {
+              id: 'message-topic-local',
+              title: '',
+              type: 'success',
+              createdAt: global.Date.now(),
+              message: 'Topic successfully recreated!',
+            },
+          },
+          { type: showSuccessAlert.fulfilled.type },
           {
             type: recreateTopic.fulfilled.type,
             payload: { [topicName]: { ...recreateResponse } },
diff --git a/kafka-ui-react-app/src/redux/reducers/topics/topicsSlice.ts b/kafka-ui-react-app/src/redux/reducers/topics/topicsSlice.ts
index 525f7548419..55c2f267199 100644
--- a/kafka-ui-react-app/src/redux/reducers/topics/topicsSlice.ts
+++ b/kafka-ui-react-app/src/redux/reducers/topics/topicsSlice.ts
@@ -220,9 +220,17 @@ export const deleteTopic = createAsyncThunk<
 export const recreateTopic = createAsyncThunk<
   { topic: Topic },
   RecreateTopicRequest
->('topic/recreateTopic', async (payload, { rejectWithValue }) => {
+>('topic/recreateTopic', async (payload, { rejectWithValue, dispatch }) => {
   try {
+    const { topicName, clusterName } = payload;
     const topic = await topicsApiClient.recreateTopic(payload);
+    dispatch(
+      showSuccessAlert({
+        id: `message-${topicName}-${clusterName}`,
+        message: 'Topic successfully recreated!',
+      })
+    );
+
     return { topic };
   } catch (err) {
     return rejectWithValue(await getResponse(err as Response));


Test patch: