Openbravo Issue Tracking System - POS2
View Issue Details
0052435POS2Corepublic2023-05-12 10:572023-05-30 09:19
AugustoMauch 
AugustoMauch 
normalmajorhave not tried
closedfixed 
5
 
23Q3 
No
0052435: When a grid has selected records and is sorted, different records are then selected
Currently we store the selected records in a grid using their position in the grid as key. When that grid is resorted, those selected records might occupy different positions, but after sorting those records might no longer be selected, the new selected records will be the ones that now occupy the positions the selected records used to occupy. See attached image.
- Apply the attached patch.
- Open storybook, select the Grid -> Sorting -> Order by column definition story
- Select the first record, then click on the First name header to resort the grid. Notice that the original record is no longer selected, but the record that now occupies the first position is.
No tags attached.
causes defect 005349824Q2 closed AugustoMauch Add and remove service associations does not allow selecting lines 
gif SortingWithSelection.gif (186,091) 2023-05-12 10:57
https://issues.openbravo.com/file_download.php?file_id=18524&type=bug
gif

diff sortableMultipleSelection.diff (1,950) 2023-05-12 11:04
https://issues.openbravo.com/file_download.php?file_id=18525&type=bug
Issue History
2023-05-12 10:57AugustoMauchNew Issue
2023-05-12 10:57AugustoMauchAssigned To => AugustoMauch
2023-05-12 10:57AugustoMauchFile Added: SortingWithSelection.gif
2023-05-12 10:57AugustoMauchTriggers an Emergency Pack => No
2023-05-12 10:57AugustoMauchStatusnew => scheduled
2023-05-12 11:04AugustoMauchFile Added: sortableMultipleSelection.diff
2023-05-15 12:10hgbotNote Added: 0149695
2023-05-15 12:13hgbotNote Added: 0149696
2023-05-15 12:14hgbotNote Added: 0149697
2023-05-30 04:38hgbotNote Added: 0150442
2023-05-30 04:38hgbotNote Added: 0150443
2023-05-30 04:38hgbotNote Added: 0150444
2023-05-30 04:38hgbotNote Added: 0150445
2023-05-30 04:38hgbotResolutionopen => fixed
2023-05-30 04:38hgbotStatusscheduled => closed
2023-05-30 04:38hgbotFixed in Version => 23Q3
2023-05-30 04:38hgbotNote Added: 0150446
2023-05-30 04:38hgbotNote Added: 0150447
2023-05-30 04:38hgbotNote Added: 0150448
2023-05-30 09:19hgbotNote Added: 0150464
2023-12-14 07:21sreehariRelationship addedcauses 0053498

Notes
(0149695)
hgbot   
2023-05-15 12:10   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.core2/-/merge_requests/1098 [^]
(0149696)
hgbot   
2023-05-15 12:13   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/merge_requests/1791 [^]
(0149697)
hgbot   
2023-05-15 12:14   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2.product.label.printing/-/merge_requests/21 [^]
(0150442)
hgbot   
2023-05-30 04:38   
Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2.product.label.printing [^]
Changeset: ea8e6d4b9903223d48867e65570382e8299cd2f8
Author: Augusto Mauch <augusto.mauch@openbravo.com>
Date: 15-05-2023 12:13:23
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2.product.label.printing/-/commit/ea8e6d4b9903223d48867e65570382e8299cd2f8 [^]

Related ISSUE-52435: Adapts to API change: ids are used as keys in selected records of grid

---
M web-jspack/org.openbravo.pos2.product.label.printing/src/components/PrintProductLabel/PrintProductLabelSelectProdStep/PrintProductLabelProductListGrid/PrintProductLabelProductListGrid.jsx
---
(0150443)
hgbot   
2023-05-30 04:38   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2.product.label.printing/-/merge_requests/21 [^]
(0150444)
hgbot   
2023-05-30 04:38   
Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2 [^]
Changeset: 909d630fab95d3b510be098b525c494880b195a2
Author: Augusto Mauch <augusto.mauch@openbravo.com>
Date: 29-05-2023 13:36:42
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/commit/909d630fab95d3b510be098b525c494880b195a2 [^]

Related ISSUE-52435: Adapts to API change: ids are used as keys in selected records of grid

---
M web-jspack/org.openbravo.pos2/src/components/Cashup/CashupSteps/CountDisplay/CountDisplay.jsx
M web-jspack/org.openbravo.pos2/src/components/Cashup/CashupSteps/SelectCashToKeepStep/SelectCashToKeepStep.jsx
M web-jspack/org.openbravo.pos2/src/components/Cashup/CountingToolDialog/CountingTool/CountingTool.jsx
---
(0150445)
hgbot   
2023-05-30 04:38   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/merge_requests/1791 [^]
(0150446)
hgbot   
2023-05-30 04:38   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.core2 [^]
Changeset: b1b36743cb98217957f2bc92ba97d66c2292935e
Author: Augusto Mauch <augusto.mauch@openbravo.com>
Date: 29-05-2023 14:37:32
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.core2/-/commit/b1b36743cb98217957f2bc92ba97d66c2292935e [^]

Fixes ISSUE-52435: Sorting a grid with selected records works now

The problem was that the object we use to maintain the list of selected records was using the index of the record in the moment
when it was selected as key. If the grid was then resorted, instead of the originally selected records being selected, the new
records that now occupy their positions will be.

To fix this problem, the object that keeps track of the selection will use as keys the ids of the selected rows

---
M web-jspack/org.openbravo.core2/src/components/Grid/DataGrid/BaseRowRender.jsx
M web-jspack/org.openbravo.core2/src/components/Grid/DataGrid/DataGrid.jsx
M web-jspack/org.openbravo.core2/src/components/Grid/DataGrid/SelectionFunctions.js
M web-jspack/org.openbravo.core2/src/components/Grid/DataGrid/SelectionModel.js
M web-jspack/org.openbravo.core2/src/components/Grid/DataGrid/__test__/SelectionFunctions.test.js
M web-jspack/org.openbravo.core2/src/components/Grid/DataGrid/__test__/SelectionModel.test.js
---
(0150447)
hgbot   
2023-05-30 04:38   
Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.core2 [^]
Changeset: 6f34cce01df65e4f95cbadf988ea19c1903710fa
Author: Augusto Mauch <augusto.mauch@openbravo.com>
Date: 29-05-2023 14:37:32
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.core2/-/commit/6f34cce01df65e4f95cbadf988ea19c1903710fa [^]

Related to ISSUE-52435: No to pass whole row on selection, as rowId might not be enough if grid is reordered

---
M web-jspack/org.openbravo.core2/src/components/Grid/DataGrid/DataGrid.jsx
M web-jspack/org.openbravo.core2/src/components/Grid/DataGrid/SelectionModel.js
M web-jspack/org.openbravo.core2/src/components/Grid/DataGrid/__test__/SelectionModel.test.js
M web-jspack/org.openbravo.core2/src/components/Grid/createDetailsGrid.jsx
---
(0150448)
hgbot   
2023-05-30 04:38   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.core2/-/merge_requests/1098 [^]
(0150464)
hgbot   
2023-05-30 09:19   
Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.core2 [^]
Changeset: 29a811ddf60910eba9d90b16ed4c9a5219c145e3
Author: Augusto Mauch <augusto.mauch@openbravo.com>
Date: 30-05-2023 09:19:11
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.core2/-/commit/29a811ddf60910eba9d90b16ed4c9a5219c145e3 [^]

Related to ISSUE-52435: Fixes DataGrid.test.jsx, includes ids in rows

---
M web-jspack/org.openbravo.core2/src/components/Grid/DataGrid/__test__/DataGrid.test.jsx
---