Просмотр исходного кода

Display cleanup policy in the topic list (#732)

* Add clean up policy to the topic overview

* Add clean up policy to the topic list
Alexander Krivonosov 3 лет назад
Родитель
Сommit
268c871312

+ 1 - 0
kafka-ui-react-app/src/components/Topics/List/List.tsx

@@ -139,6 +139,7 @@ const List: React.FC<Props> = ({
                 <th>Number of messages</th>
                 <th>Size</th>
                 <th>Type</th>
+                <th>Clean Up Policy</th>
                 <th> </th>
               </tr>
             </thead>

+ 11 - 1
kafka-ui-react-app/src/components/Topics/List/ListItem.tsx

@@ -20,7 +20,14 @@ export interface ListItemProps {
 }
 
 const ListItem: React.FC<ListItemProps> = ({
-  topic: { name, internal, partitions, segmentSize, replicationFactor },
+  topic: {
+    name,
+    internal,
+    partitions,
+    segmentSize,
+    replicationFactor,
+    cleanUpPolicy,
+  },
   deleteTopic,
   clusterName,
   clearTopicMessages,
@@ -85,6 +92,9 @@ const ListItem: React.FC<ListItemProps> = ({
           {internal ? 'Internal' : 'External'}
         </div>
       </td>
+      <td>
+        <span className="tag is-info">{cleanUpPolicy || 'Unknown'}</span>
+      </td>
       <td className="topic-action-block">
         {!internal && !isReadOnly ? (
           <>

+ 3 - 0
kafka-ui-react-app/src/components/Topics/List/__tests__/__snapshots__/List.spec.tsx.snap

@@ -217,6 +217,9 @@ exports[`List when it does not have readonly flag matches the snapshot 1`] = `
                 <th>
                   Type
                 </th>
+                <th>
+                  Clean Up Policy
+                </th>
                 <th>
                    
                 </th>