Skip to content

Commit

Permalink
fix: add selector for Latest/jump to date
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Schmidt <[email protected]>
  • Loading branch information
Sheng-Long committed Mar 12, 2024
1 parent 7f4c17b commit 739c01c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
4 changes: 3 additions & 1 deletion src/components/DateTimePicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ export default defineComponent({
const handleClosed = () => {
if (props.controller) {
const controller = props.controller
const timestamp = (date.value as Date).getTime() / 1000
// + 60 to account for when users select for a transaction executed
// the minute they selected
const timestamp = (date.value as Date).getTime() / 1000 + 60
controller.onKeyChange(timestamp.toString())
} else {
console.log("Ignoring click because props.controller is undefined")
Expand Down
4 changes: 2 additions & 2 deletions src/components/transaction/TransactionTableControllerXL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ export class TransactionTableControllerXL extends TableController<Transaction, s
//

public constructor(router: Router,
accountId: ComputedRef<string | null>,
pageSize: Ref<number>,
accountId: Ref<string | null>,
pageSize: ComputedRef<number>,
accountIdMandatory: boolean,
pageParamName = "p", keyParamName= "k") {
super(router, pageSize, 10 * pageSize.value, 5000, 10, 100,
Expand Down
19 changes: 16 additions & 3 deletions src/pages/AccountDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,15 @@
</template>
<template v-slot:control>
<div v-if="selectedTab === 'transactions'" class="is-flex is-align-items-flex-end">
<DateTimePicker :controller="transactionTableController"/>
<PlayPauseButton :controller="transactionTableController"/>
<TransactionFilterSelect :controller="transactionTableController"/>
<PlayPauseButton v-if="timeSelection == 'LATEST'" :controller="transactionTableController"/>
<DateTimePicker v-else :controller="transactionTableController"/>
<o-field style="margin-bottom: 0">
<o-select v-model="timeSelection" class="ml-2 h-is-text-size-1">
<option value="LATEST" @click="onLatest">LATEST</option>
<option value="JUMP">JUMP TO DATE</option>
</o-select>
</o-field>
<TransactionFilterSelect :controller="transactionTableController"/>
</div>
<div v-else-if="selectedTab === 'contracts'" class="is-flex is-justify-content-end is-align-items-center">
<PlayPauseButton v-if="!filterVerified" :controller="contractCreateTableController"/>
Expand Down Expand Up @@ -365,6 +371,11 @@ export default defineComponent({
const isMediumScreen = inject('isMediumScreen', true)
const isTouchDevice = inject('isTouchDevice', false)

const timeSelection = ref("LATEST")
function onLatest() {
transactionTableController.startAutoRefresh()
}

//
// account
//
Expand Down Expand Up @@ -485,6 +496,8 @@ export default defineComponent({
tabLabels,
handleTabUpdate,
filterVerified,
timeSelection,
onLatest
}
}
});
Expand Down

0 comments on commit 739c01c

Please sign in to comment.