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

Release 1.61.0 - Url history fixes, version upgrades #1813

Merged
merged 9 commits into from
Apr 13, 2022
Merged

Conversation

yong-jie
Copy link
Member

@yong-jie yong-jie commented Apr 13, 2022

Tests

Home page

  • The landing page graphic should animate example short urls correctly
  • The landing page should have no link to search

Login page

  • OTP email should contain requestor's IP address
  • Resend OTP should send a new OTP to user, and invalidate previous OTP
  • [ ] It should respond with invalid email when email does not end with .gov.sg
  • [ ] It should not allow submission when email is invalid
  • [ ] Invalid OTP should not log the user in
  • [ ] Valid OTP should log the user in
  • [ ] After trying to enter wrong OTP 3 times, it should respond with OTP not found/expired (a new OTP must be requested)
  • [ ] Visiting /user should redirect to login page when not logged in

User page

  • IE11 banner appears on top when accessed via IE11 browser
  • User message banner appears on top when USER_MESSAGE env var is set
  • Announcement modal appears when ANNOUNCEMENT_* env var is set
  • Ellipses are shown for very long links
  • Banner follows scroll

Sessions

  • [ ] Shows the homepage if user does not have an existing session
  • [ ] Redirects to /user if user has an existing session (ie logged in previously on the same browser)

URL creation

  • It should prevent uploading when a malicious file is submitted
  • [ ] The create url modal opens when the "Create link" button is clicked.
  • [ ] It should populate the short url input box on the create url modal with a random string when the refresh icon on the short url input box is pressed
  • [ ] It should show the new short url on the users’ links table when a new link is created
  • [ ] The new short url should be highlighted on the users' links table when a new link is created
  • [ ] It should prevent creation of short urls pointing to long urls hosted on blacklisted domains
  • [ ] It should show an success snackbar when a new url has been added
  • [ ] It should show an error below the file input when a file larger than 10MB is chosen
  • [ ] It should disable the submit button when a file larger than 10MB is chosen
  • [ ] It should show the short url on users' link table when a new file link is created
  • [ ] The new short url should be highlighted on the users' links table when a new file link is created
  • [ ] It should show an success snackbar when a new file link has been added
  • [ ] On link creation success, the create url modal remains open and displays isSearchable toggle and add-description fields
  • [ ] When file link is created, the modal remains open and display isSearchable toggle and add-description fields

URL Searching and Download

  • Clicking on the download button downloads all link currently shown in the links table as a .csv file.
  • [ ] Searching on the user page search bar shows links that are relevant to the search term.
  • [ ] Toggling the link to not be searchable would hide it from search
  • [ ] Toggling the link to be searchable would allow it to be searchable

Transition page

You may need to clear your cookies before testing this segment.

  • [ ] Accessing a short link with a trailing slash should not result in a broken transition page.
  • [ ] Accessing a short link for the first time shows the transition page.
  • [ ] After 6 seconds, user is redirected from the transition page to the correct destination long url.
  • [ ] A skip button is displayed immediately.
  • [ ] Visiting the same short link again does not show the transition page.

Redirection

  • It should redirect to the long url when short url is active
  • It should redirect to a 404 page when short url is inactive

Drawer, Editing and Toaster logic

  • It should redirect to the amended file immediately when the file is replaced (any caching for that short url is cleared)
  • [ ] Drawer should open with the correct long url and state when a short url row is clicked
  • [ ] Drawer can be closed on clickaway or when the close button is clicked.
  • [ ] It should set short url active or inactive immediately when the toggle is switched (any caching for that short url is cleared)
  • [ ] It should redirect to the amended url immediately when the long url is changed (any caching for that short url is cleared)
  • [ ] It should show an error and not amend the file when a file of size >10mb is selected on replace file
  • [ ] It should show a success snackbar when long url is changed
  • [ ] It should show a success snackbar when link is transferred to another user.
  • [ ] Url is updated/saved when user enters a new url, then clicks "save"
  • [ ] Url is reverts to original when user enters a new url, then re-opens the drawer without clicking "save"
  • [ ] Error validation (red underline + helperText) appears when value in edit long url textfield is invalid
  • [ ] "Save" button is disabled (grey and unclickable) when value in edit long url textfield is invalid
  • [ ] Unsuccessful link transfers do not close the drawer.
  • [ ] Successful link transfers closes the drawer.
  • [ ] Toasters to disappear when user clicks on the X only
  • [ ] Toasters to disappear after 5sec
  • [ ] Toasters to not disappear on clickaway (i.e. to prevent premature closure when user clickaway to save url)
  • [ ] It should not allow foreign characters in the description field
  • [ ] It should allow saving of description/contact as long as one of them is changed
  • [ ] It should allow saving of a blank description or contact
  • [ ] It should not allow contact emails which are not valid *.gov.sg emails

QR

  • Downloaded PNG QR code should be of width 1000px and height >= 1000px
  • Downloaded SVG QR code should work
  • Scan the downloaded QR code in SVG to check that it points to the correct long url
  • Scan the downloaded QR code in PNG to check that it points to the correct long url

User page - Sort & Filter

  • Links should be sorted by their number of clicks in descending order when enabling sort by Most number of visits and clicking apply
  • [ ] Clicking on the button at the end of the search input should open the sort and filter panel
  • [ ] Links should be sorted by their created time in descending order when enabling sort by Date of creation and clicking apply
  • [ ] Inactive links should be filtered out by checking only Active and clicking apply
  • [ ] Active links should be filtered out by checking only Inactive and clicking apply
  • [ ] File links should be filtered out by checking only Link and clicking apply
  • [ ] Non-file links should be filtered out by checking only File and clicking apply
  • [ ] Panel should be closed when clicking outside of it
  • [ ] Panel should be closed and links sorted by created time with no filtering after clicking on reset. All links and files should be visible.
  • [ ] Panel should be closed when apply is clicked
  • [ ] It should reset the table to page 1 when apply is clicked

Logging from GA event

  • UrlHistory table is populated in database

Directory - filter & sort panel

  • It should show search results after the user types in a search query
  • It should change the url in the address bar after the user stops typing in the search input box
  • It should reset search result when toggle between keyword and email filter
  • It should show default search results by keyword, sort by recency, with all states, both url and file types
  • It should show search results by url when search by keyword
  • It should show search results by email when search by email
  • It should show search results in order of recency when recency sort order is chosen
  • It should show search results in order of popularity when popularity sort order is chosen
  • It should show search results by active when filter by active
  • It should show search results by inactive when filter by inactive
  • It should show search results by file when filter by file
  • It should show search results by url when filter by url
  • It should reset search result and reset filter when reset button is clicked

Directory - desktop view

  • It should redirect to the short url link when the row is clicked for active link
  • It should underline the user email when hovering on the email
  • It should copy the user's email when click on the email

Directory - mobile view

  • It should open the bottom mobile panel when row is clicked
  • It should redirect to the short url link when the redirect icon is clicked for active link in bottom mobile panel
  • It should copy the user email when user icon clicked in the bottom mobile panel

--

Deploy Notes

Notes regarding deployment of the contained body of work. These should note any
new dependencies, new scripts, etc.

Related fixes

Code changes

  • Fix migration functions to add description when migrating url
  • Update Sequelize models to add default empty string “” for description column in url_histories table

Update current databases

Health

  • Run migration to fix this in health-staging
    • ALTER TABLE url_histories ADD "description" text NOT NULL DEFAULT '';
    • Update migration function migrate-user-links
    • Update migration function migrate-shortUrl-to-user
  • Verify that this does not occur in health-prod since the model should be fixed

Edu

  • Run migration to fix this in edu-staging
    • ALTER TABLE url_histories ADD "description" text NOT NULL DEFAULT '';
    • Add migration function migrate-user-links
    • Add migration function migrate-shortUrl-to-user
  • Run migration to fix this in edu-prod
    • ALTER TABLE url_histories ADD "description" text NOT NULL DEFAULT '';
    • Add migration function migrate-user-links
    • Add migration function migrate-shortUrl-to-user

GoGov

  • Run migration to fix this in gogov-staging
    • ALTER TABLE url_histories ADD "description" text NOT NULL DEFAULT ''; (Not necessary in gogov-staging and gogov-prod as previous migrations have added a default)
    • Update migration function migrate-user-links
    • Update migration function migrate-shortUrl-to-user
  • Run migration to fix this in gogov-prod
    • ALTER TABLE url_histories ADD "description" text NOT NULL DEFAULT ''; (Not necessary in gogov-staging and gogov-prod as previous migrations have added a default)
    • Update migration function migrate-user-links
    • Update migration function migrate-shortUrl-to-user

yong-jie and others added 9 commits March 30, 2022 16:26
* fix: update migration functions to include description column

* fix: add default empty string on description column

* chore: add migration script for default description value

* chore: fix migration script for default description value
* chore: remove vat ci commands

* chore: clean up edu and gov cicd
Bumps [redux-thunk](https://github.com/reduxjs/redux-thunk) from 2.3.0 to 2.4.1.
- [Release notes](https://github.com/reduxjs/redux-thunk/releases)
- [Commits](reduxjs/redux-thunk@v2.3.0...v2.4.1)

---
updated-dependencies:
- dependency-name: redux-thunk
  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>
Copy link
Contributor

@gweiying gweiying left a comment

Choose a reason for hiding this comment

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

lgtm

@yong-jie yong-jie merged commit 885a3ff into release Apr 13, 2022
@yong-jie yong-jie deleted the release-1.61.0 branch April 19, 2022 03:11
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