Skip to content
Snippets Groups Projects
Commit ef00bc56 authored by Mihail Gorceag's avatar Mihail Gorceag
Browse files

fix: disable form popup for ncrc

parent 11c5ec2c
No related branches found
No related tags found
No related merge requests found
...@@ -187,31 +187,34 @@ const FormTemplate = ({ ...@@ -187,31 +187,34 @@ const FormTemplate = ({
}) => { }) => {
const client = useApolloClient() const client = useApolloClient()
const submitButton = (text, haspopup = false) => ( const submitButton = (text, haspopup = false) => {
<div> return (
<Button <div>
onClick={async () => { <Button
const hasErrors = Object.keys(await validateForm()).length !== 0 onClick={async () => {
const hasErrors = Object.keys(await validateForm()).length !== 0
// If there are errors, do a fake submit
// to focus on the error // If there are errors, do a fake submit
if ( // to focus on the error
hasErrors || if (
values.status === articleStatuses.evaluated || hasErrors ||
(values.status === articleStatuses.submitted && !haspopup) values.status === articleStatuses.evaluated ||
) { values.status === articleStatuses.submitted ||
handleSubmit() !haspopup
} else { ) {
toggleConfirming() handleSubmit()
} } else {
}} toggleConfirming()
primary }
type="button" }}
> primary
{text} type="button"
</Button> >
</div> {text}
) </Button>
</div>
)
}
const submitButtonText = match.url.includes('/evaluation') const submitButtonText = match.url.includes('/evaluation')
? 'Submit Evaluation' ? 'Submit Evaluation'
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment