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

Add text formatter for accented character display Issue#542 #578

Conversation

cvillarongace
Copy link

Description

A bug was identified where special characters in text fields were not properly handled. This issue was resolved by adding a new format for text fields that can be extended to handle additional characters. The following changes were made:

  1. New Files Added:

    • text-formatter.service.ts: Implements logic for handling and formatting special characters, designed to be extensible.
    • text-formatter.service.spec.mock.ts: Provides mock data and unit tests for the text-formatter.service.ts.
    • New characters may be added in the future, I decided not to incorporate third-party libraries and manage the conversions with a map
  2. Modifications to Existing Files:

    • data-type.formatter.service.ts: Added the TextFormatter to the list of formats, integrating the new functionality into the existing service.
    • filter-field.builder.ts: Fixed an issue where the formatted value was not assigned to text fields. Added the following lines:
      if (field.type == 'text') {
          field.value = formattedValue;
      }

For more details, see GitHub Issue #542.

Motivation and Context

How To Test This

Types of changes

  • [ x] Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Final checklist

  • My code follows the code style of this project found here.
  • My change requires a change to the documentation.
  • [x ] I have read the How to Contribute guidelines.

@SuiteBot
Copy link

SuiteBot commented Dec 4, 2024

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ cvillarongace
❌ Carlos Villaronga


Carlos Villaronga seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@cvillarongace
Copy link
Author

Small issue detected was fixed, another PR was created

@muhammadasim092
Copy link

Small issue detected was fixed, another PR was created

my issue was not solved can you create any logic hook instead of changes on these code file or can you change the field type of description can you share if change the field type to varchar the then it works but the database also changes i donot want to change my db

@cvillarongace
Copy link
Author

Hi @muhammadasim092 as I see it the problem is not in the database, the problem is in applying the correct format in the text fields, for this what I did is add a new type of formatter. In the instructions I set where to add new characters. The ones you mention directly are not in the list. But you can add them yourself in the text-formatter.service.ts file starting from line 37.

By the way, I closed this PR because I found an error in the filters when the field comes null I created a new one #579. #579

@muhammadasim092
Copy link

Hi @muhammadasim092 as I see it the problem is not in the database, the problem is in applying the correct format in the text fields, for this what I did is add a new type of formatter. In the instructions I set where to add new characters. The ones you mention directly are not in the list. But you can add them yourself in the text-formatter.service.ts file starting from line 37.

By the way, I closed this PR because I found an error in the filters when the field comes null I created a new one #579. #579

can you use any type of hook or can you change the type of field just in accounts module ?

@pgorod
Copy link
Contributor

pgorod commented Dec 13, 2024

@muhammadasim092 I think your question is better suited to the Community Forums, not for GitHub.

You seem to be interested in specific concerns for your installation whereas this PR is meant to fix a bug in a generic way for everyone.

https://community.suitecrm.com

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.

4 participants