aboutsummaryrefslogtreecommitdiffstats
path: root/webui/src/pages/new
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2021-03-21 21:31:14 +0100
committerGitHub <noreply@github.com>2021-03-21 21:31:14 +0100
commit52df5a1f1199d085b2bb10fb7ed5599dcb8307c4 (patch)
tree031a10e135ceb60c623aca994db9c4c701b7ef66 /webui/src/pages/new
parent6744cddaa6ed25b9f2c0c61ef9df1823b5e74e6e (diff)
parentaeb26d0e84b14a44ed52e2fd158b01310e295e45 (diff)
downloadgit-bug-52df5a1f1199d085b2bb10fb7ed5599dcb8307c4.tar.gz
Merge pull request #600 from GlancingMind/upstream-improve-navigation
WebUI: Improve navigation
Diffstat (limited to 'webui/src/pages/new')
-rw-r--r--webui/src/pages/new/NewBugPage.tsx11
1 files changed, 8 insertions, 3 deletions
diff --git a/webui/src/pages/new/NewBugPage.tsx b/webui/src/pages/new/NewBugPage.tsx
index 96afb56a..4dc60e3c 100644
--- a/webui/src/pages/new/NewBugPage.tsx
+++ b/webui/src/pages/new/NewBugPage.tsx
@@ -1,7 +1,7 @@
import React, { FormEvent, useState } from 'react';
+import { useHistory } from 'react-router-dom';
-import { Button } from '@material-ui/core';
-import Paper from '@material-ui/core/Paper';
+import { Button, Paper } from '@material-ui/core';
import { makeStyles, Theme } from '@material-ui/core/styles';
import BugTitleInput from '../../components/BugTitleForm/BugTitleInput';
@@ -47,7 +47,9 @@ function NewBugPage() {
const [issueTitle, setIssueTitle] = useState('');
const [issueComment, setIssueComment] = useState('');
const classes = useStyles();
+
let issueTitleInput: any;
+ let history = useHistory();
function submitNewIssue(e: FormEvent) {
e.preventDefault();
@@ -59,12 +61,15 @@ function NewBugPage() {
message: issueComment,
},
},
+ }).then(function (data) {
+ const id = data.data?.newBug.bug.humanId;
+ history.push('/bug/' + id);
});
issueTitleInput.value = '';
}
function isFormValid() {
- return issueTitle.length > 0 && issueComment.length > 0 ? true : false;
+ return issueTitle.length > 0;
}
if (loading) return <div>Loading...</div>;