Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

00133 going back #247

Merged
merged 40 commits into from
Oct 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
0065d35
Added TableControllerV3 and associated classes (to be used later).
ericleponner Sep 23, 2022
cad5ac9
Updated EntityBatchLoader.loadNext() to avoid ts lint warning.
ericleponner Sep 26, 2022
821d6f8
Fixed TableSubController.headLoad() and lastLoad().
ericleponner Sep 26, 2022
19da2a6
Fixed AutoRefreshSubController.xxxLoadDidComplete().
ericleponner Sep 26, 2022
d2b7242
Removed debug trace from TableControllerV3.mountDidChange().
ericleponner Sep 26, 2022
22054b2
TopicDetails.vue is now based on TableControllerV3.
ericleponner Sep 26, 2022
35a1ab0
Fixed TableControllerV3.totalRowCount.
ericleponner Sep 26, 2022
75e865a
Fixed PaginationSubController.gotoPage.
ericleponner Sep 26, 2022
fd80749
Fixed PaginationSubController.gotoPage (take #2).
ericleponner Sep 26, 2022
01b00e8
Added pageParamName and keyParamName to TableControllerV3.
ericleponner Sep 26, 2022
8b0ed05
Added take #1 of TableControllerV3 unit test.
ericleponner Sep 27, 2022
7cddcd2
Fixed sources watching in TableControllerV3.
ericleponner Sep 27, 2022
fb200ac
Added paging test to TableController.spec.ts
ericleponner Sep 28, 2022
58aa358
AccountTableController now based on TableControllerV3.
svienot Sep 28, 2022
dd6e47d
Fixed PaginationSubController.gotoPage().
ericleponner Sep 28, 2022
c03e549
Added tests to validate TableControllerV3 logic of shadow pages.
ericleponner Sep 28, 2022
481d493
Added TableControllerV3.reset() (to be used later).
ericleponner Sep 28, 2022
8934079
BlockTableController now based on TableControllerV3.
svienot Sep 28, 2022
b6b299a
ContractTableController now based on TableControllerV3.
svienot Sep 28, 2022
f9fc15d
NftHolderTableController now based on TableControllerV3.
svienot Sep 28, 2022
9ce2392
TokenBalanceTableController now based on TableControllerV3.
svienot Sep 28, 2022
89e66c4
TokenTableController now based on TableControllerV3.
svienot Sep 28, 2022
5897118
TransactionTableController now based on TableControllerV3 (however wi…
ericleponner Sep 28, 2022
0d9c9fd
RewardsTransactionTableController is now based on TransactionControll…
ericleponner Sep 28, 2022
93f8947
Replaced last occurences of PlayPauseButton by PlayPauseButtonV3.
ericleponner Sep 28, 2022
93e8de0
Removed (now obsolete) TableController, PlayPauseButton and RowBuffer…
ericleponner Sep 28, 2022
bde2afd
Renamed TableControllerV3 class as TableController.
ericleponner Sep 28, 2022
1aaa89b
Renamed PlayPauseButtonV3 class as PlayPauseButton.
ericleponner Sep 28, 2022
e4bd403
Removed debug trace from TableController.routeDidChange().
ericleponner Sep 29, 2022
5145fda
Fixed unstable check in Staking.spec.ts.
ericleponner Sep 29, 2022
2e16cae
Adjusted TokenDetails.vue after rebasing.
ericleponner Sep 29, 2022
87b6ab2
Re-worked TableController to enable usage of current route query para…
ericleponner Sep 29, 2022
087049d
Added comment line in PaginationSubController.unmount() to avoid tsli…
ericleponner Sep 29, 2022
f4725a5
Moved fetchXXXQueryParam() methods to RouteManager.ts
ericleponner Sep 30, 2022
f122adf
TransactionTableController now adjusts its transaction filter accordi…
ericleponner Sep 30, 2022
559dbce
Moved PaginationSubController.updateCurrentPage() in TableController.
ericleponner Sep 30, 2022
fbeda04
Fixed TableController.refresh().
ericleponner Sep 30, 2022
58d5325
Split TransactionTableController as TransactionTableController and Tr…
ericleponner Sep 30, 2022
61dc773
TableController now enables TransactionTableControllerXL to set up it…
ericleponner Oct 3, 2022
5a2b794
Re-enabled e2e test in TransactionNavigation.spec.ts.
ericleponner Oct 3, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/account/AccountTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export default defineComponent({
return {
isTouchDevice,
isMediumScreen,
accounts: props.controller.pageRows as ComputedRef<AccountInfo[]>,
accounts: props.controller.rows as ComputedRef<AccountInfo[]>,
loading: props.controller.loading as ComputedRef<boolean>,
total: props.controller.totalRowCount as ComputedRef<number>,
currentPage: props.controller.currentPage as Ref<number>,
Expand Down
41 changes: 19 additions & 22 deletions src/components/account/AccountTableController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,50 +18,35 @@
*
*/

import {TableController} from "@/utils/table/TableController";
import {AccountInfo, AccountsResponse} from "@/schemas/HederaSchemas";
import {Ref} from "vue";
import {ComputedRef} from "vue";
import axios, {AxiosResponse} from "axios";
import {KeyOperator, SortOrder, TableController} from "@/utils/table/TableController";
import {Router} from "vue-router";

export class AccountTableController extends TableController<AccountInfo, string> {

//
// Public
//

public constructor(pageSize: Ref<number>) {
super(pageSize, 10 * pageSize.value, 5000, 10, 100);
public constructor(router: Router, pageSize: ComputedRef<number>) {
super(router, pageSize, 10 * pageSize.value, 5000, 10, 100);
}

//
// TableController
//

public async loadAfter(accountId: string | null, limit: number): Promise<AccountInfo[] | null> {
return this.load(accountId, "lt", limit)
}

public async loadBefore(accountId: string, limit: number): Promise<AccountInfo[] | null> {
return this.load(accountId, "gte", limit)
}

public keyFor(row: AccountInfo): string {
return row.account ?? ""
}

//
// Private
//

private load(accountId: string | null, operator: string, limit: number): Promise<AccountInfo[] | null> {
public async load(accountId: string | null, operator: KeyOperator, order: SortOrder, limit: number): Promise<AccountInfo[] | null> {

const params = {} as {
limit: number
"account.id": string | undefined
order: string
}
params.limit = limit
params.order = 'desc'
params.order = order
if (accountId !== null) {
params["account.id"] = operator + ":" + accountId
}
Expand All @@ -71,4 +56,16 @@ export class AccountTableController extends TableController<AccountInfo, string>

return axios.get<AccountsResponse>("api/v1/accounts", {params: params}).then(cb)
}

public keyFor(row: AccountInfo): string {
return row.account ?? ""
}

public stringFromKey(account: string): string {
return account
}

public keyFromString(s: string): string|null {
return s
}
}
2 changes: 1 addition & 1 deletion src/components/block/BlockTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export default defineComponent({
return {
isTouchDevice,
isMediumScreen,
blocks: props.controller.pageRows as ComputedRef<Block[]>,
blocks: props.controller.rows as ComputedRef<Block[]>,
loading: props.controller.loading as ComputedRef<boolean>,
total: props.controller.totalRowCount as ComputedRef<number>,
currentPage: props.controller.currentPage as Ref<number>,
Expand Down
41 changes: 19 additions & 22 deletions src/components/block/BlockTableController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,50 +18,35 @@
*
*/

import {TableController} from "@/utils/table/TableController";
import {Block, BlocksResponse} from "@/schemas/HederaSchemas";
import {Ref} from "vue";
import {ComputedRef} from "vue";
import axios, {AxiosResponse} from "axios";
import {KeyOperator, SortOrder, TableController} from "@/utils/table/TableController";
import {Router} from "vue-router";

export class BlockTableController extends TableController<Block, number> {

//
// Public
//

public constructor(pageSize: Ref<number>) {
super(pageSize, 10 * pageSize.value, 5000, 10, 100);
public constructor(router: Router, pageSize: ComputedRef<number>) {
super(router, pageSize, 10 * pageSize.value, 5000, 10, 100);
}

//
// TableController
//

public async loadAfter(blockNb: number | null, limit: number): Promise<Block[] | null> {
return this.load(blockNb, "lt", limit)
}

public async loadBefore(blockNb: number, limit: number): Promise<Block[] | null> {
return this.load(blockNb, "gte", limit)
}

public keyFor(row: Block): number {
return row.number ?? -1
}

//
// Private
//

private load(blockNb: number | null, operator: string, limit: number): Promise<Block[] | null> {
public async load(blockNb: number | null, operator: KeyOperator, order: SortOrder, limit: number): Promise<Block[] | null> {

const params = {} as {
limit: number
"block.number": string
order: string
}
params.limit = limit
params.order = 'desc'
params.order = order
if (blockNb !== null) {
params["block.number"] = operator + ":" + blockNb
}
Expand All @@ -71,4 +56,16 @@ export class BlockTableController extends TableController<Block, number> {

return axios.get<BlocksResponse>("api/v1/blocks", {params: params}).then(cb)
}

public keyFor(row: Block): number {
return row.number ?? -1
}

public stringFromKey(key: number): string {
return key.toString()
}

public keyFromString(s: string): number | null {
return Number(s)
}
}
2 changes: 1 addition & 1 deletion src/components/contract/ContractTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export default defineComponent({
return {
isTouchDevice,
isMediumScreen,
contracts: props.controller.pageRows as ComputedRef<Contract[]>,
contracts: props.controller.rows as ComputedRef<Contract[]>,
loading: props.controller.loading as ComputedRef<boolean>,
total: props.controller.totalRowCount as ComputedRef<number>,
currentPage: props.controller.currentPage as Ref<number>,
Expand Down
41 changes: 19 additions & 22 deletions src/components/contract/ContractTableController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,50 +18,35 @@
*
*/

import {TableController} from "@/utils/table/TableController";
import {Contract, ContractsResponse} from "@/schemas/HederaSchemas";
import {Ref} from "vue";
import {ComputedRef} from "vue";
import axios, {AxiosResponse} from "axios";
import {KeyOperator, SortOrder, TableController} from "@/utils/table/TableController";
import {Router} from "vue-router";

export class ContractTableController extends TableController<Contract, string> {

//
// Public
//

public constructor(pageSize: Ref<number>) {
super(pageSize, 10 * pageSize.value, 5000, 10, 100);
public constructor(router: Router, pageSize: ComputedRef<number>) {
super(router, pageSize, 10 * pageSize.value, 5000, 10, 100);
}

//
// TableController
//

public async loadAfter(contractId: string | null, limit: number): Promise<Contract[] | null> {
return this.load(contractId, "lt", limit)
}

public async loadBefore(contractId: string, limit: number): Promise<Contract[] | null> {
return this.load(contractId, "gte", limit)
}

public keyFor(row: Contract): string {
return row.contract_id ?? ""
}

//
// Private
//

private load(contractId: string | null, operator: string, limit: number): Promise<Contract[] | null> {
public async load(contractId: string | null, operator: KeyOperator, order: SortOrder, limit: number): Promise<Contract[] | null> {

const params = {} as {
limit: number
"contract.id": string | undefined
order: string
}
params.limit = limit
params.order = 'desc'
params.order = order
if (contractId !== null) {
params["contract.id"] = operator + ":" + contractId
}
Expand All @@ -71,4 +56,16 @@ export class ContractTableController extends TableController<Contract, string> {

return axios.get<ContractsResponse>("api/v1/contracts", {params: params}).then(cb)
}

public keyFor(row: Contract): string {
return row.contract_id ?? ""
}

public stringFromKey(key: string): string {
return key;
}

public keyFromString(s: string): string | null {
return s;
}
}
6 changes: 3 additions & 3 deletions src/components/contract/ContractTransactionTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ import TransactionLabel from "@/components/values/TransactionLabel.vue";
import HbarAmount from "@/components/values/HbarAmount.vue";
import {ORUGA_MOBILE_BREAKPOINT} from '@/App.vue';
import EmptyTable from "@/components/EmptyTable.vue";
import {TransactionTableController} from "@/components/transaction/TransactionTableController";
import {TransactionTableControllerXL} from "@/components/transaction/TransactionTableControllerXL";

export default defineComponent({
name: 'ContractTransactionTable',
Expand All @@ -102,7 +102,7 @@ export default defineComponent({

props: {
controller: {
type: Object as PropType<TransactionTableController>,
type: Object as PropType<TransactionTableControllerXL>,
required: true
}
},
Expand All @@ -118,7 +118,7 @@ export default defineComponent({
return {
isTouchDevice,
isMediumScreen,
transactions: props.controller.pageRows as ComputedRef<Transaction[]>,
transactions: props.controller.rows as ComputedRef<Transaction[]>,
loading: props.controller.loading as ComputedRef<boolean>,
total: props.controller.totalRowCount as ComputedRef<number>,
currentPage: props.controller.currentPage as Ref<number>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export default defineComponent({
}

return {
transactions: props.controller.pageRows as ComputedRef<Transaction[]>,
transactions: props.controller.rows as ComputedRef<Transaction[]>,
loading: props.controller.loading as ComputedRef<boolean>,
total: props.controller.totalRowCount as ComputedRef<number>,
currentPage: props.controller.currentPage as Ref<number>,
Expand Down
2 changes: 1 addition & 1 deletion src/components/dashboard/CryptoTransactionTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export default defineComponent({
}

return {
transactions: props.controller.pageRows as ComputedRef<Transaction[]>,
transactions: props.controller.rows as ComputedRef<Transaction[]>,
loading: props.controller.loading as ComputedRef<boolean>,
total: props.controller.totalRowCount as ComputedRef<number>,
currentPage: props.controller.currentPage as Ref<number>,
Expand Down
2 changes: 1 addition & 1 deletion src/components/dashboard/MessageTransactionTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export default defineComponent({
}

return {
transactions: props.controller.pageRows as ComputedRef<Transaction[]>,
transactions: props.controller.rows as ComputedRef<Transaction[]>,
loading: props.controller.loading as ComputedRef<boolean>,
total: props.controller.totalRowCount as ComputedRef<number>,
currentPage: props.controller.currentPage as Ref<number>,
Expand Down
2 changes: 1 addition & 1 deletion src/components/staking/RewardsTransactionTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export default defineComponent({
return {
isTouchDevice,
isMediumScreen,
transactions: props.controller.pageRows as ComputedRef<Transaction[]>,
transactions: props.controller.rows as ComputedRef<Transaction[]>,
loading: props.controller.loading as ComputedRef<boolean>,
total: props.controller.totalRowCount as ComputedRef<number>,
currentPage: props.controller.currentPage as Ref<number>,
Expand Down
Loading