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

app(IN-941): Search page alerts #1182

Draft
wants to merge 108 commits into
base: dev
Choose a base branch
from
Draft

app(IN-941): Search page alerts #1182

wants to merge 108 commits into from

Conversation

kuck1
Copy link
Contributor

@kuck1 kuck1 commented Mar 22, 2024

Pull Request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no API changes)
  • Build-related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

Issue Number: IN-941

What is the new behavior?

  • Banner at the top of the search for the US
  • Dynamic banner above results different per state

Does this introduce a breaking change?

  • Yes
  • No

Other information

Screen.Recording.2024-03-22.at.1.45.15.PM.mov

Summary by CodeRabbit

  • New Features

    • Introduced location-based alert banners with varying risk levels for anti-trans legislation across different states.
    • Enhanced search functionality to include state-specific alerts and travel advisories based on user's search terms.
    • Updated UI components to support new alert types and improved user interaction.
  • Enhancements

    • Added new color schemes (lightPink and lightGreen) to improve visual elements.
  • Bug Fixes

    • Refined state management in search components to ensure accurate alert displays.
  • Documentation

    • Updated storybook with scenarios for location-based alert banners, showcasing usage across different alert levels.

@kuck1 kuck1 requested a review from JoeKarow as a code owner March 22, 2024 20:52
Copy link

vercel bot commented Mar 22, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
inreach-app ⬜️ Ignored (Inspect) Visit Preview May 20, 2024 1:52pm

@github-actions github-actions bot added automerge Enable Kodiak auto-merge kodiak: merge.method = 'squash' Kodiak will squash merge this PR. 📦 app 📦 ui labels Mar 22, 2024
@@ -43,6 +43,77 @@ const ServiceFilter = dynamic(() =>
import('@weareinreach/ui/modals/ServiceFilter').then((mod) => mod.ServiceFilter)
)

const stateRiskLevels = {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry this is a bit ugly, I could do 4 arrays and then build some logic if else statements, not sure.

@@ -63,6 +63,8 @@ const colors = {
coolGray: '#d9d9d9',
red: '#C05C4A',
pink: '#D4A1BA',
lightPink: '#F2E1E9',
lightGreen: '#E4F9EA',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I chose the light green based on this https://m2.material.io/design/color/the-color-system.html#tools-for-picking-colors

This was not in the design, so not sure if we want to use this instead of the lightPink for all states.

Copy link

alwaysmeticulous bot commented Mar 22, 2024

🤖 No test run has been triggered as your Meticulous project has been deactivated (since you haven't viewed any test results in a while). Click here to reactivate.

Last updated for commit 61aa216. This comment will update as new commits are pushed.

Copy link
Contributor

github-actions bot commented Mar 22, 2024

📦 Next.js Bundle Analysis for @weareinreach/app

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

</Text>
</Box>
)}

Copy link
Member

Choose a reason for hiding this comment

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

Can we extract the banner code out in to a separate component?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes good call, I'll work on that this week!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Would the banners go in the story book as components?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, you can create it in components/core in the ui package - there are plenty of *.stories.tsx files to use as a starting template.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved the banners to components although my folder structure may be a bit different, was having an issue with imports

Copy link
Member

Choose a reason for hiding this comment

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

I fixed part of it - you were trying to move the component in to a storybook file (*.stories.tsx shouldn't get imported in to any functional part of the app - those are for Storybook only). I moved the component to ui/components/core/LocationBasedAlertBanner/index.tsx and set up 3 different use examples. Inside the storybook file, in the RenderWrapper component I put in there (just for purposes of pulling mock API data), you'll see how the API call is done. The API can return more than one result, in the event that there are multiple alerts for an area or overlapping alerts

Copy link
Member

Choose a reason for hiding this comment

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

I didn't touch the implementation on this page though -- that still needs to be done

Copy link
Contributor

kodiakhq bot commented May 6, 2024

This PR currently has a merge conflict. Please resolve this and then re-add the automerge label.

Signed-off-by: Joe Karow <58997957+JoeKarow@users.noreply.github.com>
Copy link

socket-security bot commented May 7, 2024

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 4308735 and bf83dcb.
Files selected for processing (1)
  • packages/db/prisma/schema.prisma (4 hunks)
Additional comments not posted (5)
packages/db/prisma/schema.prisma (5)

781-781: Added LocationAlert relation to FreeText model.

Ensure that the LocationAlert model is properly defined elsewhere in the schema to support this relation.


1303-1303: Added LocationAlert relation to Country model.

Verify that the LocationAlert model is correctly implemented and that the relation is consistent with the application's requirements.


1356-1356: Added LocationAlert relation to GovDist model.

Confirm that the LocationAlert model is correctly set up and that this relation is necessary for the functionality of the application.


1408-1430: Introduced a new model LocationAlert with fields id, active, text, level, country, and govDist.

This model is crucial for the new feature of dynamic location-based alerts. Ensure that all fields are correctly used in the application logic and that the relations (country and govDist) are properly indexed for performance.


1426-1430: Defined new enum LocationAlertLevel with values INFO, WARN, and CRITICAL.

This enum is essential for categorizing the severity of location alerts. Ensure that the application logic correctly handles these levels.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between bf83dcb and 4a157dc.
Files selected for processing (1)
  • package.json (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • package.json

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 4a157dc and d1660ff.
Files selected for processing (1)
  • package.json (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • package.json

Copy link

sonarcloud bot commented May 20, 2024

Quality Gate Passed Quality Gate passed

Issues
15 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 api 📦 app automerge Enable Kodiak auto-merge 📦 db kodiak: merge.method = 'squash' Kodiak will squash merge this PR. new-feature New features or options. 📦 ui
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants