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

fix: alert styling #1398

Merged
merged 4 commits into from
Aug 27, 2024
Merged

fix: alert styling #1398

merged 4 commits into from
Aug 27, 2024

Conversation

JoeKarow
Copy link
Collaborator

@JoeKarow JoeKarow commented Aug 27, 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: N/A

What is the new behavior?

Does this introduce a breaking change?

  • Yes
  • No

Other information

Summary by CodeRabbit

  • New Features

    • Introduced a migration job for creating election alerts, enhancing the system's responsiveness to civic events.
    • Updated the LocationBasedAlertBanner component for improved styling and layout.
  • Bug Fixes

    • Downgraded several Prisma-related dependencies to address compatibility issues and improve stability.
  • Documentation

    • Enhanced the migration capabilities documentation through the addition of new export statements for better access.

Copy link

vercel bot commented Aug 27, 2024

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 Aug 27, 2024 7:28pm

@github-actions github-actions bot added 📦 db 📦 app 📦 ui automerge Enable Kodiak auto-merge kodiak: merge.method = 'squash' Kodiak will squash merge this PR. labels Aug 27, 2024
Copy link
Contributor

coderabbitai bot commented Aug 27, 2024

Walkthrough

The changes involve downgrading several dependencies related to Prisma across multiple package.json files, specifically from version 5.19.0 to 5.18.0. Additionally, a new migration job for creating election alerts has been introduced, and modifications have been made to the LocationBasedAlertBanner component, focusing on its styling and structural layout.

Changes

File(s) Change Summary
apps/app/package.json, lambdas/cognito-user-migrate/package.json, packages/db/package.json Downgraded versions of Prisma dependencies from 5.19.0 to 5.18.0.
packages/db/prisma/data-migrations/2024-08-22_election-alert.ts Introduced a new migration job for creating election alerts in the database.
packages/db/prisma/data-migrations/index.ts Added export statement for the new election alert migration job.
packages/ui/components/core/LocationBasedAlertBanner/index.tsx Updated styling and structure of the LocationBasedAlertBanner component, enhancing layout and readability.

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 Configuration 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.

@JoeKarow JoeKarow added the bugfix Inconsistencies or issues which will cause a problem for users or implementors. label Aug 27, 2024
Copy link

socket-security bot commented Aug 27, 2024

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@prisma/[email protected] environment, filesystem, shell 0 8.41 MB prismabot
npm/@prisma/[email protected] filesystem 0 18.2 kB prismabot

🚮 Removed packages: npm/@prisma/[email protected]), npm/@prisma/[email protected])

View full report↗︎

@JoeKarow JoeKarow marked this pull request as ready for review August 27, 2024 19:10
Copy link

relativeci bot commented Aug 27, 2024

#1329 Bundle Size — 3.49MiB (~+0.01%).

f4328c7(current) vs e328a5e dev#1324(baseline)

Warning

Bundle contains 5 duplicate packages – View duplicate packages

Bundle metrics  Change 2 changes Regression 1 regression
                 Current
#1329
     Baseline
#1324
Regression  Initial JS 3.06MiB(+0.01%) 3.06MiB
No change  Initial CSS 9.54KiB 9.54KiB
Change  Cache Invalidation 46.57% 54.67%
No change  Chunks 67 67
No change  Assets 80 80
No change  Modules 2013 2013
No change  Duplicate Modules 361 361
No change  Duplicate Code 10.03% 10.03%
No change  Packages 159 159
No change  Duplicate Packages 5 5
Bundle size by type  Change 1 change Regression 1 regression
                 Current
#1329
     Baseline
#1324
Regression  JS 3.38MiB (~+0.01%) 3.38MiB
No change  Fonts 94.54KiB 94.54KiB
No change  CSS 9.54KiB 9.54KiB
No change  Other 8.7KiB 8.7KiB
No change  IMG 8.57KiB 8.57KiB

Bundle analysis reportBranch JoeKarow/alert-formattingProject dashboard


Generated by RelativeCIDocumentationReport issue

Copy link
Contributor

github-actions bot commented Aug 27, 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! 🙌

Copy link

alwaysmeticulous bot commented Aug 27, 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 f4328c7. This comment will update as new commits are pushed.

Copy link
Contributor

@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: 2

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between e328a5e and 4aabe07.

Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
Files selected for processing (6)
  • apps/app/package.json (2 hunks)
  • lambdas/cognito-user-migrate/package.json (2 hunks)
  • packages/db/package.json (2 hunks)
  • packages/db/prisma/data-migrations/2024-08-22_election-alert.ts (1 hunks)
  • packages/db/prisma/data-migrations/index.ts (1 hunks)
  • packages/ui/components/core/LocationBasedAlertBanner/index.tsx (4 hunks)
Files skipped from review due to trivial changes (3)
  • apps/app/package.json
  • lambdas/cognito-user-migrate/package.json
  • packages/db/prisma/data-migrations/index.ts
Additional context used
Biome
packages/db/prisma/data-migrations/2024-08-22_election-alert.ts

[error] 22-22: The assignment should not be in an expression.

The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.

(lint/suspicious/noAssignInExpressions)

Additional comments not posted (8)
packages/db/prisma/data-migrations/2024-08-22_election-alert.ts (3)

1-4: LGTM!

The imports are appropriate and necessary for the functionality of the migration job.

The code changes are approved.


5-12: LGTM!

The job metadata definition is clear and follows the expected structure.

The code changes are approved.


13-18: LGTM!

The job export is well-structured and follows the expected format.

The code changes are approved.

packages/ui/components/core/LocationBasedAlertBanner/index.tsx (3)

1-19: LGTM!

The imports and styles are appropriate and necessary for the functionality of the component. The styles are well-structured and follow the expected format.

The code changes are approved.


Line range hint 20-52: LGTM!

The styles for primary and secondary are well-structured and follow the expected format. The use of theme variables and responsive design is appropriate.

The code changes are approved.


Line range hint 53-107: LGTM!

The LocationBasedAlertBanner component is well-structured and follows the expected format. The use of early return statements and the Stack component improves readability and organization.

The code changes are approved.

packages/db/package.json (2)

Line range hint 1-48: LGTM!

The remaining dependencies and scripts are appropriate and necessary for the functionality of the package.

The code changes are approved.

Also applies to: 51-106, 108-151


49-50: Verify the reason for the downgrade and ensure no regressions.

The dependencies for @prisma/client, @prisma/instrumentation, and prisma have been downgraded from version 5.19.0 to 5.18.0. Ensure that the downgrade aligns with the intended functionality and does not introduce regressions.

Run the following script to verify the reason for the downgrade and ensure no regressions are introduced:

Also applies to: 107-107

Copy link

Copy link
Contributor

@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 4aabe07 and f4328c7.

Files selected for processing (3)
  • packages/api/router/component/query.LocationBasedAlertBanner.handler.ts (1 hunks)
  • packages/db/prisma/migrations/20240827192047_location_alert_order/migration.sql (1 hunks)
  • packages/db/prisma/schema.prisma (1 hunks)
Additional comments not posted (3)
packages/db/prisma/migrations/20240827192047_location_alert_order/migration.sql (1)

1-3: LGTM!

The SQL statement correctly adds a new column order to the LocationAlert table with a default value of 0.

The code changes are approved.

packages/api/router/component/query.LocationBasedAlertBanner.handler.ts (1)

27-27: LGTM! But verify the existence of the order column in the database schema.

The function is correctly implemented and the new orderBy property enhances the functionality. Ensure that the order column exists in the database schema.

The code changes are approved.

Run the following script to verify the existence of the order column in the database schema:

Verification successful

The order column exists in the database schema.

The search confirmed that the order column is defined as an Int with a default value of 0 in the schema.prisma file.

  • Location: packages/db/prisma/schema.prisma
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the existence of the `order` column in the `LocationAlert` table.

# Test: Search for the `order` column in the Prisma schema. Expect: The `order` column should be present.
rg --type prisma 'order\s+Int\s+@default\(0\)'

Length of output: 79


Script:

#!/bin/bash
# Description: Search for the `order` column definition in the entire codebase.

# Test: Search for the `order` column as an `Int` with a default value of `0`.
rg 'order\s+Int\s+@default\(0\)'

Length of output: 107

packages/db/prisma/schema.prisma (1)

1425-1425: LGTM! But verify the usage of the order field in the codebase.

The new field order is correctly added to the model. Ensure that the field is used consistently in the codebase.

The code changes are approved.

Run the following script to verify the usage of the order field in the codebase:

@kodiakhq kodiakhq bot merged commit 3f4add2 into dev Aug 27, 2024
27 checks passed
@kodiakhq kodiakhq bot deleted the JoeKarow/alert-formatting branch August 27, 2024 19:29
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 bugfix Inconsistencies or issues which will cause a problem for users or implementors. 📦 db kodiak: merge.method = 'squash' Kodiak will squash merge this PR. 📦 ui
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants