Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Design Review] Upload #430

Merged
merged 221 commits into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from 220 commits
Commits
Show all changes
221 commits
Select commit Hold shift + click to select a range
8688b34
fix: [axiosService] Add missing POST parameter
meissadia Apr 2, 2024
6822d26
[Filing Routing] Phase 1 - Mock Filing progress
meissadia Apr 5, 2024
9849158
[Filing Routing] Phase 1 - Separate routes per step
meissadia Apr 5, 2024
fea91e3
fix: axiosService.request - remove unneeded `data` param in favor of …
meissadia Apr 9, 2024
46971d5
fix: useMemo to avoid duplicate placeholder objects being generated
meissadia Apr 9, 2024
2c2de5f
fix: FilingStepWrapper.helpers - remove unused eslint rule disables
meissadia Apr 9, 2024
bc14e84
[Filing Routing] Phase 1 - Mock Filing progress
meissadia Apr 5, 2024
2cbd121
[Filing Routing] Phase 1 - Separate routes per step
meissadia Apr 5, 2024
e7d28d1
fix: useMemo to avoid duplicate placeholder objects being generated
meissadia Apr 9, 2024
9c52113
fix: FilingStepWrapper.helpers - remove unused eslint rule disables
meissadia Apr 9, 2024
d912fc7
Update imports after rebase
meissadia Apr 9, 2024
9257eb7
Update imports after rebase part 2
meissadia Apr 9, 2024
c60e6e6
Add "tasks" to our mock filing
meissadia Apr 9, 2024
2867e7b
Sync axiosService file
meissadia Apr 9, 2024
cd9a385
Filing step - Display "current" highlight even if step is incomplete
meissadia Apr 9, 2024
b937bc4
Filing - Placeholder for "is step complete?" status
meissadia Apr 9, 2024
5b6c4f3
Filing step - Improve spacing between step indicators
meissadia Apr 10, 2024
c0be487
Filing steps - Remove custom hook that contained routes, which helps …
meissadia Apr 10, 2024
f66f7b3
Merge branch 'main' into 331-filing-routing_phase1-mock-data
meissadia Apr 10, 2024
0c0d989
Filing steps - Revamp flex alignment of page elements
meissadia Apr 10, 2024
cd69c7b
[ScreenReaderOnly] Component: Extract from Filing step indicator code…
meissadia Apr 10, 2024
e64c41c
Filing steps - More dynamic routes (year and lei from the url)
meissadia Apr 10, 2024
a0dcab9
Filing steps - Add TODO to check on StepIndicator widths
meissadia Apr 10, 2024
74506f3
Merge branch 'main' into 331-filing-routing_phase1-mock-data
meissadia Apr 11, 2024
f8f1bdc
fix: [axiosService] Always include "body" for post/put/patch requests
meissadia Apr 18, 2024
502c82c
feat: [API]
meissadia Apr 18, 2024
152ceb6
feat: [FilingOverview] Determine and link to next incomplete step
meissadia Apr 19, 2024
4ebc759
feat: [Filing] Display current Institution's progress within the subm…
meissadia Apr 19, 2024
a0fa68b
feat: [Filing] Placeholder pages for Filing steps
meissadia Apr 19, 2024
77c7ea0
fix: [Institution card] Routing logic for a Submissio n with a previo…
meissadia Apr 19, 2024
e2ca8d2
feat: [FileSubmission] Integrate Filing step indicator and navigation…
meissadia Apr 19, 2024
3b1f9a7
Merge branch 'main' into 331-filing-routing_phase2-live-data
meissadia Apr 22, 2024
45c787c
feat: [Filing Steps] Split out the FilingSteps and FilingNavButtons i…
meissadia Apr 25, 2024
d6a0aa8
fix: [Filing Steps] Adjust font color/weight based on step status
meissadia Apr 25, 2024
26799d8
Merge branch 'main' into 331-filing-routing_phase2-live-data
meissadia Apr 25, 2024
fe318e5
start wip
shindigira Apr 26, 2024
19fbbaf
added Alert
shindigira Apr 26, 2024
beb8475
single errors count
shindigira Apr 26, 2024
2d34bcf
added TODOs
shindigira Apr 26, 2024
1625732
resolved merge conflicts -- after upload adjustments PR
shindigira Apr 26, 2024
be097dd
Merge main
meissadia Apr 26, 2024
dc1e91f
task: More compact error/loading checks
meissadia Apr 26, 2024
9baf597
fix(Upload - Infinite Loading): adjusted the useGetLatestSubmission s…
shindigira Apr 26, 2024
c355edf
resolved merge conflict
shindigira Apr 26, 2024
a7caaf4
alternative solution to react-query settings changes on useGetSubmiss…
shindigira Apr 27, 2024
3b0e54f
removed unnecessary variable
shindigira Apr 27, 2024
91970e5
Merge branch '331-filing-routing_phase2-live-data' of github.com:cfpb…
shindigira Apr 27, 2024
1d1bf6e
removed unusued
shindigira Apr 27, 2024
1964c52
Merge branch '331-filing-routing_phase2-live-data' of github.com:cfpb…
shindigira Apr 27, 2024
d70c852
best solution for initial check
shindigira Apr 27, 2024
34c6444
Merge branch '331-filing-routing_phase2-live-data' of github.com:cfpb…
shindigira Apr 27, 2024
33cf044
chore(errors_warnings): Created helper functions to sort between erro…
shindigira Apr 27, 2024
513e2d2
chore(errors_warnings): Updated errors and warnings helper functions
shindigira Apr 27, 2024
a546911
chore(errors_warnings): Added Alert links
shindigira Apr 27, 2024
f8b9e32
fix phantom space
shindigira Apr 27, 2024
f6450bc
remove refetches on window focus by default
shindigira Apr 27, 2024
47b360a
disabled refetch on window focus
shindigira Apr 27, 2024
997da1b
resolve comment conflict
shindigira Apr 27, 2024
e372b60
style(FilingNavButtons): 18px between buttons (according to figma), m…
shindigira Apr 29, 2024
527bbf1
task: [useFilingAndSubmissionInfo] Simplify fetching logic
meissadia Apr 29, 2024
211a45f
fix: [FileSubmission] New Filers get stuck in "Loading" state on init…
meissadia Apr 29, 2024
95f6108
task: [useFilingAndSubmissionInfo] Set staletime to 0
meissadia Apr 29, 2024
8438199
task: [useFilingAndSubmissionInfo] Utilize useGetSubmissionLatest hook
meissadia Apr 29, 2024
614ca43
task: [fetchSubmissionLatest] Delete
meissadia Apr 29, 2024
4612751
Merge branch 'main' into 331-filing-routing_phase2-live-data
meissadia Apr 29, 2024
17b71eb
task: Utilize some of the Design System colors that have been integra…
meissadia Apr 29, 2024
d661744
fix: [useFilingAndSubmissionInfo] Ensure Filing is created before fet…
meissadia Apr 29, 2024
b856cda
added a check for register errors
shindigira Apr 29, 2024
963a7ca
task: Use fetchFilingSubmissionLatest
meissadia Apr 29, 2024
53a1793
fixed one typescript item
shindigira Apr 29, 2024
158b8e1
Merge branch '331-filing-routing_phase2-live-data' of github.com:cfpb…
shindigira Apr 30, 2024
1d3a68d
chore(single-field-error): subfolder start
shindigira Apr 30, 2024
7a4bc32
enhancement(single-field-errors): Started table implementation
shindigira Apr 30, 2024
74a921e
enhancement(single-field-errors): Table - rows
shindigira Apr 30, 2024
273834e
resolved merge conflict
shindigira Apr 30, 2024
fa28321
Removed unused file
shindigira Apr 30, 2024
0a47c45
chore(single-field-errors): set tables to be horizontal scrollable
shindigira Apr 30, 2024
7603d16
chore(resolve-errors-warnings): updated function to separate singles/…
shindigira May 1, 2024
4c51b9f
formatting start
shindigira May 1, 2024
be6704d
feat(errors): multifield start
shindigira May 1, 2024
8486616
chore(errors): Updated Step2 with MultiErrors
shindigira May 1, 2024
0a82a76
feat(errors): Alerts properly toggle depending on errors
shindigira May 1, 2024
c050a3a
feat(errors): Multifield errors rendering
shindigira May 1, 2024
0d79dcd
refactor(errors): Used a common component between single and multi
shindigira May 1, 2024
63007c3
feat(errors): Added Register level errors
shindigira May 1, 2024
cd8738a
refactor(errors): swapped out hook for useGetSubmissionLatest
shindigira May 1, 2024
dbbf77a
Merge branch 'main' of github.com:cfpb/sbl-frontend into 333-resolve-…
shindigira May 1, 2024
18d3262
chore(Resolve Errors): added commented out td shrink for demo
shindigira May 2, 2024
17f2f68
refactor(get submission latest): refactored the hook and axios reques…
shindigira May 2, 2024
3aae0fc
feat(Resolve Errors): Buttons that toggle between state or transition…
shindigira May 2, 2024
574b2e9
style(Resolve Errors): 18px between buttons
shindigira May 2, 2024
51f695b
feat(Upload): added an enableLongPolling boolean to useGetSubmissionL…
shindigira May 2, 2024
4bf9507
enhancement(Resolve Errors): Implemented 'react-markdown' in Resolve …
shindigira May 2, 2024
05d64b1
fix(Resolve Errors): updated Link with the proper component
shindigira May 2, 2024
67be125
ts error
shindigira May 2, 2024
bbef90c
update(Resolve Errors): due to sbl-filing data schema change -- valid…
shindigira May 2, 2024
7d98720
typescript update
shindigira May 2, 2024
ef61955
more TS handling
shindigira May 2, 2024
d380708
enhancement(Upload): Hide FilingNavButtons if still loading
shindigira May 2, 2024
acb452f
feat(Resolve Errors): if a get submission latest fails, there is an a…
shindigira May 2, 2024
2b16c0d
pathing updates
shindigira May 2, 2024
cfe5e33
warnings skeleton complete
shindigira May 2, 2024
50d0061
refactor(Errors/Warnings): Made FieldErrorsSummary more flexible
shindigira May 3, 2024
f7338b1
renamed components handling both errors and warnings to be more appro…
shindigira May 3, 2024
f8f44d5
TypeScript handling -- FieldEntry
shindigira May 3, 2024
b49a472
Merge branch 'main' of github.com:cfpb/sbl-frontend into 333-resolve-…
shindigira May 3, 2024
7f7a324
column ref
shindigira May 6, 2024
74a5f0f
resolve merge conflicts
shindigira May 6, 2024
759c2f6
added error incorrect file type based on status 415
shindigira May 6, 2024
e78eabd
removed unused check due to backend data schema change
shindigira May 6, 2024
bb8675a
pulled in errors and warnings; resolved merge conflicts
shindigira May 6, 2024
142e82a
Merge branch 'main' of github.com:cfpb/sbl-frontend into 333-resolve-…
shindigira May 6, 2024
0254a14
Merge branch 'design-review-upload' of github.com:cfpb/sbl-frontend i…
shindigira May 6, 2024
3e3e31d
Merge branch 'main' of github.com:cfpb/sbl-frontend into 333-resolve-…
shindigira May 6, 2024
6335396
step2 message fixed
shindigira May 6, 2024
3e20323
fixed isstep2 subheading on errors
shindigira May 6, 2024
931fd71
final isstep2 fix
shindigira May 6, 2024
d6be6e0
Merge branch 'main' of github.com:cfpb/sbl-frontend into design-revie…
shindigira May 6, 2024
6fcd5f9
fix(record_no): In the Error/Warnings tables, incremented the row num…
shindigira May 9, 2024
ff752e0
chore(filingTypes): added total_count to a filing type
shindigira May 9, 2024
7a15556
styling(pagination/tables): extra unused rows are now white
shindigira May 9, 2024
fb68da3
style(table): removed the every other table row background color
shindigira May 9, 2024
8d9504a
enhancement(Upload): SUBMISSION_ACCEPTED warnings and no warnings dif…
shindigira May 10, 2024
b1e7183
change(Upload): The Upload Alert is now always present if there was a…
shindigira May 10, 2024
c2d0738
enhancement(Upload): Redirect to 500 page if initial get submission l…
shindigira May 10, 2024
46c96a8
enhancement(Upload): Updated figma/excel up with new success scenarios
shindigira May 10, 2024
3d8244b
wording update
shindigira May 10, 2024
47f5143
general upload alert error implemented
shindigira May 10, 2024
a15f9cd
enhancement(links): Modified uses of Alert and TextIntroduction to us…
shindigira May 10, 2024
e8d2080
Merge branch '473-upload-excel-figma-content-update' of github.com:cf…
shindigira May 10, 2024
bb3c8f0
fixed a missing import
shindigira May 10, 2024
0122810
fixed a missing import 2
shindigira May 10, 2024
719d6f9
addressed the validatedomnest error in TextIntroduction
shindigira May 10, 2024
179ed6c
corrected SUBMISSION_ACCEPTED no warnings
shindigira May 10, 2024
bb0e63a
more Alert references
shindigira May 10, 2024
555ee1f
chore
shindigira May 10, 2024
f30bd3b
removed p
shindigira May 10, 2024
9fb67f1
redirect corrected
shindigira May 11, 2024
26475b8
,
shindigira May 11, 2024
b0ea143
more robust redirect logic
shindigira May 11, 2024
5e16184
underline link start
shindigira May 13, 2024
ec1af5a
underline instead if Alert wrapper
shindigira May 13, 2024
f7657be
step1 header underline
shindigira May 13, 2024
cda1267
missing link ref
shindigira May 13, 2024
c47c503
missing link ref 2
shindigira May 13, 2024
67e6a12
underlined links
shindigira May 13, 2024
d0e5d3e
content(Resolve Errors): Text Introduction content updated
shindigira May 13, 2024
ac0c914
chore(longpolling): set delay to one second
shindigira May 13, 2024
441e138
style(FieldLinks - Download report): updated button style based on figma
shindigira May 13, 2024
d89e797
content(FilingErrorsAlerts): Updated based on figma updates
shindigira May 13, 2024
398c4d6
feat(Resolve Errors - Bottom Alert): Syntax or logic errors warning n…
shindigira May 13, 2024
a023107
fix(time): set to the proper one second
shindigira May 13, 2024
eebc3aa
feat(Resolve Errors - Bottom Alert): Syntax or logic errors warning n…
shindigira May 13, 2024
a57dd6b
style(Upload): errors or warnings in validation details icon is yellow
shindigira May 13, 2024
09bbdd2
style(Alert - underline links): changed to border bottom solid
shindigira May 13, 2024
4507b06
style(underline links): changed to border bottom solid
shindigira May 13, 2024
fbe8e6f
style(underlined error links): utlize text-decoration underline
shindigira May 13, 2024
0292c19
content(Resolve Errors): single field errors description update
shindigira May 13, 2024
108dcf2
dotted underline
shindigira May 13, 2024
6ea1b08
underline solid to dotted
shindigira May 13, 2024
8dafb4b
focus style on validation link
shindigira May 13, 2024
378013a
content update - warning alert
shindigira May 13, 2024
b198f6e
missing styles
shindigira May 13, 2024
5ff8f26
more content update
shindigira May 13, 2024
9b6ad8b
resolved merge conflicts
shindigira May 13, 2024
8d1623e
desp(DSR): pagination component update
shindigira May 13, 2024
4dba6db
deps(DSR): updated DSR's pagination component
shindigira May 13, 2024
3e21fc6
style: TextIntroduction description instances utilize Paragraph wrappers
shindigira May 14, 2024
ba5baa4
design - upload/errors/warnings
shindigira May 14, 2024
49c305a
error link hover border solid
shindigira May 14, 2024
7afd9fb
Merge branch 'resolve-errors-bugs-1' of github.com:cfpb/sbl-frontend …
shindigira May 14, 2024
1230fb6
border separate on hidden table
shindigira May 14, 2024
e45d3c4
Merge branch 'resolve-errors-bugs-1' of github.com:cfpb/sbl-frontend …
shindigira May 14, 2024
5c3c48e
fix(Upload - Alert): after attempting above file size upload, alert s…
shindigira May 14, 2024
04bafe9
Merge branch 'design-review-upload' of github.com:cfpb/sbl-frontend i…
shindigira May 14, 2024
4f8448c
ref fix for Paragraph in contact
shindigira May 14, 2024
40b4ac5
exclamation mark fixed in upload
shindigira May 14, 2024
a84f734
Merge branch 'design-review-upload' of github.com:cfpb/sbl-frontend i…
shindigira May 14, 2024
f0a25bc
resolve merge conflict
shindigira May 14, 2024
dda1f9a
download report and upload is not visible if no warnings
shindigira May 14, 2024
6bd2cc9
Merge branch 'resolve-errors-bugs-1' of github.com:cfpb/sbl-frontend …
shindigira May 14, 2024
a2b142b
Merge branch 'main' of github.com:cfpb/sbl-frontend into errors-and-u…
shindigira May 14, 2024
8dd1d80
style(Button): focus -- bg-white
shindigira May 14, 2024
5892774
Merge branch 'design-review-upload' of github.com:cfpb/sbl-frontend i…
shindigira May 14, 2024
9b102d2
feat(download report): removed caching heads -- using submissionId so…
shindigira May 14, 2024
76fd904
Merge branch 'design-review-upload' of github.com:cfpb/sbl-frontend i…
shindigira May 14, 2024
57e8156
Merge branch 'main' of github.com:cfpb/sbl-frontend into design-revie…
shindigira May 14, 2024
16fbfd8
Merge branch 'main' of github.com:cfpb/sbl-frontend into resolve-erro…
shindigira May 14, 2024
74b4f7c
reverted cache headers change
shindigira May 14, 2024
823d864
Merge branch 'design-review-upload' of github.com:cfpb/sbl-frontend i…
shindigira May 14, 2024
0b2ead0
enabled one second polling
shindigira May 15, 2024
0a788af
content(Upload): updated based on figma updates
shindigira May 15, 2024
49b7a97
Paragraph wrapping -- underlined links
shindigira May 15, 2024
e45bb8a
resolve merge conflicts
shindigira May 15, 2024
6b259f3
paragraph wrapping, logicerroralert
shindigira May 15, 2024
7b26caa
resolve merge conflicts
shindigira May 15, 2024
0c1e09f
TODO - table stripe fix
shindigira May 15, 2024
9ada256
Merge branch 'resolve-errors-bugs-1' of github.com:cfpb/sbl-frontend …
shindigira May 15, 2024
4dac8a3
Merge branch 'main' into exponential-backoff-one-second
shindigira May 15, 2024
56d6c67
button content
shindigira May 15, 2024
ba66606
Merge branch 'design-review-upload' of github.com:cfpb/sbl-frontend i…
shindigira May 15, 2024
8f740e8
Merge branch 'main' of github.com:cfpb/sbl-frontend into errors-and-u…
shindigira May 15, 2024
3615120
Merge branch 'main' into design-review-upload
shindigira May 15, 2024
e600ff7
Merge branch 'main' into resolve-errors-bugs-1
shindigira May 15, 2024
71214e1
style(InstitutionHeading): 2 spaces instead of 1
shindigira May 15, 2024
3f6849b
Merge branch 'design-review-upload' of github.com:cfpb/sbl-frontend i…
shindigira May 15, 2024
86880b0
resolve merge conflict - one second longpolling
shindigira May 15, 2024
e2a465b
Merge branch 'main' of github.com:cfpb/sbl-frontend into errors-and-u…
shindigira May 15, 2024
e32cb89
merged with main
shindigira May 15, 2024
5e90e17
Merge branch 'main' of github.com:cfpb/sbl-frontend into design-revie…
shindigira May 15, 2024
85b8db5
Merge branch 'resolve-errors-bugs-1' of github.com:cfpb/sbl-frontend …
shindigira May 15, 2024
ebb9e1c
Merge branch 'design-review-upload' of github.com:cfpb/sbl-frontend i…
shindigira May 15, 2024
df816a9
updated with main
shindigira May 15, 2024
5b68cf3
updated with main
shindigira May 15, 2024
3f3398e
Merge branch 'design-review-upload' of github.com:cfpb/sbl-frontend i…
shindigira May 15, 2024
c9c78a5
merged with all
shindigira May 15, 2024
d36a57b
resolve merge conflict part 2
shindigira May 15, 2024
137f402
point of contact - double issue
shindigira May 15, 2024
aa28d1d
upload button always primary
shindigira May 15, 2024
d9abe04
resolve merge conflicts
shindigira May 15, 2024
d757afc
Merge branch 'main' of github.com:cfpb/sbl-frontend into design-revie…
shindigira May 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 19 additions & 15 deletions src/api/requests/fetchFilingSubmissionLatest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,24 +70,28 @@ async function retryRequestWithDelay(
// eslint-disable-next-line no-param-reassign
axiosInstance.defaults.retryCount += One;

// TODO: Remove console.logs once retry adjustments have been fully accepted
console.log(
'Validation STILL in-progress - Long Polling - RETRYING',
response,
);
if (import.meta.env.DEV) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wonder how the security scan stuff will handle these dev only console.logs. We'll find out. 👍

// eslint-disable-next-line no-console
console.log(
'Validation STILL in-progress - Long Polling - RETRYING',
response,
);

console.log(
'retry delay time:',
// getRetryDelay(axiosInstance.defaults.retryCount),
);
// eslint-disable-next-line no-console
console.log(
'retry delay time:',
getRetryDelay(axiosInstance.defaults.retryCount),
);
}

return new Promise(resolve => {
setTimeout(
() => resolve(axiosInstance(response.config)),
// getRetryDelay(axiosInstance.defaults.retryCount),
// NOTE: Set to one second for AWS load testing
STANDARD_TIMEOUT,
);
// NOTE: Set to one second for AWS load testing, will revert before mvp
// https://github.com/cfpb/sbl-frontend/issues/497
// setTimeout(
// () => resolve(axiosInstance(response.config)),
// getRetryDelay(axiosInstance.defaults.retryCount),
// );
setTimeout(() => resolve(axiosInstance(response.config)), STANDARD_TIMEOUT);
});
}

Expand Down
15 changes: 9 additions & 6 deletions src/components/AlertApiUnavailable.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Link } from 'components/Link';
import { Alert } from 'design-system-react';
import { Alert, Paragraph } from 'design-system-react';
import type { ComponentProps } from 'react';
import { sblHelpMail } from 'utils/common';

interface AlertApiUnavailableProperties {
Expand All @@ -14,18 +15,20 @@ export function AlertApiUnavailable({
message,
href = sblHelpMail,
...others
}: AlertApiUnavailableProperties & Partial<typeof Alert>): JSX.Element {
}: AlertApiUnavailableProperties & ComponentProps<typeof Alert>): JSX.Element {
return (
<Alert
className='mb-[2.8125rem] [&_div]:max-w-[41.875rem] [&_p]:max-w-[41.875rem]'
message={message}
status='error'
{...others}
>
There was a connection issue or our service may be temporarily
unavailable. Make sure your computer is connected to the internet, and try
again. If this issue persists,{' '}
<Link href={href}>contact our support staff</Link>.
<Paragraph>
There was a connection issue or our service may be temporarily
unavailable. Make sure your computer is connected to the internet, and
try again. If this issue persists,{' '}
<Link href={href}>contact our support staff</Link>.
</Paragraph>
</Alert>
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ type ButtonProperties = ComponentProps<typeof ButtonDSR>;
/* Handles new secondary styling */

const newSecondaryStyle =
'cursor-pointer border-[1px] border-solid border-pacific bg-white text-pacific hover:border-[#0050B4] hover:bg-white hover:text-[#0050B4] focus:bg-transparent disabled:cursor-not-allowed disabled:border-none';
'cursor-pointer border-[1px] border-solid border-pacific bg-white text-pacific hover:border-[#0050B4] hover:bg-white hover:text-[#0050B4] focus:bg-white disabled:cursor-not-allowed disabled:border-none';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking forward to getting this in the DSR post-mvp.


export function Button({
children,
Expand Down
23 changes: 14 additions & 9 deletions src/pages/Filing/FilingApp/FileDetailsValidation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,32 @@ import { fileSubmissionValidationStatus } from './FileSubmission.data';
interface FileDetailsProperties {
dataGetSubmissionLatest: SubmissionResponse | undefined;
errorGetSubmissionLatest: unknown;
hasWarnings: boolean;
}

function FileDetailsValidation({
dataGetSubmissionLatest,
errorGetSubmissionLatest,
hasWarnings,
}: FileDetailsProperties): JSX.Element | null {
// Should only show once an validation has completed
if (
!dataGetSubmissionLatest?.filename &&
!dataGetSubmissionLatest?.submission_time
errorGetSubmissionLatest ||
(!dataGetSubmissionLatest?.filename &&
!dataGetSubmissionLatest?.submission_time)
)
return null;

// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
const validationStatusMessage: string = errorGetSubmissionLatest
? fileSubmissionValidationStatus[FileSubmissionState.VALIDATION_ERROR]
: // @ts-expect-error key in
dataGetSubmissionLatest.state in fileSubmissionValidationStatus
? // @ts-expect-error use key
fileSubmissionValidationStatus[dataGetSubmissionLatest.state]
: '';
const validationStatusMessage: string =
hasWarnings &&
dataGetSubmissionLatest.state === FileSubmissionState.SUBMISSION_ACCEPTED
? 'Your file contains no errors and warnings have been verified'
: // @ts-expect-error key in
dataGetSubmissionLatest.state in fileSubmissionValidationStatus
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh interesting... I added the exception to this ticket

? // @ts-expect-error use key
fileSubmissionValidationStatus[dataGetSubmissionLatest.state]
: '';

return (
<div id='file-details-validation'>
Expand Down
98 changes: 66 additions & 32 deletions src/pages/Filing/FilingApp/FileSubmission.data.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
import AlertApiUnavailable from 'components/AlertApiUnavailable';
import { Link } from 'components/Link';
import { Alert } from 'design-system-react';
import { Alert, Paragraph } from 'design-system-react';
import { FileSubmissionState } from 'types/filingTypes';
import { fileFormatLink, sblHelpMail } from 'utils/common';

const uploadErrorSubheading = 'There was a problem uploading your file';
const validationErrorSubheading =
'There was a problem performing validation checks on your file';

function SuccessAlert(): JSX.Element {
return (
<Alert
className='mb-[2.8125rem] [&_div]:max-w-[41.875rem] [&_p]:max-w-[41.875rem]'
message='File successfully uploaded and validation check completed'
message='Your file was successfully uploaded and validation checks were performed'
status='success'
/>
);
Expand All @@ -18,26 +22,49 @@ export function ValidationInitialFetchFailAlert(): JSX.Element {
return <AlertApiUnavailable message='The filing service is unavailable' />;
}

function ValidationErrorGeneralAlert(): JSX.Element {
export function UploadErrorGeneralAlert(): JSX.Element {
return (
<Alert
className='mb-[2.8125rem] [&_div]:max-w-[41.875rem] [&_p]:max-w-[41.875rem]'
message='There was a problem validating your file'
message={uploadErrorSubheading}
status='error'
/>
>
<Paragraph>
An unknown error occurred during file upload. If this issue persists,{' '}
<Link href={sblHelpMail}>email our support staff</Link>.
</Paragraph>
</Alert>
);
}

export function ValidationErrorGeneralAlert(): JSX.Element {
return (
<Alert
className='mb-[2.8125rem] [&_div]:max-w-[41.875rem] [&_p]:max-w-[41.875rem]'
message={validationErrorSubheading}
status='error'
>
<Paragraph>
An unknown error occurred while performing validation checks on your
file. If this issue persists,{' '}
<Link href={sblHelpMail}>email our support staff</Link>.
</Paragraph>
</Alert>
);
}

function ValidationErrorTimeoutAlert(): JSX.Element {
return (
<Alert
className='mb-[2.8125rem] [&_div]:max-w-[41.875rem] [&_p]:max-w-[41.875rem]'
message='There was a problem validating your file'
message={validationErrorSubheading}
status='error'
>
Our system was not able to process your file within the allotted
timeframe. Try re-uploading the file. If this issue persists,{' '}
<Link href={sblHelpMail}>email our support staff</Link>.{' '}
<Paragraph>
Our system was not able to process your file within the allotted
timeframe. Try re-uploading the file. If this issue persists,{' '}
<Link href={sblHelpMail}>email our support staff</Link>.
</Paragraph>
</Alert>
);
}
Expand All @@ -46,12 +73,14 @@ 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'
message={uploadErrorSubheading}
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>.
<Paragraph>
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>.
</Paragraph>
</Alert>
);
}
Expand All @@ -60,12 +89,14 @@ export function IncorrectFileTypeAlert(): 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'
message={uploadErrorSubheading}
status='error'
>
The file you uploaded is an unsupported media type. Check your file and
try again. If this issue persists,{' '}
<Link href={sblHelpMail}>email our support staff</Link>.
<Paragraph>
The file you uploaded is an unsupported media type. Check your file and
try again. If this issue persists,{' '}
<Link href={sblHelpMail}>email our support staff</Link>.
</Paragraph>
</Alert>
);
}
Expand All @@ -80,23 +111,27 @@ export const fileSubmissionStateAlert: Record<
JSX.Element
> = {
[FileSubmissionState.VALIDATION_SUCCESSFUL]: <SuccessAlert />,
[FileSubmissionState.SUBMISSION_ACCEPTED]: <SuccessAlert />,
[FileSubmissionState.VALIDATION_WITH_WARNINGS]: <SuccessAlert />,
[FileSubmissionState.VALIDATION_WITH_ERRORS]: <SuccessAlert />,
[FileSubmissionState.UPLOAD_FAILED]: (
<AlertApiUnavailable message='There was a problem uploading your file' />
<AlertApiUnavailable message={uploadErrorSubheading} />
),
[FileSubmissionState.VALIDATION_ERROR]: <ValidationErrorGeneralAlert />,
[FileSubmissionState.VALIDATION_EXPIRED]: <ValidationErrorTimeoutAlert />,
[FileSubmissionState.SUBMISSION_UPLOAD_MALFORMED]: (
<Alert
className='mb-[2.8125rem] [&_div]:max-w-[41.875rem] [&_p]:max-w-[41.875rem]'
message='There was a problem validating your file'
message={validationErrorSubheading}
status='error'
>
There may be an issue with the formatting of your file. Make sure your
file meets the <Link href={fileFormatLink}>requirements</Link> detailed in
section 2.2 of the Filing instructions guide and try again. If this issue
persists, <Link href={sblHelpMail}>email our support staff</Link>.
<Paragraph>
There may be an issue with the formatting of your file. Make sure your
file meets the requirements detailed in the filing instructions guide (
<Link href={fileFormatLink}>section 2.2, &quot;File format&quot;</Link>)
and try again. If this issue persists,{' '}
<Link href={sblHelpMail}>email our support staff</Link>.
</Paragraph>
</Alert>
),
};
Expand All @@ -105,22 +140,21 @@ export const fileSubmissionValidationStatus: Record<
Exclude<
FileSubmissionState,
| FileSubmissionState.SUBMISSION_STARTED
| FileSubmissionState.SUBMISSION_UPLOAD_MALFORMED
| FileSubmissionState.SUBMISSION_UPLOADED
| FileSubmissionState.UPLOAD_FAILED
| FileSubmissionState.VALIDATION_ERROR
| FileSubmissionState.VALIDATION_EXPIRED
| FileSubmissionState.VALIDATION_IN_PROGRESS
>,
string
> = {
[FileSubmissionState.VALIDATION_SUCCESSFUL]:
'No errors or warnings were found in your file',
'The validation checks returned no errors or warnings',
[FileSubmissionState.SUBMISSION_ACCEPTED]:
'The validation checks returned no errors or warnings',
[FileSubmissionState.VALIDATION_WITH_WARNINGS]:
'Warnings were found in your file',
'The validation checks returned warnings',
[FileSubmissionState.VALIDATION_WITH_ERRORS]:
'Errors were found in your file',
[FileSubmissionState.SUBMISSION_UPLOAD_MALFORMED]:
'There may be an issue with the formatting of your file',
[FileSubmissionState.VALIDATION_ERROR]:
'There may be an issue with the validation of your file',
[FileSubmissionState.VALIDATION_EXPIRED]:
'There may be an issue with the validation of your file',
'The validation checks returned errors',
};
Loading