Remove outdated option for sharing project data

- the specific project data dir is no longer even created
This commit is contained in:
Mattias Granlund 2024-10-31 11:04:19 +01:00
parent 1c8d30f40e
commit 973be98101
5 changed files with 2 additions and 44 deletions

View File

@ -4,10 +4,6 @@ export async function logs() {
return await invoke<string>('get_logs_archive_path');
}
export async function gitbutlerData(params: { projectId: string }) {
return await invoke<string>('get_project_data_archive_path', params);
}
export async function projectData(params: { projectId: string }) {
return await invoke<string>('get_project_archive_path', params);
}

View File

@ -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<Feedback> {
@ -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 @@
</div>
{#if projectId}
<div class="content-wrapper__checkbox">
<Checkbox name="project-data" bind:checked={sendProjectData} />
<label class="text-13" for="project-data">Share project data</label>
</div>
<div class="content-wrapper__checkbox">
<Checkbox name="project-repository" bind:checked={sendProjectRepository} />
<label class="text-13" for="project-repository">Share project repository</label>

View File

@ -24,11 +24,6 @@ impl Archival {
self.zipper().zip(project.path).map_err(Into::into)
}
pub fn data_archive(&self, project_id: ProjectId) -> Result<PathBuf> {
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<PathBuf> {
self.zipper().zip(&self.logs_dir).map_err(Into::into)
}

View File

@ -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,

View File

@ -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<PathBuf, Error> {
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<PathBuf, Error> {