-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Show console debug logs via test tools menu #40656
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
46a6c3e
Show console debug logs via test tools menu
ShridharGoel a323a21
Update
ShridharGoel d9ec214
Fix number of taps
ShridharGoel 64873dd
Fix test tools modal visibility condition
ShridharGoel 65e4338
Typecheck fixes
ShridharGoel 8af99fe
Update
ShridharGoel 851f959
Navigate to console page
ShridharGoel 2cc1846
Update
ShridharGoel d3bfce5
Lint fixes
ShridharGoel 107addb
Merge branch 'main' of https://github.com/Expensify/App into view-logs
ShridharGoel a9176d6
Update
ShridharGoel 1d01420
Fixes
ShridharGoel 8f1da7f
Update
ShridharGoel 064cd4d
Update
ShridharGoel 42193ec
Update
ShridharGoel c64c55f
Fixes
ShridharGoel ae229bd
Merge branch 'main' of https://github.com/Expensify/App into view-logs
ShridharGoel f7d5ead
Merge branch 'main' of https://github.com/Expensify/App into view-logs
ShridharGoel 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 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
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
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
@@ -1,3 +1,5 @@ | ||||
import type {RouteProp} from '@react-navigation/native'; | ||||
import {useRoute} from '@react-navigation/native'; | ||||
import {format} from 'date-fns'; | ||||
import React, {useCallback, useEffect, useMemo, useState} from 'react'; | ||||
import {View} from 'react-native'; | ||||
|
@@ -21,9 +23,11 @@ import type {Log} from '@libs/Console'; | |||
import localFileCreate from '@libs/localFileCreate'; | ||||
import localFileDownload from '@libs/localFileDownload'; | ||||
import Navigation from '@libs/Navigation/Navigation'; | ||||
import type {SettingsNavigatorParamList} from '@navigation/types'; | ||||
import CONST from '@src/CONST'; | ||||
import ONYXKEYS from '@src/ONYXKEYS'; | ||||
import ROUTES from '@src/ROUTES'; | ||||
import type SCREENS from '@src/SCREENS'; | ||||
import type {CapturedLogs} from '@src/types/onyx'; | ||||
|
||||
type ConsolePageOnyxProps = { | ||||
|
@@ -44,6 +48,8 @@ function ConsolePage({capturedLogs, shouldStoreLogs}: ConsolePageProps) { | |||
const {translate} = useLocalize(); | ||||
const styles = useThemeStyles(); | ||||
|
||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||
const route = useRoute<RouteProp<SettingsNavigatorParamList, typeof SCREENS.SETTINGS.CONSOLE>>(); | ||||
|
||||
const logsList = useMemo( | ||||
() => | ||||
Object.entries(logs ?? {}) | ||||
|
@@ -114,7 +120,7 @@ function ConsolePage({capturedLogs, shouldStoreLogs}: ConsolePageProps) { | |||
<ScreenWrapper testID={ConsolePage.displayName}> | ||||
<HeaderWithBackButton | ||||
title={translate('initialSettingsPage.troubleshoot.debugConsole')} | ||||
onBackButtonPress={() => Navigation.goBack(ROUTES.SETTINGS_TROUBLESHOOT)} | ||||
onBackButtonPress={() => Navigation.goBack(route.params?.backTo)} | ||||
/> | ||||
<View style={[styles.border, styles.highlightBG, styles.borderNone, styles.mh5, styles.flex1]}> | ||||
<InvertedFlatList | ||||
|
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
Oops, something went wrong.
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.
This comment was marked as resolved.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But it will not always be
ROUTES.HOME
I think. What if this is opened via some chat?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is true. I assumed you can't open the debug menu web (can you?), but even if you can't, let's keep
Navigation.getActiveRoute()
since it's more universal. Thanks!There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can't be opened on web, but on mobile it can be opened via any page.