diff options
author | Michael Muré <batolettre@gmail.com> | 2021-03-21 21:31:14 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-21 21:31:14 +0100 |
commit | 52df5a1f1199d085b2bb10fb7ed5599dcb8307c4 (patch) | |
tree | 031a10e135ceb60c623aca994db9c4c701b7ef66 /webui/src/pages/new | |
parent | 6744cddaa6ed25b9f2c0c61ef9df1823b5e74e6e (diff) | |
parent | aeb26d0e84b14a44ed52e2fd158b01310e295e45 (diff) | |
download | git-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.tsx | 11 |
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>; |