vtex / shoreline

VTEX Design System for back-office experiences. Currently available for internal usage at VTEX.
https://shoreline.vtex.com
24 stars 1 forks source link

[collection] Render button to action in error and empty status even if you have not received an action #1652

Closed lafray closed 3 months ago

lafray commented 3 months ago

Summary

In the current implementation of CollectionView, the action button for the status empty and error status is allways rendered, even if you have not received an action for the corresponding status. The functions for 'Error and notEmpty are not mandatory, therefore, if the status is one of these values ​​and its function was not passed, a button that does nothing is rendered. I also think it is important to consider that there are scenarios in which there are no actions available. An example is the Meli integration promotions center, which currently has nothing that can be done as we only support integrations created by mel

Expected behavior

It is expected that if you did not receive a function for the action of that status, the button will not be rendered in that status

Current behavior

Empty and error status are rendered with button that does nothing

Reproducible Example

The Shoreline storybook itself has buttons that do nothing in these status

Suggested solution

No response

Additional context

No response

Package

@vtex/shoreline

Packages version

No response

Browser

No response

Package Manager

pnpm

matheusps commented 3 months ago

So, actions would only appear if onError or onEmpty are passed. Right?