From 973be98101113509aa70be4daaadefdeb0beb60e Mon Sep 17 00:00:00 2001 From: Mattias Granlund Date: Thu, 31 Oct 2024 11:04:19 +0100 Subject: [PATCH] Remove outdated option for sharing project data - the specific project data dir is no longer even created --- apps/desktop/src/lib/backend/zip.ts | 4 ---- .../src/lib/components/ShareIssueModal.svelte | 23 ++----------------- crates/gitbutler-feedback/src/controller.rs | 5 ---- crates/gitbutler-tauri/src/main.rs | 1 - crates/gitbutler-tauri/src/zip.rs | 13 ----------- 5 files changed, 2 insertions(+), 44 deletions(-) diff --git a/apps/desktop/src/lib/backend/zip.ts b/apps/desktop/src/lib/backend/zip.ts index de562d292..af35ad4f2 100644 --- a/apps/desktop/src/lib/backend/zip.ts +++ b/apps/desktop/src/lib/backend/zip.ts @@ -4,10 +4,6 @@ export async function logs() { return await invoke('get_logs_archive_path'); } -export async function gitbutlerData(params: { projectId: string }) { - return await invoke('get_project_data_archive_path', params); -} - export async function projectData(params: { projectId: string }) { return await invoke('get_project_archive_path', params); } diff --git a/apps/desktop/src/lib/components/ShareIssueModal.svelte b/apps/desktop/src/lib/components/ShareIssueModal.svelte index 3813d17c0..b9a9b5c81 100644 --- a/apps/desktop/src/lib/components/ShareIssueModal.svelte +++ b/apps/desktop/src/lib/components/ShareIssueModal.svelte @@ -41,7 +41,6 @@ let messageInputValue = ''; let emailInputValue = ''; let sendLogs = false; - let sendProjectData = false; let sendProjectRepository = false; $: projectId = $page.params.projectId!; @@ -49,7 +48,6 @@ function reset() { messageInputValue = ''; sendLogs = false; - sendProjectData = false; sendProjectRepository = false; } @@ -78,33 +76,23 @@ toasts.promise( Promise.all([ sendLogs ? zip.logs().then(async (path) => await readZipFile(path, 'logs.zip')) : undefined, - sendProjectData - ? zip - .gitbutlerData({ projectId }) - .then(async (path) => await readZipFile(path, 'data.zip')) - .catch(() => undefined) - : undefined, sendProjectRepository ? zip .projectData({ projectId }) .then(async (path) => await readZipFile(path, 'project.zip')) : undefined ]).then( - async ([logs, data, repo]) => + async ([logs, repo]) => await createFeedback($user?.access_token, { email, message, context, logs, - data, repo }) ), { - loading: - !sendLogs && !sendProjectData && !sendProjectRepository - ? 'Sending feedback...' - : 'Uploading data...', + loading: !sendLogs && !sendProjectRepository ? 'Sending feedback...' : 'Uploading data...', success: 'Feedback sent successfully', error: 'Failed to send feedback' } @@ -119,7 +107,6 @@ message: string; context?: string; logs?: Blob | File; - data?: Blob | File; repo?: Blob | File; } ): Promise { @@ -129,7 +116,6 @@ if (params.context) formData.append('context', params.context); if (params.logs) formData.append('logs', params.logs); if (params.repo) formData.append('repo', params.repo); - if (params.data) formData.append('data', params.data); // Content Type must be unset for the right form-data border to be set automatically return await httpClient.put('feedback', { @@ -206,11 +192,6 @@ {#if projectId} -
- - -
-
diff --git a/crates/gitbutler-feedback/src/controller.rs b/crates/gitbutler-feedback/src/controller.rs index a81c8bc35..6c8f9b5ba 100644 --- a/crates/gitbutler-feedback/src/controller.rs +++ b/crates/gitbutler-feedback/src/controller.rs @@ -24,11 +24,6 @@ impl Archival { self.zipper().zip(project.path).map_err(Into::into) } - pub fn data_archive(&self, project_id: ProjectId) -> Result { - let dir_to_archive = self.projects_controller.project_metadata_dir(project_id); - self.zipper().zip(dir_to_archive).map_err(Into::into) - } - pub fn logs_archive(&self) -> Result { self.zipper().zip(&self.logs_dir).map_err(Into::into) } diff --git a/crates/gitbutler-tauri/src/main.rs b/crates/gitbutler-tauri/src/main.rs index c695cd4e6..2039f6203 100644 --- a/crates/gitbutler-tauri/src/main.rs +++ b/crates/gitbutler-tauri/src/main.rs @@ -141,7 +141,6 @@ fn main() { commands::git_index_size, zip::commands::get_logs_archive_path, zip::commands::get_project_archive_path, - zip::commands::get_project_data_archive_path, users::commands::set_user, users::commands::delete_user, users::commands::get_user, diff --git a/crates/gitbutler-tauri/src/zip.rs b/crates/gitbutler-tauri/src/zip.rs index 92b121057..557ed2e50 100644 --- a/crates/gitbutler-tauri/src/zip.rs +++ b/crates/gitbutler-tauri/src/zip.rs @@ -23,19 +23,6 @@ pub mod commands { archival.archive(project_id).map_err(Into::into) } - #[tauri::command(async)] - #[instrument(skip(archival), err(Debug))] - pub fn get_project_data_archive_path( - archival: State<'_, Archival>, - project_id: &str, - ) -> Result { - let project_id = project_id.parse().context(error::Context::new_static( - Code::Validation, - "Malformed project id", - ))?; - archival.data_archive(project_id).map_err(Into::into) - } - #[tauri::command(async)] #[instrument(skip(archival), err(Debug))] pub fn get_logs_archive_path(archival: State<'_, Archival>) -> Result {