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: implement announcement modal #691

Merged
merged 4 commits into from
Oct 7, 2020
Merged

feat: implement announcement modal #691

merged 4 commits into from
Oct 7, 2020

Conversation

LoneRifle
Copy link
Contributor

@LoneRifle LoneRifle commented Oct 5, 2020

Problem

Closes #397

Solution

  • Inject the user message into UserController rather than getting it via
    the config module. This simplifies the corresponding test and will
    establish a consistent pattern when testing a future dependency, ie
    the user modal message
    • Declare userMessage as a dependency id
    • Inject userMessage via inversify into UserController as ctor param
    • Simplify the UserController test suite, dropping need for jest.mock
  • Allow new env vars - to be specified at runtime,
    parsed into a simple JSON payload to be at /api/user/announcement
  • Provide scaffolding for user announcements in Redux
  • Inject ANNOUNCEMENT_ env vars in docker-compose
  • Move fullScreenDialog helper to UserPage and reference it in
    AnnouncementModal
  • Fully flesh out AnnouncementModal, using localStorage to remember
    when a modal is last seen

Screenshots

image

image

image

Deploy Notes

New environment variables:

  • USER_ANNOUNCEMENT : a ;-separated string that describes in sequence message, title, subtitle, url and path to image

Inject the user message into UserController rather than getting it via
the config module. This simplifies the corresponding test and will
establish a consistent pattern when testing a future dependency, ie
the user modal message

- Declare userMessage as a dependency id
- Inject userMessage via inversify into UserController as ctor param
- Simplify the UserController test suite, dropping need for jest.mock
Allow a new env var - `USER_ANNOUNCEMENT` - to be specified at runtime,
parsed into a simple JSON payload to be at `/api/user/announcement`

- Declare `USER_ANNOUNCEMENT` at config, to be parsed into `userModal`
- Inject `config.userAnnouncement` into UserController via inversify
- Expose this via `/api/user/announcement`
- Provide coverage tests that verify parsing and serving
@LoneRifle LoneRifle requested a review from liangyuanruo October 5, 2020 09:47
@LoneRifle LoneRifle force-pushed the feat/modal branch 2 times, most recently from ca3ed16 to 13f49cd Compare October 7, 2020 00:53
If there is a new response at `/api/user/announcement`, flash a modal
at the user

- Provide scaffolding for user announcements in Redux
- Inject `USER_ANNOUNCEMENT` env var in docker-compose
- Move `fullScreenDialog` helper to UserPage and reference it in
  AnnouncementModal
- Fully flesh out AnnouncementModal, using localStorage to remember
  when a modal is last seen
- use multiple env vars, one for each field, rather than a single one
- adjust button colour
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.

code lgtm

@yong-jie yong-jie merged commit 994324a into develop Oct 7, 2020
@yong-jie yong-jie deleted the feat/modal branch October 7, 2020 07:00
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.

Announcement modal after user login
2 participants