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

chore: add minor changes to sample form submission api #7442

Merged
merged 2 commits into from
Jun 26, 2024

Conversation

m0nggh
Copy link
Collaborator

@m0nggh m0nggh commented Jun 26, 2024

Problem

Data from the sample form submission API are not in the correct format.

  • Checkbox field, should return the same fieldOptions to allow users to use every option possible
  • Date field, should return month in short format

Solution

  • Checkbox field to return all fields options
  • Date field to return months as short

Breaking Changes

  • No - this PR is backwards compatible

@m0nggh m0nggh requested a review from KenLSM June 26, 2024 02:55
Copy link
Contributor

@KenLSM KenLSM left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks!!

Copy link
Collaborator Author

@m0nggh m0nggh left a comment

Choose a reason for hiding this comment

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

thankss, discussed to only modify date since checkbox options should inherently be randomised

@KenLSM KenLSM merged commit 0530cd7 into develop Jun 26, 2024
19 checks passed
@KenLSM KenLSM deleted the chore/modify-sample-form-submission branch June 26, 2024 07:12
@KenLSM KenLSM mentioned this pull request Jun 30, 2024
30 tasks
m0nggh added a commit to opengovsg/plumber that referenced this pull request Jul 8, 2024
**NOTE**: the short form for date field is fixed with a formsg
[PR](opengovsg/FormSG#7442) instead
## Problem

Right now, formsg sample form submission randomises the checkbox options
which is not the best experience for users since they may want to use
every option.

## Solution

Formsg wanted the idea of randomising the options since it is a sample
submission so I have forcefully included all checkbox options (including
others option) on our end when we return the mock data.

## Tests
- [x] Mock data with checkbox will give all options regardless of
whether optional field or not
- [x] Normal test data with a form submission still returns as intended
g-tejas pushed a commit that referenced this pull request Jul 18, 2024
* add minor changes to sample form submission api

* revert checkbox field to randomising options
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