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: charts #6790

Merged
merged 132 commits into from
Nov 21, 2023
Merged

feat: charts #6790

merged 132 commits into from
Nov 21, 2023

Conversation

foochifa
Copy link
Contributor

@foochifa foochifa commented Oct 11, 2023

Problem

Many admins have to transfer their form responses over to another analytics tool.

Closes FRM-1525, Closes FRM-1526, Closes FRM-1531

Solution

Show and process simple charts to provide insights on FormSG directly.

Breaking Changes

  • No - this PR is backwards compatible

Features:

  • Add feature flag on growthbook named charts
  • Add WordCloud for text-based fields
  • Add Charts (PieChart, BarChart, ColumnChart)

Before & After Screenshots

Announcement Modal
announcement-modal

What's new drawer
whats-new-drawer

No result page
no-charts-generated

Tests

Regression Tests

Ensure viewing of storage form submission results
  • Go to a storage mode form results page
  • Enter secret key for form
  • Ensure that results page can be entered
  • Ensure that results page renders table with results
  • Click on an entry
  • Ensure that results page is showing individual results

Deploy Notes

New dependencies:

  • react-wordcloud : to render wordcloud on react
  • stopword: to remove stopwords for wordcloud
  • react-google-charts: wrapper to google charts

New dev dependencies:

  • @types/stopword : types for stopword

arshadali172 and others added 30 commits August 12, 2020 15:33
chore: Merge release into master
feat: merge release v4.31.0 into master branch
chore: [master] Merge release 4.33.0
build: [master] Release 4.35.1 hotfix
build: merge release v4.36.0 into master
chore: merge release v4.37.1 into master
chore: merge release v4.39.0 into master
build: merge release 4.40.0 into master
build: merge Release 4.41.0 into master
build: merge Release 4.42.0 into master
build: merge release 4.43.2 into master
build: merge Release 4.44.0 into master
build: release 4.45.1 hotfix to master
build: merge release 4.46.1 into master
build: merge release v4.47.0 into master
build: merge release 4.48.2 into master
build: merge Release 4.49.1 into master
build: merge 4.50.3 into master
build: merge Release 4.51.0 into master
chore: merge release 4.52.1 into master
chore: merge 4.53.0 into master
chore: merge 4.54.0 into master
build: merge Release 4.56.0 into master
chore: merge 4.57.0 into master
chore: merge release 4.58.2 into master
build: merge Release v5.0.4 into master
chore: merge v5.1.0 into master
mb="0.5rem"
align="center"
>
There may not have been any responses collected within this date
Copy link
Contributor

Choose a reason for hiding this comment

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

question: why may?

suggestion: There were no responses collected within this date range.

Copy link
Contributor

Choose a reason for hiding this comment

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

Great catch. Updated in fe93acf

Copy link
Contributor

@tshuli tshuli 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 please also review 19dc00a before merge in 😃

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 70bfb70 into develop Nov 21, 2023
20 of 24 checks passed
@KenLSM KenLSM deleted the hack/eliminate-data branch November 21, 2023 07:16
@KenLSM KenLSM mentioned this pull request Nov 21, 2023
9 tasks
Copy link

linear bot commented Nov 21, 2023

FRM-1531 Charts V1.1 | getAllEncryptedSubmissionData to query by date range

getAllEncryptedSubmissionData returns the first 1000th items in reverse chronological order (to prevent a runaway response that returns all submission). This however, cannot be used together with the FE's DateRangePicker as FE will filter based on the BE data instead of DB.

BE will need to support lt / gt query that will be passed in from FE this request.

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

9 participants