Skip to content

Commit

Permalink
feat: do not allow for handling if csv is not downloaded
Browse files Browse the repository at this point in the history
  • Loading branch information
sirtawast committed Oct 4, 2024
1 parent b9b8f27 commit 656bc4c
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,6 @@ type Props = {
onClose: () => void;
};

const handleAlterationCsvDownload = (): void => {
// TODO add any necessary logic here after the CSV download
};

const AlterationHandlingForm = ({
application,
alteration,
Expand Down Expand Up @@ -83,6 +79,12 @@ const AlterationHandlingForm = ({
const [isMessagesDrawerVisible, toggleMessagesDrawerVisibility] =
useState<boolean>(false);

const [isCSVDownloadDone, setIsCSVDownloadDone] = useState<boolean>(false);

const handleAlterationCsvDownload = (): void => {
setIsCSVDownloadDone(true);
};

const getErrorMessage = (fieldName: string): string | undefined =>
getErrorText(formik.errors, formik.touched, fieldName, t, isSubmitted);

Expand Down Expand Up @@ -287,7 +289,9 @@ const AlterationHandlingForm = ({
onClick={openConfirmationModal}
theme="coat"
iconLeft={<IconCheck />}
disabled={isSubmitting || (isSubmitted && hasErrors)}
disabled={
isSubmitting || (isSubmitted && hasErrors) || !isCSVDownloadDone
}
isLoading={isSubmitting}
loadingText={t('common:utility.submitting')}
>
Expand Down

0 comments on commit 656bc4c

Please sign in to comment.