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

Products not sorted alphabetically within OC edit/create page #4845

Closed
RachL opened this issue Feb 25, 2020 · 2 comments
Closed

Products not sorted alphabetically within OC edit/create page #4845

RachL opened this issue Feb 25, 2020 · 2 comments
Assignees
Labels
bug-s3 The bug is stopping a critical or non-critical feature but there is a usable workaround. hackathon Issues for upcoming hackathons

Comments

@RachL
Copy link
Contributor

RachL commented Feb 25, 2020

Description

As part of #4454 (comment) we introduced alphabetical ordering of products in OC admin page. However this is not working anymore.

There is no actual workaround except doing a search within the page.

Steps to Reproduce

  1. Create or edit an OC for hub 922 in French prod or use Mercia Food hub in UK staging (ID 201002)
  2. Observe ordering of product in both incoming and outgoing steps

Animated Gif/Screenshot

image

Severity

bug-s3: a feature is broken but there is a workaround

Your Environment

  • Version used: v2.7.6
  • Browser name and version: Firefox 73
  • Operating System and version (desktop or mobile): Desktop
@RachL RachL added the bug-s3 The bug is stopping a critical or non-critical feature but there is a usable workaround. label Feb 25, 2020
@RachL RachL changed the title Product not ordered alphabetically within OC edition/creation page Products not ordered alphabetically within OC edition/creation page Feb 25, 2020
@luisramos0
Copy link
Contributor

ok, I can explain the regression!
First of all, we dont have auto tests to verify alpha ordering, a MUST have for this issue here so this doesnt happen again...

Alpha ordering was introduced in #4454 merged on Nov 27th.
But after this we had all the work in the OC edit page coming in #4455 merged Dec 17th. From 4455 we started fetching the products from a completely different place (pagination!). Not ordered.

In this issue we can remove unnecessary product order from EnterpriseSerializer and add it where it is needed: ExchangeProductsRenderer: here for incoming and here for outgoing, or maybe here for both cases.

Good first issue only if the dev knows how to build ActiveRecord queries already.
It will be as simple as adding something like relation.order(:name) or relation.order("spree_products.name") in the correct place. And then test it in the ExchangeProductsRenderer spec.

@kirstenalarsen kirstenalarsen added the AU Selected to be done by the Australian active instance label Apr 6, 2020
@sigmundpetersen sigmundpetersen changed the title Products not ordered alphabetically within OC edition/creation page Products not ordered alphabetically within OC edit/create page Apr 17, 2020
@kirstenalarsen kirstenalarsen removed the AU Selected to be done by the Australian active instance label Jul 7, 2020
@sigmundpetersen sigmundpetersen changed the title Products not ordered alphabetically within OC edit/create page Products not sorted alphabetically within OC edit/create page Sep 9, 2020
@RachL RachL added the hackathon Issues for upcoming hackathons label Sep 25, 2020
@yihyang
Copy link
Contributor

yihyang commented Oct 29, 2020

Hi there, I have created a new PR #6268 based on @luisramos0 's comment. Please let me know if there are things that needs to be updated, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-s3 The bug is stopping a critical or non-critical feature but there is a usable workaround. hackathon Issues for upcoming hackathons
Projects
None yet
Development

No branches or pull requests

5 participants