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

build: release v4.48.0 #760

Merged
merged 31 commits into from
Dec 1, 2020
Merged

build: release v4.48.0 #760

merged 31 commits into from
Dec 1, 2020

Conversation

karrui
Copy link
Contributor

@karrui karrui commented Dec 1, 2020

Release v4.48.0

New

  • chore: add Go and Postman tips on Share tab #759
  • feat: remove .oa file from allowed file types #731
  • feat(utils): add exhaustive switch case typeguard #729

Improvements

  • ref: migrate get feedback flow to TypeScript #735
  • ref: migrate stream feedback flow to TypeScript #733
  • refactor: migrate mobile number validator to ts #713
  • refactor: migrate radio button validator to ts #723
  • refactor: migrate rating validator to ts #724
  • refactor(field-validation): simplify #734
  • feat: migrate get encrypt metadata endpoint controller to TypeScript #711

Bug fixes

  • fix: backend validation does not prevent responses on hidden fields #736
  • fix(AdminFormRoutes): add Joi validation on /submission endpoint #712

Misc

  • chore: update travis to have multiple ci stages #742
  • docs: add script for unlisting array of forms #714

Dependency upgrades

  • fix(deps): bump angular-messages from 1.8.1 to 1.8.2 #725
  • fix(deps): bump celebrate from 13.0.3 to 13.0.4 #756
  • fix(deps): bump express-rate-limit from 5.1.3 to 5.2.3 #726
  • fix(deps): bump mongoose from 5.10.15 to 5.10.18 #758
  • fix(deps): bump opossum from 5.0.1 to 5.0.2 #738
  • fix(deps): bump winston-cloudwatch from 2.3.2 to 2.4.0 #728
  • chore(deps-dev): bump @babel/preset-env from 7.12.1 to 7.12.7 #740
  • chore(deps-dev): bump @types/mongoose from 5.10.0 to 5.10.1 #746
  • chore(deps-dev): bump eslint from 7.13.0 to 7.14.0 #741
  • chore(deps-dev): bump lint-staged from 10.5.1 to 10.5.2 #722
  • chore(deps-dev): bump prettier from 2.1.2 to 2.2.0 #709
  • chore(deps-dev): bump stylelint from 13.6.1 to 13.8.0 #721
  • chore(deps-dev): bump ts-jest from 26.4.1 to 26.4.4 #720
  • chore(deps-dev): bump ts-mock-imports from 1.3.0 to 1.3.1 #747

mantariksh and others added 30 commits November 24, 2020 14:04
build: merge release 4.47.0 into develop
Bumps [lint-staged](https://github.com/okonet/lint-staged) from 10.5.1 to 10.5.2.
- [Release notes](https://github.com/okonet/lint-staged/releases)
- [Commits](lint-staged/lint-staged@v10.5.1...v10.5.2)

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [stylelint](https://github.com/stylelint/stylelint) from 13.6.1 to 13.8.0.
- [Release notes](https://github.com/stylelint/stylelint/releases)
- [Changelog](https://github.com/stylelint/stylelint/blob/master/CHANGELOG.md)
- [Commits](stylelint/stylelint@13.6.1...13.8.0)

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* chore(deps-dev): bump prettier from 2.1.2 to 2.2.0

Bumps [prettier](https://github.com/prettier/prettier) from 2.1.2 to 2.2.0.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/master/CHANGELOG.md)
- [Commits](prettier/prettier@2.1.2...2.2.0)

Signed-off-by: dependabot[bot] <[email protected]>

* fix: lint

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Kar Rui Lau <[email protected]>
…711)

* feat(EncryptSubSvc): add getSubmissionMetadata service fn (and tests)

* feat(EncryptSubSvc): add getSubmissionMetadataList service fn (+tests)

* feat(EncryptSubCtl): add handleGetMetadata fn

* ref(AdminFormRoutes): use new handleGetMetadata handler fn

* feat(AdminFormRoutes): allow optional page when submissionId exists

* test(EncryptSubCtl): add tests for handleGetMetadata
* refactor: migrate radioButtonValidator to ts

* refactor: update references

* chore: update isVisible for tests
* refactor: migrate ratingValidator to ts

* refactor: update references
Bumps [ts-jest](https://github.com/kulshekhar/ts-jest) from 26.4.1 to 26.4.4.
- [Release notes](https://github.com/kulshekhar/ts-jest/releases)
- [Changelog](https://github.com/kulshekhar/ts-jest/blob/master/CHANGELOG.md)
- [Commits](kulshekhar/ts-jest@v26.4.1...v26.4.4)

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* refactor: migrate mobileValidator to ts

* refactor: update references

* chore: correct param name

* refactor: improve clarity of prefixValidator
Bumps [angular-messages](https://github.com/angular/angular.js) from 1.8.1 to 1.8.2.
- [Release notes](https://github.com/angular/angular.js/releases)
- [Changelog](https://github.com/angular/angular.js/blob/master/CHANGELOG.md)
- [Commits](angular/angular.js@v1.8.1...v1.8.2)

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [express-rate-limit](https://github.com/nfriedly/express-rate-limit) from 5.1.3 to 5.2.3.
- [Release notes](https://github.com/nfriedly/express-rate-limit/releases)
- [Commits](express-rate-limit/express-rate-limit@v5.1.3...v5.2.3)

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* ref: pass length validator function to chain

* ref: use flow instead of pipe

* ref: cut indirection in homeno

* ref: cut indirection in mobileno

* ref: cut indirection in nric

* ref: cut indirection in radiobutton

* ref: cut indirection in rating

* ref: improve variable name for textfield
* feat(FeedbackModel): add static method getFeedbackCursorByFormId

* feat(FeedbackSvc): add getFormFeedbackStream fn

* feat(AdminFormCtl): add handleStreamFormFeedback fn

* feat(utils): add exhaustive switch case typeguard

* ref(AdminFormsRoutes): use new handleStreamFormFeedback handler

* test(FormFeedbackModel): add tests for model schema and statics

* feat(AuthService): add getFormAfterPermissionChecks helper function

* test(AuthService): add test cases for getFormAfterPermissionChecks

* ref(AdminFormCtl): use getFormAfterPermissionChecks fn in controllers

* test(AdminFormCtl): add tests for handleStreamFormFeedback

Note that I have no clue how to test express streams, and my Google-fu failed me this time. Thus, the success case test is just testing that the services return correctly and not whether the stream passes :(

* feat: remove unused code and add jsdoc for handler

* test(AuthSvc): replace assertSpy with inlined mock
Bumps [eslint](https://github.com/eslint/eslint) from 7.13.0 to 7.14.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
- [Commits](eslint/eslint@v7.13.0...v7.14.0)

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [opossum](https://github.com/nodeshift/opossum) from 5.0.1 to 5.0.2.
- [Release notes](https://github.com/nodeshift/opossum/releases)
- [Changelog](https://github.com/nodeshift/opossum/blob/master/CHANGELOG.md)
- [Commits](nodeshift/opossum@v5.0.1...v5.0.2)

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* chore: update travis to have multiple build stages

* chore: use correct paths

* chore: remove create

* fix: missing script tag

* chore: correct order of stages

* chore: experiment with only building node_modules once

* chore: add default language without install step

* chore: use node_js 12 in all Travis stages

* chore: run lint-ci concurrently

* chore: copy all in coverage workspace

* chore: run coveralls after_success

* chore: use node testEnvironment when running Jest tests

Allows for speed up of Jest tests
See: https://itnext.io/how-to-make-your-sluggish-jest-v23-tests-go-faster-1d4f3388bcdd

* chore: increase number of parallel workers in Jest to 4

* chore: remove unnecessary coverage reporters in Jest
Bumps [ts-mock-imports](https://github.com/EmandM/ts-mock-imports) from 1.3.0 to 1.3.1.
- [Release notes](https://github.com/EmandM/ts-mock-imports/releases)
- [Commits](EmandM/ts-mock-imports@v1.3.0...v1.3.1)

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [celebrate](https://github.com/arb/celebrate) from 13.0.3 to 13.0.4.
- [Release notes](https://github.com/arb/celebrate/releases)
- [Commits](arb/celebrate@v13.0.3...v13.0.4)

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [mongoose](https://github.com/Automattic/mongoose) from 5.10.15 to 5.10.18.
- [Release notes](https://github.com/Automattic/mongoose/releases)
- [Changelog](https://github.com/Automattic/mongoose/blob/master/History.md)
- [Commits](Automattic/mongoose@5.10.15...5.10.18)

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…736)

* fix: add check for responses on hidden fields

* fix: correct isVisible values for tests

* chore: update status code on ValidateFieldError

* fix: remove invalid visibility tests from server controller spec because hidden field answers should not even be in the response

* chore: add tests for hidden fields in field validator specs

* refactor: type FieldResponse as union of Response interfaces

* refactor: use else if

* chore: tighten type guards for checkbox and table responses

* fix: check for table response on hidden field

* refactor: TableRow subtype

* fix: concatenate flattened array for table response before evaluating length

* refactor: beforeAll and afterAll for jasmine clock

* chore: add check that all arrays have same length

* refactor: type ITableRow is string array

* refactor: check if array contains any value by traversing each element instead of using string concatenation

* chore: check that answerArray[0] exists and is a tableRow
* chore: change copy

* style: standardise top and bottom padding

* chore: remove period
@karrui
Copy link
Contributor Author

karrui commented Dec 1, 2020

@mantariksh

Tests

Tips on Share Tab, .oa file removal

  • On share tab, tips show up
  • On share tab, links work
  • Attempt to upload <filename>.oa files. Should prevent submission.

@karrui
Copy link
Contributor Author

karrui commented Dec 1, 2020

@mantariksh

Tests

TypeScript endpoint migrations

  • Can retrieve feedback successfully (if feedback exists)
  • Go to a form without feedback. Request should still succeed with 200 but empty page shown.
  • Can download feedback successfully
  • In storage mode, can view storage mode responses page successfully
  • Can search for valid storage mode responses successfully
  • Can search for invalid storage mode, just that no results are returned
  • In empty responses, empty info is shown appropriately

@karrui
Copy link
Contributor Author

karrui commented Dec 1, 2020

@mantariksh

Tests

Validator migrations

  • Create two mobile phone number fields. Hide one of them behind logic.
  • Check that validation on both visible and hidden phone number fields work when submitting programatically
    • Invalid phone number format is rejected
    • Valid phone number format is accepted
    • When international number are allowed, international phone number is accepted
    • When international number is not allowed, international phone number is rejected
  • Create two radio button fields. Hide one of them behind logic.
  • Check that validation on both visible and hidden radio button fields work, when submitting programatically
    • Answer is accepted if it is one of the options or "other" if enabled
    • Answer is rejected otherwise
  • Create two rating fields. Hide one of them behind logic.
  • Check that validation on both visible and hidden rating fields work by submitting programatically
    • Rating is accepted if it is an integer between 1 and "steps", rejected otherwise
    • Rating must not have leading zero
  • Create a form with Yes/No field, and a Number Field hidden behind it. Attempt to submit a response programatically with the number field still hidden. Submission should fail.
  • Now unhide the Number Field. Attempt to submit a response on the number field normally. Submission should pass.
  • Create email mode form with all field types (including Yes/No) hidden behind a Yes/No field. Submit while keeping the fields hidden. Submission should pass.

@karrui
Copy link
Contributor Author

karrui commented Dec 1, 2020

Tests

@karrui

General intranet run-through

  • Create email mode form with all fields. Activate and submit form. Check that you can receive responses in your GSIB inbox.
  • Collaborators can be added in email mode.
  • Create storage mode form with all fields. Activate and submit form.
  • Response CSV can be downloaded for storage mode.
  • Responses can be viewed in Data tab in storage mode.
  • Attachments can be downloaded from Data tab in storage mode.
  • Submission IDs can be filtered in storage mode.
  • Collaborators can be added and their collaborating rights edited in storage mode.
  • Create form with MyInfo fields. Submit successfully

@karrui
Copy link
Contributor Author

karrui commented Dec 1, 2020

Tests

@karrui

Specific IE11 run-through

  • Share tips for Go/Postman renders correctly
  • Can retrieve feedback successfully (if feedback exists)
  • Go to a form without feedback. Request should still succeed with 200 but empty page shown.
  • Can download feedback successfully
  • In storage mode, can view storage mode responses page successfully
  • Can search for valid storage mode responses successfully
  • Can search for invalid storage mode, just that no results are returned
  • In empty responses, empty info is shown appropriately

@mantariksh
Copy link
Contributor

mantariksh commented Dec 1, 2020

@mantariksh

Tests

Logic edge cases

  • Hide a table field using logic and check that the form can be submitted
  • Hide a table field using logic, then unhide it and hide it again, and check that the form can be submitted
  • Hide a table field using logic, then unhide it and fill it in, and check that the form can be submitted
  • Hide a checkbox field using logic and check that the form can be submitted
  • Hide a checkbox field using logic, then unhide it and hide it again, and check that the form can be submitted
  • Hide a checkbox field using logic, then unhide it and fill it in, and check that the form can be submitted
  • Hide an attachment field using logic and check that the form can be submitted
  • Hide an attachment field using logic, then unhide it and hide it again, and check that the form can be submitted
  • Hide an attachment field using logic, then unhide it and fill it in, and check that the form can be submitted

@karrui karrui merged commit 5eaa80f into release Dec 1, 2020
@liangyuanruo liangyuanruo deleted the release-v4.48.0 branch January 14, 2021 06:15
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.

3 participants