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

fix(files): File type filter UI sync with filter state #49259

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

susnux
Copy link
Contributor

@susnux susnux commented Nov 13, 2024

Summary

When changing the folder the filter will be re-mounted by the file list, so we need to pass the current state of the filter to the filter UI.

Checklist

When changing the folder the filter will be re-mounted by the file list,
so we need to pass the current state of the filter to the filter UI.

Signed-off-by: Ferdinand Thiessen <[email protected]>
@susnux susnux added this to the Nextcloud 31 milestone Nov 13, 2024
@susnux susnux requested review from a team and removed request for a team November 13, 2024 16:02
@susnux susnux self-assigned this Nov 13, 2024
@susnux
Copy link
Contributor Author

susnux commented Nov 13, 2024

/backport to stable30

@susnux susnux requested a review from Pytal November 13, 2024 16:03
@susnux
Copy link
Contributor Author

susnux commented Nov 13, 2024

/compile

Signed-off-by: nextcloud-command <[email protected]>
@@ -45,6 +45,10 @@ export default defineComponent({
},

props: {
preset: {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
preset: {
presets: {

We should use either singular or plural everywhere to minimize confusion

@@ -142,7 +145,8 @@ class TypeFilter extends FileListFilter {
}

public setPreset(presets?: ITypePreset[]) {
this.currentPresets = presets
this.currentPresets = presets ?? []
this.currentInstance!.$props.preset = presets
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
this.currentInstance!.$props.preset = presets
this.currentInstance!.$props.preset = presets ?? []

The proptype is an array so we could do this and remove the || [] in FileListFilterType?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Filter does not survive the change to a subdirectory
3 participants