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

EntitySearchInput should be able to be initialized automatically like other PrestaShop components #29252

Open
5 of 6 tasks
jolelievre opened this issue Aug 4, 2022 · 1 comment
Labels
8.0.x Branch CO Category: Core Developer Feature Developer-oriented feature Feature Type: New Feature javascript Pull requests that update Javascript code Needs Specs Status: issue needs to be specified Waiting for PM Status: action required, waiting for product feedback

Comments

@jolelievre
Copy link
Contributor

Prerequisites

Is your feature request related to a problem?

In PS 178 and even in 80 we introduced a EntitySearchInput js component, for now it is always initialised with explicit instanciation in the JS code. To ease the modules developer work this should be doable like other components relying on the initComponents method

Describe the solution you'd like

Here is the expected solution:

  • add an option in the form type automatic_init false by default (naming should be improved)
  • when this option is set we automatically add a dedicated class that can be used as a selector
    in the PrestaShop initComponents we can add a AutomaticEntitySearchInput its role is to select the inputs by class and then loop through each one of them to get their IDs (already automatically created as well)
  • it needs to create a new EntitySearchInput for each element because the JS component was only built to target ONE input so far, and I’m not sure a refacto to handle multiple ones is necessary for now

Alternatives you've considered

Instead of creating a new AutomaticEntitySearchInput component which would only be used for the initComponents method, we can do a small refacto of EntitySearchInput :

  • the first parameter which is a selector would be nullable
  • if it's undefined/null then we use a default class selector as a fallback
  • we refacto the initialization part a bit so that it can handle selector for single and/or multiple elements

We'll need to think about how this automatic initialization is handled in the form type, should it be the default behaviour (then we should modify all the current uses) or should the automatic initialization be activated manually (thus it won't impact the current use cases).

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.
@jolelievre jolelievre added Feature Type: New Feature New New issue not yet processed by QA Developer Feature Developer-oriented feature Ready Status: Issue is ready to be worked on 8.0.x Branch labels Aug 4, 2022
@AureRita
Copy link
Contributor

AureRita commented Aug 4, 2022

Hi @jolelievre ,

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.
We're waiting for your PR 🚀

Thank you

@AureRita AureRita added Waiting for PM Status: action required, waiting for product feedback CO Category: Core Needs Specs Status: issue needs to be specified javascript Pull requests that update Javascript code and removed Ready Status: Issue is ready to be worked on New New issue not yet processed by QA labels Aug 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.0.x Branch CO Category: Core Developer Feature Developer-oriented feature Feature Type: New Feature javascript Pull requests that update Javascript code Needs Specs Status: issue needs to be specified Waiting for PM Status: action required, waiting for product feedback
Projects
None yet
Development

No branches or pull requests

2 participants