From 4ad39e7f92e09ec37ba4dbbee738c131566acb47 Mon Sep 17 00:00:00 2001 From: Aleksei Potsetsuev Date: Tue, 27 Feb 2024 21:58:25 +0800 Subject: [PATCH] CB-4681 fix: review --- .../ResultSet/IResultSetDataContentAction.ts | 1 - .../ResultSet/ResultSetDataContentAction.ts | 40 +++++++++---------- .../ImageValue/ImageValuePresentation.tsx | 3 ++ 3 files changed, 23 insertions(+), 21 deletions(-) diff --git a/webapp/packages/plugin-data-viewer/src/DatabaseDataModel/Actions/ResultSet/IResultSetDataContentAction.ts b/webapp/packages/plugin-data-viewer/src/DatabaseDataModel/Actions/ResultSet/IResultSetDataContentAction.ts index 00abcdec9c..2cadad2189 100644 --- a/webapp/packages/plugin-data-viewer/src/DatabaseDataModel/Actions/ResultSet/IResultSetDataContentAction.ts +++ b/webapp/packages/plugin-data-viewer/src/DatabaseDataModel/Actions/ResultSet/IResultSetDataContentAction.ts @@ -12,7 +12,6 @@ export interface IResultSetDataContentAction { isBlobTruncated: (element: IResultSetElementKey) => boolean; isTextTruncated: (element: IResultSetElementKey) => boolean; isDownloadable: (element: IResultSetElementKey) => boolean; - getFileDataUrl: (element: IResultSetElementKey) => Promise; resolveFileDataUrl: (element: IResultSetElementKey) => Promise; retrieveBlobFromCache: (element: IResultSetElementKey) => Blob | undefined; downloadFileData: (element: IResultSetElementKey) => Promise; diff --git a/webapp/packages/plugin-data-viewer/src/DatabaseDataModel/Actions/ResultSet/ResultSetDataContentAction.ts b/webapp/packages/plugin-data-viewer/src/DatabaseDataModel/Actions/ResultSet/ResultSetDataContentAction.ts index 4fce524a15..c32557fbf5 100644 --- a/webapp/packages/plugin-data-viewer/src/DatabaseDataModel/Actions/ResultSet/ResultSetDataContentAction.ts +++ b/webapp/packages/plugin-data-viewer/src/DatabaseDataModel/Actions/ResultSet/ResultSetDataContentAction.ts @@ -139,26 +139,6 @@ export class ResultSetDataContentAction extends DatabaseDataAction { - try { - this.updateCache(element, { loading: true }); - return await this.loadDataURL(this.result, column.position, row); - } finally { - this.updateCache(element, { loading: false }); - } - }); - - return url; - } - async resolveFileDataUrl(element: IResultSetElementKey) { const cachedUrl = this.retrieveBlobFromCache(element); @@ -187,6 +167,26 @@ export class ResultSetDataContentAction extends DatabaseDataAction { + try { + this.updateCache(element, { loading: true }); + return await this.loadDataURL(this.result, column.position, row); + } finally { + this.updateCache(element, { loading: false }); + } + }); + + return url; + } + private async loadFileFullText(result: IDatabaseResultSet, columnIndex: number, row: IResultSetValue[]) { if (!result.id) { throw new Error("Result's id must be provided"); diff --git a/webapp/packages/plugin-data-viewer/src/ValuePanelPresentation/ImageValue/ImageValuePresentation.tsx b/webapp/packages/plugin-data-viewer/src/ValuePanelPresentation/ImageValue/ImageValuePresentation.tsx index 8d208ce4cc..4a8933c217 100644 --- a/webapp/packages/plugin-data-viewer/src/ValuePanelPresentation/ImageValue/ImageValuePresentation.tsx +++ b/webapp/packages/plugin-data-viewer/src/ValuePanelPresentation/ImageValue/ImageValuePresentation.tsx @@ -93,6 +93,9 @@ export const ImageValuePresentation: TabContainerPanelComponent