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

fix: omit isVisible property from webhook response #6907

Merged
merged 1 commit into from
Nov 21, 2023

Conversation

wanlingt
Copy link
Contributor

@wanlingt wanlingt commented Nov 16, 2023

Problem

Remove redundant isVisible property from storage-mode response

Solution

Do not return isVisible property for each form response.

Note: I originally wanted to use lodash's pick/omit, but this returns a Partial type which was incompatible with the return type needed for req.body.responses in encrypt-submission.middleware

Another note:
Other properties (screenshots below) returned in the webhook response are:

  • "myInfo": { "attr": <name of attribute> }
  • "isUserVerified": boolean (set to true if the field has been verified by the user, e.g. email and mobile number)
  • "signature": string (for verified fields)
  • "isHeader": boolean (set to true if it's a Heading field)

Breaking Changes

  • No - this PR is backwards compatible

Before & After Screenshots

AFTER:

Webhook responses

Field Screenshot
Normal field image
Myinfo field image
Verified field image
Heading image

Tests

  • Create a storage mode form, with at least 1 of the following fields: short text field, Myinfo field, verified field, heading, attachment
  • Set up a webhook server and update the webhook url in the form's settings
  • Submit the form, check that the responses are decrypted by the webhook server and do not contain isVisible

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!

@KenLSM KenLSM merged commit 63f9e5f into develop Nov 21, 2023
42 checks passed
@KenLSM KenLSM deleted the fix/remove-isvisible branch November 21, 2023 07:39
@KenLSM KenLSM mentioned this pull request Nov 21, 2023
9 tasks
KenLSM added a commit that referenced this pull request Nov 21, 2023
* feat: charts (#6790)

* chore: import react google charts

* feat: create skeleton insights page

* fix: regex for route matching for insight page

* fix: layout of insights page

* feat: dummy endpoint for all encrypted data

* feat: queries to get all encrypted submission

* fix: encrypted model find params

* feat: get and decrypted all submission data

* feat: get formfields

* feat: generate charts

* fix: typing of spacing

* feat: create mapping for field to charts

* feat: some upgrades to format charts

* feat:wordcloud

* fix: remove excess divider

* fix: prefill rating values in bar chart

* feat: add question number to chart title

* feat: skeleton for changing chart to table

* chore: add gstatic charts to csp policy

* fix: rating average counting

* feat: table toggle mode

* feat: use icon button instead of toggle

* feat: dummy date picker

* fix: better date range picker styling

* feat: date range filtering

* fix: do not show rating if no values

* fix: filtering by date and styling

* fix: increase size of charts

* fix: do not display wordcloud if no words

* fix: alignment of wordcloud title

* fix: typing for submission insights dto

* refactor: make code more readable

* fix: typing of render array

* fix: do not randomize color for rating

* feat: fix bar graph colours changing on refocus

* feat: fix random word cloud movements on re-render

* feat: address MR comments

* feat: corrected types and fixed lint comments

* feat: update average rating to account for division by 0

* feat: refactored filter function to remove redundant date parsing

* feat: set max words for word cloud

* fix: fe lint issue

* refactor: cleanup constants

* feat: add growthbook toggle

* fix: flickering pie chart tooltip

* fix: ordering of frontend/package.json

* chore: add utils

* feat: add empty insights field

* fix: typeerror on admin submission

* refactor: rename insights to charts

* feat: add beta badge

* refactor: secretkeyverification to common component for results and charts tab

* fix: table charts ui

* fix: charts secretkeyvewrification component

* fix: remove stray space between charts and badge on tab title

* fix: remove testing flag

* chore: update copy for no charts generted

* fix: endday not calculated correctly

* feat(be): add limit and reverse chrono sort for submissions query

* feat(fe): add forced redirect for email charts

* chore: update charts supported field for better visual alignment with secret key section

* feat: add marketing prompts for charts

* chore: add copy for 1000 chart limit

* chore: shorten copy

* refactor: create daterangepicker helpers

* refactor: use helpers from daterangepicker

* feat: add no charts prompt

* chore: update language to omit implication of uncertainty

* fix: number typo

* feat: correctly retrieve based on date range

* fix: remove incorrect generic

* fix: remove unnecessary comment

---------

Co-authored-by: Timothee Groleau <timothee.groleau@gmail.com>
Co-authored-by: sebastianwzq <sebastian@open.gov.sg>
Co-authored-by: Ken <ken@open.gov.sg>
Co-authored-by: tshuli <shuli@open.gov.sg>

* fix: omit isVisible property from webhook response (#6907)

fix: omit isVisible property

* fix(markdown): refine regex to handle newlines after indentation groups (#6917)

fix: refine regex to handle newlines after indentation groups

* chore: bump version to v6.91.0

---------

Co-authored-by: Foo Chi Fa <59867455+foochifa@users.noreply.github.com>
Co-authored-by: Timothee Groleau <timothee.groleau@gmail.com>
Co-authored-by: sebastianwzq <sebastian@open.gov.sg>
Co-authored-by: tshuli <shuli@open.gov.sg>
Co-authored-by: wanlingt <56983748+wanlingt@users.noreply.github.com>
This was referenced Nov 21, 2023
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.

None yet

2 participants