-
Notifications
You must be signed in to change notification settings - Fork 87
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: add sample-submission endpoint to retrieve sample submission data of a public form #6325
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wanlingt
force-pushed
the
feat/sample-submission
branch
from
May 15, 2023 15:05
fff7cab
to
d039a65
Compare
foochifa
reviewed
May 16, 2023
timotheeg
reviewed
May 16, 2023
timotheeg
reviewed
May 16, 2023
LinHuiqing
approved these changes
May 18, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
wanlingt
added a commit
that referenced
this pull request
May 18, 2023
* test: add stories for admin and public forms with payments (#6292) * test: add stories for admin and public forms * test: add stories for FormPaymentPage * fix: misc frontend updates * fix: UI fixes for payment preview block in form builder and public form * chore(deps-dev): bump @babel/plugin-transform-runtime from 7.19.6 to 7.21.4 (#6297) chore(deps-dev): bump @babel/plugin-transform-runtime Bumps [@babel/plugin-transform-runtime](https://github.com/babel/babel/tree/HEAD/packages/babel-plugin-transform-runtime) from 7.19.6 to 7.21.4. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.21.4/packages/babel-plugin-transform-runtime) --- updated-dependencies: - dependency-name: "@babel/plugin-transform-runtime" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps-dev): bump @typescript-eslint/eslint-plugin from 5.59.2 to 5.59.5 in /shared (#6288) chore(deps-dev): bump @typescript-eslint/eslint-plugin in /shared Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 5.59.2 to 5.59.5. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.59.5/packages/eslint-plugin) --- updated-dependencies: - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * build(deps): bump json5 from 1.0.1 to 1.0.2 in /frontend (#5688) Bumps [json5](https://github.com/json5/json5) from 1.0.1 to 1.0.2. - [Release notes](https://github.com/json5/json5/releases) - [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md) - [Commits](json5/json5@v1.0.1...v1.0.2) --- updated-dependencies: - dependency-name: json5 dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * build(deps): bump http-cache-semantics from 4.1.0 to 4.1.1 in /frontend (#5729) Bumps [http-cache-semantics](https://github.com/kornelski/http-cache-semantics) from 4.1.0 to 4.1.1. - [Release notes](https://github.com/kornelski/http-cache-semantics/releases) - [Commits](kornelski/http-cache-semantics@v4.1.0...v4.1.1) --- updated-dependencies: - dependency-name: http-cache-semantics dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps-dev): bump type-fest from 2.19.0 to 3.10.0 (#6270) Bumps [type-fest](https://github.com/sindresorhus/type-fest) from 2.19.0 to 3.10.0. - [Release notes](https://github.com/sindresorhus/type-fest/releases) - [Commits](sindresorhus/type-fest@v2.19.0...v3.10.0) --- updated-dependencies: - dependency-name: type-fest dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps-dev): bump jest-extended from 1.2.1 to 3.2.4 (#5793) Bumps [jest-extended](https://github.com/jest-community/jest-extended) from 1.2.1 to 3.2.4. - [Release notes](https://github.com/jest-community/jest-extended/releases) - [Changelog](https://github.com/jest-community/jest-extended/blob/main/CHANGELOG.md) - [Commits](jest-community/jest-extended@v1.2.1...v3.2.4) --- updated-dependencies: - dependency-name: jest-extended dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix: squished logic block either option (#6305) * Add minimum width 0 for flex child items that do not respect flex basis settings * refactor: logicValueWrapperWidth to be more concise --------- Co-authored-by: Dexter Tan <[email protected]> * feat: add local dev support for twilio (#5881) * feat: add prism for twilio * feat: add localdev env config * fix: mocktwilio randomly assigning errorCode in response * feat: route sms body to maildev * fix: incorrect refernce to determine localdev * refactor: rename localDev to useMockTwilio * feat: generalize sendLocalDevMail * fix: test cases not mocking new mocktwilio * chore(deps-dev): bump @types/express from 4.17.14 to 4.17.17 (#6311) Bumps [@types/express](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/express) from 4.17.14 to 4.17.17. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/express) --- updated-dependencies: - dependency-name: "@types/express" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix(deps): bump @sentry/browser from 7.28.1 to 7.51.2 (#6314) Bumps [@sentry/browser](https://github.com/getsentry/sentry-javascript) from 7.28.1 to 7.51.2. - [Release notes](https://github.com/getsentry/sentry-javascript/releases) - [Changelog](https://github.com/getsentry/sentry-javascript/blob/develop/CHANGELOG.md) - [Commits](getsentry/sentry-javascript@7.28.1...7.51.2) --- updated-dependencies: - dependency-name: "@sentry/browser" dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps-dev): bump @types/opossum from 6.2.2 to 6.2.3 (#6316) Bumps [@types/opossum](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/opossum) from 6.2.2 to 6.2.3. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/opossum) --- updated-dependencies: - dependency-name: "@types/opossum" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps-dev): bump husky from 8.0.2 to 8.0.3 (#6312) Bumps [husky](https://github.com/typicode/husky) from 8.0.2 to 8.0.3. - [Release notes](https://github.com/typicode/husky/releases) - [Commits](typicode/husky@v8.0.2...v8.0.3) --- updated-dependencies: - dependency-name: husky dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps-dev): bump axios-mock-adapter from 1.21.2 to 1.21.4 (#6313) Bumps [axios-mock-adapter](https://github.com/ctimmerm/axios-mock-adapter) from 1.21.2 to 1.21.4. - [Release notes](https://github.com/ctimmerm/axios-mock-adapter/releases) - [Changelog](https://github.com/ctimmerm/axios-mock-adapter/blob/master/CHANGELOG.md) - [Commits](ctimmerm/axios-mock-adapter@v1.21.2...v1.21.4) --- updated-dependencies: - dependency-name: axios-mock-adapter dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * feat: prevent prefill editing (#6097) * chore: add prefill property to model * feat: admin can lock prefill * chore: render locked prefill on public form * chore: update copy * feat: styling for locked prefill field * fix: model validation * chore: add tests * chore: add stories * fix: prefill can be locked only when there is a prefill value * chore: update copy * chore: update copy * fix: styling for dropdown input * chore: copy update * chore: unwanted import * feat: show different message based on combination of prefills * feat: update stories * chore: update copy for locked fields * perf: conditionally use hooks based on activeness of field row (#6303) * perf: refactor active field button group which separates the hooks relating to handling duplicate fields and deleting fields. Preventing unnecessary re-renders to non-active fields. * perf: update parent builder field * perf: update dragging over flag only for active fields * refactor: available size limit should only be computed on attachment * chore: remove unnecessary check * refactor: improve name of activeField * refactor: improve readability for dragging over * refactor: only pass extra props when active * fix: playwright tests cancelled after timeout (and other issues) (#6308) * fix: add ssm env site name for playwright * fix: email sort by time in ascending order * ci: separate playwright test suites into diff steps * fix: change textbox to combobox for field settings dropdown * fix: change in fillMultiDropdowns behaviour - Don't close dropdown between item selections. - Scroll options into view if they're not in view. * ci: temporarily comment out responses download * ci: temp rm of webkit from playwright - due to secret key download issues only on webkit * fix: type change due to upgrade in types/express to 4.17.17 (#6319) fix: type change due to upgrade in types/express * feat: retain image metadata after compression (#6320) * chore: bump browser-image-compression to 2.0.2 * feat: preserve exif when image is compressed * chore(deps-dev): bump @types/jsonfile from 6.1.0 to 6.1.1 (#6329) Bumps [@types/jsonfile](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jsonfile) from 6.1.0 to 6.1.1. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jsonfile) --- updated-dependencies: - dependency-name: "@types/jsonfile" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps-dev): bump @typescript-eslint/parser from 5.59.5 to 5.59.6 in /shared (#6331) chore(deps-dev): bump @typescript-eslint/parser in /shared Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.59.5 to 5.59.6. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.59.6/packages/parser) --- updated-dependencies: - dependency-name: "@typescript-eslint/parser" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps-dev): bump @typescript-eslint/eslint-plugin from 5.59.5 to 5.59.6 in /shared (#6332) chore(deps-dev): bump @typescript-eslint/eslint-plugin in /shared Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 5.59.5 to 5.59.6. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.59.6/packages/eslint-plugin) --- updated-dependencies: - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore: add code of conduct from contributor covenant (#6326) * fix: pin MockPass version (#6324) * fix(deps): bump twilio from 4.7.2 to 4.11.0 (#6328) Bumps [twilio](https://github.com/twilio/twilio-node) from 4.7.2 to 4.11.0. - [Release notes](https://github.com/twilio/twilio-node/releases) - [Changelog](https://github.com/twilio/twilio-node/blob/main/CHANGES.md) - [Commits](twilio/twilio-node@4.7.2...4.11.0) --- updated-dependencies: - dependency-name: twilio dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix(deps): bump vm2 from 3.9.17 to 3.9.18 (#6333) Bumps [vm2](https://github.com/patriksimek/vm2) from 3.9.17 to 3.9.18. - [Release notes](https://github.com/patriksimek/vm2/releases) - [Changelog](https://github.com/patriksimek/vm2/blob/master/CHANGELOG.md) - [Commits](patriksimek/vm2@3.9.17...3.9.18) --- updated-dependencies: - dependency-name: vm2 dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * feat: required copy updates for payment launch on prod (#6327) * feat: update banner copy on payment forms preview * feat: add test card banner for non-production envs * feat: update payments settings page with guide * chore: remove unnecessary Box import * fix: remove external link icon for payment guide * refactor: extract textProps in preview banner * fix: put px back into payments input panel infobox * refactor: extract uat link to constant file * fix: preview banner env condition * fix: disable payment resume and duplicate modals in preview (#6334) * feat: add isPreview context to PublicFormContext * refactor: change isPreview props to useContext * fix: disable payment resume modal in preview * fix: disable payment duplicate modal in preview * refactor: made isPreview essential * fix: do not show any payment modal in preview * fix(deps): bump stripe from 11.1.0 to 12.5.0 (#6330) Bumps [stripe](https://github.com/stripe/stripe-node) from 11.1.0 to 12.5.0. - [Release notes](https://github.com/stripe/stripe-node/releases) - [Changelog](https://github.com/stripe/stripe-node/blob/master/CHANGELOG.md) - [Commits](stripe/stripe-node@v11.1.0...v12.5.0) --- updated-dependencies: - dependency-name: stripe dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore: remove support for legacy stripe metadata (#6264) chore: remove support for legacy metadata * fix: rm white box for payment preview when disabled (#6342) * fix: rm white box for payment preview when disabled * fix: paymentPreview must define paymentDetails * chore: remove conditional frontend routing (#6190) * chore: remove react migration vars * chore: remove more conditional code in angular, backend types * chore: remove angular from express routing rules! * chore: add back public route * chore: remove angular public route * chore: add react router * chore: delete home folder, rename frontend to frontend-old and frontend-new to frontend * chore: remove src_e2e ci test, rename tests to better reflect backend-frontend split * test: add --openssl-legacy-provider to the ci build step * chore: update node options for build step * chore: revert ci to node 14 * fix(deps): bump @aws-sdk/client-cloudwatch-logs from 3.276.0 to 3.332.0 (#6345) Bumps [@aws-sdk/client-cloudwatch-logs](https://github.com/aws/aws-sdk-js-v3/tree/HEAD/clients/client-cloudwatch-logs) from 3.276.0 to 3.332.0. - [Release notes](https://github.com/aws/aws-sdk-js-v3/releases) - [Changelog](https://github.com/aws/aws-sdk-js-v3/blob/main/clients/client-cloudwatch-logs/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-js-v3/commits/v3.332.0/clients/client-cloudwatch-logs) --- updated-dependencies: - dependency-name: "@aws-sdk/client-cloudwatch-logs" dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * feat: add sample-submission endpoint to retrieve sample submission data of a public form (#6325) * feat: add createSampleSubmissionData function * feat: add endpoint to get sample submission * docs: add comments for GET sample submission endpoint * feat: randomise response, add attachment type * fix: remove form deactivation check * tests: add unit tests for sample submission endpoint * ref: split sample submission creation into smaller functions * fix: return static fields in createSingleSampleSubmissionAnswer * chore: bump version to v6.50.0 --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Justyn Oh <[email protected]> Co-authored-by: Lin Huiqing <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Dexter Tan <[email protected]> Co-authored-by: Ken Lee Shu Ming <[email protected]> Co-authored-by: tshuli <[email protected]> Co-authored-by: Foo Chi Fa <[email protected]> Co-authored-by: Timothee Groleau <[email protected]> Co-authored-by: Ken Jin <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
Some integrations e.g. Zapier, Plumber, require sample form submission data to test triggers. Providing sample data is also more convenient for admins as they would not have to make a (fake) form submission just for the sake of testing the integration.
Solution
This PR creates a new endpoint
/api/v3/forms/:formId/sample-submission
which returns a sample form submission data.Breaking Changes
Before & After Screenshots
AFTER:
Tests
GET
request tohttp://staging.form.gov.sg/api/v3/forms/:formId/sample-submission
using