-
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-4124 add upload/download context actions
- Loading branch information
Showing
9 changed files
with
70 additions
and
0 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
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
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
32 changes: 32 additions & 0 deletions
32
webapp/packages/core-sdk/src/Extensions/uploadFileSystemEntityExtension.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,32 @@ | ||
/* | ||
* CloudBeaver - Cloud Database Manager | ||
* Copyright (C) 2020-2023 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 { GlobalConstants } from '@cloudbeaver/core-utils'; | ||
|
||
import type { CustomGraphQLClient, UploadProgressEvent } from '../CustomGraphQLClient'; | ||
|
||
export interface IUploadFileSystemEntityExtension { | ||
uploadFileSystemEntity: ( | ||
parentURI: string, | ||
projectId: string, | ||
files: FileList, | ||
onUploadProgress?: (event: UploadProgressEvent) => void, | ||
) => Promise<void>; | ||
} | ||
|
||
export function uploadFileSystemEntityExtension(client: CustomGraphQLClient): IUploadFileSystemEntityExtension { | ||
return { | ||
uploadFileSystemEntity( | ||
parentURI: string, | ||
projectId: string, | ||
files: FileList, | ||
onUploadProgress?: (event: UploadProgressEvent) => void, | ||
): Promise<void> { | ||
return client.uploadFiles(GlobalConstants.absoluteServiceUrl('fs-data'), files, undefined, { parentURI, projectId }, onUploadProgress); | ||
}, | ||
}; | ||
} |
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
13 changes: 13 additions & 0 deletions
13
webapp/packages/core-view/src/Action/Actions/ACTION_DOWNLOAD.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,13 @@ | ||
/* | ||
* CloudBeaver - Cloud Database Manager | ||
* Copyright (C) 2020-2023 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 { createAction } from '../createAction'; | ||
|
||
export const ACTION_DOWNLOAD = createAction('download', { | ||
label: 'ui_download', | ||
icon: '/icons/export.svg', | ||
}); |
13 changes: 13 additions & 0 deletions
13
webapp/packages/core-view/src/Action/Actions/ACTION_UPLOAD.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,13 @@ | ||
/* | ||
* CloudBeaver - Cloud Database Manager | ||
* Copyright (C) 2020-2023 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 { createAction } from '../createAction'; | ||
|
||
export const ACTION_UPLOAD = createAction('upload', { | ||
label: 'ui_upload', | ||
icon: '/icons/import.svg', | ||
}); |
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