Skip to content

Commit

Permalink
satellite/web/vuetify-poc: make tables consistent
Browse files Browse the repository at this point in the history
This change makes tables in the vuetify app more consistent. Also
clearing search has been fixed for tables whose data would not populate
after search has been cleared.

Issue: #6267

Change-Id: I053d9e5f23662774c60d67a29f814a2c1c3067ed
  • Loading branch information
wilfred-asomanii authored and Storj Robot committed Sep 13, 2023
1 parent f14fabc commit ccb9b7a
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 11 deletions.
Expand Up @@ -25,9 +25,9 @@
:items-length="page.totalCount"
:items-per-page-options="tableSizeOptions(page.totalCount)"
item-value="name"
no-data-text="No results found"
select-strategy="all"
class="elevation-1"
show-select
@update:itemsPerPage="onUpdateLimit"
@update:page="onUpdatePage"
@update:sortBy="onUpdateSortBy"
Expand Down Expand Up @@ -139,7 +139,7 @@ watch(() => search.value, () => {
clearTimeout(searchTimer.value);
searchTimer.value = setTimeout(() => {
agStore.setSearchQuery(search.value);
agStore.setSearchQuery(search.value || '');
fetch();
}, 500); // 500ms delay for every new call.
});
Expand Down
Expand Up @@ -26,7 +26,7 @@
:search="search"
class="elevation-1"
:item-value="(item: BrowserObjectWrapper) => item.browserObject.Key"
show-select
no-data-text="No results found"
hover
must-sort
:loading="isFetching || loading"
Expand Down
Expand Up @@ -26,6 +26,7 @@
:items-length="page.totalCount"
:items-per-page-options="tableSizeOptions(page.totalCount)"
item-value="name"
no-data-text="No results found"
class="elevation-1"
hover
@update:itemsPerPage="onUpdateLimit"
Expand Down Expand Up @@ -292,7 +293,7 @@ watch(() => search.value, () => {
clearTimeout(searchTimer.value);
searchTimer.value = setTimeout(() => {
bucketsStore.setBucketsSearch(search.value);
bucketsStore.setBucketsSearch(search.value || '');
fetchBuckets();
}, 500); // 500ms delay for every new call.
});
Expand Down
Expand Up @@ -17,6 +17,7 @@
:headers="headers"
:items="items"
:search="search"
no-data-text="No results found"
class="elevation-1"
item-key="path"
>
Expand Down
Expand Up @@ -22,10 +22,10 @@
:sort-by="sortBy"
:headers="headers"
:items="projectMembers"
no-data-text="No results found"
:search="search"
class="elevation-1"
item-value="email"
show-select
hover
>
<template #item.name="{ item }">
Expand Down
Expand Up @@ -8,7 +8,13 @@
label="Search"
prepend-inner-icon="mdi-magnify"
single-line
variant="solo-filled"
flat
hide-details
clearable
density="comfortable"
rounded="lg"
class="mx-2 mt-2"
/>
<v-data-table
:sort-by="sortBy"
Expand All @@ -19,6 +25,7 @@
:items-per-page-options="tableSizeOptions(nativePaymentHistoryItems.length)"
:search="search"
:custom-key-sort="customSortFns"
no-data-text="No results found"
class="elevation-1"
>
<template #item.timestamp="{ item }">
Expand Down
Expand Up @@ -8,6 +8,7 @@
:headers="headers"
:items="historyItems"
:must-sort="false"
no-data-text="No results found"
class="elevation-1"
hover
>
Expand Down Expand Up @@ -36,10 +37,7 @@
<div class="v-data-table-footer">
<v-row justify="end" align="center" class="pa-2">
<v-col cols="auto">
<v-btn-group density="compact">
<v-btn :disabled="!historyPage.hasPrevious" icon="mdi-chevron-left" @click="previousClicked" />
<v-btn :disabled="!historyPage.hasNext" icon="mdi-chevron-right" @click="nextClicked" />
</v-btn-group>
<span class="caption">Items per page:</span>
</v-col>
<v-col cols="auto">
<v-select
Expand All @@ -50,6 +48,12 @@
@update:model-value="sizeChanged"
/>
</v-col>
<v-col cols="auto">
<v-btn-group density="compact">
<v-btn :disabled="!historyPage.hasPrevious" icon="mdi-chevron-left" @click="previousClicked" />
<v-btn :disabled="!historyPage.hasNext" icon="mdi-chevron-right" @click="nextClicked" />
</v-btn-group>
</v-col>
</v-row>
</div>
</template>
Expand All @@ -59,15 +63,15 @@

<script setup lang="ts">
import { VBtn, VBtnGroup, VCard, VChip, VCol, VRow, VSelect, VWindowItem } from 'vuetify/components';
import { VBtn, VBtnGroup, VCard, VChip, VCol, VRow, VSelect } from 'vuetify/components';
import { computed, onMounted, ref } from 'vue';
import { VDataTable } from 'vuetify/labs/components';
import { centsToDollars } from '@/utils/strings';
import { useBillingStore } from '@/store/modules/billingStore';
import { useNotify } from '@/utils/hooks';
import { AnalyticsErrorEventSource } from '@/utils/constants/analyticsEventNames';
import { PaymentHistoryPage, PaymentsHistoryItem, PaymentsHistoryItemStatus } from '@/types/payments';
import { PaymentHistoryPage, PaymentsHistoryItem } from '@/types/payments';
import { useLoading } from '@/composables/useLoading';
import { DEFAULT_PAGE_LIMIT } from '@/types/pagination';
Expand Down

0 comments on commit ccb9b7a

Please sign in to comment.