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: social media saving #1238

Merged
merged 4 commits into from
Apr 22, 2024
Merged

fix: social media saving #1238

merged 4 commits into from
Apr 22, 2024

Conversation

JoeKarow
Copy link
Member

@JoeKarow JoeKarow commented Apr 22, 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: IN-966

What is the new behavior?

Does this introduce a breaking change?

  • Yes
  • No

Other information

Summary by CodeRabbit

  • New Features

    • Enhanced navigation in components for a smoother user experience.
    • Added social media management capabilities for organizations.
    • Improved search functionality and UI elements for better performance.
    • Upgraded pagination and tab components for enhanced interaction.
  • Refactor

    • Optimized components using useCallback, useMemo, and useEffect.
    • Enhanced error handling and state management.
  • Bug Fixes

    • Addressed prop handling issues and improved conditional rendering.
  • Style

    • Updated component styling for consistency and visual appeal.
  • Documentation

    • Enhanced code comments and inline documentation for improved clarity.

Copy link

vercel bot commented Apr 22, 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 22, 2024 9:41pm

Copy link
Contributor

coderabbitai bot commented Apr 22, 2024

Walkthrough

The recent updates across various components and pages primarily focus on performance optimization, code maintainability, and functionality enhancements. Key changes include the adoption of useCallback, useMemo, and better error handling strategies. Notably, the introduction of the upsert mutation for social media links, alongside improved UI component structuring, and enhanced user interaction handling and state management.

Changes

File(s) Change Summary
apps/app/src/pages/account/... Added useCallback for handleReturnHome in QuickPromotionModal across multiple account pages.
apps/app/src/pages/org/[slug]/[orgLocationId]/index.tsx, .../[slug]/index.tsx Enhanced use of useMemo and useCallback; improved sidebar and tabs handling.
apps/app/src/pages/org/[slug]/remote.tsx, .../search/[...params]/index.tsx Refactored with useCallback for better event handling and state management.
packages/api/..., packages/ui/components/core/..., packages/ui/components/data-portal/... Extensive use of useCallback, useMemo, and schema updates for robust data handling.
packages/ui/package.json, packages/api/package.json Added "social-links": "1.14.0" to dependencies.
packages/ui/components/core/... Refactored various UI components for performance optimization and readability.

This structured approach ensures that the application remains scalable, maintainable, and performs efficiently as new features and updates are rolled out.


Recent Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between ee4ae38 and 6b17370.
Files selected for processing (1)
  • packages/ui/components/data-portal/SocialMediaDrawer/index.tsx (7 hunks)
Additional comments not posted (19)
packages/ui/components/data-portal/SocialMediaDrawer/index.tsx (19)

15-15: Added useDebouncedValue import from @mantine/hooks.


21-25: Added useCallback, useMemo, and useState imports from react.


28-28: Added SocialLinks import.


35-36: Added useNewNotification and useOrgInfo imports.


53-54: Modified default values for published and deleted in FormSchema.


57-65: Added service and orgLocationOnly fields in FormSchema.


73-73: Updated SelectItem component to destructure value prop.


86-86: Modified state initialization for socialId.


104-104: Updated form initialization based on createNew and hasLocationId.


121-132: Added notifySave notification and updated mutation handling in databaseUpdate.


140-150: Added debounced value handling for url and related logic for parsing the username.


152-161: Added logic to handle modal close and unlink actions.


179-179: Refactored modal submit and dismiss functions.


215-215: Refactored form submission logic.


245-245: Added handling for serviceId in Select component.


249-249: Added username field handling in TextInput component.


258-258: Added logic for handleUnlink function.


276-276: Refactored handleModalSubmit function.


280-280: Refactored handleModalDismiss function.


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.

@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 22, 2024
@JoeKarow JoeKarow added bugfix Inconsistencies or issues which will cause a problem for users or implementors. automerge Enable Kodiak auto-merge and removed automerge Enable Kodiak auto-merge 📦 api 📦 ui kodiak: merge.method = 'squash' Kodiak will squash merge this PR. labels Apr 22, 2024
Copy link

relativeci bot commented Apr 22, 2024

Job #180: Bundle Size — 3.39MiB (+0.56%).

6b17370(current) vs 864e7fe dev#166(baseline)

Warning

Bundle contains 3 duplicate packages – View duplicate packages

Warning

Bundle introduced one new package: social-links – View changed packages

Bundle metrics  Change 5 changes Regression 3 regressions
                 Current
Job #180
     Baseline
Job #166
Regression  Initial JS 3.01MiB(+0.63%) 2.99MiB
No change  Initial CSS 9.54KiB 9.54KiB
Change  Cache Invalidation 49.5% 55.36%
No change  Chunks 64 64
No change  Assets 78 78
Change  Modules 1967(+1.44%) 1939
No change  Duplicate Modules 274 274
Regression  Duplicate Code 7.78%(+0.39%) 7.75%
Regression  Packages 209(+0.48%) 208
No change  Duplicate Packages 3 3
Bundle size by type  Change 1 change Regression 1 regression
                 Current
Job #180
     Baseline
Job #166
Regression  JS 3.26MiB (+0.58%) 3.24MiB
Not changed  Fonts 94.54KiB 94.54KiB
Not changed  Other 22.39KiB 22.39KiB
Not changed  CSS 9.54KiB 9.54KiB
Not changed  IMG 8.57KiB 8.57KiB

View job #180 reportView JoeKarow/portal-social-media branch activityView project dashboard

Copy link

socket-security bot commented Apr 22, 2024

🚨 Potential security issues detected. Learn more about Socket for GitHub ↗︎

To accept the risk, merge this PR and you will not be notified again.

Alert Package NoteSource
Install scripts npm/[email protected]
  • Install script: postinstall
  • Source: node -e "try{require('./postinstall')}catch(e){}"

View full report↗︎

Next steps

What is an install script?

Install scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.

Packages should not be running non-essential scripts during install and there are often solutions to problems people solve with install scripts that can be run at publish time instead.

Take a deeper look at the dependency

Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev.

Remove the package

If you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency.

Mark a package as acceptable risk

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of ecosystem/package-name@version specifiers. e.g. @SocketSecurity ignore npm/[email protected] or ignore all packages with @SocketSecurity ignore-all

Copy link
Contributor

github-actions bot commented Apr 22, 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)
/ 285.19 KB 689.22 KB 119.86% (🟡 +0.62%)
/org/[slug] 327.24 KB 731.27 KB 127.18% (🟡 +0.62%)
/org/[slug]/[orgLocationId] 321.77 KB 725.8 KB 126.23% (🟡 +0.62%)
/org/[slug]/[orgLocationId]/edit 322.94 KB 726.97 KB 126.43% (🟡 +0.62%)
/org/[slug]/edit 280.38 KB 684.41 KB 119.03% (🟡 +0.61%)
/org/[slug]/remote 282.48 KB 686.5 KB 119.39% (🟡 +0.62%)
/search/[...params] 277.04 KB 681.07 KB 118.45% (🟡 +0.62%)
/search/intl/[country] 276.01 KB 680.04 KB 118.27% (🟡 +0.61%)
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 22, 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 6b17370. This comment will update as new commits are pushed.

@JoeKarow JoeKarow marked this pull request as ready for review April 22, 2024 21:34
Copy link

sonarcloud bot commented Apr 22, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
1 Accepted issue

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

See analysis details on SonarCloud

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

@kodiakhq kodiakhq bot merged commit 5664f62 into dev Apr 22, 2024
32 of 34 checks passed
@kodiakhq kodiakhq bot deleted the JoeKarow/portal-social-media branch April 22, 2024 21:46
JoeKarow added a commit that referenced this pull request Apr 24, 2024
<!--- Please provide a general summary of your changes in the title
above -->

<!-- Please try to limit your pull request to one type; submit multiple
pull requests if needed. -->

Please check the type of change your PR introduces:

- [x] Bugfix
- [ ] Feature
- [ ] Code style update (formatting, renaming)
- [ ] Refactoring (no functional changes, no API changes)
- [ ] Build-related changes
- [ ] Documentation content changes
- [ ] Other (please describe):

<!-- Please describe the current behavior that you are modifying, or
link to a relevant issue. -->

Issue Number: IN-966

<!-- Please describe the behavior or changes that are being added by
this PR. -->

-
-
-

- [ ] Yes
- [ ] No

<!-- If this does introduce a breaking change, please describe the
impact and migration path for existing applications below. -->

<!-- Any other information that is important to this PR, such as
screenshots of how the component looks before and after the change. -->

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

- **New Features**
  - Enhanced navigation in components for a smoother user experience.
  - Added social media management capabilities for organizations.
- Improved search functionality and UI elements for better performance.
  - Upgraded pagination and tab components for enhanced interaction.

- **Refactor**
- Optimized components using `useCallback`, `useMemo`, and `useEffect`.
  - Enhanced error handling and state management.

- **Bug Fixes**
  - Addressed prop handling issues and improved conditional rendering.

- **Style**
  - Updated component styling for consistency and visual appeal.

- **Documentation**
- Enhanced code comments and inline documentation for improved clarity.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
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. 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