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

Cb 4270 row counter add cancel button for big tables #2545

Merged
merged 41 commits into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
d4b5296
CB-4270 adds cancel option for load total count of rows in table
sergeyteleshev Apr 10, 2024
a6da7c5
CB-4270 adds ui for load total count of rows in table
sergeyteleshev Apr 11, 2024
de7c6e4
CB-4270 fix: task cancels in a true way
sergeyteleshev Apr 11, 2024
bfcfaa0
CB-4270 cleanup
sergeyteleshev Apr 11, 2024
7c424c6
CB-4270 cancel load total count on close table tab
sergeyteleshev Apr 11, 2024
110c1d8
CB-4270 cancel load total count on close sql editor tab
sergeyteleshev Apr 11, 2024
d58b80c
CB-4270 fix: cancel close only task if it is not already cancelled
sergeyteleshev Apr 11, 2024
9eea88c
CB-4270 chore: tasks -> cancelLoadTotalCountTasks
sergeyteleshev Apr 11, 2024
9ddb968
CB-4270 stops counting rows when tab closes
sergeyteleshev Apr 11, 2024
bcc43ce
CB-4270 reverts incorrect calls of cancelLoadTotalCount
sergeyteleshev Apr 11, 2024
064a737
CB-4270 reverts ToolsActions unneeded props
sergeyteleshev Apr 12, 2024
2e5f4f8
CB-4270 pr fixes
sergeyteleshev Apr 12, 2024
96f4ea0
СB-4270 cancel load total count for refresh action
sergeyteleshev Apr 12, 2024
8417093
CB-4270 fix: place cancelLoadTotalCount to DatabaseDataSource
sergeyteleshev Apr 12, 2024
13f3eae
CB-4270 fix: cancel load rows in refresh data in data source
sergeyteleshev Apr 12, 2024
62d282f
CB-4270 cancels load on close result set tab
sergeyteleshev Apr 12, 2024
10623ce
CB-4270 refactor: move cancelLoadTotalCount to resultsetdatasource
sergeyteleshev Apr 12, 2024
1fbb20c
CB-4270 cancel load total count execute only for resultsetdatasource
sergeyteleshev Apr 12, 2024
c96508e
CB-4270 adds constraint for TableFooterRowCount
sergeyteleshev Apr 12, 2024
12c3d99
CB-4270 fix: do not load new value if cancelled rows loading
sergeyteleshev Apr 12, 2024
f8bffa2
CB-4270 cleanup
sergeyteleshev Apr 12, 2024
24f2e12
Revert "CB-4270 cleanup"
sergeyteleshev Apr 12, 2024
95fa2ed
CB-4270 pr fixes
sergeyteleshev Apr 12, 2024
8acd987
Merge branch 'devel' into CB-4270-row-counter-add-cancel-button-for-b…
sergeyteleshev Apr 15, 2024
dee0295
CB-4270 pr fixes
sergeyteleshev Apr 15, 2024
708d658
CB-4270 deletes cross icon icon
sergeyteleshev Apr 15, 2024
4a3445e
CB-4270 DataSources has correct tree of calls for cancel and dispose …
sergeyteleshev Apr 15, 2024
815cd26
CB-4270 cleanup
sergeyteleshev Apr 15, 2024
8b185d5
chore: add experimental cancellable promise implementation
Wroud Apr 15, 2024
46b89da
CB-4270 pr fixes: remove unneeded disposes + close results in close r…
sergeyteleshev Apr 15, 2024
c665a13
CB-4270 removes closeResults abstraction leak in ResultSetDataSource …
sergeyteleshev Apr 16, 2024
a37d332
CB-4270 removes unused context in data sources
sergeyteleshev Apr 16, 2024
a35fa39
Merge branch 'devel' into CB-4270-row-counter-add-cancel-button-for-b…
dariamarutkina Apr 16, 2024
44c8f5a
Merge branch 'devel' into CB-4270-row-counter-add-cancel-button-for-b…
dariamarutkina Apr 16, 2024
6581fa4
Merge branch 'devel' into CB-4270-row-counter-add-cancel-button-for-b…
sergeyteleshev Apr 18, 2024
6f4482d
CB-4270 adds loader for CancelTotalCountAction on cancel task action
sergeyteleshev Apr 18, 2024
d894010
CB-4270 cancel row count job fix
yagudin10 Apr 18, 2024
f7b9328
CB-4270 cancel row counter with notification
sergeyteleshev Apr 18, 2024
ea2a1cf
CB-4270 pr fixes
sergeyteleshev Apr 19, 2024
8e7f48b
CB-4270 pr fixes
sergeyteleshev Apr 19, 2024
c37cd9f
Merge branch 'devel' into CB-4270-row-counter-add-cancel-button-for-b…
dariamarutkina Apr 22, 2024
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
15 changes: 15 additions & 0 deletions webapp/packages/core-executor/src/TaskScheduler/CancelError.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
* CloudBeaver - Cloud Database Manager
* Copyright (C) 2020-2024 DBeaver Corp and others
*
* Licensed under the Apache License, Version 2.0.
* you may not use this file except in compliance with the License.
*/

export class CancelError extends Error {
constructor(message?: string, options?: ErrorOptions) {
super(message, options);

this.name = 'Cancel Error';
}
}
43 changes: 43 additions & 0 deletions webapp/packages/core-executor/src/TaskScheduler/ITaskNew.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
* CloudBeaver - Cloud Database Manager
* Copyright (C) 2020-2024 DBeaver Corp and others
*
* Licensed under the Apache License, Version 2.0.
* you may not use this file except in compliance with the License.
*/

export interface ITaskConstructor {
readonly prototype: ITask<any>;
new <T>(executor: TaskExecutor<T>): ITask<T>;

reject<T = never>(reason?: any): ITask<T>;
cancel<T = never>(reason?: any): ITask<T>;
resolve(): ITask<void>;
resolve<T>(value: T): ITask<Awaited<T>>;
resolve<T>(value: T | PromiseLike<T>): ITask<Awaited<T>>;
fromPromise<T>(promise: Promise<T>): ITask<T>;
all<T extends readonly unknown[] | []>(values: T): ITask<{ -readonly [P in keyof T]: Awaited<T[P]> }>;
allSettled<T extends readonly unknown[] | []>(
values: T,
): ITask<{ -readonly [P in keyof T]: { status: 'fulfilled'; value: Awaited<T[P]> } | { status: 'rejected' | 'cancelled'; reason: any } }>;
}

declare const ITask: ITaskConstructor;

export interface ITask<TValue> extends Promise<TValue>, PromiseLike<TValue> {
readonly then: <TResult1 = TValue, TResult2 = never, TResult3 = never>(
onFulfilled?: ((value: TValue) => TResult1 | PromiseLike<TResult1>) | null,
onRejected?: ((reason: any, cancelled: boolean) => TResult2 | PromiseLike<TResult2>) | null,
) => ITask<TResult1 | TResult2 | TResult3>;
readonly catch: <TResult = never>(
onRejected?: ((reason: any, cancelled: boolean) => TResult | PromiseLike<TResult>) | null,
) => ITask<TValue | TResult>;
readonly finally: (onfinally?: (() => void) | null) => ITask<TValue>;
readonly cancel: (reason?: any) => ITask<void>;
}

export type TaskResolveFn<T> = (reason: T | PromiseLike<T>) => void;
export type TaskRejectFn = (reason?: any, cancelled?: boolean) => void;
export type TaskCancelFn = (reason?: any) => ITask<void> | void;

export type TaskExecutor<T> = (resolve: TaskResolveFn<T>, reject: TaskRejectFn, registerCancel: (cancel: TaskCancelFn) => void) => void;
Loading
Loading