Commit 7ff49822 authored by Stefan Probst's avatar Stefan Probst
Browse files

fix: allow workflow submission when form page pristine

parent 1b47ea7f
Pipeline #178358 passed with stage
in 5 minutes and 49 seconds
...@@ -188,6 +188,7 @@ export function ItemForm(props: ItemFormProps<ItemFormValues>): JSX.Element { ...@@ -188,6 +188,7 @@ export function ItemForm(props: ItemFormProps<ItemFormValues>): JSX.Element {
> >
{pages[state.page]} {pages[state.page]}
<div className="flex items-center justify-end space-x-6"> <div className="flex items-center justify-end space-x-6">
<pre>{JSON.stringify(pristine)}</pre>
<Button onPress={onCancel} variant="link"> <Button onPress={onCancel} variant="link">
Cancel Cancel
</Button> </Button>
...@@ -202,7 +203,8 @@ export function ItemForm(props: ItemFormProps<ItemFormValues>): JSX.Element { ...@@ -202,7 +203,8 @@ export function ItemForm(props: ItemFormProps<ItemFormValues>): JSX.Element {
form.change('draft', true) form.change('draft', true)
}} }}
isDisabled={ isDisabled={
pristine || invalid || submitting || create.isLoading /* FIXME: handle `pristine` for multi-step form || */
invalid || submitting || create.isLoading
} }
variant="link" variant="link"
> >
...@@ -214,7 +216,8 @@ export function ItemForm(props: ItemFormProps<ItemFormValues>): JSX.Element { ...@@ -214,7 +216,8 @@ export function ItemForm(props: ItemFormProps<ItemFormValues>): JSX.Element {
form.change('draft', undefined) form.change('draft', undefined)
}} }}
isDisabled={ isDisabled={
pristine || invalid || submitting || create.isLoading /* FIXME: pristine || */
invalid || submitting || create.isLoading
} }
> >
{isAllowedToPublish ? 'Publish' : 'Submit'} {isAllowedToPublish ? 'Publish' : 'Submit'}
......
...@@ -205,7 +205,8 @@ export function ItemForm(props: ItemFormProps<ItemFormValues>): JSX.Element { ...@@ -205,7 +205,8 @@ export function ItemForm(props: ItemFormProps<ItemFormValues>): JSX.Element {
form.change('draft', true) form.change('draft', true)
}} }}
isDisabled={ isDisabled={
pristine || invalid || submitting || create.isLoading /* FIXME: handle `pristine` for multi-step form || */
invalid || submitting || create.isLoading
} }
variant="link" variant="link"
> >
...@@ -217,7 +218,8 @@ export function ItemForm(props: ItemFormProps<ItemFormValues>): JSX.Element { ...@@ -217,7 +218,8 @@ export function ItemForm(props: ItemFormProps<ItemFormValues>): JSX.Element {
form.change('draft', undefined) form.change('draft', undefined)
}} }}
isDisabled={ isDisabled={
pristine || invalid || submitting || create.isLoading /* FIXME: pristine || */
invalid || submitting || create.isLoading
} }
> >
{isAllowedToPublish ? 'Publish' : 'Submit'} {isAllowedToPublish ? 'Publish' : 'Submit'}
......
Markdown is supported
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