aboutsummaryrefslogtreecommitdiffstats
path: root/webui/src/pages/bug/CommentForm.tsx
diff options
context:
space:
mode:
authorSascha <GlancingMind@outlook.com>2021-05-25 17:20:36 +0200
committerSascha <GlancingMind@outlook.com>2021-05-26 12:52:07 +0200
commit6f6831e18d08773540a4c897866985c0bf950de5 (patch)
tree1429892b6f3da035dc0dacc38d2507d26f3fea97 /webui/src/pages/bug/CommentForm.tsx
parent27b5285b8cbccec7fb6d17fb2c765d45530605c2 (diff)
downloadgit-bug-6f6831e18d08773540a4c897866985c0bf950de5.tar.gz
WebUI: Add comment-and-reopen of a bug in one step
Diffstat (limited to 'webui/src/pages/bug/CommentForm.tsx')
-rw-r--r--webui/src/pages/bug/CommentForm.tsx20
1 files changed, 18 insertions, 2 deletions
diff --git a/webui/src/pages/bug/CommentForm.tsx b/webui/src/pages/bug/CommentForm.tsx
index 1a7ebc29..395b955d 100644
--- a/webui/src/pages/bug/CommentForm.tsx
+++ b/webui/src/pages/bug/CommentForm.tsx
@@ -8,6 +8,7 @@ import CommentInput from '../../components/CommentInput/CommentInput';
import CloseBugButton from 'src/components/CloseBugButton/CloseBugButton';
import CloseBugWithCommentButton from 'src/components/CloseBugWithCommentButton/CloseBugWithCommentButton';
import ReopenBugButton from 'src/components/ReopenBugButton/ReopenBugButton';
+import ReopenBugWithCommentButton from 'src/components/ReopenBugWithCommentButton/ReopenBugWithCommentButton';
import { BugFragment } from './Bug.generated';
import { useAddCommentMutation } from './CommentForm.generated';
@@ -80,12 +81,27 @@ function CommentForm({ bug }: Props) {
function getBugStatusButton() {
if (bug.status === 'OPEN' && issueComment.length > 0) {
- return <CloseBugWithCommentButton bug={bug} comment={issueComment} />;
+ return (
+ <CloseBugWithCommentButton
+ bug={bug}
+ comment={issueComment}
+ postClick={resetForm}
+ />
+ );
}
if (bug.status === 'OPEN') {
return <CloseBugButton bug={bug} />;
}
- return <ReopenBugButton bug={bug} disabled={issueComment.length > 0} />;
+ if (bug.status === 'CLOSED' && issueComment.length > 0) {
+ return (
+ <ReopenBugWithCommentButton
+ bug={bug}
+ comment={issueComment}
+ postClick={resetForm}
+ />
+ );
+ }
+ return <ReopenBugButton bug={bug} />;
}
return (