Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0052402
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[POS2] CoreminorN/A2023-05-09 19:402023-06-29 15:57
Reportergorka_gilView Statuspublic 
Assigned Tomeriem_azaf 
PriorityhighResolutionfixedFixed in Version23Q4
StatusclosedFix in branchFixed in SCM revision
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned To
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0052402: WrapTextParams: not working with $ symbol and when the name of the params appears more than once

DescriptionWrapTextParams makes parameters of a message to transfrom into a span that can be set css styles.

but it firsts reemplace the parameters and then replace the params with the html span components

In this example label:
'a %1 b %2 c'

Problem 1:
%1 = $ -> it doesn't create the span because the regex don't recognize it since the $ it has meaning in regex
Example:
Message: "You are going to deposit $8 in USA Cash"
Parameters: ['$8', 'USA Cash']
Expected: "You are going to deposit <span>$8</span> in <span>USA Cash</span>"
Received: "You are going to deposit $8 in <span>USA Cash</span>"

Problem 2:
%2 = c -> it gives an error in console because it setting the same span in two ocassions, since the c value exists so try to create 2 spans for it instead one.
Example:
Parameter: "Cash"
Message: "You are going to add Cash with Cashier shift event."
Expected: "You are going to add [[Cash]] with Cashier shift event."
Received: "You are going to add [[Cash]] with [[Cash]]ier shift event."
Steps To Reproduce- Login in POS2
- Open Cash Management option in the menu
- Do a New Deposit in Cash of 10 with "Other Cash Deposit"
- Check the error in the console log (check attached screenshot)
- Do a New Deposit in USA Cash of 5 with any event
- Check that the confirm popup is highlighting "deposit" word instead of "$8"
TagsNo tags attached.
Attached Filespng file icon Screenshot from 2023-05-09 11-28-28.png [^] (108,664 bytes) 2023-05-10 12:11


diff file icon WarningFix.diff [^] (895 bytes) 2023-05-10 13:21 [Show Content]

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0149561)
migueldejuana (developer)
2023-05-10 13:35

See attached "WarningFix.diff" file to fix Problem 2. Changes done:

- Replace transformedLabel only the FIRST match labelParam instead of ALL matches
- Order labelParams by length descendent to replace first long params that could have in other params. Doing this, we avoid replacing a param with a word inside anothe param --> "Other Cash Deposit" and "Cash"
(0151495)
hgbot (developer)
2023-06-22 12:18

Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.core2/-/merge_requests/1149 [^]
(0151864)
hgbot (developer)
2023-06-29 15:57

Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.core2/-/merge_requests/1149 [^]
(0151865)
hgbot (developer)
2023-06-29 15:57

Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.core2 [^]
Changeset: 10273a72687dc8fc4ab384c24ae943345726ab7a
Author: Meriem Azaf <meriem.azaf@openbravo.com>
Date: 29-06-2023 15:56:44
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.core2/-/commit/10273a72687dc8fc4ab384c24ae943345726ab7a [^]

Fixes ISSUE-52402: WrapTextParams: not working with $ symbol and when the name of the params appears more than once

WrapTextParams makes parameters of a message to transfrom into a span that can be set css styles, but it firsts replace the parameters and then replace the params with the html span components.

The problem was in the regex expression so we added a regex expression that will escape regex special caracters that we have in our parametrs.

---
M web-jspack/org.openbravo.core2/src/components/Translate/Translate.jsx
M web-jspack/org.openbravo.core2/src/components/Translate/__test__/Translate.test.jsx
M web-jspack/org.openbravo.core2/src/components/Translate/__test__/TranslateLabels.test.json
M web-jspack/org.openbravo.core2/src/core/I18N.js
M web-jspack/org.openbravo.core2/src/core/__test__/I18N.test.js
M web-jspack/org.openbravo.core2/src/core/useLabel.js
---

- Issue History
Date Modified Username Field Change
2023-05-09 19:40 gorka_gil New Issue
2023-05-09 19:40 gorka_gil Assigned To => Triage Platform Base
2023-05-09 19:40 gorka_gil Triggers an Emergency Pack => No
2023-05-10 08:38 migueldejuana Description Updated View Revisions
2023-05-10 12:10 migueldejuana Description Updated View Revisions
2023-05-10 12:10 migueldejuana Steps to Reproduce Updated View Revisions
2023-05-10 12:11 migueldejuana File Added: Screenshot from 2023-05-09 11-28-28.png
2023-05-10 12:19 migueldejuana Steps to Reproduce Updated View Revisions
2023-05-10 12:20 migueldejuana Steps to Reproduce Updated View Revisions
2023-05-10 13:21 migueldejuana File Added: WarningFix.diff
2023-05-10 13:35 migueldejuana Note Added: 0149561
2023-06-21 11:21 AugustoMauch Assigned To Triage Platform Base => meriem_azaf
2023-06-22 12:18 hgbot Note Added: 0151495
2023-06-22 14:04 AugustoMauch Status new => scheduled
2023-06-29 15:57 hgbot Note Added: 0151864
2023-06-29 15:57 hgbot Resolution open => fixed
2023-06-29 15:57 hgbot Status scheduled => closed
2023-06-29 15:57 hgbot Fixed in Version => 23Q4
2023-06-29 15:57 hgbot Note Added: 0151865


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker