aboutsummaryrefslogtreecommitdiffstats
path: root/webui/src/components/CloseBugWithCommentButton
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/components/CloseBugWithCommentButton
parent27b5285b8cbccec7fb6d17fb2c765d45530605c2 (diff)
downloadgit-bug-6f6831e18d08773540a4c897866985c0bf950de5.tar.gz
WebUI: Add comment-and-reopen of a bug in one step
Diffstat (limited to 'webui/src/components/CloseBugWithCommentButton')
-rw-r--r--webui/src/components/CloseBugWithCommentButton/CloseBugWithCommentButton.tsx10
1 files changed, 8 insertions, 2 deletions
diff --git a/webui/src/components/CloseBugWithCommentButton/CloseBugWithCommentButton.tsx b/webui/src/components/CloseBugWithCommentButton/CloseBugWithCommentButton.tsx
index 1d713f88..a0fefa4a 100644
--- a/webui/src/components/CloseBugWithCommentButton/CloseBugWithCommentButton.tsx
+++ b/webui/src/components/CloseBugWithCommentButton/CloseBugWithCommentButton.tsx
@@ -1,6 +1,7 @@
import React from 'react';
import Button from '@material-ui/core/Button';
+import CircularProgress from '@material-ui/core/CircularProgress';
import { makeStyles, Theme } from '@material-ui/core/styles';
import ErrorOutlineIcon from '@material-ui/icons/ErrorOutline';
@@ -19,9 +20,10 @@ const useStyles = makeStyles((theme: Theme) => ({
interface Props {
bug: BugFragment;
comment: string;
+ postClick?: () => void;
}
-function CloseBugWithCommentButton({ bug, comment }: Props) {
+function CloseBugWithCommentButton({ bug, comment, postClick }: Props) {
const [
addCommentAndCloseBug,
{ loading, error },
@@ -47,10 +49,14 @@ function CloseBugWithCommentButton({ bug, comment }: Props) {
},
],
awaitRefetchQueries: true,
+ }).then(() => {
+ if (postClick) {
+ postClick();
+ }
});
}
- if (loading) return <div>Loading...</div>;
+ if (loading) return <CircularProgress />;
if (error) return <div>Error</div>;
return (