Skip to content

reduce receipt content font size#894

Merged
belwalshubham merged 3 commits intodevelopfrom
feat/reduce-font-content-size
Jan 28, 2025
Merged

reduce receipt content font size#894
belwalshubham merged 3 commits intodevelopfrom
feat/reduce-font-content-size

Conversation

@belwalshubham
Copy link
Copy Markdown
Collaborator

@belwalshubham belwalshubham commented Jan 28, 2025

Summary by CodeRabbit

  • New Features

    • Enhanced contribution receipt generation process.
    • Integrated activity data into the email sending mechanism.
  • Improvements

    • Updated method signatures to include more comprehensive contribution details.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Jan 28, 2025

Warning

Rate limit exceeded

@belwalshubham has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 27 minutes and 38 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 11ac116 and 3e3009a.

📒 Files selected for processing (1)
  • wp-content/civi-extensions/goonjcustom/Civi/InstitutionMaterialContributionService.php (7 hunks)

Walkthrough

The pull request modifies the InstitutionMaterialContributionService class in the CiviCRM extension. The changes focus on enhancing the process of handling institution material contributions by integrating activity data retrieval and updating the email receipt generation method. The modifications include adding an import for the Activity class, retrieving activity data, and adjusting method signatures to incorporate contribution-specific information into the email generation process.

Changes

File Change Summary
wp-content/civi-extensions/goonjcustom/Civi/InstitutionMaterialContributionService.php - Added import for Civi\Api4\Activity
- Updated processInstitutionMaterialContributions method to check for $data and retrieve activity data
- Modified sendInstitutionMaterialContributionEmails method signature to accept $contribution
- Updated generateContributionReceiptHtml method to accept $contribution and adjust HTML generation accordingly

Possibly related PRs

Suggested reviewers

  • tarunnjoshi

Poem

🏛️ In halls of data, code takes flight,
Contributions dance with digital might.
Activities tracked, emails unfurled,
A receipt's journey through the digital world.
Bits and bytes in harmonious song 🌟


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.

@belwalshubham belwalshubham changed the title reduce receipt font content reduce receipt content font size Jan 28, 2025
Copy link
Copy Markdown

@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

🧹 Nitpick comments (3)
wp-content/civi-extensions/goonjcustom/Civi/InstitutionMaterialContributionService.php (3)

229-247: Consider using CSS variables for consistent font sizes.

The font sizes are hardcoded in multiple places. Consider using CSS variables to maintain consistency and make future updates easier.

 <style>
+  :root {
+    --font-size-small: 12px;
+    --font-size-medium: 14px;
+  }
   .table-header {
     text-align: left;
     font-weight: bold;
-    font-size: 14px;
+    font-size: var(--font-size-medium);
   }
   .table-cell {
-    font-size: 14px;
+    font-size: var(--font-size-medium);
     text-align: center;
   }
 </style>

Line range hint 280-293: Consolidate font size declarations.

Multiple elements use the same font size (12px). Consider using a common CSS class.

+<style>
+  .text-small {
+    font-size: 12px;
+  }
+</style>
-<div style="float: left; width: 60%; font-size: 12px;">
+<div style="float: left; width: 60%;" class="text-small">

295-307: Improve address section styling.

The address section has inconsistent styling and a color property without a value.

-              <div style="font-size: 12px; float: left; color:">
+              <div style="font-size: 12px; float: left;">
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between cbb8344 and 11ac116.

📒 Files selected for processing (1)
  • wp-content/civi-extensions/goonjcustom/Civi/InstitutionMaterialContributionService.php (7 hunks)
🔇 Additional comments (1)
wp-content/civi-extensions/goonjcustom/Civi/InstitutionMaterialContributionService.php (1)

141-141: LGTM: Method signature changes.

The addition of the contribution parameter to both methods improves the data flow and maintains consistency.

Also applies to: 204-204

return;
}

error_log("objectRef: " . print_r($objectRef, TRUE));
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Remove or sanitize error logging in production code.

The error logging of $objectRef might expose sensitive data. Consider removing it or sanitizing the output.

-    error_log("objectRef: " . print_r($objectRef, TRUE));
+    // Log only necessary fields or remove in production
+    error_log("Processing AfformSubmission ID: " . $objectId);
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
error_log("objectRef: " . print_r($objectRef, TRUE));
error_log("Processing AfformSubmission ID: " . $objectId);

Comment on lines +47 to +54
$activities = Activity::get(FALSE)
->addSelect('*')
->addJoin('Organization AS organization', 'LEFT')
->addWhere('activity_type_id:name', '=', 'Institution Material Contribution')
->addWhere('organization.id', '=', 17383)
->addOrderBy('created_date', 'DESC')
->setLimit(1)
->execute();
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Avoid hardcoding organization ID.

The organization ID (17383) should not be hardcoded. Consider moving it to configuration.

-      ->addWhere('organization.id', '=', 17383)
+      ->addWhere('organization.id', '=', GOONJ_ORGANIZATION_ID)

Committable suggestion skipped: line range outside the PR's diff.

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.

1 participant