-
Notifications
You must be signed in to change notification settings - Fork 397
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CB-4289 pass file name based on context
- Loading branch information
Showing
7 changed files
with
132 additions
and
49 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
* CloudBeaver - Cloud Database Manager | ||
* Copyright (C) 2020-2024 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 { withTimestamp } from './withTimestamp'; | ||
|
||
describe('withTimestamp', () => { | ||
it('should generate a value with timestamp at the end', () => { | ||
const mockDate = new Date('2020-09-09T14:13:20'); | ||
const spy = jest.spyOn(global, 'Date').mockImplementation(() => mockDate); | ||
|
||
const value = 'value'; | ||
const expectedValue = `${value} 2020-09-09 14-13-20`; | ||
|
||
expect(withTimestamp(value)).toEqual(expectedValue); | ||
|
||
spy.mockRestore(); | ||
}); | ||
}); |
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,14 @@ | ||
/* | ||
* CloudBeaver - Cloud Database Manager | ||
* Copyright (C) 2020-2024 DBeaver Corp and others | ||
* | ||
* Licensed under the Apache License, Version 2.0. | ||
* you may not use this file except in compliance with the License. | ||
*/ | ||
|
||
export function withTimestamp(value: string) { | ||
const now = new Date(); | ||
return `${value} ${now.toISOString().slice(0, 10)} ${('0' + now.getHours()).slice(-2)}-${('0' + now.getMinutes()).slice(-2)}-${( | ||
'0' + now.getSeconds() | ||
).slice(-2)}`; | ||
} |
14 changes: 14 additions & 0 deletions
14
webapp/packages/plugin-data-export/src/ACTION_EXPORT_DATA.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,14 @@ | ||
/* | ||
* CloudBeaver - Cloud Database Manager | ||
* Copyright (C) 2020-2024 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 '@cloudbeaver/core-view'; | ||
|
||
export const ACTION_EXPORT_DATA = createAction('export-data', { | ||
label: 'data_transfer_dialog_export', | ||
tooltip: 'data_transfer_dialog_export', | ||
icon: 'table-export', | ||
}); |
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