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: patch "Report Title" option to "Report Name" in skip export #1034

Merged

Conversation

JustARatherRidiculouslyLongUsername
Copy link
Contributor

@JustARatherRidiculouslyLongUsername JustARatherRidiculouslyLongUsername commented Oct 17, 2024

Description

Affects advanced settings of intacct, netsuite, business central, qbo and sage 300

Clickup

https://app.clickup.com/

Summary by CodeRabbit

  • New Features

    • Updated dropdown options to display 'report_name' instead of 'report_title' based on specific conditions.
  • Bug Fixes

    • Ensured correct display of selected items in dropdowns for improved user experience.

Affects advanced settings of intacct, netsuite, business central, qbo and sage 300
Copy link
Contributor

coderabbitai bot commented Oct 17, 2024

Walkthrough

The changes involve modifications to the HTML templates of two components: configuration-skip-export.component.html and skip-export.component.html. The string 'report_title' is conditionally replaced with 'report_name' in the dropdown templates for specific conditions, ensuring that the correct label is displayed based on the field_name. The overall structure and functionality of the forms remain unchanged.

Changes

File Path Change Summary
src/app/shared/components/configuration/configuration-skip-export/... Updated dropdown templates to conditionally replace 'report_title' with 'report_name' for options.
src/app/shared/components/si/helper/skip-export/... Updated dropdown templates to conditionally replace 'report_title' with 'report_name' for options.

Possibly related PRs

  • fix: intacct prepend code field fix #1011: This PR addresses enhancements in the IntacctImportSettingsComponent, specifically related to managing import code fields, which may connect with the dropdown modifications in the main PR regarding how fields are displayed and handled in forms.
  • fix: form value bug fixes #1022: This PR includes changes to the IntacctImportSettingsComponent that enhance the management of custom and dependent fields within the import settings form, which could relate to the dropdown logic in the main PR that modifies how fields are displayed based on conditions.

Suggested labels

size/XS

Suggested reviewers

  • ashwin1111
  • DhaaraniCIT

Poem

🐰 In the fields where data plays,
A name change brightens up the ways.
From 'report_title' to 'report_name',
Our dropdowns dance, never the same!
With each selection, joy we find,
A hop, a skip, all well-defined! 🌼


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 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/XS Extra Small PR label Oct 17, 2024
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: 0

🧹 Outside diff range and nitpick comments (5)
src/app/shared/components/si/helper/skip-export/skip-export.component.html (2)

26-26: LGTM! Consider extracting the condition to a variable for improved readability.

The changes correctly implement the requirement to update "Report Title" to "Report Name" in the dropdown options. The conditional check ensures that only 'report_title' is replaced while maintaining other field names.

To improve code readability, consider extracting the condition to a variable:

{{ let updatedFieldName = option.field_name === 'report_title' ? 'report_name' : option.field_name; }}
{{ updatedFieldName | snakeCaseToSpaceCase | titlecase }}

This approach would make the template easier to read and maintain, especially if this condition needs to be reused elsewhere in the component.

Also applies to: 30-30


Line range hint 91-97: Consider applying the "Report Name" change to the second condition dropdown.

The changes to replace "Report Title" with "Report Name" have been applied to the first condition dropdown, but not to the second one. This inconsistency might lead to confusion for users.

To maintain consistency throughout the form, consider applying the same changes to the second condition dropdown:

 <ng-template let-option pTemplate="item">
-  {{ option.field_name | snakeCaseToSpaceCase | titlecase }}
+  {{ (option.field_name === 'report_title' ? 'report_name' : option.field_name) | snakeCaseToSpaceCase | titlecase }}
 </ng-template>
 <!-- For selected option -->
 <ng-template let-selectedOption pTemplate="selectedItem">
-  {{ selectedOption.field_name | snakeCaseToSpaceCase | titlecase }}
+  {{ (selectedOption.field_name === 'report_title' ? 'report_name' : selectedOption.field_name) | snakeCaseToSpaceCase | titlecase }}
 </ng-template>

This change will ensure that the terminology is consistent across both condition dropdowns.

src/app/shared/components/configuration/configuration-skip-export/configuration-skip-export.component.html (3)

27-27: LGTM! Consider applying the change consistently.

The change aligns well with the PR objective of updating "Report Title" to "Report Name" in the user interface. This modification enhances clarity for users without affecting the underlying data structure.

For consistency, consider applying this change to other occurrences of 'report_title' in the file, if any exist.


36-36: LGTM! Consider refactoring for DRY principle.

This change correctly updates the selected item display, maintaining consistency with the dropdown options. It ensures that "Report Name" is displayed instead of "Report Title" when selected.

To adhere to the DRY (Don't Repeat Yourself) principle, consider extracting the conditional expression into a custom pipe or a component method. This would centralize the logic and make future updates easier. For example:

@Pipe({
  name: 'fieldNameDisplay'
})
export class FieldNameDisplayPipe implements PipeTransform {
  transform(value: string): string {
    return value === 'report_title' ? 'report_name' : value;
  }
}

Then, in the template:

{{ selectedOption.field_name | fieldNameDisplay | snakeCaseToSpaceCase | titlecase }}

This approach would reduce duplication and make the code more maintainable.


Incomplete Terminology Update Detected

The following occurrences of "report_title" were found and still need to be updated:

  • src/app/shared/components/configuration/configuration-skip-export/configuration-skip-export.component.html:
    • Line 27
    • Line 36

Additionally, "report_title" was found in the following files and may require similar updates:

  • src/stories/ExportLogChildTableDialog.stories.ts
  • src/stories/ExportLogTable.stories.ts
  • src/stories/DashboardExportLogDialog.stories.ts
  • src/stories/DashboardAccountingErrorDialog.stories.ts
  • src/app/shared/components/configuration/configuration-skip-export/configuration-skip-export.component.ts
  • src/app/shared/components/si/helper/skip-export/skip-export.component.html
  • src/app/shared/components/si/helper/skip-export/skip-export.component.ts
  • src/app/core/models/intacct/misc/skip-export.model.ts
  • src/app/core/models/intacct/db/expense.model.ts
  • src/app/core/models/common/advanced-settings.model.ts
  • src/app/integrations/sage300/sage300-shared/fixture.ts
  • src/app/integrations/qbo/qbo.fixture.ts
  • src/app/integrations/business-central/business-central-shared/business-central.fixture.ts

Please ensure all instances are updated to "report_name" for consistency.

🔗 Analysis chain

Line range hint 1-180: Overall, the changes look good. Ensure consistency throughout the file.

The modifications successfully update the terminology from "Report Title" to "Report Name" in the dropdown for both options and selected items. This aligns well with the PR objectives and improves clarity for users.

To ensure complete implementation of the change:

  1. Verify that all occurrences of 'report_title' in this file have been addressed.
  2. Check if similar changes are needed in related components or services.

Run the following script to verify:

Review the results to ensure comprehensive implementation of the terminology update.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any remaining occurrences of 'report_title' in the file
grep -n "report_title" src/app/shared/components/configuration/configuration-skip-export/configuration-skip-export.component.html

# Search for related files that might need similar updates
fd -e ts -e html | xargs grep -l "report_title"

Length of output: 1365

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 6c816be and e03236a.

📒 Files selected for processing (2)
  • src/app/shared/components/configuration/configuration-skip-export/configuration-skip-export.component.html (2 hunks)
  • src/app/shared/components/si/helper/skip-export/skip-export.component.html (1 hunks)
🧰 Additional context used

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

Successfully merging this pull request may close these issues.

2 participants