Skip to content

Commit

Permalink
loadLazyData on keychange
Browse files Browse the repository at this point in the history
  • Loading branch information
TimCsaky committed Feb 27, 2024
1 parent 587361b commit 82359bc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
10 changes: 0 additions & 10 deletions frontend/src/components/object/ObjectFilters.vue
Original file line number Diff line number Diff line change
Expand Up @@ -115,16 +115,6 @@ const selectedFilterValuesChanged = () => {
const tagSetToSearch: Array<Tag> = selectedTags.value.map(({ ...tag }: any) => tag);
emit('selectedFilters', { metaToSearch, tagSetToSearch });
// Search the object store with the tagset as a param and metadata as headers
objectStore.fetchObjects(
{
bucketId: props.bucketId,
bucketPerms: true,
permCode: Permissions.READ,
userId: getUserId.value
},
tagSetToSearch,
metaToSearch
);
};
const searchMetadata = async () => {
Expand Down
8 changes: 5 additions & 3 deletions frontend/src/components/object/ObjectTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ const loadLazyData = (event?: any) => {
deleteMarker: false,
latest: true,
page: lazyParams.value?.page ? ++lazyParams.value.page : 1,
name: lazyParams.value?.filters?.name.value,
name: lazyParams.value?.filters?.name.value ? lazyParams.value?.filters?.name.value : undefined,
limit: lazyParams.value.rows,
sort: lazyParams.value.sortField,
order: lazyParams.value.sortOrder === 1 ? 'asc' : 'desc',
Expand Down Expand Up @@ -170,6 +170,7 @@ const selectedFilters = (payload: any) => {
return r;
}, {});
lazyParams.value.filters = filters;
loadLazyData();
};
</script>

Expand All @@ -187,8 +188,8 @@ const selectedFilters = (payload: any) => {
data-key="id"
class="p-datatable-sm"
responsive-layout="scroll"
:rows="10"
:rows-per-page-options="[10, 20, 50]"
:rows="3"
:rows-per-page-options="[3, 20, 50]"
sort-field="updatedAt"
:sort-order="-1"
:global-filter-fields="['name']"
Expand All @@ -212,6 +213,7 @@ const selectedFilters = (payload: any) => {
v-model="filters.name.value"
class="searchInput"
placeholder="Search File Names"
@keyup.enter="loadLazyData"
/>
<Button
v-show="filters.name.value !== undefined"
Expand Down

0 comments on commit 82359bc

Please sign in to comment.