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

Product Editor API: Select field block #40550

Closed
1 task
nathanss opened this issue Oct 2, 2023 · 12 comments · Fixed by #46447
Closed
1 task

Product Editor API: Select field block #40550

nathanss opened this issue Oct 2, 2023 · 12 comments · Fixed by #46447
Assignees
Labels
category: extensibility focus: new product ux revamped product management experience team: Mothra WC Merchants activation and store management

Comments

@nathanss
Copy link
Contributor

nathanss commented Oct 2, 2023

Description

Similar to the woocommerce_wp_select function, we should create a block that provides select field functionality in the new product editor.

It should be able to persist information in the product, both as a regular field and in the meta_data array, using the useProductEntityProp hook.

It should contain at least the following attributes:

  • label (string)
  • property (string)
  • help (string)
  • tooltip (string)
  • options (array): array containing the possible label and values

Tooltip is the only one left.

Acceptance criteria

  • I can use the woocommerce/product-select-field to persist a custom field in the product editor
@github-actions github-actions bot added the status: awaiting triage This is a newly created issue waiting for triage. label Oct 2, 2023
@nathanss nathanss assigned nathanss and unassigned nathanss Oct 2, 2023
@rrennick rrennick added focus: new product ux revamped product management experience team: Mothra WC Merchants activation and store management and removed status: awaiting triage This is a newly created issue waiting for triage. labels Oct 11, 2023
@NTShop
Copy link

NTShop commented Nov 21, 2023

Just saw this, it would be great to have a select field available! That would save a ton of development work creating a custom block just for a basic HTML field.

@NTShop
Copy link

NTShop commented Nov 24, 2023

This field should support multi-select.

@mattsherman
Copy link
Contributor

There have also been requests to support searching and dynamic values (retrieved via API calls, for example).

Moving this back to prioritization until we nail down the requirements!

@NTShop
Copy link

NTShop commented Dec 1, 2023

Somewhat related: What about something similar to how Select2 works, which helps tremendously for very long lists because it allows searching the list by typing into the input field?

@mattsherman mattsherman changed the title Create reusable woocommerce/product-select-field block Template API: Select field Dec 5, 2023
@mattsherman mattsherman changed the title Template API: Select field Template API: Select field block Dec 5, 2023
@mattsherman
Copy link
Contributor

Blocking this for now, as we should first complete the work on the updated select component in #38226.

@mattsherman mattsherman added the status: blocked The issue is blocked from progressing, waiting for another piece of work to be done. label Dec 14, 2023
@helgatheviking
Copy link
Contributor

This field should support multi-select.

💯

There have also been requests to support searching and dynamic values (retrieved via API calls, for example).

:100 personally, i need a product/variation selector very much like Select2 currently works.

@leewillis77
Copy link
Contributor

Just dropping a comment here to log the fact that the lack of a SELECT-style component pretty much blocks us building support for the new Product Editor into at least one of our Woo extensions.

@mattsherman mattsherman removed the status: blocked The issue is blocked from progressing, waiting for another piece of work to be done. label Mar 27, 2024
@mattsherman
Copy link
Contributor

Note that we have a basic select block available now (thanks @mdperez86!):

https://github.com/woocommerce/woocommerce/blob/trunk/packages/js/product-editor/src/blocks/generic/select

We need to take a look at this and see what things still need to be added.

@mattsherman mattsherman changed the title Template API: Select field block Product Editor API: Select field block Mar 27, 2024
@NTShop
Copy link

NTShop commented Mar 27, 2024

@mattsherman - Any chance of having it support Select2 (includes Ajax search), or at least being able to assign a class name to it so we can hook up Select2 ourselves?

@helgatheviking
Copy link
Contributor

@mattsherman this looks like a great start. But to echo @NTShop I think we would also need search and ajax sources... So parity with selectWoo/Select2.

@leewillis77
Copy link
Contributor

@mattsherman That's great - thanks! As others have said selectWoo behaviour and ajax hookup would be nice, but this is a good start

@mattsherman
Copy link
Contributor

Searching/filtering and dynamic sources will definitely be coming in the future. There are some larger architectural pieces that need to be in place first, but we recognize that these are important needs for WooCommerce developers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: extensibility focus: new product ux revamped product management experience team: Mothra WC Merchants activation and store management
Projects
None yet
6 participants