-
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.
Cb 4760 add to value panel more clear abstractions and separation of …
…the logic (#2688) * CB-4760 refactors value panel boolean presentation * CB-4760 refactors value panel image presentation * CB-4760 refactors value panel text presentation (part 1) * CB-4760 refactors value panel text presentation (part 2) * CB-4760 moves ValuePanel presentation layer to ValuePanel folder * CB-4760 fixes type in file name * CB-4760 modifies isBlob truncated logic * CB-4760 booleanValuePresentation uses actions helper * CB-4760 reverts value panel helpers location * CB-4760 reverts getResultSetActions * CB-4760 add preprocessBooleanValue helper instead of hook * CB-4760 reverts truncated message isTruncated logic * CB-4760 cleanup * CB-4760 cleanup * CB-4760 test commit for save file history * CB-4760 test commit for save file history [2] * CB-4760 test commit for save file history [3] * CB-4760 moves back ValuePanelPresentation directory to src folder to save git history * CB-4760 pr fixes * CB-4760 adds placeholder for non selected elements in boolean value presentation (value panel) * CB-4760 fixes placeholder translation for non selected elements in boolean value presentation (value panel) * CB-4760 fix: app restart process * CB-4760 fix: app restart process --------- Co-authored-by: mr-anton-t <[email protected]> Co-authored-by: Aleksei Potsetsuev <[email protected]>
- Loading branch information
1 parent
1c9b4f1
commit a65dff3
Showing
18 changed files
with
382 additions
and
350 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
58 changes: 0 additions & 58 deletions
58
...ackages/plugin-data-viewer/src/DatabaseDataModel/Actions/ResultSet/useResultSetActions.ts
This file was deleted.
Oops, something went wrong.
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
21 changes: 21 additions & 0 deletions
21
...ages/plugin-data-viewer/src/ValuePanelPresentation/BooleanValue/preprocessBooleanValue.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,21 @@ | ||
/* | ||
* 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. | ||
*/ | ||
import type { IResultSetValue } from '../../DatabaseDataModel/Actions/ResultSet/ResultSetFormatAction'; | ||
import { isStringifiedBoolean } from './isBooleanValuePresentationAvailable'; | ||
|
||
export function preprocessBooleanValue(cellValue: IResultSetValue): boolean | null | undefined { | ||
if (typeof cellValue === 'string' && isStringifiedBoolean(cellValue)) { | ||
return cellValue.toLowerCase() === 'true'; | ||
} | ||
|
||
if (typeof cellValue === 'boolean' || cellValue === null) { | ||
return cellValue; | ||
} | ||
|
||
return undefined; | ||
} |
Oops, something went wrong.