Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Fix export column widths in new Financial sample app #333

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
Loading
from

Conversation

dimodi
Copy link
Contributor

@dimodi dimodi commented Jun 5, 2025

No description provided.

@dimodi dimodi requested review from a team and Copilot June 5, 2025 10:47
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR centralizes column width settings for Excel and PDF exports into a shared utility and cleans up repetitive inline width assignments across multiple pages. Additionally, it adds a display title for the Payment Method column in Overview and Analytics.

  • Introduced CommonUtils.SetExportableColumnWidths to apply consistent column widths.
  • Refactored OnGridBeforeExcelExport and OnGridBeforePdfExport handlers to use the new utility.
  • Added a Title="Payment Method" attribute to the PaymentMethodId column in Overview and Analytics pages.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
Services/CommonUtils.cs New utility class for export column width settings.
Components/Pages/Transactions.razor Replaced manual width assignments with utility call.
Components/Pages/Overview.razor Ditto, plus added Title for Payment Method column.
Components/Pages/Analytics.razor Same refactoring and Title addition.
Comments suppressed due to low confidence (3)

sample-applications/blazor-financial-dashboard/BlazorFinancialDashboard/Services/CommonUtils.cs:8

  • The variable name 'ExportableColumnWiths' contains a typo and may be misleading. Consider renaming it to 'ExportableColumnWidths' for clarity.
private static readonly Dictionary<string, string> ExportableColumnWiths = new()

sample-applications/blazor-financial-dashboard/BlazorFinancialDashboard/Services/CommonUtils.cs:6

  • [nitpick] Public utility class and methods lack XML documentation. Adding <summary> comments would improve maintainability and API clarity.
public static class CommonUtils

sample-applications/blazor-financial-dashboard/BlazorFinancialDashboard/Services/CommonUtils.cs:20

  • New utility methods aren’t covered by any unit tests. Adding tests for both Excel and PDF overloads would help prevent regressions in column width logic.
public static void SetExportableColumnWidths(List<GridExcelExportColumn> currentColumns)

Comment on lines +20 to +22
public static void SetExportableColumnWidths(List<GridExcelExportColumn> currentColumns)
{
foreach (GridExcelExportColumn column in currentColumns)
Copy link
Preview

Copilot AI Jun 5, 2025

Choose a reason for hiding this comment

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

[nitpick] There are two nearly identical overloads of SetExportableColumnWidths for Excel and PDF columns. Consider abstracting the shared logic (e.g., via a generic method or interface) to reduce duplication.

Suggested change
public static void SetExportableColumnWidths(List<GridExcelExportColumn> currentColumns)
{
foreach (GridExcelExportColumn column in currentColumns)
public static void SetExportableColumnWidths<T>(List<T> currentColumns) where T : IExportableColumn
{
foreach (T column in currentColumns)

Copilot uses AI. Check for mistakes.

Positive FeedbackNegative Feedback
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
Morty Proxy This is a proxified and sanitized view of the page, visit original site.