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

132 Add pop up message to CPE about outdated data #131

Merged
merged 2 commits into from
Oct 15, 2024

Conversation

horatiorosa
Copy link
Contributor

@horatiorosa horatiorosa commented Aug 26, 2024

Description

New modal with advisory copy added to 3 CPE map pages

  • landing page
    Screenshot 2024-10-09 at 3 13 30 PM
  • capital project map page
    Screenshot 2024-10-09 at 3 16 40 PM
  • capital projects table data page
    Screenshot 2024-10-09 at 3 17 28 PM

Tickets

Closes #132

@horatiorosa horatiorosa self-assigned this Aug 26, 2024
@horatiorosa horatiorosa requested a review from a team as a code owner August 26, 2024 13:33
Copy link

netlify bot commented Aug 26, 2024

Deploy Preview for cp-platform ready!

Name Link
🔨 Latest commit 9be475a
🔍 Latest deploy log https://app.netlify.com/sites/cp-platform/deploys/67097501856c6400085d7d00
😎 Deploy Preview https://deploy-preview-131--cp-platform.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

 - created advisory modal with copy and inline styling
 - added the modal to three pages:
  - landing page
  - capital project map page
  - capital projects table data page
 - added functionality to dismiss/close the modal
@horatiorosa horatiorosa changed the title 130 added warning copy to CPE map 130 Add pop up message to CPE about outdated data Oct 9, 2024
@horatiorosa horatiorosa force-pushed the issue/130-add-warning-to-cpe-map branch from fbc7f1c to 63bd4d7 Compare October 9, 2024 19:11
@horatiorosa horatiorosa requested review from a team and removed request for a team October 9, 2024 19:19
@horatiorosa horatiorosa changed the title 130 Add pop up message to CPE about outdated data 132 Add pop up message to CPE about outdated data Oct 9, 2024
@TangoYankee
Copy link
Member

From the original ticket:

Users should be able to dismiss the message and continue to use the app as normal.

My interpretation of "normal" means that once users click "close" on the modal, then they can navigate to other pages without the modal returning. Under the current changes, navigating to another page reopens the modal.

@dhochbaum-dcp
Copy link
Contributor

From the original ticket:

Users should be able to dismiss the message and continue to use the app as normal.

My interpretation of "normal" means that once users click "close" on the modal, then they can navigate to other pages without the modal returning. Under the current changes, navigating to another page reopens the modal.

I agree. I also think there should be a "don't show this again" checkbox. You can check out how it was implemented in ZoLa: NYCPlanning/labs-zola#1197

@TangoYankee
Copy link
Member

We have a few options on how to approach this:

  1. If we want to make it go away semi-permanently, then we can copy the local storage approach from ZoLa (as suggested earlier). This will preserve the user's choice when they reload the application and also when they reopen their browser.

  2. If we want a softer dismissal, we can move the 'modal' state from the component to the store. This will make the modal go away as the user navigates the application. However, it will return when reloading the application or reopening their browser.

  3. A third option is to use a cookie. Though, that has other complications.

Regardless of the chosen approach, it would involve moving the state from the components to something more permanent.

@horatiorosa
Copy link
Contributor Author

The ticket also states

The message should appear when a user visits any of the three following pages:
https://capitalplanning.nyc.gov/capitalprojects
https://capitalplanning.nyc.gov/capitalprojects/table
https://capitalplanning.nyc.gov/map/capitalprojects

Dismissing and not showing the modal again isn't mentioned in the requirements. It may be unwanted behavior. What if someone navigates away from the root page to /capitalprojects. They see and dismiss the modal and proceed to either of the/capitalprojects/table or /map/capitalprojects pages. Would they associate the warning on the previous page with the current one? What if the user comes back 3 days later and doesn't remember the warning and relies on outdated data?

We would need more info as to the desired behavior before working expanding the scope of the ticket. Maybe @TylerMatteo can chime in or has more information.

If a dismiss and don't show the modal gain during the current session, perhaps a cookie lasting a few hours might be a good approach. Perhaps even the store approach but I would need help with that.

…ge but will re-render on the map and table pages by design. otheise, we would need to track via local storage or cookies
@horatiorosa
Copy link
Contributor Author

horatiorosa commented Oct 11, 2024

@TangoYankee @TangoYankee and @TylerMatteo
I added some logic for remembering the modal dismissal state on the LandingPage (the modal won't re-render navigating back to it from elsewhere) but by design, it will always render on the map and table pages unless we resort to more rigorous measures using localstorage or cookies.

@horatiorosa horatiorosa merged commit ae2875d into staging Oct 15, 2024
4 checks passed
@horatiorosa horatiorosa deleted the issue/130-add-warning-to-cpe-map branch October 15, 2024 15: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.

Add pop up message to CPE about outdated data
4 participants