InReach
InReach copied to clipboard
app(IN-941): Search page alerts
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
andlightGreen
) to improve visual elements.
- Added new color schemes (
-
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.
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 |
🤖 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.
📦 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! 🙌
#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
4 changes
1 regression
Current #739 |
Baseline #724 |
|
---|---|---|
3.19MiB (+0.06% ) |
3.19MiB |
|
9.54KiB |
9.54KiB |
|
44.19% |
65.28% |
|
68 |
68 |
|
81 |
81 |
|
2036 (+0.05% ) |
2035 |
|
257 |
257 |
|
7.08% (-0.14% ) |
7.09% |
|
219 |
219 |
|
8 |
8 |
Bundle size by type
1 change
1 regression
Current #739 |
Baseline #724 |
|
---|---|---|
3.46MiB (+0.06% ) |
3.46MiB |
|
94.54KiB |
94.54KiB |
|
9.57KiB |
9.57KiB |
|
9.54KiB |
9.54KiB |
|
8.57KiB |
8.57KiB |
Bundle analysis report Branch search-page-alerts Project dashboard
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?
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.
This PR currently has a merge conflict. Please resolve this and then re-add the automerge
label.
This PR currently has a merge conflict. Please resolve this and then re-add the automerge
label.
No dependency changes detected. Learn more about Socket for GitHub ↗︎
👍 No dependency changes detected in pull request
This PR currently has a merge conflict. Please resolve this and then re-add the automerge
label.
This PR currently has a merge conflict. Please resolve this and then re-add the automerge
label.
This PR currently has a merge conflict. Please resolve this and then re-add the automerge
label.
This PR currently has a merge conflict. Please resolve this and then re-add the automerge
label.
This PR currently has a merge conflict. Please resolve this and then re-add the automerge
label.
Quality Gate passed
Issues
0 New issues
1 Accepted issue
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code
@coderabbitai resolve
Actions performed
Comments resolved.