Skip to content

Conversation

@ncla
Copy link
Contributor

@ncla ncla commented Oct 1, 2022

Closes #4246.

In the first PR, Duncan hid the toggle all button completely if max. selections was only 1. This PR addresses the issue further to handle values larger than 1.

This change will select maximum amount of possible entries, while respecting max. items value. If none is provided, it will toggle all items in the data list page.

As a side mission I was checking out where else this button is utilized, to cover my bases. I found out that uncheckAllItems was being used in HasFilters mixin, which depended on component reference to ToggleAll. When the filters change, the selections are suppose to be cleared. However this reference did not work anymore as the reference was now one level deeper from where HasFilters mixin was being used. I updated this mixin to point to a newly added DataList component reference, which conveniently already had a clearSelections method for clearing selections.

I am not sure if selection clearing when changing filters is relevant anymore, as the changes that broke this are before my times, before I discovered Statamic. Feel free to disregard by removing ref="dataList". I noticed that relationship item selector resources/js/components/inputs/relationship/Selector.vue does not have selection clearing , despite using the same HasFilters mixin. I would update it, but this is outside of the scope of this issue and I don't know if it's even an issue yet.

And I removed allItemsChecked because as far as I could tell it wasn't being used anymore.

@jasonvarga jasonvarga merged commit 7a3cfb7 into statamic:3.3 Nov 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Assets max files bug

2 participants