From d3e728e03345642072ff4d90ca0e9c37de61ff5e Mon Sep 17 00:00:00 2001 From: "s.teleshev" Date: Wed, 3 Jan 2024 13:51:37 +0100 Subject: [PATCH 1/3] CB-4461 fix: json and xml formats properly --- .../Actions/ResultSet/isResultSetBinaryFileValue.ts | 5 ++--- .../src/ValuePanelPresentation/TextValue/useTextValue.ts | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/webapp/packages/plugin-data-viewer/src/DatabaseDataModel/Actions/ResultSet/isResultSetBinaryFileValue.ts b/webapp/packages/plugin-data-viewer/src/DatabaseDataModel/Actions/ResultSet/isResultSetBinaryFileValue.ts index 87afa5cb3e..ae85c5deba 100644 --- a/webapp/packages/plugin-data-viewer/src/DatabaseDataModel/Actions/ResultSet/isResultSetBinaryFileValue.ts +++ b/webapp/packages/plugin-data-viewer/src/DatabaseDataModel/Actions/ResultSet/isResultSetBinaryFileValue.ts @@ -1,6 +1,5 @@ import type { IResultSetBinaryFileValue } from './IResultSetBinaryFileValue'; -import type { IResultSetContentValue } from './IResultSetContentValue'; -export function isResultSetBinaryFileValue(value: IResultSetContentValue): value is IResultSetBinaryFileValue { - return value.contentType === 'application/octet-stream' && Boolean(value?.binary); +export function isResultSetBinaryFileValue(value: any): value is IResultSetBinaryFileValue { + return value?.contentType === 'application/octet-stream' && Boolean(value?.binary); } diff --git a/webapp/packages/plugin-data-viewer/src/ValuePanelPresentation/TextValue/useTextValue.ts b/webapp/packages/plugin-data-viewer/src/ValuePanelPresentation/TextValue/useTextValue.ts index 62d8bf187e..90f899576f 100644 --- a/webapp/packages/plugin-data-viewer/src/ValuePanelPresentation/TextValue/useTextValue.ts +++ b/webapp/packages/plugin-data-viewer/src/ValuePanelPresentation/TextValue/useTextValue.ts @@ -5,7 +5,7 @@ * Licensed under the Apache License, Version 2.0. * you may not use this file except in compliance with the License. */ -import { isResultSetContentValue } from '../../DatabaseDataModel/Actions/ResultSet/isResultSetContentValue'; +import { isResultSetBinaryFileValue } from '../../DatabaseDataModel/Actions/ResultSet/isResultSetBinaryFileValue'; import { ResultSetEditAction } from '../../DatabaseDataModel/Actions/ResultSet/ResultSetEditAction'; import { ResultSetFormatAction } from '../../DatabaseDataModel/Actions/ResultSet/ResultSetFormatAction'; import { ResultSetSelectAction } from '../../DatabaseDataModel/Actions/ResultSet/ResultSetSelectAction'; @@ -34,7 +34,7 @@ export function useTextValue({ model, resultIndex, currentContentType }: IUseTex const blob = format.get(firstSelectedCell); - if (isResultSetContentValue(blob)) { + if (isResultSetBinaryFileValue(blob)) { const value = formatter.formatBlob(currentContentType, blob); if (value) { From a25e29bda24c09679195d59f6a4d7a19fd62115b Mon Sep 17 00:00:00 2001 From: "s.teleshev" Date: Wed, 3 Jan 2024 13:56:16 +0100 Subject: [PATCH 2/3] CB-4461 fix: edited cell can show its unformatted string value --- .../Actions/ResultSet/ResultSetViewAction.ts | 4 ++++ .../src/ValuePanelPresentation/TextValue/useTextValue.ts | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/webapp/packages/plugin-data-viewer/src/DatabaseDataModel/Actions/ResultSet/ResultSetViewAction.ts b/webapp/packages/plugin-data-viewer/src/DatabaseDataModel/Actions/ResultSet/ResultSetViewAction.ts index 3835cc88b6..682de84b1b 100644 --- a/webapp/packages/plugin-data-viewer/src/DatabaseDataModel/Actions/ResultSet/ResultSetViewAction.ts +++ b/webapp/packages/plugin-data-viewer/src/DatabaseDataModel/Actions/ResultSet/ResultSetViewAction.ts @@ -127,6 +127,10 @@ export class ResultSetViewAction extends DatabaseDataAction Date: Wed, 3 Jan 2024 15:06:45 +0100 Subject: [PATCH 3/3] CB-4461 fix: panel value - on empty selected cell return empty string --- .../Actions/ResultSet/ResultSetViewAction.ts | 4 ---- .../src/ValuePanelPresentation/TextValue/useTextValue.ts | 9 +++++++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/webapp/packages/plugin-data-viewer/src/DatabaseDataModel/Actions/ResultSet/ResultSetViewAction.ts b/webapp/packages/plugin-data-viewer/src/DatabaseDataModel/Actions/ResultSet/ResultSetViewAction.ts index 682de84b1b..3835cc88b6 100644 --- a/webapp/packages/plugin-data-viewer/src/DatabaseDataModel/Actions/ResultSet/ResultSetViewAction.ts +++ b/webapp/packages/plugin-data-viewer/src/DatabaseDataModel/Actions/ResultSet/ResultSetViewAction.ts @@ -127,10 +127,6 @@ export class ResultSetViewAction extends DatabaseDataAction