InReach icon indicating copy to clipboard operation
InReach copied to clipboard

app(IN-941): Search page alerts

Open kuck1 opened this issue 11 months ago • 13 comments

Pull Request type

Please check the type of change your PR introduces:

  • [ ] Bugfix
  • [x] 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
  • [x] No

Other information

https://github.com/weareinreach/InReach/assets/10719286/7041466b-b08b-4f0d-bbab-140bb91ab2da

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 avatar Mar 22 '24 20:03 kuck1

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

Name Status Preview Comments Updated (UTC)
inreach-app ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 27, 2024 3:21pm

vercel[bot] avatar Mar 22 '24 20:03 vercel[bot]

🤖 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 0ef1740. This comment will update as new commits are pushed.

alwaysmeticulous[bot] avatar Mar 22 '24 20:03 alwaysmeticulous[bot]

📦 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! 🙌

github-actions[bot] avatar Mar 22 '24 20:03 github-actions[bot]

#739 Bundle Size — 3.58MiB (+0.06%).

0ef1740(current) vs 3610f56 dev#724(baseline)

[!WARNING] Bundle contains 8 duplicate packages – View duplicate packages

Bundle metrics  Change 4 changes Regression 1 regression
                 Current
#739
     Baseline
#724
Regression  Initial JS 3.19MiB(+0.06%) 3.19MiB
No change  Initial CSS 9.54KiB 9.54KiB
Change  Cache Invalidation 44.19% 65.28%
No change  Chunks 68 68
No change  Assets 81 81
Change  Modules 2036(+0.05%) 2035
No change  Duplicate Modules 257 257
Change  Duplicate Code 7.08%(-0.14%) 7.09%
No change  Packages 219 219
No change  Duplicate Packages 8 8
Bundle size by type  Change 1 change Regression 1 regression
                 Current
#739
     Baseline
#724
Regression  JS 3.46MiB (+0.06%) 3.46MiB
No change  Fonts 94.54KiB 94.54KiB
No change  Other 9.57KiB 9.57KiB
No change  CSS 9.54KiB 9.54KiB
No change  IMG 8.57KiB 8.57KiB

Bundle analysis reportBranch search-page-alertsProject dashboard

relativeci[bot] avatar Apr 11 '24 21:04 relativeci[bot]

Walkthrough

The recent updates introduce new alert messages regarding anti-trans legislative risks in localizable JSON files, alongside major changes to alert banner components, location-based alert functionalities, and API schema adjustments. The system now supports location-based alerts triggered by latitude and longitude inputs, enhancing the alert framework. Key refactors also improve state management within the search interface and align UI components with the updated alert mechanisms, while database schema updates include new alert levels and indexing optimizations.

Changes

File Path Change Summary
apps/app/public/locales/en/common.json Added new alert messages for anti-trans legislation risks and removed a specific alert message from the search page.
apps/app/src/pages/search/[...params]/index.tsx Updated with new alert banner logic, state management, and layout changes related to country and state alerts.
package.json Added specific versions for react and react-dom in the peerDependencyRules section.
packages/api/router/component/index.ts Added LocationBasedAlertBanner: publicProcedure with input and query method.
packages/api/router/component/query.LocationBasedAlertBanner.handler.ts Added LocationBasedAlertBanner function to retrieve location-based alert banners based on latitude and longitude.
packages/api/router/component/query.LocationBasedAlertBanner.schema.ts Introduced a schema for location-based alert banner with latitude and longitude properties.
packages/api/router/component/schemas.ts Exported query.LocationBasedAlertBanner.schema.
packages/db/lib/generateFreeText.ts Refactored generateFreeText to accept a single args object and handle a new case for locationAlert type.
packages/db/lib/idGen.ts Added locationAlert: 'alrt' to the idPrefix constant object.
packages/db/prisma/migrations/20240515003535_/migration.sql Updated LocationAlertLevel enum values.
packages/db/prisma/schema.prisma Added LocationAlert model, updated relationships, and enhanced indexing.
packages/ui/components/core/LocationBasedAlertBanner/index.stories.tsx Introduced storybook stories for LocationBasedAlertBanner component with variations for statewide, county-level, and nationwide.
packages/ui/components/core/SearchBox.tsx Replaced resetInitialValue prop with setSearchValue prop and added call to setSearchValue within an useEffect block.
packages/ui/mockData/component.ts Added LocationBasedAlertBanner property to component object with mock data handling based on lat and lon.
packages/ui/mockData/json/component.LocationBasedAlertBanner.json Added mock data for location-based alert banners with different severity levels.
packages/ui/modals/ServiceFilter/index.tsx Added current?: string[] to the ServiceFilterProps interface.
packages/ui/theme/common.tsx Added new color definitions for lightPink and lightGreen.
InReach.code-workspace Added additional paths for i18n locales in the i18n-ally settings.

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

coderabbitai[bot] avatar Apr 12 '24 14:04 coderabbitai[bot]

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

kodiakhq[bot] avatar Apr 15 '24 20:04 kodiakhq[bot]

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

kodiakhq[bot] avatar Apr 20 '24 01:04 kodiakhq[bot]

No dependency changes detected. Learn more about Socket for GitHub ↗︎

👍 No dependency changes detected in pull request

socket-security[bot] avatar Apr 22 '24 14:04 socket-security[bot]

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

kodiakhq[bot] avatar Apr 22 '24 21:04 kodiakhq[bot]

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

kodiakhq[bot] avatar Apr 30 '24 18:04 kodiakhq[bot]

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

kodiakhq[bot] avatar May 06 '24 16:05 kodiakhq[bot]

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

kodiakhq[bot] avatar Jun 10 '24 20:06 kodiakhq[bot]

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

kodiakhq[bot] avatar Jun 25 '24 17:06 kodiakhq[bot]

@coderabbitai resolve

JoeKarow avatar Jun 27 '24 16:06 JoeKarow

Actions performed

Comments resolved.

coderabbitai[bot] avatar Jun 27 '24 16:06 coderabbitai[bot]