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

Fixed autosave from triggering on empty forms #195

Merged
merged 1 commit into from
Nov 18, 2024

Conversation

qhanson55
Copy link
Collaborator

Description

When changing steps in the submission intake form autosave is no longer triggered, onBlur for phone number doesn't trigger autosave anymore, and no more double autosave on initial save of draft.
Keeps empty drafts from cluttering the draft and submissions table.

PADS-337

Types of changes

Bug fix (non-breaking change which fixes an issue)

Checklist

  • I have read the CONTRIBUTING doc
  • I have checked that unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Copy link

github-actions bot commented Nov 8, 2024

Coverage Report (Frontend)

Totals Coverage
Statements: 25.05% ( 1599 / 6383 )
Methods: 20.44% ( 225 / 1101 )
Lines: 29.45% ( 923 / 3134 )
Branches: 21% ( 451 / 2148 )

@qhanson55 qhanson55 force-pushed the bug/empty-form-autosaves branch from 22a65f7 to da2ed8b Compare November 9, 2024 00:10
Copy link

github-actions bot commented Nov 9, 2024

Coverage Report (Application)

Totals Coverage
Statements: 36.43% ( 966 / 2652 )
Methods: 26.22% ( 118 / 450 )
Lines: 47.43% ( 647 / 1364 )
Branches: 23.99% ( 201 / 838 )

@slhurley
Copy link
Collaborator

Looking almost perfect! I did have one weird thing where I didn't fill out the Address section, clicked Submit and the validation occurred telling me I forgot that field...I stopped to read the red error message and it all of a sudden auto-saved and the validation went away...but I couldn't make it happen again! But I did find one error...go back and fill out the address/coordinates and click Submit and I get an Axios Error 422 (Failed to save intake) after clicking Yes to submitting so I couldn't actually submit my submission.

@qhanson55 qhanson55 force-pushed the bug/empty-form-autosaves branch from da2ed8b to ef806df Compare November 12, 2024 22:45
Comment on lines 42 to 56
async function generateActivityId() {
try {
const response = await submissionService.updateDraft({});
if (response.data?.activityId && response.data?.submissionId) {
emit('activityGenerated', response.data.activityId, response.data.submissionId);
return response.data.activityId;
} else {
return undefined;
}
} catch (error) {
toast.error('Failed to generate activity ID');
return undefined;
}
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

This is a lot of logic unrelated to file uploading. Can this be moved to the intake form?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

@qhanson55 qhanson55 force-pushed the bug/empty-form-autosaves branch from ef806df to e10bdc8 Compare November 15, 2024 00:14
@qhanson55 qhanson55 force-pushed the bug/empty-form-autosaves branch from e10bdc8 to 37e97ba Compare November 15, 2024 00:33
Copy link
Collaborator

@kyle1morel kyle1morel left a comment

Choose a reason for hiding this comment

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

Approving as is. Changes will have to be made to this due to the new draft saving functionality happening in another branch.

@kyle1morel kyle1morel merged commit 03a9e93 into release/interregnum Nov 18, 2024
16 of 17 checks passed
@kyle1morel kyle1morel deleted the bug/empty-form-autosaves branch November 18, 2024 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants