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

Loader: Implement existing product group picker in Group Products dialog #668

Open
wants to merge 17 commits into
base: develop
Choose a base branch
from

Conversation

BigRoy
Copy link
Collaborator

@BigRoy BigRoy commented Jun 18, 2024

Changelog Description

Implement an "existing product group" picker in Group Products dialog,

image

Additional info

Fixes #648

Testing notes:

  1. Press CTRL+G in loader to get the Group Products dialog
  2. If the current folder has any existing product groups - clicking button right hand side in pop-up should list them for you to easily "put it into that group"
  3. if the current folder has no existing product groups - the button right hand side should be disabled.

@BigRoy BigRoy requested a review from iLLiCiTiT June 18, 2024 20:15
@BigRoy BigRoy added the community Issues and PRs coming from the community members label Jun 18, 2024
@ynbot ynbot added size/XS type: enhancement Improvement of existing functionality or minor addition labels Jun 18, 2024
@BigRoy BigRoy requested a review from iLLiCiTiT June 19, 2024 22:17
@BigRoy BigRoy requested a review from iLLiCiTiT June 20, 2024 18:46
@BigRoy BigRoy assigned BigRoy and unassigned iLLiCiTiT Sep 17, 2024
Comment on lines +53 to +54
self._name_line_edit.set_options(list(sorted(product_groups)))

Copy link
Member

@iLLiCiTiT iLLiCiTiT Sep 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pre-fill group field value based on selection.

Suggested change
self._name_line_edit.set_options(list(sorted(product_groups)))
product_group = ""
if product_groups:
product_group = next(iter(product_groups))
self._name_line_edit.setText(product_group)
self._name_line_edit.set_options(list(sorted(product_groups)))

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The listed product groups are ALL groups under the active folders - not just the groups of the products in your selection. Just so that you can easily move it into another group outside of your selection.

So technically, this would first have to get all the product entities, get their product groups - then from those pick the first entry (or most used entry)...

Copy link
Member

@iLLiCiTiT iLLiCiTiT Sep 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, right now it's prefilled with previous value of the widget. So either we use first, or empty string, or most common, but current behavior is not correct.

Suggested change
self._name_line_edit.set_options(list(sorted(product_groups)))
self._name_line_edit.setText("")
self._name_line_edit.set_options(list(sorted(product_groups)))

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reminder...

Copy link
Contributor

@robin-ynput robin-ynput left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed it works locally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community Issues and PRs coming from the community members size/XS type: enhancement Improvement of existing functionality or minor addition
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Loader: Set Product Group add dropdown for existing product groups
4 participants