moqui / SimpleScreens

Simple Screens is a library of screens and screen components (forms, sections, transitions) to be included, extended, or generally reused in applications based on Moqui Framework and Mantle Business Artifacts.
Other
21 stars 61 forks source link

`getProductList` transition duplicates items while searching for exact product id #138

Closed diegonc closed 1 year ago

diegonc commented 1 year ago

Steps to Reproduce

  1. Go to https://demo.moqui.org/qapps/PopcAdmin/Asset/Asset/FindAsset
  2. Click Find Options button
  3. In Product combo-box enter DEMO_1_1

Results

The product with ID DEMO_1_1 is listed twice as is shown in the following screenshot.

image

Causes

My suspicion is that the getProductList transition adds one instance of the DEMO_1_1 product while looking up by id in line below

https://github.com/moqui/SimpleScreens/blob/master/template/product/ProductTransitions.xml#L38

and then when searching through ElasticSearch another instance is added in the loop below

https://github.com/moqui/SimpleScreens/blob/master/template/product/ProductTransitions.xml#L106

jonesde commented 1 year ago

This is intentional behavior, maybe confusing to users, but the design is as you describe and it isn't just a quirk in implementation: if there is an exact ID match then it is always the first item in the list, and other search results are independent of that (which usually means you know it was an exact ID match if the next item in the list, or soon after it, is the same product). Part of the UI design problem is there is not currently any way, especially from the server side, to highlight an item as being different from the others. Before this design, IIRC, it used to only show the exact match if there was an exact match, then it was changed to this approach.

diegonc commented 1 year ago

Ok, thanks for the rationale.