From 8a27a7d5a142064d404c00a55e19f7d91ae87d4e Mon Sep 17 00:00:00 2001
From: ShridharGoel <35566748+ShridharGoel@users.noreply.github.com>
Date: Tue, 23 Apr 2024 17:12:25 +0530
Subject: [PATCH 01/15] Save logs data in downloads and show meaningful path
---
.../BaseClientSideLoggingToolMenu.tsx | 6 +++--
.../index.android.tsx | 1 +
.../ClientSideLoggingToolMenu/index.ios.tsx | 1 +
...x.native.tsx => BaseProfilingToolMenu.tsx} | 26 ++++++++++++-------
.../ProfilingToolMenu/index.android.tsx | 16 ++++++++++++
.../ProfilingToolMenu/index.ios.tsx | 16 ++++++++++++
6 files changed, 54 insertions(+), 12 deletions(-)
rename src/components/ProfilingToolMenu/{index.native.tsx => BaseProfilingToolMenu.tsx} (87%)
create mode 100644 src/components/ProfilingToolMenu/index.android.tsx
create mode 100644 src/components/ProfilingToolMenu/index.ios.tsx
diff --git a/src/components/ClientSideLoggingToolMenu/BaseClientSideLoggingToolMenu.tsx b/src/components/ClientSideLoggingToolMenu/BaseClientSideLoggingToolMenu.tsx
index fcad770908a6..e69da3ba1200 100644
--- a/src/components/ClientSideLoggingToolMenu/BaseClientSideLoggingToolMenu.tsx
+++ b/src/components/ClientSideLoggingToolMenu/BaseClientSideLoggingToolMenu.tsx
@@ -30,9 +30,11 @@ type BaseClientSideLoggingToolProps = {
onDisableLogging: (logs: Log[]) => void;
/** Action to run when enabling logging */
onEnableLogging?: () => void;
+ /** Path used to display location of saved file */
+ displayPath: string;
} & BaseClientSideLoggingToolMenuOnyxProps;
-function BaseClientSideLoggingToolMenu({shouldStoreLogs, capturedLogs, file, onShareLogs, onDisableLogging, onEnableLogging}: BaseClientSideLoggingToolProps) {
+function BaseClientSideLoggingToolMenu({shouldStoreLogs, capturedLogs, file, onShareLogs, onDisableLogging, onEnableLogging, displayPath}: BaseClientSideLoggingToolProps) {
const {translate} = useLocalize();
const onToggle = () => {
@@ -70,7 +72,7 @@ function BaseClientSideLoggingToolMenu({shouldStoreLogs, capturedLogs, file, onS
{!!file && (
<>
- {`path: ${file.path}`}
+ {`path: ${displayPath}/${file.newFileName}`}
{!!pathIOS && (
<>
- {`path: ${pathIOS}`}
+ {`path: ${displayPath}/${newFileName}`}
{!!file && (
<>
- {`path: ${displayPath}/${file.newFileName}`}
+ {`path: ${displayPath}`}