Skip to content

Commit

Permalink
Merge pull request #18395 from davelopez/24.1_fix_filesources_subfold…
Browse files Browse the repository at this point in the history
…er_pagination

[24.1] Reset current page when browsing sub-folders in FilesSources
  • Loading branch information
bgruening authored Jun 14, 2024
2 parents ab533b6 + 03001d4 commit f2de606
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions client/src/components/FilesDialog/FilesDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,7 @@ onMounted(() => {
:is-busy="isBusy"
:items="items"
:items-provider="itemsProvider"
:provider-url="currentDirectory?.url"
:total-items="totalItems"
:modal-show="modalShow"
:modal-static="modalStatic"
Expand Down
12 changes: 12 additions & 0 deletions client/src/components/SelectionDialog/SelectionDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ interface Props {
isEncoded?: boolean;
items?: SelectionItem[];
itemsProvider?: ItemsProvider;
providerUrl?: string;
totalItems?: number;
leafIcon?: string;
modalShow?: boolean;
Expand All @@ -48,6 +49,7 @@ const props = withDefaults(defineProps<Props>(), {
isEncoded: false,
items: () => [],
itemsProvider: undefined,
providerUrl: undefined,
totalItems: 0,
leafIcon: "fa fa-file-o",
modalShow: true,
Expand Down Expand Up @@ -127,6 +129,16 @@ watch(
filtered(props.items);
}
);
watch(
() => props.providerUrl,
() => {
// We need to reset the current page when drilling down sub-folders
if (props.itemsProvider !== undefined) {
currentPage.value = 1;
}
}
);
</script>

<template>
Expand Down

0 comments on commit f2de606

Please sign in to comment.