diff --git a/webapp/packages/core-app/public/icons/icons.svg b/webapp/packages/core-app/public/icons/icons.svg
index 86782beddc..01304442a5 100644
--- a/webapp/packages/core-app/public/icons/icons.svg
+++ b/webapp/packages/core-app/public/icons/icons.svg
@@ -359,15 +359,17 @@
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
+
diff --git a/webapp/packages/core-utils/src/download.ts b/webapp/packages/core-utils/src/download.ts
index 0cd0dee02c..e5f452b990 100644
--- a/webapp/packages/core-utils/src/download.ts
+++ b/webapp/packages/core-utils/src/download.ts
@@ -6,11 +6,15 @@
* you may not use this file except in compliance with the License.
*/
-export function download(content: Blob | string, fileName = ''): void {
+export function download(content: Blob | string, fileName = '', blank?: boolean): void {
const saveLink = document.createElement('a');
saveLink.tabIndex = -1;
saveLink.download = fileName;
+ if (blank) {
+ saveLink.target = '_blank';
+ saveLink.rel = 'noopener';
+ }
saveLink.style.display = 'none';
document.body.appendChild(saveLink);
diff --git a/webapp/packages/plugin-data-spreadsheet-new/src/DataGrid/DataGridContextMenu/DataGridContextMenuSaveContentService.ts b/webapp/packages/plugin-data-spreadsheet-new/src/DataGrid/DataGridContextMenu/DataGridContextMenuSaveContentService.ts
index 87277e9a3f..2933995c41 100644
--- a/webapp/packages/plugin-data-spreadsheet-new/src/DataGrid/DataGridContextMenu/DataGridContextMenuSaveContentService.ts
+++ b/webapp/packages/plugin-data-spreadsheet-new/src/DataGrid/DataGridContextMenu/DataGridContextMenuSaveContentService.ts
@@ -39,11 +39,11 @@ export class DataGridContextMenuSaveContentService {
onClick: async context => {
try {
await context.data.model.source.dataManager.downloadFileData(context.data.key, context.data.resultIndex);
- } catch (exception) {
- this.notificationService.logException(exception as any, 'data_grid_table_context_menu_save_value_error');
+ } catch (exception: any) {
+ this.notificationService.logException(exception, 'data_grid_table_context_menu_save_value_error');
}
},
- isHidden: context => !context.data.model.source.dataManager.canDownload(
+ isHidden: context => !context.data.model.source.dataManager.isContent(
context.data.key,
context.data.resultIndex
),
diff --git a/webapp/packages/plugin-data-viewer/src/DatabaseDataModel/DatabaseDataManager.ts b/webapp/packages/plugin-data-viewer/src/DatabaseDataModel/DatabaseDataManager.ts
index 072cc85996..5213354983 100644
--- a/webapp/packages/plugin-data-viewer/src/DatabaseDataModel/DatabaseDataManager.ts
+++ b/webapp/packages/plugin-data-viewer/src/DatabaseDataModel/DatabaseDataManager.ts
@@ -23,7 +23,7 @@ import type { IDatabaseResultSet } from './IDatabaseResultSet';
const RESULT_VALUE_PATH = 'sql-result-value';
-export class DatabaseDataManager> implements IDatabaseDataManager {
+export class DatabaseDataManager implements IDatabaseDataManager {
private readonly cache: Map;
activeElement: IResultSetElementKey | null;
@@ -34,13 +34,13 @@ export class DatabaseDataManager>
this.cache = new Map();
this.activeElement = null;
- makeObservable, 'cache'>(this, {
+ makeObservable(this, {
cache: observable,
activeElement: observable.ref,
});
}
- canDownload(element: IResultSetElementKey, resultIndex: number) {
+ isContent(element: IResultSetElementKey, resultIndex: number) {
const view = this.source.getAction(resultIndex, ResultSetViewAction);
const cellValue = view.getCellValue(element);
diff --git a/webapp/packages/plugin-data-viewer/src/DatabaseDataModel/IDatabaseDataManager.ts b/webapp/packages/plugin-data-viewer/src/DatabaseDataModel/IDatabaseDataManager.ts
index c9148ed8c9..6049931303 100644
--- a/webapp/packages/plugin-data-viewer/src/DatabaseDataModel/IDatabaseDataManager.ts
+++ b/webapp/packages/plugin-data-viewer/src/DatabaseDataModel/IDatabaseDataManager.ts
@@ -10,7 +10,7 @@ import type { IResultSetElementKey } from './Actions/ResultSet/IResultSetDataKey
export interface IDatabaseDataManager {
activeElement: IResultSetElementKey | null;
- canDownload: (element: IResultSetElementKey, resultIndex: number) => boolean;
+ isContent: (element: IResultSetElementKey, resultIndex: number) => boolean;
getFileDataUrl: (element: IResultSetElementKey, resultIndex: number) => Promise;
resolveFileDataUrl: (element: IResultSetElementKey, resultIndex: number) => Promise;
retrieveFileDataUrlFromCache: (element: IResultSetElementKey, resultIndex: number) => string | undefined;
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 03249089c8..3d2522a1d1 100644
--- a/webapp/packages/plugin-data-viewer/src/ValuePanelPresentation/ImageValue/ImageValuePresentation.tsx
+++ b/webapp/packages/plugin-data-viewer/src/ValuePanelPresentation/ImageValue/ImageValuePresentation.tsx
@@ -16,7 +16,7 @@ import { NotificationService } from '@cloudbeaver/core-events';
import { useTranslate } from '@cloudbeaver/core-localization';
import { useStyles } from '@cloudbeaver/core-theming';
import type { TabContainerPanelComponent } from '@cloudbeaver/core-ui';
-import { getMIME, isImageFormat, isValidUrl } from '@cloudbeaver/core-utils';
+import { download, getMIME, isImageFormat, isValidUrl } from '@cloudbeaver/core-utils';
import { isResultSetContentValue, isResultSetContentValueTruncated } from '../../DatabaseDataModel/Actions/ResultSet/isResultSetContentValue';
import { ResultSetDataKeysUtils } from '../../DatabaseDataModel/Actions/ResultSet/ResultSetDataKeysUtils';
@@ -138,8 +138,11 @@ export const ImageValuePresentation: TabContainerPanelComponent {
try {
await model.source.dataManager.resolveFileDataUrl(state.selectedCell, resultIndex);
- } catch (exception) {
- notificationService.logException(exception as any, 'data_viewer_presentation_value_content_download_error');
+ } catch (exception: any) {
+ notificationService.logException(exception, 'data_viewer_presentation_value_content_download_error');
}
};
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 78369ecb7b..f94fd16879 100644
--- a/webapp/packages/plugin-data-viewer/src/ValuePanelPresentation/TextValue/TextValuePresentation.tsx
+++ b/webapp/packages/plugin-data-viewer/src/ValuePanelPresentation/TextValue/TextValuePresentation.tsx
@@ -155,7 +155,7 @@ export const TextValuePresentation: TabContainerPanelComponent