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): create droppable empty form placeholder #3502

Merged
merged 7 commits into from
Mar 1, 2022

Conversation

mantariksh
Copy link
Contributor

@mantariksh mantariksh commented Feb 24, 2022

Currently the form builder renders an empty page when the form has no fields. This PR adds the placeholder for fields to be dragged in when the form is empty:
empty-form-placeholder

Moreover, previously, background colour of existing fields would change to neutral.100 when a new field was being dragged over, even though they are not responsive to new fields being dropped over them. This is inconsistent with the design system. This PR fixes the issue by preventing the background colour of existing fields from changing when new fields are being dragged over.

Other improvements

  • Mocks added for POST request to create field and PUT request to update field

Known bugs

These will be fixed in a future PR:

  • After creating a new field, the onSuccess handler in the Edit* component does not fire, because the component unmounts and re-mounts due to its key in the parent changing.
  • After updating a field and exiting the edit field drawer, the field reverts back to its previous state. When attempting to create a new field, the field flips into the new state again.

@mantariksh mantariksh force-pushed the form-v2/empty-form-placeholder branch from 5c3e8f4 to 7d0ca3f Compare February 25, 2022 05:17
@mantariksh mantariksh force-pushed the form-v2/empty-form-placeholder branch from 7d0ca3f to 363d9fb Compare February 25, 2022 05:23
@mantariksh mantariksh marked this pull request as ready for review February 25, 2022 06:22
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

@mantariksh mantariksh merged commit c2844be into form-v2/develop Mar 1, 2022
@mantariksh mantariksh deleted the form-v2/empty-form-placeholder branch March 1, 2022 05:04
@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