Skip to content

Commit

Permalink
file size max alert updated
Browse files Browse the repository at this point in the history
  • Loading branch information
shindigira committed Apr 23, 2024
1 parent 5a6538a commit 35c178e
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 13 deletions.
6 changes: 3 additions & 3 deletions src/components/StepIndicator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ export interface StepType {
}

export const mockSteps: StepType[] = [
{ status: STEP_COMPLETE, label: 'Upload file' },
{ status: STEP_COMPLETE, label: 'Resolve errors' },
{ status: STEP_CURRENT, label: 'Review warnings' },
{ status: STEP_CURRENT, label: 'Upload file' },
{ status: STEP_INCOMPLETE, label: 'Resolve errors' },
{ status: STEP_INCOMPLETE, label: 'Review warnings' },
{ status: STEP_INCOMPLETE, label: 'Provide point of contact' },
{ status: STEP_INCOMPLETE, label: 'Sign and submit' },
];
Expand Down
14 changes: 14 additions & 0 deletions src/pages/Filing/FilingApp/FileSubmission.data.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,20 @@ function ValidationErrorGeneralAlert(): JSX.Element {
);
}

export function UploadMaxSizeAlert(): JSX.Element {
return (
<Alert
className='mb-[2.8125rem] [&_div]:max-w-[41.875rem] [&_p]:max-w-[41.875rem]'
message='There was a problem uploading your file'
status='error'
>
The file you tried to upload exceeds the file size requirement or contains
no data. Check your file and try again. If this issue persists,{' '}
<Link href={sblHelpMail}>email our support staff.</Link>
</Alert>
);
}

export const fileSubmissionStateAlert: Record<
Exclude<
FileSubmissionState,
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Filing/FilingApp/FileSubmission.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { FileSubmissionState } from 'types/filingTypes';
import { filingInstructionsPage } from 'utils/common';
import {
FILE_SIZE_LIMIT_2MB,
FILE_SIZE_LIMIT_ERROR_MESSAGE
FILE_SIZE_LIMIT_ERROR_MESSAGE,
} from 'utils/constants';
import FileDetailsUpload from './FileDetailsUpload';
import FileDetailsValidation from './FileDetailsValidation';
Expand Down
14 changes: 5 additions & 9 deletions src/pages/Filing/FilingApp/FileSubmissionAlert.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import type { AxiosError } from 'axios';
import { Alert } from 'design-system-react';
import type { SubmissionResponse } from 'types/filingTypes';
import { FileSubmissionState } from 'types/filingTypes';
import { FILE_SIZE_LIMIT_ERROR_MESSAGE } from 'utils/constants';
import { fileSubmissionStateAlert } from './FileSubmission.data';
import {
UploadMaxSizeAlert,
fileSubmissionStateAlert,
} from './FileSubmission.data';

interface FileSubmissionAlertProperties {
uploadedBefore: boolean;
Expand All @@ -19,13 +21,7 @@ function FileSubmissionAlert({
errorUpload,
}: FileSubmissionAlertProperties): JSX.Element | null {
if (errorUpload && errorUpload.message === FILE_SIZE_LIMIT_ERROR_MESSAGE)
return (
<Alert
className='mb-[2.8125rem] [&_div]:max-w-[41.875rem] [&_p]:max-w-[41.875rem]'
message='The file size is over the file size limit or does not contain data'
status='error'
/>
);
return <UploadMaxSizeAlert />;

if (errorUpload)
return fileSubmissionStateAlert[FileSubmissionState.UPLOAD_FAILED];
Expand Down

0 comments on commit 35c178e

Please sign in to comment.