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 95e2c1591d..a584941cf6 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 @@ -9,7 +9,8 @@ import type { IResultSetElementKey } from './IResultSetDataKey'; export interface IResultSetDataContentAction { activeElement: IResultSetElementKey | null; - isContentTruncated: (element: IResultSetElementKey) => boolean; + isImageTruncated: (element: IResultSetElementKey) => boolean; + isTextTruncated: (element: IResultSetElementKey) => boolean; isDownloadable: (element: IResultSetElementKey) => boolean; getFileDataUrl: (element: IResultSetElementKey) => Promise; resolveFileDataUrl: (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 8057ab9cf6..99fe2f42d2 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 @@ -79,15 +79,26 @@ export class ResultSetDataContentAction extends DatabaseDataAction limit; + } + + isTextTruncated(elementKey: IResultSetElementKey) { const limit = this.getLimitInfo(elementKey).limit; const content = this.format.get(elementKey); const cachedFullText = elementKey ? this.retrieveFileFullTextFromCache(elementKey) : ''; const isLoadedFullText = Boolean(cachedFullText) && this.format.isText(elementKey); - const cachedImage = elementKey ? this.retrieveFileDataUrlFromCache(elementKey) : ''; - const isLoadedFullImage = Boolean(cachedImage) && this.format.isBinary(elementKey); - if (!isNotNullDefined(limit) || !isResultSetContentValue(content) || isLoadedFullText || isLoadedFullImage) { + if (!isNotNullDefined(limit) || !isResultSetContentValue(content) || isLoadedFullText) { return false; } 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 6f8d1def8f..73b443bf18 100644 --- a/webapp/packages/plugin-data-viewer/src/ValuePanelPresentation/ImageValue/ImageValuePresentation.tsx +++ b/webapp/packages/plugin-data-viewer/src/ValuePanelPresentation/ImageValue/ImageValuePresentation.tsx @@ -154,11 +154,7 @@ export const ImageValuePresentation: TabContainerPanelComponent {data.shouldShowImage && } - - {isDownloadable && ( - - )} - + {data.truncated ? ( + + {isDownloadable && ( + + )} + + ) : null} diff --git a/webapp/packages/plugin-data-viewer/src/ValuePanelPresentation/QuotaPlaceholder.tsx b/webapp/packages/plugin-data-viewer/src/ValuePanelPresentation/QuotaPlaceholder.tsx index ff1615b7ab..88c39b8b8a 100644 --- a/webapp/packages/plugin-data-viewer/src/ValuePanelPresentation/QuotaPlaceholder.tsx +++ b/webapp/packages/plugin-data-viewer/src/ValuePanelPresentation/QuotaPlaceholder.tsx @@ -38,10 +38,6 @@ export const QuotaPlaceholder: React.FC> = observ const { contentAction } = useResultSetActions({ model, resultIndex }); const limitInfo = elementKey ? contentAction.getLimitInfo(elementKey) : null; - if (!elementKey || (elementKey && !contentAction.isContentTruncated(elementKey))) { - return null; - } - return ( diff --git a/webapp/packages/plugin-data-viewer/src/ValuePanelPresentation/TextValue/TextValuePresentation.tsx b/webapp/packages/plugin-data-viewer/src/ValuePanelPresentation/TextValue/TextValuePresentation.tsx index 85f7223680..739402f509 100644 --- a/webapp/packages/plugin-data-viewer/src/ValuePanelPresentation/TextValue/TextValuePresentation.tsx +++ b/webapp/packages/plugin-data-viewer/src/ValuePanelPresentation/TextValue/TextValuePresentation.tsx @@ -125,7 +125,7 @@ export const TextValuePresentation: TabContainerPanelComponent getTypeExtension(contentType!) ?? [], [contentType]); const extensions = useCodemirrorExtensions(undefined, typeExtension); @@ -185,15 +185,17 @@ export const TextValuePresentation: TabContainerPanelComponent - - {shouldShowPasteButton && ( - - - - )} - + {firstSelectedCell && contentAction.isTextTruncated(firstSelectedCell) ? ( + + {shouldShowPasteButton && ( + + + + )} + + ) : null} {canSave && (