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

Add the ability to extend the list of sortable fields $sortableFields in src/Core/Grid/Query/* final classes #30787

Open
6 tasks done
levyn opened this issue Jan 10, 2023 · 1 comment
Labels
CO Category: Core Customer Component: Which BO section is concerned Feature Type: New Feature Hook Needs Specs Status: issue needs to be specified

Comments

@levyn
Copy link
Contributor

levyn commented Jan 10, 2023

Prerequisites

Is your feature request related to a problem?

There are two hooks
actionOrderGridQueryBuilderModifier
actionOrderGridDefinitionModifier
which can be used to add new columns to the BO lists. In the list of customers or list of orders as example. But there is no sorting option for the added fields and without the ability to expand it. Because the fields are defined by the local variable into the src/Core/Grid/Query/*QueryBuilder.php::applySorting() function. Classes (for example: CustomerQueryBuilder, OrderQueryBuilder) have prefix final so they are closed from decorating or extending.
This means we can add additional fields to the BO lists, but we cannot sort the lists by them.

Describe the solution you'd like

I see two solutions.

  1. Remove final prefix from src/Core/Grid/Query/*QueryBuilder.php classes (for example: src/Core/Grid/Query/CustomerQueryBuilder.php, src/Core/Grid/Query/OrderQueryBuilder.php). This will allow you to decorate or override the class.
  2. Make the local variable $sortableFields in the OrderQueryBuilder::applySorting() function public and add a function to changing fields in it.

Alternatives you've considered

No response

Additional context

No response

Do you plan to work on this feature?

  • I'm willing to contribute a formal specification.
  • I'm willing to provide any wireframes or design assets required for this feature.
  • I'm willing to submit a Pull Request that implements this feature.
  • I'm willing to help verify that the implemented feature works as intended and produces no unintended side effects.
@levyn levyn added Feature Type: New Feature New New issue not yet processed by QA labels Jan 10, 2023
@paulnoelcholot
Copy link

Hello @levyn,

Thank you for your suggestion. The Maintainer Team will take it into consideration for future developments.

Please be aware that there is no guarantee that this feature will be developed anytime soon. If this is important to you, we strongly suggest you consider contacting a professional to help you create it.

If you or anyone else is willing to contribute this feature to the PrestaShop Project, the teams will be happy to help by ensuring that it fits well within the project. Please let us know if that is the case!

Thank you

@paulnoelcholot paulnoelcholot added Needs Specs Status: issue needs to be specified CO Category: Core Customer Component: Which BO section is concerned Hook and removed New New issue not yet processed by QA labels Jan 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CO Category: Core Customer Component: Which BO section is concerned Feature Type: New Feature Hook Needs Specs Status: issue needs to be specified
Projects
None yet
Development

No branches or pull requests

2 participants