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: trim number values in traffic sources piechart (BAL-3482) #3028

Merged
merged 3 commits into from
Feb 5, 2025
Merged

Conversation

r4zendev
Copy link
Collaborator

@r4zendev r4zendev commented Feb 4, 2025

image

Summary by CodeRabbit

  • Chores

    • Updated versions and dependencies across core applications and packages for improved stability.
  • Bug Fixes

    • Enhanced numerical precision in data charts to ensure values are now displayed more accurately.

@r4zendev r4zendev self-assigned this Feb 4, 2025
Copy link

changeset-bot bot commented Feb 4, 2025

⚠️ No Changeset found

Latest commit: ef94288

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

coderabbitai bot commented Feb 4, 2025

Walkthrough

This pull request updates multiple packages by bumping version numbers and synchronizing dependency versions from @ballerine/[email protected] to 0.5.73. The changelog and package manifest files for the kyb-app, react-pdf-toolkit, and ui packages have been updated accordingly. Additionally, the WebsiteCredibility.tsx component has been modified for improved control flow and to apply rounding logic for computed values.

Changes

File(s) Summary
apps/kyb-app/CHANGELOG.md
apps/kyb-app/package.json
Added new version 0.3.122 and updated dependency @ballerine/ui from 0.5.72 to 0.5.73.
packages/react-pdf-toolkit/CHANGELOG.md
packages/react-pdf-toolkit/package.json
Added new version 1.2.73 with dependency update for @ballerine/ui from 0.5.72 to 0.5.73.
packages/ui/CHANGELOG.md
packages/ui/package.json
Added new version 0.5.73 in the changelog and updated the package version in the manifest.
packages/ui/.../WebsiteCredibility.tsx Modified control flow for handling empty trafficSources and applied rounding logic to update values with two-decimal precision.

Sequence Diagram(s)

sequenceDiagram
    participant VC as WebsiteCredibility
    participant Data as TrafficAnalysis

    VC->>Data: Check if trafficSources exist
    alt No trafficSources
      VC-->>VC: Return empty array []
    else TrafficSources present
      VC->>VC: Compute values array
      alt existingOtherIdx found
          VC->>VC: Update value with remainder (rounded to 2 decimals)
      else
          VC->>VC: Append new entry with rounded remainder
      end
    end
Loading

Possibly related PRs

Suggested reviewers

  • Omri-Levy
  • tomer-shvadron

Poem

I’m a rabbit in a codefield so bright,
Hopping through updates in sheer delight,
Version bumps and rounding with care,
Dependencies aligned, oh what a flair!
With every line, I cheer and sing—
Code dreams come true with each new spring!
🐰 Happy coding, let your changes take wing!

Tip

🌐 Web search-backed reviews and chat
  • We have enabled web search-based reviews and chat for all users. This feature allows CodeRabbit to access the latest documentation and information on the web.
  • You can disable this feature by setting web_search: false in the knowledge_base settings.
  • Please share any feedback in the Discord discussion.

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 94cbce8 and ef94288.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (7)
  • apps/kyb-app/CHANGELOG.md (1 hunks)
  • apps/kyb-app/package.json (2 hunks)
  • packages/react-pdf-toolkit/CHANGELOG.md (1 hunks)
  • packages/react-pdf-toolkit/package.json (2 hunks)
  • packages/ui/CHANGELOG.md (1 hunks)
  • packages/ui/package.json (1 hunks)
  • packages/ui/src/components/templates/report/components/WebsiteCredibility/WebsiteCredibility.tsx (2 hunks)
✅ Files skipped from review due to trivial changes (6)
  • packages/ui/package.json
  • packages/ui/CHANGELOG.md
  • apps/kyb-app/package.json
  • apps/kyb-app/CHANGELOG.md
  • packages/react-pdf-toolkit/package.json
  • packages/react-pdf-toolkit/CHANGELOG.md
⏰ Context from checks skipped due to timeout of 90000ms (8)
  • GitHub Check: test_windows
  • GitHub Check: test_linux
  • GitHub Check: build (windows-latest)
  • GitHub Check: spell_check
  • GitHub Check: Analyze (javascript)
  • GitHub Check: lint
  • GitHub Check: format
  • GitHub Check: build (ubuntu-latest)
🔇 Additional comments (2)
packages/ui/src/components/templates/report/components/WebsiteCredibility/WebsiteCredibility.tsx (2)

80-82: LGTM! Improved code readability.

The block statement enhances readability while maintaining the same logic.


94-96: LGTM! Fixed number precision in traffic sources pie chart.

The changes ensure consistent decimal places for percentage values, which aligns with the PR objective to trim number values in the traffic sources pie chart.

Let's verify if similar rounding logic is consistently applied across the component:

Also applies to: 98-98

✅ Verification successful

🏁 Script executed:

#!/bin/bash
# Description: Check for other number formatting instances in the component
# that might benefit from similar rounding logic

# Search for number formatting patterns
rg -A 2 'parseFloat|parseInt|toFixed|Math\.(round|floor|ceil)' packages/ui/src/components/templates/report/components/WebsiteCredibility/WebsiteCredibility.tsx

Length of output: 1263


Rounding logic for the pie chart and related values is consistently applied.

The search confirms that the updated rounding using toFixed(2) for the pie chart (both for the cumulative value and the “other” value) matches the expected precision. Other instances of number formatting (like percentage display using toFixed(1) and integer parsing via parseInt) serve their distinct purposes and don't require the two-decimal precision fix.


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>, please review it.
    • 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @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 using 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 generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

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.

@r4zendev r4zendev changed the title fix: trim number values in traffic sources piechart fix: trim number values in traffic sources piechart (BAL-3482) Feb 4, 2025
@r4zendev r4zendev enabled auto-merge (squash) February 5, 2025 13:46
@r4zendev r4zendev merged commit 4517bac into dev Feb 5, 2025
18 checks passed
@r4zendev r4zendev deleted the bal3482 branch February 5, 2025 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants