Skip to content

Commit

Permalink
🐛 Don't allow save as draft on first page of wizard (#1461)
Browse files Browse the repository at this point in the history
Resolves https://issues.redhat.com/browse/MTA-1207?filter=12422675

Don't allow save as draft to be rendered on first page when nothing has
been answered yet.

Signed-off-by: ibolton336 <ibolton@redhat.com>
  • Loading branch information
ibolton336 authored Oct 11, 2023
1 parent 050e3c7 commit 11feb0f
Showing 1 changed file with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,16 @@ export const CustomWizardFooter: React.FC<CustomWizardFooterProps> = ({
<Button variant="link" onClick={onClose} cy-data="cancel">
{t("actions.cancel")}
</Button>
<Button
variant="link"
onClick={onSaveAsDraft}
isDisabled={isFormInvalid || isFirstStep || !hasAnswers}
cy-data="save-as-draft"
>
{t("actions.saveAsDraft")}
</Button>
{!isFirstStep && (
<Button
variant="link"
onClick={onSaveAsDraft}
isDisabled={isFormInvalid || isFirstStep || !hasAnswers}
cy-data="save-as-draft"
>
{t("actions.saveAsDraft")}
</Button>
)}
</>
);
}}
Expand Down

0 comments on commit 11feb0f

Please sign in to comment.