Code Monkey home page Code Monkey logo

formsg's Introduction


Contributor Covenant Build Status Coverage Status

Table of Contents

Contributing

We welcome all contributions, bug reports, bug fixes, documentation improvements, enhancements, and ideas to code open sourced by the Government Technology Agency of Singapore. Contributors will also be asked to sign a Contributor License Agreement (CLA) to ensure that everybody is free to use their contributions.

IMPORTANT NOTE TO ALL CONTRIBUTORS

Before contributing, please read CONTRIBUTING.md. In particular, we strongly encourage contributors to please first discuss the change you wish to make via GitHub issue, email, or any other method with the repository owners beforehand. Otherwise, we may not be able to review or accept your PR.

Features

FormSG is a form builder application built, open sourced and maintained by the Open Government Products team of the Singapore Government Technology Agency to digitise paper processes.

Notable features include:

  • 19 different form field types, including attachments, tables, email and mobile
  • Verified email and mobile phone fields via integrations with Twilio and AWS SES
  • Automatic emailing of submissions for forms built with Email Mode
  • Encryption for data collected on forms built with Storage Mode
  • (Singapore government agencies only) Citizen authentication with SingPass
  • (Singapore government agencies only) Citizen authentication with sgID
  • (Singapore government agencies only) Corporate authentication with CorpPass
  • (Singapore government agencies only) Automatic prefill of verified data with MyInfo
  • Webhooks functionality via the official FormSG JavaScript SDK and contributor-supported FormSG Ruby SDK
  • Variable amount and Itemised payments on forms with stripe integration

Local Development (Docker)

Prerequisites

Install docker and docker-compose and the node version manager.

First Setup

First, make sure to install and use the node version used by the project:

nvm install
nvm use

To install the relevant npm packages (frontend, backend and virus-scanner), run the following in the root direcory:

npm install && npm --prefix serverless/virus-scanner install

To prevent breaking changes to webpack4 introduced in node 17 and above, enable the --openssl-legacy-provider flag:

export NODE_OPTIONS=--openssl-legacy-provider

If you are on Mac OS X, you may want to allow Docker to use more RAM (minimum of 4GB) by clicking on the Docker icon on the toolbar, clicking on the "Preferences" menu item, then clicking on the "Resources" link on the left.

Running Locally

First, build the frontend for local development:

npm run build:frontend

Run the following shell commands to build the Docker image. The first time will usually take 10 or so minutes. These commands runs the backend services specified under docker-compose.yml and the React frontend on the native host.

npm run dev

After the Docker image has finished building, the following local applications can be accessed:

  • React application can be accessed at localhost:3000
  • The backend API server can be accessed at localhost:5001
  • The development mail server can be accessed at localhost:1080

Adding dependencies

Run npm install as per usual.

For backend, run

docker-compose up --build --renew-anon-volumes

which will rebuild the backend Docker image and not reuse the existing node_modules volume.

As frontend project is currently not using Docker, no other steps are required.

Accessing email locally

We use MailDev to access emails in the development environment. The MailDev UI can be accessed at localhost:1080 when the Docker container runs.

Login using mockpass locally

  1. Click on the Login with Singpass button on the login page
  2. In the dropdown menu, select S9812379B [MyInfo]
  3. Choose the profile with the email [email protected]
  4. You should now be successfully logged in

Note: Remember to renew your formsg_mongodb_data volume

Environment variables

Docker-compose looks at various places for environment variables to inject into the containers. The following is the order of priority:

  • Compose file
  • Shell environment variables
  • Environment file
  • Dockerfile

FormSG requires some environment variables to function. More information about the required environment variables are in DEPLOYMENT_SETUP.md.

We provide a .template-env file with the secrets blanked out. You can copy and paste the variables described into a self-created .env file, replacing the required values with your own.

Trouble-shooting

You can consult TROUBLESHOOTING.md for common issues that developers face and how to resolve them.

Testing

The docker environment has not been configured to run tests. Thus, you will need to follow the following local build guide to get tests running locally.

Testing Prerequisites

The team uses macOS for development.

Make you sure have the following node version & package manager on your machine:

  • "node": ">=18.12.1"
  • "npm": ">=8.19.2"
  • "mongo": ">=4.0.0"

Run

nvm install 18
npm install
pip install "localstack[full]"

to install node modules and Localstack locally to be able to run tests. Note that localstack[full] is only compatible with Python 3.7 and above.

Running tests

Unit tests

npm run test

will build the backend and run our backend unit tests. The tests are located at __tests__/unit/backend.

If the backend is already built, you can run

npm run test-ci

Frontend tests are located at frontend/__tests__. They can be run with

npm run test:frontend

End-to-end tests

npm run test:e2e-v2

will build both the frontend and backend then run our end-to-end tests. The tests are located at __tests__/e2e. You will need to stop the Docker dev container to be able to run the end-to-end tests.

If you do not need to rebuild the frontend and backend, you can run

npx playwright test

Cross-browser testing

This project is tested with BrowserStack.

Architecture

The architecture overview is here.

MongoDB Scripts

Scripts for common tasks in MongoDB can be found here.

Support

Please contact FormSG ([email protected]) for any details.

Database Alternatives

Migrating from MongoDB to FerretDB

FerretDB is an open source MongoDB alternative built on PostgreSQL. MongoDB can be swapped out of FormSG for FerretDB. In order for this to be done, certain changes to the code should be made as described below:

  • Add postgres to the list of services in the docker.compose file e.g.

      image: postgres:15.3-alpine3.18
      environment:
        - POSTGRES_USER=<pguser>
        - POSTGRES_PASSWORD=<pgpassword>
        - POSTGRES_DB=<pgdbname>
      volumes:
        - pgdata:/var/lib/postgresql/data
      ports:
        - '5432:5432'
    
  • In the same file, change the "database" image from MongoDB to FerretDB and update the database section to include the lines below:

     image: ghcr.io/ferretdb/ferretdb:1.17.0
     environment:
       - FERRETDB_TELEMETRY=disable
       - FERRETDB_POSTGRESQL_URL=postgres://pg:5432/formsg?user=<pguser>&password=<pgpassword>
     ports:
       - '8080:8080'
     depends_on:
       - pg
    
  • Lastly, add the pgdata volume

        volumes:
            mongodb_data:
                driver: local
            pgdata:
    
  • FerretDB currently has some limitations and certain database features are not supported, these include TTL, database transactions and some aggregration pipelines which are all features used by FormSG.

    The following changes can be made to mitigate the limitations of FerretDB:

    • Add the autoRemove: 'interval' property to the initializing of the session object in the session.ts file.
    • Remove the unsupported aggregration pipeline stages e.g. lookup and project, in the submission.server.model.ts file.
    • Replace the findOneAndUpdate code block in the user.server.model.ts file with code similar to the one below:
       const user = await this.exists({ email: upsertParams.email })
       if (!user) {
        await this.create(upsertParams)
      }
      return this.findOne({
        email: upsertParams.email,
      }).populate({...
      

Migrating from Mongoose ODM to Prisma ORM

FormSG uses Mongoose as the Object-Document Mapping (ODM) to MongoDB. This means that our code is strongly coupled with MongoDB as Mongoose solely supports it.

In order to use a different database with FormSG you will have to first migrate from Mongoose to other object modelling libraries. One of which is Prisma.

Prisma is an Object-Relational Mapping (ORM) library that can also be used as the object model for MongoDB. Prisma is compatible with various other relational databases like Cockroach DB.

Follow this guide by Prisma to migrate from Mongoose.

The guide has 4 primary steps:

  1. Install Prisma CLI
  2. Introspect the current MongoDB for the data model
    1. For this section, Prisma’s introspection should be able to create prisma models that will replace your server.model.ts for each collection
    2. Additionally, as Prisma is relational, you could add relations between the various documents. One good relation to add will be form many to one user on the [form.email](http://form.email) field.
  3. Install Prisma Client
  4. Replace Mongoose Queries with Prisma Client
    1. This step will likely take the most refactoring efforts
    2. This will include most files in formsg/src ending with service.ts
    3. Including test files ending with service.spec.ts

Replacing MongoDB with CockroachDB

Thereafter, you could set up CockroachDB which is a distributed SQL DB. Follow the quick start guide by CockroachDB to create a CockroachDB Serverless cluster.

To replace the local development instance, you can follow this guide. As FormSG uses Docker for local development, you will have to replace the mongoDB container from docker-compose.yml to the cockroachDB version.

Then connect to CockroachDB by changing the DB url in .env to the one from your CockroachDB DATABASE_URL="YOUR_COCKROACH_DB_URL".

For local development, if the DB is replaced as above, you should not need to modify the ports as it will still be hosted on localhost:27017.

Other Prisma supported DBs

MongoDB can be replaced with other various relational databases supported by Prisma in this list.

Other potential DB migrations

It is also possible to migrate from Mongoose to Ottoman, which is another ODM.

The process will be simpler than migrating to Prisma, but Ottoman is more restrictive and can only be used together with Couchbase, which is also a noSQL DB like MongoDB.

Refer to this guide to migrate from Mongoose to Ottoman and then replace MongoDB with Couchbase.

Acknowledgements

FormSG acknowledges the work done by Arielle Baldwynn to build and maintain TellForm, on which FormSG is based.

Contributions have also been made by:
@RyanAngJY
@jeantanzy
@pregnantboy
@namnguyen08
@zioul123
@JoelWee
@limli
@tankevan

formsg's People

Contributors

arshadali172 avatar chowyiyin avatar darrelhong avatar dependabot[bot] avatar foochifa avatar frankchn avatar hanstirtaputra avatar jia1 avatar justynoh avatar karrui avatar kathleenkhy avatar kenjin-work avatar kenlsm avatar liangyuanruo avatar linhuiqing avatar lonerifle avatar mantariksh avatar mayying avatar orbitalsqwib avatar r00dgirl avatar seaerchin avatar sebastianwzq avatar siddarth2824 avatar snyk-bot avatar timotheeg avatar tohhengxing avatar tshuli avatar wanlingt avatar yong-jie avatar zatkiller avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

formsg's Issues

Technical design for Storage mode agency key

Problem: Prevent loss of Storage mode response data due to form admins losing secret keys. Loss of keys is expected especially over time with the form changing hands. However loss of response data undermines public confidence in the government, and could have individually significant consequences for form respondents (e.g. financial aid application).

Technical design

Design document here

Agency central key in the hands of CIO/CISO. Each new form key will be encrypted by agency’s public key and stored in agencyKey table for CIO retrieval with his private key. If agency private key is lost, have to manually contact each form owner to get private keys to re-encrypt with new agency key.

To be implemented after React rewrite

Improve Email mode messaging (smol ticket)

Email mode "Emails where responses will be sent" field

  • When only 1 recipient email is entered, amend the toaster to turn blue instead and display "Recommended: at least 2 recipients to prevent response loss from bounced emails"

  • 'Read about email reliability' link --> 'Guarding against bounces' with link https://guide.form.gov.sg/AdvancedGuide.html#how-do-i-ensure-my-form-responses-will-not-bounce

  • Alert msg when there is no recipient email entered: amend the ! to be consistent with the ! icon in other toaster messages ignoring

Settings page

  • Change the toaster under 'authentication' to say 'Deactivate your form to change authentication method'

Create form modal

  • Create form modal > Email mode red alert-content. amend copy slightly to "...Not recommended usually, especially for high volume forms...

Activation Email mode only

Refreshing form causes html title of form to change to "FormSG"

Steps to reproduce:

  1. Go to any form (or this test form created for this issue https://form.gov.sg/5ebe2d79b561af00110ea58b)

  2. Look at the tab title: Should be "(debug) Test form" or whatever the form title is.
    Screenshot 2020-05-15 at 1 52 40 PM

  3. Refresh the form

  4. Form title changes to generic "FormSG"
    Screenshot 2020-05-15 at 1 51 29 PM

Expected behaviour:
The title displayed in the tab should remain as the form title regardless of refresh

Speculation:
This is probably due to the redirect from the non hashbanged url https://form.gov.sg/5ebe2d79b561af00110ea58b to the hashbanged version https://form.gov.sg/#!/5ebe2d79b561af00110ea58b

Secret key mailto design updates

Related to UI fix #124

'Save your Secret Key' modal:

Save your Secret Key

Refer to zeplin https://app.zeplin.io/project/5b29ffde48eaaf6318d01b05/screen/5f2df833d0299b1c22acd717

@mantariksh don't implement the button dropdown yet, lets just do a simple link on the word 'Email' in the info box and leave the download and copy buttons unchanged. this is because i'm not confident that having Email in the dropdown options is sufficiently prominent, but we dont have a designer this week. if needed we can update the UI later.

Email prefill

Subject: Secret Key to 'Form Title' has been shared with you
To: all collaborator emails

Dear collaborator,

I am sharing my form's secret key with you for safekeeping and backup. This is an important key that is needed to access all form responses.

Form name: 'Form Title'
Form link: form.gov.sg/2098590248
Secret key: secretkey.

All you need to do is keep this email as a record, and please do not share this key with anyone else.

Thank you for helping to safekeep my form!

Other requirements

add event so we know when link/button is clicked, and tracker so we know when emails are opened

Webhooks interface for viewing logs

The UI today isn't able to display network logs from webhook requests, hampering integration and debugging for downstream systems.

We should have a webhooks dashboard that allows users to examine the network response for each webhook submission.

what is needed
alert
logs for debugging
how to recover

Optionally persist email OTP verification

So that respondents will not have to repeatedly verify their email if their job is to complete many form submissions at one go - repeated data submission by authorised persons only e.g.

  • referral forms
  • logging of assets
  • test result reporting

maybe:

  • include session id when creating transaction object, look up before creating new transaction
  • if transaction exists, prefill verified email field(s) and indicate verified
  • refresh to clear fields or detect field edits to reset fields in transaction object
  • on Thank You page, also show ~ "If you are done submitting forms, please close your browser tab to end this session securely"
  • transaction has 4h expiry currently, ideally OTP verification has closer to 1h expiry similar to SPCP

optionally:

  • allow user to check Remember me for next submission on frontend, which is by default unchecked
  • if Remember me is checked in submission, session Id is saved to transaction obj. if it is not checked, session id is updated to null.
  • Remember me is also checked by default on the next submission

Hand over function to transfer all ownership roles

What the admin sees:
confirmation message: "This will transfer all the forms you own to 'email address'. You will be removed as a collaborator and lose access to the forms you previously owned.

What should happen:

  • For all forms on which admin is Owner, replace ownership with new admin
  • Not touching editor and read-only roles for now
  • Log all replacements

Investigate Babel configuration to target IE11 / ES5

Babel should be transpiling code to be ES5 / IE11-compatible. Currently IE11 is specified as a target browser in .babelrc file, yet Object.values was not transpiled.

Additionally - check if polyfills from polyfills.js are being added by babel e.g. whatwg-fetch

@mantariksh said: I investigated this for a while today but didn't get very far. Tried using the useBuiltIns option for Babel but it didn't help. I'm pretty sure the polyfills are being imported though, both from inspection of bundle.js and the fact that downloading storage mode attachments works in IE11 (hence fetch is definitely working). I'm setting this aside for now to work on other things.

Remove self from collaborator list

Give users the ability to remove themselves from collaborator lists of forms

Currently only the form owner can remove a collaborator; this is slightly more inconvenient during events such as handing over administration of a form than if collaborators had the ability to remove themselves.

Proposed solution to add a bin next to own name for Editors and Read-only to remove oneself.

Confirmation modal: "You will be removed as a collaborator and will lose access to this form. You cannot undo this." buttons: "Remove me" and "Cancel"

Update data collation tool delimiter

Table style fields on Email mode often need to be split to column after data collation into an Excel sheet. However we use a comma delimiter that makes this difficult. Excel 365 splits to column whether or not the comma delimiter is followed by a space.

SnipImage

Storage mode uses ; delimiter:

Screenshot 2020-07-22 at 12 47 34 AM

To discuss: backwards compatibility

Technical design: Save draft

Top requested feature from form respondents (est. 10%).

A few ideas for save draft:

  1. Encrypt data and store it in a new collection, with private key in form link, e.g. form.gov.sg/<form_id>/<draft_id>

  2. Download a file with draft response data in it and upload again to restore (does not touch server, key concern is feasibility & UX on mobile devices)

  3. Save it to local storage (non-ideal, but simple to implement)

Prior discussion at https://github.com/datagovsg/formsg/issues/2063

ui/copy fixes

  1. change 'NRIC' field to say 'NRIC/FIN'

  2. IE11 storage mode Save your Secret Key modal download buttons are misaligned in desktop view

Fix credentials issue for Localstack

All builds are failing with the following error:

CredentialsError: Missing credentials in config, if using

We need to configure Localstack such that it works without us having to expose our AWS secrets to all branches.

Migrate server utility functions to Typescript (minus utils/field-validation)

This issue would cover files/folders in src/app/utils, except field-validation.

During the migration, also consider whether it makes sense for some of these utility functions to be refactored into instance or static methods in the mongoose schema e.g. getQuestionFromField in question.js.

Bigger folders

  • field-validation in #7

Logic for checkboxes

Background

Checkbox is the next most popular limited-choice field after those supported by logic - at 6.8% of all occurrences it is about as popular as Yes/No. The checkbox field serves unique use cases where admins want respondents to be able to select up to n choices, instead of just one choice.

Currently it is not feasible to set a logic condition for a respondent's choices having included a particular value.

  • the logic-based workaround is very unwieldy, you would have to ask about each choice as its own individual question, at the expense of respondent UX
  • more likely you would just do away with logic, and just issue a text-based prompt to respondents to answer a further question if it is applicable to them, especially if you have lots of checkbox options

Discuss

'includes' enum for checkbox fieldType

Review calendar usability on mobile

Review if calendar usability is fine on mobile. If ok, can close


#2078 is done, but mobile view might not be as optimised. Understand mobile design is here (https://zpl.io/blYnMXD), but it seems a bit squeezy for fat fingers, especially on an iphone 7 screen.

Circles are cut off, might want to fix this first (update from @jonathangohjy that circles are no longer cut off)

image

[UX revamp] Attachment field design

problem

today, the admin needs to collect some info in the attachments but does not know how many actual attachments the respondent has to submit.
e.g. Submit screenshots of your error. Its one error, but could be 1, 2, 3, 4 screenshots.

despite this, only one attachment can be uploaded per field.

this means that if respondent has multiple attachments (pictures for example), they will need to zip them up before uploading. this is too difficult on mobile, and mobile is 75% of respondents.

constraints

  • Emails have limit of 7mb attachments over entire form, Storage mode has limit of 20mb attachments.
  • mobile (75%) respondents would probably not be able to zip

research @wing-yiu

  • forms with multiple attachment fields that are sprinkled throughout the form, not clustered together
  • forms with attachment fields hidden by logic

what we want

for the respondent

  • upload as many attachments as needed, but keep within the size limit
  • be informed at point of upload if the size limit has been reached, so they dont fill in other fields before submission fails

for the admin

  • be able to communicate that they want different kinds of attachments, subject to logic if necessary

possible design

  • multiple uploads enabled for attachment field
  • continue to have multiple attachment fields anyway, to support logic, communication of different types of attachments, and form admin flexibility
  • each attachment field when clicked will show progress toward the size limit, similar to our design for attachment field config today

Introduce webhook retries

Web hooks today has a high chance of failure, e.g. if receiving server does not return success. Improve web hook's reliability through a few possible ways:

  1. Retry on failure, thus maintaining a queue
  2. Report on UI which entries failed, so users can download the delta and manually recover

To be clear, this should be an external queue such as SQS, not an in-memory queue.

Blocked by #1210

Investigate cause of intermittent offline page

Users occasionally find the site offline, but a refresh always loads FormSG successfully. Our logs also do not seem to pinpoint the cause of failure.

image

TODO: Take time out to re-examine the logs carefully. One known incident was at 2020-07-01 at 6.38.00 PM and was reported by Talitha.

Webhook attachments

Currently users of Storage Mode are forced to choose between creating attachment fields and using webhooks. This issue aims to bridge this gap so that there is feature parity between Storage Mode and email mode.

Use cases

  • 10k/year feedback channel

Prior discussion here: https://github.com/datagovsg/formsg/issues/2346

Bulk download attachments on Storage mode

Problem
Currently users have to individually download attachments on the corresponding response view in FormSG. The exported csv shows filename. If users receive a high volume of responses and every one of them has an attachment, individually downloading attachments is going to be a pain in the ass.

How do we make attachment downloads more convenient for users, and best support whatever they need to do with attachments after?

Why users have to download attachments rather than just viewing them

For common use cases like applications, users often need to bring up attachments again or send them to other parties for downstream stages of the process.
e.g. need to bring up CV and personal statement again if applicant is shortlisted through later rounds

Immediate implementation

summary: https://docs.google.com/document/d/1nzUHQDzo4WBA67xdy0a3A3nJLCeKVSzjzPtJebtS9xQ/edit#heading=h.ypu06omk303h

  1. Previous discussions were halted because downloading all attachments within x date range in 1 zip file was not technically feasible.

  2. Alternative was to have browser download 1 zip file (per response) at a time, but would not be a great UX, as user has to click twice (unzip, then open folder) just to access each response's attachments.

Do we have a better option than option 2?

Screens
https://app.zeplin.io/project/5b29ffde48eaaf6318d01b05/dashboard?seid=5f87c5ed5cf4fc4b800abbde

Longer term

  • Look at Zendesk extension
  • Explore service worker and saving to disk

Emergency contact number

Why

This is particularly useful for us to quickly alert user if their form is rejecting submissions due to bounced emails. Wouldn't be able to reach out via email since their mailbox is full.

More and more forms that are high stakes will be on FormSG (e.g. P1 registration next week), and for any issues we want to notify users immediately through a call, as users aren't reading emails all the time.

Design

https://app.zeplin.io/project/5b29ffde48eaaf6318d01b05?sid=5f1656f5d426c69dee81504e&sid=5f1656f63e0e752eff76503b&sid=5f1656f5b8fd637ed258ce82&sid=5f1656f5013cfd9cd7b9ec99&sid=5f1656f6fbff438dfe044d4a&sid=5f1656f6b8fd637ed258ce96&sid=5f1656f5013cfd9cd7b9ec6b&ref=slack

Frontend

  • use a small modal (background visible) instead of a full-page one like in the mockup
  • modal opens on login until user has entered an emergency contact number.
  • modal can be closed (X in top right as with our other modals)
  • modal copy (take note as different from mockup)
    Emergency mobile number
    We will only contact you in case of urgent issues with your form. You can change this number later in your user settings.

Backend

  • Emergency # is a key in user collection

Intelligent email bounce alarm

Create a new bounces collection where each document has a 48hr TTL and has the following fields:

  • formId: ObjectId
  • hasAlarmed: boolean: whether an alarm has been sent
  • bounces: Array<{ emailAddress: string, hasBounced: boolean }>: whether an email has bounced.

When we receive a bounce notification via webhook notifications, retrieve the document by finding the correct form ID. For each email in the list of bounced emails, set the corresponding hasBounced to true. If all the hasBounced are true and hasAlarmed is false, send an alarm write a log message and set hasAlarmed to true. CloudWatch should monitor the log message and trigger an alert if necessary

If the list of email recipients is different from the bounces array, update the bounces array.

If an email was successfully received, set hasBounced to false for the corresponding email.

Update documentation for site banners

README.md and docs/DEPLOYMENT_SETUP.md should be updated with the documentation for the env vars IS_LOGIN_BANNER, SITE_BANNER_CONTENT and ADMIN_BANNER_CONTENT and how they are prioritised with respect to the other banner env vars.

Simplify login by combining /checkuser and /sendotp

The login flow appears unnecessarily complex today as we need 3 network calls for a 2-step login

  1. call to /checkuser to make sure that the email is valid on the "Get Started" page
  2. call to /sendotp to request for an OTP, which checks the user's email again
  3. call to /verifyotp to login

We could potentially simplify by combining the first two steps into one API call.

Remove forced typecastings from converted Typescript files

Typecasting (such as typing as any, or to an interface) may be inevitable when some dependencies of the file that is being converted to Typescript is not in Typescript yet, and thus may not be emitting the correct types.

This issue is a holder issue to mark those forced typecastings in the application with an issue number so we can delete them in one shot after a majority of the backend has been migrated.

Extend coverage of e2e tests

Our approach to end-to-end tests is not proactive, but reactive: we write new tests whenever we encounter a bug which caused a rollback. This helps to ensure old bugs do not pop up again, but does not protect us against future bugs. Instead, we should be actively extending our test coverage to ensure that we test as many features as possible whenever we make code changes.

In my opinion, the biggest gap in our e2e tests is coverage of the form editing dashboard. We have no tests which cover editing of forms via the Build, Logic and Settings tabs. While former 2006 and former 2034 extended the coverage of submissions-related testing, they still rely on modifying the Forms collection directly, instead of manually creating a new form to submit.

I suggest the following roadmap to move forward with this:

  • Refactor: create a centralised resource of Selectors for the various buttons and controls in the admin dashboard. Continued reliance on data-test attributes will quickly become unsustainable and hard to debug as we expand the number of form controls we are testing.
  • Change the createForm function used in all the submissions tests to manually create the given forms using the admin dashboard, instead of adding them directly to the database.
  • Change the addLogic function used in the logic-related submissions tests to manually create the given logic using the Logic tab.
  • Unite the admin and submissions fixtures into actual end-to-end tests which manually create forms, activate them and submit them
  • Add a test for a form with MyInfo fields
  • Add tests for all the controls in the Settings tab, including typing in the various inputs and expecting them to be either reverted or updated upon blur
  • #5930
  • Add tests for other parts of the app (Share tab, Billing, examples etc). This is a low priority since these other parts seem to be stable.

[Responses tab] search by submissionId

Aim: make it easier to navigate to individual attachment for download

Feature: searchbar for single submissionId on the responses tab

Zeplin: https://app.zeplin.io/project/5b29ffde48eaaf6318d01b05/screen/5f2b713ca4a638880b1ddcdb

  • searchbar placeholder should be Search by reference no.
  • also change 'Ref no.' to 'Reference No.'
  • note comments on zeplin
  • dont include the filter button
  • may include the black bar in no-result view pending pearly

can we add a GA event so we know how often submissionIds get searched? @liangyuanruo

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.