Shopify / shopify-app-bridge

https://shopify.dev/docs/api/app-bridge
85 stars 9 forks source link

ResourcePicker showDraft is not working #161

Open ericute opened 1 year ago

ericute commented 1 year ago

Describe the bug

I am using the Resource Picker to display products on a page. I do not want to display products with draft status so I set the showDraft flag to false. However, Draft products are still showing up.

<ResourcePicker
    resourceType="Product"
    open={isProductPickerOpen}
    showVariants
    showDraft="false"
/>

Here's what was shown in the Resource Picker: image

The No Image product shouldn't show up since it is on Draft status. image

To Reproduce

Steps to reproduce the behaviour:

  1. On a page, add the ResourcePicker snippet similar to what I put in the Describe the bug section.
  2. Save it and refresh the page so it would show up.
  3. Open the resource picker.

If applicable, add screenshots to help explain your problem.

Expected behaviour

Products with draft status should not show up.

Contextual information

Packages and versions

List the relevant packages you’re using, and their versions. For example:

Platform

Additional context

Add any other context about the problem here, such as your app’s configuration (Node, Next.js, Rails).

danbete commented 1 year ago

Still not working in the latest version...

LHongy commented 11 months ago

I have the same problem on the new remix app template, any help please?

cyberwombat commented 11 months ago

On a perhaps related note showVariants: false does show all the variants in the drop down. But when I look at typescript types they are different. I think the docs may be wrong. These are the types:

 filter?: {
        hidden?: boolean;
        variants?: boolean;
        draft?: boolean | undefined;
        archived?: boolean | undefined;
    };

And with filter.variants:false it now works. Perhaps drafts as well. Evidently the docs for the Component is what I saw.