-
Notifications
You must be signed in to change notification settings - Fork 392
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* CB-4401 feat: save value panel state per column * CB-4401 fix: pr review --------- Co-authored-by: Daria Marutkina <[email protected]>
- Loading branch information
1 parent
5041312
commit b0586e7
Showing
19 changed files
with
271 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
webapp/packages/plugin-data-viewer/src/DatabaseDataModel/Actions/DatabaseDataResultAction.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* CloudBeaver - Cloud Database Manager | ||
* Copyright (C) 2020-2023 DBeaver Corp and others | ||
* | ||
* Licensed under the Apache License, Version 2.0. | ||
* you may not use this file except in compliance with the License. | ||
*/ | ||
import type { ResultDataFormat } from '@cloudbeaver/core-sdk'; | ||
|
||
import { DatabaseDataAction } from '../DatabaseDataAction'; | ||
import type { IDatabaseDataResult } from '../IDatabaseDataResult'; | ||
import type { IDatabaseDataSource } from '../IDatabaseDataSource'; | ||
import { databaseDataAction } from './DatabaseDataActionDecorator'; | ||
import type { IDatabaseDataResultAction } from './IDatabaseDataResultAction'; | ||
|
||
@databaseDataAction() | ||
export abstract class DatabaseDataResultAction<TKey, TResult extends IDatabaseDataResult> | ||
extends DatabaseDataAction<any, TResult> | ||
implements IDatabaseDataResultAction<TKey, TResult> | ||
{ | ||
static dataFormat: ResultDataFormat[] | null = null; | ||
|
||
constructor(source: IDatabaseDataSource<any, TResult>) { | ||
super(source); | ||
} | ||
abstract getIdentifier(key: TKey): string; | ||
abstract serialize(key: TKey): string; | ||
} |
47 changes: 47 additions & 0 deletions
47
webapp/packages/plugin-data-viewer/src/DatabaseDataModel/Actions/DatabaseMetadataAction.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
* CloudBeaver - Cloud Database Manager | ||
* Copyright (C) 2020-2023 DBeaver Corp and others | ||
* | ||
* Licensed under the Apache License, Version 2.0. | ||
* you may not use this file except in compliance with the License. | ||
*/ | ||
import type { ResultDataFormat } from '@cloudbeaver/core-sdk'; | ||
import { MetadataMap } from '@cloudbeaver/core-utils'; | ||
|
||
import { DatabaseDataAction } from '../DatabaseDataAction'; | ||
import type { IDatabaseDataResult } from '../IDatabaseDataResult'; | ||
import type { IDatabaseDataSource } from '../IDatabaseDataSource'; | ||
import { databaseDataAction } from './DatabaseDataActionDecorator'; | ||
import type { IDatabaseDataMetadataAction } from './IDatabaseDataMetadataAction'; | ||
|
||
@databaseDataAction() | ||
export class DatabaseMetadataAction<TKey, TResult extends IDatabaseDataResult> | ||
extends DatabaseDataAction<any, TResult> | ||
implements IDatabaseDataMetadataAction<TKey, TResult> | ||
{ | ||
static dataFormat: ResultDataFormat[] | null = null; | ||
readonly metadata: MetadataMap<string, any>; | ||
|
||
constructor(source: IDatabaseDataSource<any, TResult>) { | ||
super(source); | ||
this.metadata = new MetadataMap(); | ||
} | ||
|
||
has(key: string): boolean { | ||
return this.metadata.has(key); | ||
} | ||
|
||
get<T>(key: string): T | undefined; | ||
get<T>(key: string, getDefaultValue: (() => T) | undefined): T; | ||
get<T>(key: string, getDefaultValue?: (() => T) | undefined): T | undefined { | ||
return this.metadata.get(key, getDefaultValue); | ||
} | ||
|
||
set(key: string, value: any): void { | ||
this.metadata.set(key, value); | ||
} | ||
|
||
delete(key: string): void { | ||
this.metadata.delete(key); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
.../packages/plugin-data-viewer/src/DatabaseDataModel/Actions/IDatabaseDataMetadataAction.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* | ||
* CloudBeaver - Cloud Database Manager | ||
* Copyright (C) 2020-2023 DBeaver Corp and others | ||
* | ||
* Licensed under the Apache License, Version 2.0. | ||
* you may not use this file except in compliance with the License. | ||
*/ | ||
import type { IDatabaseDataAction } from '../IDatabaseDataAction'; | ||
import type { IDatabaseDataResult } from '../IDatabaseDataResult'; | ||
|
||
export interface IDatabaseDataMetadataAction<TKey, TResult extends IDatabaseDataResult> extends IDatabaseDataAction<any, TResult> { | ||
get<T>(key: string): T | undefined; | ||
get<T>(key: string, getDefaultValue: () => T): T; | ||
set(key: string, value: any): void; | ||
delete(key: string): void; | ||
has(key: string): boolean; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.