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

Godirectory #813

Merged
merged 14 commits into from
Nov 3, 2020
Merged

Godirectory #813

merged 14 commits into from
Nov 3, 2020

Conversation

Oxiang
Copy link
Contributor

@Oxiang Oxiang commented Oct 28, 2020

Problem

GoDirectory allows link owners to search for the ownership of other gogovsg shortlinks

Closes #672
Closes #816
Closes #815
Closes #828

Solution

New endpoint (/directory) to search in the directory page

new/affected folders

  • server/controllers/directorycontroller
  • server/services/directorysearchservice
  • server/api/directory
  • server/models/url
  • server/repositories/urlrepository

New directory search dashboard

new/affected folders

  • client/components/directorypage
  • client/components/rootpage
  • client/components/widget/godirectoryinput
  • client/action/directory
  • client/constants/directory
  • client/locale/en/translation
  • client/reducers
  • client/util

Change header for directory page and user page

new/affected folders

  • client/component/baselayout/baselayoutheader

Ensure directory page will redirect back to itself

new/affected folders

  • client/components/loginpage
  • client/components/privateroute

Ensure pagination row and sort panel will not intersect

new/affected folders

  • client/components/widgets/paginationactioncomponent

Other improvements

  • replace the big go logo on user page with the mini go logo (mobile version)
  • new svg logo
  • GA and sentry logging for entering directory page and directory searches
  • redirection to directory page in error message on link creation modal

Screenshots

AFTER:
GoDirectory desktop default
ss_desktop_default

GoDirectory desktop keyword search
ss_desktop_keyword

GoDirectory desktop email search
ss_dekstop_email

GoDirectory desktop sort panel and filter panel
ss_desktop_sort_n_filter

GoDirectory mobile default
ss_mobile_default

GoDirectory mobile filter panel
ss_mobile_filterpanel

GoDirectory mobile sort panel
ss_mobile_sortpanel

GoDirectory mobile result panel
ss_mobile_search

User page redirection in error message on link creation url
Screenshot 2020-10-29 at 2 29 42 PM

New announcement modal
Screenshot 2020-11-02 at 2 43 40 PM

oxiang and others added 6 commits October 27, 2020 09:39
- add GET endpoint for /api/directory/search
- requires query, order, limit, offset and isEmail
- decision to search by email or text is done in UrlRepository
- to be done: use mappers
- to be done: change hardcoded sql variables and sql query checkers
- to be done: include user guard for route
- to be done: isolate filter checkers into helper functions
- add directory ui
- add directory redirection
- add actions and reducers for directory
- remove userid that was previously added to urltypes
- refactor endpoint
- include individual email in search results
- add mini go logo for mobile version
- ensure directory to redirect back to itself on refresh
- stop pagination row and sort panel from intersecting
- fix svg resizing
- refactor domain validation
- expand filter button to cover square area
- replace go logo with mini version for mobile mode
- clip shorturl in mobile panel for directory
- change the jsdoc for rawdirectoryinput
Copy link
Contributor

@LoneRifle LoneRifle left a comment

Choose a reason for hiding this comment

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

Final thoughts:

  • Too much to review in one sitting here. Consider splitting your PRs in future; one for backend and one for frontend
  • Could we have some tests for the controller and services please?

src/server/controllers/DirectoryController.ts Outdated Show resolved Hide resolved
src/server/repositories/UrlRepository.ts Outdated Show resolved Hide resolved
src/server/config.ts Outdated Show resolved Hide resolved
src/server/repositories/UrlRepository.ts Outdated Show resolved Hide resolved
- refactor code for redirection to directory page from login page
- remove the new email validation and use the old validation
- replace lengthy arguments with directoryquerycondition
- make isfile condition explicit
- refactor rawdirectorysearch
- add noopener and noreferrer to window open and anchor tag
- remove semicolon for both directory and search headers
- add test for directorycontroller
- add test for directorysearchservice
- add test for urlrepository
- track ga event and sentry event for directory search for both success and error case
- track ga event and pageview when entering into directory page
- provide redirection to directory page in error message on link creation modal
- add new reset result state and action in redux
- reset to initial result state when toggle between keyword and email in directory
- add new svg to announcement modal
- add line break functionality to announcement message
@Oxiang Oxiang requested a review from yong-jie November 2, 2020 07:03
@Oxiang Oxiang requested a review from yong-jie November 3, 2020 07:39
Copy link
Member

@yong-jie yong-jie left a comment

Choose a reason for hiding this comment

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

lgtm. To address linting issues in separate PR outside of the upcoming release

@Oxiang Oxiang merged commit ff6d42c into develop Nov 3, 2020
@Oxiang Oxiang deleted the godirectory branch November 3, 2020 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants