-
-
Notifications
You must be signed in to change notification settings - Fork 4
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: email editing, data portal option display #1349
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
WalkthroughThe recent updates enhance data handling and user interactions across various components. Key modifications include improved query logic to include inactive entities, new state management for visibility toggling, and refined UI components for better user experience. These changes aim to increase robustness, usability, and maintainability while ensuring accurate data retrieval based on active statuses. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant UI
participant API
participant DB
User->>UI: Toggle "Show Inactive Attributes"
UI->>API: Fetch Attributes with filter
API->>DB: Retrieve attributes based on active states
DB-->>API: Return filtered attributes
API-->>UI: Send back attributes
UI-->>User: Display updated list of attributes
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? TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Additionally, you can add CodeRabbit Configuration File (
|
Quality Gate passedIssues Measures |
#1032 Bundle Size — 3.5MiB (+0.01%).Warning Bundle contains 5 duplicate packages – View duplicate packages Bundle metrics
|
Current #1032 |
Baseline #1029 |
|
---|---|---|
Initial JS | 3.07MiB (+0.01% ) |
3.07MiB |
Initial CSS | 9.54KiB |
9.54KiB |
Cache Invalidation | 32.24% |
39.4% |
Chunks | 64 |
64 |
Assets | 77 |
77 |
Modules | 2056 |
2056 |
Duplicate Modules | 340 |
340 |
Duplicate Code | 9.43% |
9.43% |
Packages | 209 |
209 |
Duplicate Packages | 5 |
5 |
Bundle size by type 1 change
1 regression
Current #1032 |
Baseline #1029 |
|
---|---|---|
JS | 3.39MiB (+0.01% ) |
3.39MiB |
Fonts | 94.54KiB |
94.54KiB |
CSS | 9.54KiB |
9.54KiB |
Other | 9.09KiB |
9.09KiB |
IMG | 8.57KiB |
8.57KiB |
Bundle analysis report Branch JoeKarow/email-update-crowdin-tw... Project dashboard
📦 Next.js Bundle Analysis for @weareinreach/appThis analysis was generated by the Next.js Bundle Analysis action. 🤖 This PR introduced no changes to the JavaScript bundle! 🙌 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
Outside diff range, codebase verification and nitpick comments (1)
packages/db/prisma/data-migrations/2024-07-29_new-service-tags.ts (1)
4-11
: LGTM! Consider adding a description.The job definition is correct and follows the required format. The description is optional but can provide additional context.
- description: undefined, + description: 'This job creates new service tags for self-advocacy and community organizing.',
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (13)
- packages/api/router/component/query.ServiceSelect.handler.ts (1 hunks)
- packages/api/router/fieldOpt/query.attributesByCategory.handler.ts (1 hunks)
- packages/api/router/fieldOpt/query.attributesByCategory.schema.ts (1 hunks)
- packages/api/router/orgEmail/mutation.update.handler.ts (1 hunks)
- packages/db/client/index.ts (3 hunks)
- packages/db/prisma/data-migrations/2024-07-29_address-visibility-update.ts (1 hunks)
- packages/db/prisma/data-migrations/2024-07-29_new-service-tags.ts (1 hunks)
- packages/db/prisma/data-migrations/index.ts (1 hunks)
- packages/db/prisma/migrations/20240729192332_update_view/migration.sql (1 hunks)
- packages/db/prisma/schema.prisma (1 hunks)
- packages/ui/components/data-portal/ServiceSelect/index.tsx (2 hunks)
- packages/ui/modals/dataPortal/Attributes/SelectionItem.tsx (2 hunks)
- packages/ui/modals/dataPortal/Attributes/index.tsx (5 hunks)
Additional context used
Biome
packages/db/prisma/data-migrations/2024-07-29_address-visibility-update.ts
[error] 24-24: 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)
packages/db/prisma/data-migrations/2024-07-29_new-service-tags.ts
[error] 21-21: 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 (42)
packages/db/prisma/data-migrations/index.ts (2)
10-10
: LGTM!The export statement for
2024-07-29_address-visibility-update
is correct and consistent with the existing structure.
11-11
: LGTM!The export statement for
2024-07-29_new-service-tags
is correct and consistent with the existing structure.packages/db/prisma/migrations/20240729192332_update_view/migration.sql (1)
1-33
: LGTM! But verify the view creation.The SQL query to create or replace the view
public.attributes_by_category
is correct and efficient.However, ensure that the view creation does not introduce any potential issues.
packages/api/router/component/query.ServiceSelect.handler.ts (4)
16-16
: LGTM!Adding the
active
field to the selection criteria for service categories is correct and aligns with the intended functionality.
22-27
: LGTM!Adding the
active
field to the selection criteria for services and service tags is correct and aligns with the intended functionality.
19-19
: Verify the impact of commenting out theactive
filter.Ensure that commenting out the
active: true
filter aligns with the intended functionality and does not introduce any potential issues.
9-9
: Verify the impact of commenting out theactive
filter.Ensure that commenting out the
active: true
filter aligns with the intended functionality and does not introduce any potential issues.packages/ui/modals/dataPortal/Attributes/SelectionItem.tsx (2)
7-7
: LGTM! The addition of theactive
prop is clear and straightforward.The
active
prop has been added to the destructured parameters, which aligns with the intended functionality enhancements.
42-42
: LGTM! Theactive
property has been appropriately added to theSelectionItemProps
interface.The addition aligns with the changes made to the component and ensures type safety.
packages/api/router/fieldOpt/query.attributesByCategory.schema.ts (1)
9-10
: LGTM! TheattributeActive
andcategoryActive
properties have been appropriately added to the schema.These additions enhance the schema by allowing the representation of the active state of attributes and categories.
packages/api/router/fieldOpt/query.attributesByCategory.handler.ts (1)
18-18
: LGTM! The destructuring of theinput
parameter with default values is a robust improvement.This change ensures that
attributeActive
andcategoryActive
are always defined, preventing potential runtime errors.packages/db/client/index.ts (5)
15-23
: LGTM!The function
getErrorFormat
enhances configurability by allowing different error formats for local development and Vercel environments.
40-42
: LGTM!The
errorFormat
property inclientOptions
is now assigned dynamically usinggetErrorFormat
, enhancing configurability.
59-61
: LGTM!The error and warning event handlers remain intact, ensuring that errors and warnings are still logged appropriately.
3-3
: Verify the impact of commenting outcreatePrismaQueryEventHandler
.Commenting out this import indicates a shift in how query logging is managed. Ensure that this change does not affect other parts of the codebase that rely on
createPrismaQueryEventHandler
.Verification successful
The impact of commenting out
createPrismaQueryEventHandler
is limited topackages/db/client/index.ts
and does not affect other parts of the codebase.
- The function is only referenced in the file where it was imported, and both the import and its usage are commented out.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage of `createPrismaQueryEventHandler` in the codebase. # Test: Search for the function usage. Expect: No occurrences of the function. rg --type js --type ts 'createPrismaQueryEventHandler'Length of output: 235
Script:
#!/bin/bash # Description: Verify the usage of `createPrismaQueryEventHandler` in the entire codebase. # Test: Search for the function usage in the entire codebase. Expect: No occurrences of the function outside `packages/db/client/index.ts`. rg 'createPrismaQueryEventHandler'Length of output: 215
48-57
: Verify the impact of commenting out verbose logging logic.Commenting out the verbose logging logic suggests that detailed query logging might be temporarily disabled. Ensure that this change does not affect debugging and monitoring.
packages/db/prisma/data-migrations/2024-07-29_address-visibility-update.ts (6)
1-6
: LGTM!The import statements include necessary modules for file operations, path resolution, and database migrations.
7-14
: LGTM!The job metadata is defined with properties such as
jobId
,title
,createdBy
, anddescription
, which are essential for identifying and describing the migration job.
18-19
: LGTM!The job export includes the job metadata and the task function, which are necessary for the migration runner to execute the job.
20-64
: LGTM!The task function includes the main logic for the data migration, including logging, updating the database, and logging the results. The function is well-structured and includes necessary steps for the migration.
Tools
Biome
[error] 24-24: 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)
64-64
: LGTM!Logging the results of the migration is essential for tracking the success of the migration.
66-71
: LGTM!Calling the job post-runner to register the successful completion of the migration is necessary to ensure that the migration is recorded as completed.
packages/api/router/orgEmail/mutation.update.handler.ts (2)
53-53
: LGTM!The
description
field is now conditionally assigned based on the presence ofupdateDescriptionText
, enhancing the robustness of the code.
Line range hint
1-60
:
LGTM!The
update
function handles the updating of email records, including description, title, and location linking. The function is well-structured and includes necessary steps for updating the email records.packages/db/prisma/data-migrations/2024-07-29_new-service-tags.ts (4)
1-2
: LGTM!The import statements are correct and necessary for the functionality of the file.
12-17
: LGTM!The job export is correct and follows the required format.
18-21
: LGTM!The logging setup is correct and necessary for tracking the job's progress.
Tools
Biome
[error] 21-21: 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)
76-85
: LGTM!The job post-runner is correct and necessary for tracking the job's completion.
packages/ui/components/data-portal/ServiceSelect/index.tsx (6)
Line range hint
1-8
:
LGTM!The import statements are correct and necessary for the functionality of the file.
Line range hint
9-20
:
LGTM!The useStyles function is correct and follows the required format.
Line range hint
21-45
:
LGTM!The initial setup of the ServiceSelect component is correct and follows the required format.
46-76
: LGTM!The rendering logic is correct and improves the component's efficiency and user experience.
Line range hint
77-101
:
LGTM!The Drawer component setup is correct and follows the required format.
Line range hint
102-104
:
LGTM!The ServiceSelectProps interface is correct and follows the required format.
packages/ui/modals/dataPortal/Attributes/index.tsx (6)
Line range hint
1-15
:
LGTM!The import statements are correct and necessary for the functionality of the file.
Line range hint
16-67
:
LGTM!The initial setup of the AttributeModalBody component is correct and follows the required format.
Line range hint
68-87
:
LGTM!The memoization of attributeCategories is correct and improves the component's performance.
Line range hint
88-213
:
LGTM!The handlers are correct and follow the required format. The toggleShowInactiveAttribs handler is a new addition and enhances the component's functionality.
Line range hint
214-273
:
LGTM!The rendering logic is correct and follows the required format.
Line range hint
274-283
:
LGTM!The AttributeModalProps interface is correct and follows the required format.
packages/db/prisma/schema.prisma (2)
2365-2365
: Addition ofattributeActive
field is approved.The new field
attributeActive
enhances the model's capability to manage and filter attributes based on their active state.
2366-2366
: Addition ofcategoryActive
field is approved.The new field
categoryActive
enhances the model's capability to manage and filter categories based on their active state.
Pull Request type
Please check the type of change your PR introduces:
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Does this introduce a breaking change?
Other information
Summary by CodeRabbit
New Features
ServiceSelect
component to only display categories with available services and added visual indicators for active/inactive states.AttributeModalBody
to toggle the visibility of inactive attributes, improving user interaction and filtering capabilities.Bug Fixes
Documentation
Refactor
attributesByCategory
function to enhance robustness and prevent runtime errors.