Skip to content

Commit

Permalink
Remove transaction counts from transaction table
Browse files Browse the repository at this point in the history
  • Loading branch information
seeker25 committed Dec 13, 2024
1 parent 020b4eb commit 42b7b58
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 12 deletions.
6 changes: 3 additions & 3 deletions auth-web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion auth-web/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "auth-web",
"version": "2.6.125",
"version": "2.6.126",
"appName": "Auth Web",
"sbcName": "SBC Common Components",
"private": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export default defineComponent({
const csvErrorDialog: Ref<InstanceType<typeof ModalDialog>> = ref(null)
const csvErrorTextBasic = 'We were unable to process your CSV export. Please try again later.'
const csvErrorTextMaxExceeded = 'You have exceeded the maximum of 60,000 records for your CSV export. Please refine your search and try again.'
const csvErrorTextMaxExceeded = 'You have exceeded the maximum of 100,000 records for your CSV export. Please refine your search and try again.'
const csvErrorDialogText = ref(csvErrorTextBasic)
const { setAccountChangedHandler, beforeDestroy } = useAccountChangeHandler()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
indeterminate
size="20"
/>
<span v-else>({{ transactions.totalResults }})</span>
</h3>
</div>
<BaseVDataTable
Expand All @@ -42,6 +41,7 @@
:setTableDataOptions="tableDataOptions"
:totalItems="transactions.totalResults"
@update-table-options="tableDataOptions = $event"
:disableRowCount="true"
>
<template #header-filter-slot-actions>
<v-btn
Expand Down
9 changes: 8 additions & 1 deletion auth-web/src/components/datatable/BaseVDataTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,12 @@
v-html="noDataText"
/>
</template>

<!-- Override pagination text -->
<template v-if="disableRowCount" v-slot:[`footer.page-text`]>
Page {{ tableDataOptions["page"] }}
</template>

</v-data-table>
</template>

Expand Down Expand Up @@ -189,7 +195,8 @@ export default defineComponent({
useObserver: { type: Boolean, required: false },
observerCallback: { type: Function as PropType<() => Promise<boolean>>, required: false, default: null },
hideFilters: { type: Boolean, default: false },
setExpanded: { default: () => [] as object[] }
setExpanded: { default: () => [] as object[] },
disableRowCount: { type: Boolean, default: false }
},
emits: ['update-table-options'],
setup (props, { emit }) {
Expand Down
5 changes: 2 additions & 3 deletions auth-web/src/composables/transactions-factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ export const useTransactions = () => {
currentOrganization.value.id, transactions.filters, viewAll.value)
if (response?.data) {
transactions.results = response.data.items || []
transactions.totalResults = response.data.total

transactions.totalResults = transactions.results.length * response.data.page + (response.data.hasMore ? 1 : 0)
const transactionClone = [...transactions.results]
const allowedRefundedStatuses = [InvoiceStatus.PAID, InvoiceStatus.REFUNDED, InvoiceStatus.CREDITED]
const allowedPaymentMethods = [PaymentTypes.PAD, PaymentTypes.ONLINE_BANKING]
Expand All @@ -94,7 +93,7 @@ export const useTransactions = () => {
})
if (transactions.results.some((transaction: Transaction) => transaction.refundDate)) {
transactions.results.sort((transaction1: Transaction, transaction2: Transaction) => {
return new Date(transaction2.createdOn).getTime() - new Date(transaction1.createdOn).getTime()
return moment(transaction2.createdOn).valueOf() - moment(transaction1.createdOn).valueOf()
})
}
} else throw new Error('No response from getTransactions')
Expand Down
3 changes: 2 additions & 1 deletion auth-web/src/models/transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export interface TransactionFilter {
paymentMethod?: PaymentTypes,
product?: string,
statusCode?: InvoiceStatus
excludeCount?: boolean
}

export interface TransactionFilterParams {
Expand All @@ -57,7 +58,7 @@ export interface TransactionListResponse {
items: Transaction[]
limit: number
page: number
total: number
hasMore: boolean
}

export interface TransactionState {
Expand Down
2 changes: 1 addition & 1 deletion auth-web/src/services/payment.services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export default class PaymentService {
if (viewAll) params.append('viewAll', `${viewAll}`)

const url = `${ConfigHelper.getPayAPIURL()}/accounts/${accountId}/payments/queries`
return axios.post(url, filterParams.filterPayload, { params })
return axios.post(url, {...filterParams.filterPayload, excludeCounts: true}, { params })
}

static getTransactionReports (accountId: number, filterParams: TransactionFilter): AxiosPromise<any> {
Expand Down

0 comments on commit 42b7b58

Please sign in to comment.