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(form-v2): show emergency contact popup in workspace page #4125

Merged
merged 3 commits into from
Jul 13, 2022

Conversation

wanlingt
Copy link
Contributor

@wanlingt wanlingt commented Jul 8, 2022

Problem

Emergency contact modal does not pop up on the workspace page

Working towards #4110

Somewhat blocked by #4006

Solution

Emergency contact modal pops up on the workspace page if the user does not have an existing emergency contact. This appears after the rollout announcement modal.

Breaking Changes

  • No - this PR is backwards compatible

Features:

  • Local storage is used to track if a user has already seen the emergency contact modal.
    TODO: Clear emergencyContactKey in local storage upon logout, when the logout button is implemented (related to Issue [React] Admin Header component #4006 )

Before & After Screenshots

AFTER:
emergencyContactModal (1)

Tests

  • Log in. If rollout announcement and emergency contact keys exist in local storage, remove them. On the workspace page, the rollout announcement modal should appear first, then the emergency contact modal. Refresh the workspace page. Both modals should not pop up.

@wanlingt wanlingt marked this pull request as ready for review July 8, 2022 05:38
Copy link
Contributor

@karrui karrui left a comment

Choose a reason for hiding this comment

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

lgtm with some suggestions

Comment on lines +185 to +188
<EmergencyContactModal
onClose={() => setHasSeenEmergencyContact(true)}
isOpen={isEmergencyContactModalOpen}
/>
Copy link
Contributor

Choose a reason for hiding this comment

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

probably not the correct place to put this, since the modal will probably be instantiated in the admin header (when it is complete) (and it is also now when i realize that is why this feature is not in the app yet)

Add a TODO i guess, to move the auto-instantiation of the modal into the admin header when that is done?

Copy link
Contributor Author

@wanlingt wanlingt Jul 13, 2022

Choose a reason for hiding this comment

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

gotcha. and this is because we want it to appear whenever an admin logs in, not just the workspace page right? will create this as a separate issue

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Issue #4153

frontend/src/features/workspace/WorkspacePage.tsx Outdated Show resolved Hide resolved
@wanlingt wanlingt merged commit b438a3f into form-v2/develop Jul 13, 2022
@wanlingt wanlingt deleted the form-v2/emergency-contact-popup branch July 13, 2022 02:34
timotheeg pushed a commit that referenced this pull request Jul 17, 2022
* feat: add modal to workspacepage

* test: add ViewedEmergencyContactDecorator to prevent emergency contact modal from showing in chromatic

* fix: return null if user does not exist
@justynoh justynoh mentioned this pull request Oct 5, 2022
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.

2 participants