Openbravo Issue Tracking System - POS2
View Issue Details
0053741POS2POSpublic2023-10-23 15:372024-01-02 17:53
igor_trebol 
cberner 
normalmajoralways
closedfixed 
5
 
24Q1 
approved
No
No
0053741: Opening a popover with a BaseFormRadioGroup from TicketPopover does not catch the event to change the radio button selected
The event does not get launched if the popover is opened through TicketPopover.

It should be caught in TicketLineDeliveryModePopover.jsx line 102 ->

onChange={event => {
    setSelectedMode(event.target.value);
}}

But if the popover is opened through TicketLinePopover, it works.

Created branch for testing: https://gitlab.com/openbravo/devel/pmods/org.openbravo.pos2/-/tree/fix/53610_eventTest?ref_type=heads [^]
To reproduce it, you can just copy this :

 {
      "id": "SetLineDeliveryMode",
      "component": "OBPOS2_TicketLineDeliveryModeButton",
      "layout": {
        "rowStart": 4,
        "colStart": 1,
        "rowSpan": 1,
        "colSpan": 2
      },
      "properties": {
        "variantClass": "obpos2TicketLinePopover-multiLineButton",
        "label": "$OBRDM_DeliveryMode",
        "icon": "obc2IconDelivery",
        "testId": "obpos2TicketLinePopover-setLineDeliveryModeButton",
        "payload": {}
      }
    }

in the TicketPopover.config.json .

Open the popover with the 'Delivery Modes' button in multi-line selection, from the three dots menu. See gif.
No tags attached.
gif Events.gif (1,513,355) 2023-10-23 15:37
https://issues.openbravo.com/file_download.php?file_id=19082&type=bug
Issue History
2023-10-23 15:37igor_trebolNew Issue
2023-10-23 15:37igor_trebolAssigned To => AugustoMauch
2023-10-23 15:37igor_trebolFile Added: Events.gif
2023-10-23 15:37igor_trebolOBNetwork customer => No
2023-10-23 15:37igor_trebolTriggers an Emergency Pack => No
2023-12-21 10:01meriem_azafSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=27256#r27256
2023-12-29 11:26cbernerAssigned ToAugustoMauch => cberner
2023-12-29 11:32hgbotMerge Request Status => open
2023-12-29 11:32hgbotNote Added: 0158723
2024-01-02 17:53hgbotMerge Request Statusopen => approved
2024-01-02 17:53hgbotResolutionopen => fixed
2024-01-02 17:53hgbotStatusnew => closed
2024-01-02 17:53hgbotFixed in Version => 24Q1
2024-01-02 17:53hgbotNote Added: 0158777
2024-01-02 17:53hgbotNote Added: 0158778

Notes
(0158723)
hgbot   
2023-12-29 11:32   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/merge_requests/2316 [^]
(0158777)
hgbot   
2024-01-02 17:53   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2 [^]
Changeset: 0426ff38db0a031040c81d484d40dbeed34a523d
Author: Cristian Berner <cristian.berner@openbravo.com>
Date: 02-01-2024 11:45:14
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/commit/0426ff38db0a031040c81d484d40dbeed34a523d [^]

Fixes ISSUE-53741: Opening a popover from TicketPopover with radio buttons does not change on clicking the radio buttons

This particular case was due to how we created the TicketPopover, it was
declared as a component of the header, which resulted in some click
events being sent to the parent components of the header, one of those
might be stopping the event propagations and resulting in radiobuttons
and checkboxes not being selectable, due to the onChange event not being
triggered.

To fix this, I changed this component to be a global component, the same
as TicketLinePopover, by doing this the clicks are only handled by the
popover, and not sent back to the parent components, anchorEl still
works as expected and the component behaves properly in all scenarios.

Tests and stories have also been modified to work with this new
behaviour.

---
A web-jspack/org.openbravo.pos2/src/model/user-interface/actions/ShowLinesPopover.js
M web-jspack/org.openbravo.pos2/src/components/Ticket/TicketLines/TicketLinesHeader.jsx
M web-jspack/org.openbravo.pos2/src/components/Ticket/TicketLines/__test__/TicketLinesHeader.test.jsx
M web-jspack/org.openbravo.pos2/src/components/Ticket/TicketPopover/TicketPopover.jsx
M web-jspack/org.openbravo.pos2/src/components/Ticket/TicketPopover/__test__/TicketPopover.test.jsx
M web-jspack/org.openbravo.pos2/src/components/Ticket/TicketPopover/stories/TicketPopover.stories.jsx
M web-jspack/org.openbravo.pos2/src/model/user-interface/UIExtension.js
M web-jspack/org.openbravo.pos2/src/ob-init.js
---
(0158778)
hgbot   
2024-01-02 17:53   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/merge_requests/2316 [^]