-
Notifications
You must be signed in to change notification settings - Fork 33
feat: Add global shortcut to export logs #2336
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
ericlln
merged 17 commits into
deephaven:main
from
ericlln:DH-18341-method-to-export-logs-when-login-or-connection-fails
Jan 17, 2025
Merged
Changes from 15 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
014bd71
add global shortcut for exporting logs
ericlln 00f05c8
add actions to export logs using global shortcut
ericlln 91b77ad
remove ContextMenuRoot from code-studio App
ericlln ce0a9fd
add tests for downloading logs shortcut
ericlln 5d3167a
add embed-widget to ci environment
ericlln 275d16e
add test for testing shortcut in embed-widgets
ericlln 8fa404e
add uiVersion to exportLogs action
ericlln 9a3b143
Merge branch 'deephaven:main' into DH-18341-method-to-export-logs-whe…
ericlln f41014a
remove ContextMenuRoot from embed-widgets App
ericlln 9e69bec
increase timeout time for slow e2e test
ericlln e322984
replace uiVersion with optional logMetadata prop
ericlln 982f65f
unify export logs context actions
ericlln fdb434f
fix log export in embed-widget test flakiness
ericlln 6c4cb43
remove unused imports from AppMainContainer
ericlln 5b22f85
fix serverConfigValues type AppMainContainer tests
ericlln 61c8b05
Fix typo in tests/shortcuts.spec.ts
ericlln e8c092f
put comment into description of test.slow()
ericlln File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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
25 changes: 25 additions & 0 deletions
25
packages/app-utils/src/utils/createExportLogsContextAction.ts
This file contains hidden or 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,25 @@ | ||
| import { type ContextAction, GLOBAL_SHORTCUTS } from '@deephaven/components'; | ||
| import { exportLogs, logHistory } from '@deephaven/log'; | ||
| import { store } from '@deephaven/redux'; | ||
|
|
||
| export function createExportLogsContextAction( | ||
| metadata?: Record<string, unknown>, | ||
| isGlobal = false | ||
| ): ContextAction { | ||
| return { | ||
| action: () => { | ||
| exportLogs( | ||
| logHistory, | ||
| { | ||
| ...metadata, | ||
| userAgent: navigator.userAgent, | ||
| }, | ||
| store.getState() | ||
| ); | ||
| }, | ||
| shortcut: GLOBAL_SHORTCUTS.EXPORT_LOGS, | ||
| isGlobal, | ||
| }; | ||
| } | ||
|
|
||
| export default createExportLogsContextAction; |
This file contains hidden or 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 |
|---|---|---|
| @@ -1 +1,2 @@ | ||
| export * from './ConnectUtils'; | ||
| export * from './createExportLogsContextAction'; |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,43 @@ | ||
| import { test, expect } from '@playwright/test'; | ||
| import { gotoPage } from './utils'; | ||
|
|
||
| test('shortcut downloads logs', async ({ page }) => { | ||
| await gotoPage(page, ''); | ||
|
|
||
| const downloadPromise = page.waitForEvent('download'); | ||
| await page.keyboard.press('ControlOrMeta+Alt+Shift+KeyL'); | ||
| const download = await downloadPromise; | ||
|
|
||
| expect(download).not.toBeNull(); | ||
| }); | ||
|
|
||
| test('shortcut downloads logs in full screen error', async ({ page }) => { | ||
| // Go to embed-widget page without url parameter to trigger a full screen error | ||
| await gotoPage(page, 'http://localhost:4010/'); | ||
|
|
||
| const downloadPromise = page.waitForEvent('download'); | ||
| await page.keyboard.press('ControlOrMeta+Alt+Shift+KeyL'); | ||
| const download = await downloadPromise; | ||
|
|
||
| expect(download).not.toBeNull(); | ||
| }); | ||
|
|
||
| test('shortcut downloads logs in embeded-widget', async ({ page }) => { | ||
| test.slow(); // Extend timeout to prevent a failure before page loads | ||
|
ericlln marked this conversation as resolved.
Outdated
|
||
|
|
||
| // The embed-widgets page and the table itself have seperate loading spinners, | ||
|
ericlln marked this conversation as resolved.
Outdated
|
||
| // causing a strict mode violation intermittently when using the goToPage helper | ||
| await gotoPage(page, 'http://localhost:4010?name=all_types'); | ||
| await expect( | ||
| page.getByRole('progressbar', { | ||
| name: 'Loading...', | ||
| exact: true, | ||
| }) | ||
| ).toHaveCount(0); | ||
|
|
||
| const downloadPromise = page.waitForEvent('download'); | ||
| await page.keyboard.press('ControlOrMeta+Alt+Shift+KeyL'); | ||
| const download = await downloadPromise; | ||
|
|
||
| expect(download).not.toBeNull(); | ||
| }); | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.