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

feat(v2): prevent attachment field duplication if size limit exceeded, add toasts for duplication #4699

Merged
merged 3 commits into from
Aug 29, 2022

Conversation

justynoh
Copy link
Contributor

@justynoh justynoh commented Aug 26, 2022

Problem

Attachment fields can be duplicated even if the size limit ends up being exceeded which is a bug. In Angular, a modal pops up showing that the attachment can't be duplicated.

Simultaneously, found a difference between angular and react in that we don't notify users when logiced fields are duplicated. Added as part of the toast, as agreed on slack.

Closes #4648

Solution

  1. Improve language of all the field update toasts.
  2. Prevent attachment dupe:
    a. In field row container, add check prior to dupe.
    b. Factor out function getting max attachment size.
  3. Add logicedFieldIdsSet to admin form logic, and access it in order to determine whether to show logic sentence in dupe toast.

Breaking Changes

  • No - this PR is backwards compatible

Screenshots

Screen.Recording.2022-08-26.at.6.28.59.PM.mov

@justynoh justynoh marked this pull request as ready for review August 29, 2022 01:58
@justynoh
Copy link
Contributor Author

Actually, our backend should also probably validate the dupe request as well to ensure that it's valid. Might want to implement that to develop though

Copy link
Contributor

@karrui karrui left a comment

Choose a reason for hiding this comment

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

Lgtm

@justynoh justynoh merged commit eb50e5c into form-v2/develop Aug 29, 2022
@justynoh justynoh deleted the form-v2/fix/attachment-field-duplication branch August 29, 2022 05:50
@justynoh justynoh mentioned this pull request Oct 5, 2022
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.

2 participants