Browse Source

Merge pull request #1524 from visuddhinanda/agile

add topic delete event #1520
visuddhinanda 2 years ago
parent
commit
b09442d45b

+ 3 - 0
dashboard/src/components/discussion/DiscussionBox.tsx

@@ -91,6 +91,9 @@ const DiscussionBoxWidget = ({ onTopicChange }: IWidget) => {
             onTopicReady={(value: IComment) => {
               setCurrTopic(value);
             }}
+            onTopicDelete={() => {
+              setChildrenDrawer(false);
+            }}
           />
         </div>
       ) : (

+ 7 - 0
dashboard/src/components/discussion/DiscussionTopic.tsx

@@ -12,6 +12,7 @@ interface IWidget {
   focus?: string;
   onItemCountChange?: Function;
   onTopicReady?: Function;
+  onTopicDelete?: Function;
 }
 const DiscussionTopicWidget = ({
   resType,
@@ -20,6 +21,7 @@ const DiscussionTopicWidget = ({
   focus,
   onTopicReady,
   onItemCountChange,
+  onTopicDelete,
 }: IWidget) => {
   const [count, setCount] = useState<number>();
   const [currResId, setCurrResId] = useState<string>();
@@ -38,6 +40,11 @@ const DiscussionTopicWidget = ({
             onTopicReady(value);
           }
         }}
+        onDelete={() => {
+          if (typeof onTopicDelete !== "undefined") {
+            onTopicDelete();
+          }
+        }}
       />
       <DiscussionTopicChildren
         topic={currTopic}