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: misc data portal #1233

Merged
merged 16 commits into from
Apr 20, 2024
Merged

fix: misc data portal #1233

merged 16 commits into from
Apr 20, 2024

Conversation

JoeKarow
Copy link
Member

@JoeKarow JoeKarow commented Apr 18, 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):

Issue Number:

Does this introduce a breaking change?

  • Yes
  • No

Summary by CodeRabbit

  • New Features

    • Introduced attribute editing capabilities in the API and UI, allowing for modifications such as toggling active status and deleting attributes.
    • Enhanced service editing interfaces with new components and logic for attribute management.
    • Added default values in forms for better initial user interaction and data handling.
  • Refactor

    • Restructured service processing logic for better clarity and maintainability, including handling of various service-related attributes.
    • Improved error handling and data structure updates in service modals.
  • Documentation

    • Added and updated type definitions and interfaces for service processing, enhancing development clarity and supporting new features.

Copy link
Contributor

coderabbitai bot commented Apr 18, 2024

Walkthrough

The recent updates focus on enhancing attribute management in the service system. Changes include the introduction of AttributeEditWrapper for efficient attribute editing, improved form initializations in UI components, and the addition of new processing functions for various service attributes. These updates aim to streamline attribute editing processes, enhance data handling, and improve user interface interactions.

Changes

Files Changes
.../component/index.ts, .../component/schemas.ts, .../component/mutation.AttributeEditWrapper.* Introduced AttributeEditWrapper in router and schema exports, added handler and schema for attribute editing.
.../ui/components/data-portal/PhoneDrawer/index.tsx, .../ui/components/data-portal/ServiceEditDrawer/index.tsx Enhanced form initializations, added attribute editing components.
.../ui/hooks/useFreeText.ts Improved error handling for clarity and consistency.
.../ui/modals/Service/index.tsx, .../ui/modals/Service/processor.tsx, .../ui/modals/Service/processors/*.ts Restructured and optimized code for processing service details, attributes, and locations.
.../ui/modals/dataPortal/Attributes/index.tsx Updated with useCallback and modified function signatures for attribute handling.

Recent Review Details

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 416adcb and cf249dd.
Files selected for processing (2)
  • packages/ui/modals/Service/index.tsx (2 hunks)
  • packages/ui/modals/Service/processor.tsx (4 hunks)
Additional comments not posted (4)
packages/ui/modals/Service/processor.tsx (1)

44-87: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [33-84]

The refactoring in processAccessInstructions enhances clarity and maintainability by using structured parsing and conditional processing based on access type.

packages/ui/modals/Service/index.tsx (3)

29-54: Refactoring of ServiceModalTitle to use a helper function renderModalTitle enhances readability and maintainability.


74-303: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [61-300]

The use of useMemo and useCallback in ServiceModalBody optimizes component rendering and improves performance by avoiding unnecessary re-renders.


61-61: Ensure the TODO comment is tracked in the project management tool.

Would you like me to open a GitHub issue to track the tasks listed in the TODO comment?


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.

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 a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @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.

Copy link

vercel bot commented Apr 18, 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 Apr 19, 2024 11:53pm

@github-actions github-actions bot added automerge Enable Kodiak auto-merge kodiak: merge.method = 'squash' Kodiak will squash merge this PR. 📦 api 📦 ui labels Apr 18, 2024
@JoeKarow JoeKarow added bugfix Inconsistencies or issues which will cause a problem for users or implementors. and removed 📦 api 📦 ui kodiak: merge.method = 'squash' Kodiak will squash merge this PR. labels Apr 18, 2024
Copy link

relativeci bot commented Apr 18, 2024

Job #150: Bundle Size — 3.37MiB (+0.21%).

cf249dd(current) vs 3a2f374 dev#140(baseline)

Warning

Bundle contains 3 duplicate packages – View duplicate packages

Bundle metrics  Change 5 changes Regression 1 regression Improvement 2 improvements
                 Current
Job #150
     Baseline
Job #140
Regression  Initial JS 2.99MiB(+0.24%) 2.98MiB
No change  Initial CSS 9.54KiB 9.54KiB
Change  Cache Invalidation 43.59% 73.33%
No change  Chunks 64 64
No change  Assets 78 78
Change  Modules 1939(+0.62%) 1927
Improvement  Duplicate Modules 274(-0.36%) 275
Improvement  Duplicate Code 7.76%(-0.26%) 7.78%
No change  Packages 208 208
No change  Duplicate Packages 3 3
Bundle size by type  Change 2 changes Regression 1 regression Improvement 1 improvement
                 Current
Job #150
     Baseline
Job #140
Regression  JS 3.23MiB (+0.22%) 3.23MiB
Not changed  Fonts 94.54KiB 94.54KiB
Improvement  Other 22.4KiB (-0.01%) 22.4KiB
Not changed  CSS 9.54KiB 9.54KiB
Not changed  IMG 8.57KiB 8.57KiB

View job #150 reportView JoeKarow/portal-saving branch activityView project dashboard

Copy link
Contributor

github-actions bot commented Apr 18, 2024

📦 Next.js Bundle Analysis for @weareinreach/app

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

Eight Pages Changed Size

The following pages changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load % of Budget (575 KB)
/ 281.36 KB 684.43 KB 119.03% (🟡 +0.25%)
/org/[slug] 323.39 KB 726.46 KB 126.34% (🟡 +0.35%)
/org/[slug]/[orgLocationId] 317.92 KB 721 KB 125.39% (🟡 +0.35%)
/org/[slug]/[orgLocationId]/edit 319.11 KB 722.18 KB 125.60% (🟡 +0.34%)
/org/[slug]/edit 276.56 KB 679.63 KB 118.20% (🟡 +0.25%)
/org/[slug]/remote 278.63 KB 681.7 KB 118.56% (🟡 +0.34%)
/search/[...params] 273.19 KB 676.26 KB 117.61% (🟡 +0.25%)
/search/intl/[country] 272.19 KB 675.26 KB 117.44% (🟡 +0.25%)
Details

Only the gzipped size is provided here based on an expert tip.

First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

The "Budget %" column shows what percentage of your performance budget the First Load total takes up. For example, if your budget was 100kb, and a given page's first load size was 10kb, it would be 10% of your budget. You can also see how much this has increased or decreased compared to the base branch of your PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this. If you see "+/- <0.01%" it means that there was a change in bundle size, but it is a trivial enough amount that it can be ignored.

Copy link

alwaysmeticulous bot commented Apr 18, 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 cf249dd. This comment will update as new commits are pushed.

@JoeKarow
Copy link
Member Author

@coderabbitai review

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: 1

packages/ui/modals/Service/processors/eligOtherAttrib.ts Outdated Show resolved Hide resolved
@kodiakhq kodiakhq bot removed the automerge Enable Kodiak auto-merge label Apr 19, 2024
Copy link
Contributor

kodiakhq bot commented Apr 19, 2024

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

# Conflicts:
#	pnpm-lock.yaml
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: 5

packages/ui/modals/Service/processor.tsx Outdated Show resolved Hide resolved
packages/ui/modals/Service/processor.tsx Show resolved Hide resolved
packages/ui/modals/Service/index.tsx Outdated Show resolved Hide resolved
packages/ui/modals/Service/index.tsx Show resolved Hide resolved
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: 1

Copy link

sonarcloud bot commented Apr 19, 2024

Quality Gate Passed Quality Gate passed

Issues
1 New issue
2 Accepted issues

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

See analysis details on SonarCloud

@JoeKarow
Copy link
Member Author

@coderabbitai review

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: 1

packages/ui/modals/Service/processor.tsx Show resolved Hide resolved
@JoeKarow
Copy link
Member Author

@coderabbitai resolve

@kodiakhq kodiakhq bot merged commit da82c52 into dev Apr 20, 2024
41 of 42 checks passed
@kodiakhq kodiakhq bot deleted the JoeKarow/portal-saving branch April 20, 2024 01:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 api 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