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

ManagementToolbar ActionItems show if an empty array is passed #1178

Closed
jbalsas opened this issue Sep 11, 2018 · 3 comments
Closed

ManagementToolbar ActionItems show if an empty array is passed #1178

jbalsas opened this issue Sep 11, 2018 · 3 comments
Labels
status: next-release Issues that will enter into the next release type: bug Issues reporting that Component is not doing what should be done

Comments

@jbalsas
Copy link
Contributor

jbalsas commented Sep 11, 2018

In the management toolbar, if an empty array is passed as actionItems, an empty dropdown is shown. Would it be possible to control this case?

ManagementToolbar.STATE = {
    [...]
    actionItems: actionItemsValidator.value([]),
    [...]
};

screen shot 2018-09-11 at 13 22 21

@jbalsas jbalsas added the type: bug Issues reporting that Component is not doing what should be done label Sep 11, 2018
brianchandotcom pushed a commit to brianchandotcom/liferay-portal that referenced this issue Sep 11, 2018
@matuzalemsteles
Copy link
Member

hey @jbalsas, we can control this, in that when the array is empty the Dropdown will not appear or we can disable it. We have to check this behavior with Lexicon.

@jbalsas
Copy link
Contributor Author

jbalsas commented Sep 12, 2018

Hey @matuzalemsteles, this is the expected Lexicon behaviour.

The problem right now is more of an issue in our implementation. As it is, actionItems=null and actionItems=[] have different behaviours. In fact, it would make the component more robust if actionItems default value was [] instead of to null, so we wouldn't need to check for actionItems !== null all the time when doing operations.

My expectation is that both should be equivalente in behaviour :)

matuzalemsteles added a commit to matuzalemsteles/clay that referenced this issue Sep 12, 2018
matuzalemsteles added a commit to matuzalemsteles/clay that referenced this issue Sep 12, 2018
@matuzalemsteles
Copy link
Member

hey @jbalsas, send a correction to fixed this in ManagementToolbar but I will create another issue to analyze the other components that also reproduce the same behavior.

matuzalemsteles added a commit to matuzalemsteles/clay that referenced this issue Sep 12, 2018
matuzalemsteles added a commit to matuzalemsteles/clay that referenced this issue Sep 12, 2018
matuzalemsteles added a commit to matuzalemsteles/clay that referenced this issue Sep 17, 2018
matuzalemsteles added a commit to matuzalemsteles/clay that referenced this issue Sep 17, 2018
matuzalemsteles added a commit to matuzalemsteles/clay that referenced this issue Sep 17, 2018
carloslancha added a commit that referenced this issue Sep 18, 2018
Change the default value of actionItems to [] | Fixes #1178
@carloslancha carloslancha added the status: next-release Issues that will enter into the next release label Sep 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: next-release Issues that will enter into the next release type: bug Issues reporting that Component is not doing what should be done
Projects
None yet
Development

No branches or pull requests

3 participants