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

feat: View advance request display exact amount (SPENDER + APPROVER) #3353

Merged
merged 2 commits into from
Dec 16, 2024

Conversation

SahilK-027
Copy link
Contributor

@SahilK-027 SahilK-027 commented Dec 13, 2024

Clickup

clickup link

UI Preview

Please add screenshots for UI changes
Screenshot 2024-12-13 at 4 40 26 PM
Screenshot 2024-12-13 at 4 40 21 PM

Summary by CodeRabbit

  • New Features

    • Introduced a new container class for better layout management.
  • Style

    • Adjusted font sizes for various elements to enhance readability.
    • Updated color scheme for specific sections to improve visual appeal.
    • Modified currency display formatting for better clarity.
  • Tests

    • Added ExactCurrencyPipe to the test suite for enhanced testing capabilities.

Copy link

coderabbitai bot commented Dec 13, 2024

Walkthrough

The changes in this pull request involve modifications to the HTML and SCSS files of the summary-tile component, including a renaming of the CSS class from summary-tile to summary-title. Adjustments to font sizes and colors have been made, along with the introduction of a new nested class. Additionally, a new pipe, ExactCurrencyPipe, has been added to the test suite, indicating potential usage in the component's template. The overall functionality and control flow of the component remain unchanged, my friend.

Changes

File Change Summary
src/app/shared/components/summary-tile/summary-tile.component.html Formatting changes made for readability; updated currency display logic to use ExactCurrencyPipe.
src/app/shared/components/summary-tile/summary-tile.component.scss Renamed main class to .summary-title, adjusted font sizes, colors, and introduced a new nested class &__amount_container.
src/app/shared/components/summary-tile/summary-tile.component.spec.ts Added ExactCurrencyPipe to the test suite for the FySummaryTileComponent.

Possibly related PRs

Suggested reviewers

  • Dimple16

🎉 In the land of code, changes do flow,
From summary-tile to summary-title, oh what a show!
Fonts and colors dance, in a stylish embrace,
With ExactCurrencyPipe, we keep up the pace!
So here’s to the tweaks, both big and small,
In the world of coding, we’re having a ball! 🎊


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. (Experiment)
  • @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.

@github-actions github-actions bot added the size/M Medium PR label Dec 13, 2024
Copy link

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

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between e8932a9 and 5e7db4b.

📒 Files selected for processing (3)
  • src/app/shared/components/summary-tile/summary-tile.component.html (2 hunks)
  • src/app/shared/components/summary-tile/summary-tile.component.scss (2 hunks)
  • src/app/shared/components/summary-tile/summary-tile.component.spec.ts (2 hunks)
🔇 Additional comments (3)
src/app/shared/components/summary-tile/summary-tile.component.html (1)

19-20: Magizhchi! The exactCurrency pipe implementation looks sharp!

The new currency formatting with exactCurrency pipe is a style upgrade that shows precise amounts. But like my punch dialogues, we need proper test coverage!

✅ Verification successful

Mind it! Your ExactCurrencyPipe is fully loaded with test coverage, just like my action sequences!

The test coverage is as perfect as my signature sunglasses flip! You've got comprehensive test cases covering:

  • Positive and negative values
  • Currency symbol handling
  • Custom fraction digits
  • Zero value handling
  • Large number formatting
  • All configuration combinations

The implementation matches perfectly with the test cases, like a well-choreographed fight scene. No gaps in coverage found!

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if ExactCurrencyPipe has proper test coverage
rg -l "describe.*ExactCurrencyPipe" 

Length of output: 86


Script:

#!/bin/bash
# Let's check the actual test coverage of ExactCurrencyPipe
cat src/app/shared/pipes/exact-currency.pipe.spec.ts

Length of output: 5448


Script:

#!/bin/bash
# Let's check the implementation to ensure all cases are covered
cat src/app/shared/pipes/exact-currency.pipe.ts

Length of output: 887

src/app/shared/components/summary-tile/summary-tile.component.scss (1)

22-22: 🧹 Nitpick (assertive)

Style pandratha nalla pannu! (Do styling properly!)

The font size reductions from 18px to 14px and color changes to dark-grey might affect readability. Like my movies' cinematography, every detail matters!

Let's ensure these changes align with design system:

Consider using CSS variables for consistent styling:

-      font-size: 14px;
+      font-size: var(--font-size-regular);
-      color: $dark-grey;
+      color: var(--color-text-secondary);

Also applies to: 28-28, 34-34, 35-35, 39-39, 40-40

✅ Verification successful

Style is all about consistency, and this change is perfectly in sync with our shared components!

The font-size reduction to 14px is actually following a well-established pattern across our shared components. The ripgrep results show that 14px is widely used across more than 50 shared components, making it a de-facto standard in our design system. Just like how I maintain my signature style across all my movies, this font size maintains consistency across our UI!

While the suggestion to use CSS variables is stylish, the current implementation is already following the established pattern in our codebase. The readability concerns are unwarranted since this font size is proven to work well across numerous components.

Remember what I always say: "When something works in style, don't fix it!"

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for similar font sizes in other components
rg -l "font-size:\s*(12|14)px" "src/app/shared/components"

Length of output: 5321

src/app/shared/components/summary-tile/summary-tile.component.spec.ts (1)

19-26: ⚠️ Potential issue

Test cases are like my stunts - they must be perfect!

The ExactCurrencyPipe is added to declarations, but like my movie's continuity, we need to update the test selectors!

Update the test selectors to match new class names:

- '.summary-tile--card-container__category'
+ '.summary-title--card-container__category'

And similar changes throughout the test file.

Likely invalid or redundant comment.

Copy link

@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: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5e7db4b and 7b5a460.

📒 Files selected for processing (2)
  • src/app/shared/components/summary-tile/summary-tile.component.html (2 hunks)
  • src/app/shared/components/summary-tile/summary-tile.component.scss (1 hunks)
🔇 Additional comments (4)
src/app/shared/components/summary-tile/summary-tile.component.html (2)

1-1: Mind it! The class naming needs attention!

Hey boss, the class names are changed from 'summary-tile' to 'summary-title', but the component is still named 'summary-tile'. This inconsistency will confuse other developers like a plot twist in my movies!


20-20: Mind it! The currency pipe change looks powerful!

The switch from humanizeCurrency to exactCurrency pipe is exactly what we need for precise amount display. But like in my movies, we need to verify all the scenes!

✅ Verification successful

Mind it! The exactCurrency pipe is perfectly set up, like a well-choreographed action sequence!

The pipe is properly declared in SharedModule and its implementation is rock solid! It handles currency formatting with style, maintaining exact precision while respecting currency codes and symbols. When I make a style statement, I make it perfect - and this pipe does exactly that!

  • Properly imported and exported in SharedModule ✨
  • Handles negative numbers with finesse 💪
  • Maintains exact decimal precision 🎯
  • Works in perfect sync with FyCurrencyPipe 🌟
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if exactCurrency pipe is properly imported and declared
ast-grep --pattern 'import { ExactCurrencyPipe } from $_'

Length of output: 59


Script:

#!/bin/bash
# Let's search for the ExactCurrencyPipe class definition and its module declaration
ast-grep --pattern 'export class ExactCurrencyPipe implements PipeTransform'

# Also search for the pipe declaration in any module
ast-grep --pattern '@NgModule({
  $$$
  declarations: [$$$ExactCurrencyPipe$$$]
  $$$
})'

# And let's check where this pipe is actually used
rg "exactCurrency" -A 2

Length of output: 5149


Script:

#!/bin/bash
# Let's check the shared module for the pipe declaration, mind it!
rg -l "SharedModule" | xargs rg "ExactCurrencyPipe"

# And check the implementation of our powerful pipe, thalaiva style!
cat src/app/shared/pipes/exact-currency.pipe.ts

Length of output: 1144

src/app/shared/components/summary-tile/summary-tile.component.scss (2)

35-35: Superstar! These colors are perfect!

The color changes to $dark-grey and $black improve contrast like the perfect lighting in my movie scenes!

Also applies to: 40-40, 45-45


50-51: Kabali da! New amount container looks stylish!

The new amount container with margin-top: 10px gives better spacing. But like my movie's timing, we need to ensure it's responsive!

Copy link

Unit Test Coverage % values
Statements 96% ( 19301 / 20104 )
Branches 91.12% ( 10664 / 11703 )
Functions 94.3% ( 5741 / 6088 )
Lines 96.04% ( 18431 / 19190 )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/M Medium PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants