mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-11-27 09:47:34 +03:00
Remove outdated option for sharing project data
- the specific project data dir is no longer even created
This commit is contained in:
parent
1c8d30f40e
commit
973be98101
@ -4,10 +4,6 @@ export async function logs() {
|
|||||||
return await invoke<string>('get_logs_archive_path');
|
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 }) {
|
export async function projectData(params: { projectId: string }) {
|
||||||
return await invoke<string>('get_project_archive_path', params);
|
return await invoke<string>('get_project_archive_path', params);
|
||||||
}
|
}
|
||||||
|
@ -41,7 +41,6 @@
|
|||||||
let messageInputValue = '';
|
let messageInputValue = '';
|
||||||
let emailInputValue = '';
|
let emailInputValue = '';
|
||||||
let sendLogs = false;
|
let sendLogs = false;
|
||||||
let sendProjectData = false;
|
|
||||||
let sendProjectRepository = false;
|
let sendProjectRepository = false;
|
||||||
|
|
||||||
$: projectId = $page.params.projectId!;
|
$: projectId = $page.params.projectId!;
|
||||||
@ -49,7 +48,6 @@
|
|||||||
function reset() {
|
function reset() {
|
||||||
messageInputValue = '';
|
messageInputValue = '';
|
||||||
sendLogs = false;
|
sendLogs = false;
|
||||||
sendProjectData = false;
|
|
||||||
sendProjectRepository = false;
|
sendProjectRepository = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -78,33 +76,23 @@
|
|||||||
toasts.promise(
|
toasts.promise(
|
||||||
Promise.all([
|
Promise.all([
|
||||||
sendLogs ? zip.logs().then(async (path) => await readZipFile(path, 'logs.zip')) : undefined,
|
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
|
sendProjectRepository
|
||||||
? zip
|
? zip
|
||||||
.projectData({ projectId })
|
.projectData({ projectId })
|
||||||
.then(async (path) => await readZipFile(path, 'project.zip'))
|
.then(async (path) => await readZipFile(path, 'project.zip'))
|
||||||
: undefined
|
: undefined
|
||||||
]).then(
|
]).then(
|
||||||
async ([logs, data, repo]) =>
|
async ([logs, repo]) =>
|
||||||
await createFeedback($user?.access_token, {
|
await createFeedback($user?.access_token, {
|
||||||
email,
|
email,
|
||||||
message,
|
message,
|
||||||
context,
|
context,
|
||||||
logs,
|
logs,
|
||||||
data,
|
|
||||||
repo
|
repo
|
||||||
})
|
})
|
||||||
),
|
),
|
||||||
{
|
{
|
||||||
loading:
|
loading: !sendLogs && !sendProjectRepository ? 'Sending feedback...' : 'Uploading data...',
|
||||||
!sendLogs && !sendProjectData && !sendProjectRepository
|
|
||||||
? 'Sending feedback...'
|
|
||||||
: 'Uploading data...',
|
|
||||||
success: 'Feedback sent successfully',
|
success: 'Feedback sent successfully',
|
||||||
error: 'Failed to send feedback'
|
error: 'Failed to send feedback'
|
||||||
}
|
}
|
||||||
@ -119,7 +107,6 @@
|
|||||||
message: string;
|
message: string;
|
||||||
context?: string;
|
context?: string;
|
||||||
logs?: Blob | File;
|
logs?: Blob | File;
|
||||||
data?: Blob | File;
|
|
||||||
repo?: Blob | File;
|
repo?: Blob | File;
|
||||||
}
|
}
|
||||||
): Promise<Feedback> {
|
): Promise<Feedback> {
|
||||||
@ -129,7 +116,6 @@
|
|||||||
if (params.context) formData.append('context', params.context);
|
if (params.context) formData.append('context', params.context);
|
||||||
if (params.logs) formData.append('logs', params.logs);
|
if (params.logs) formData.append('logs', params.logs);
|
||||||
if (params.repo) formData.append('repo', params.repo);
|
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
|
// Content Type must be unset for the right form-data border to be set automatically
|
||||||
return await httpClient.put('feedback', {
|
return await httpClient.put('feedback', {
|
||||||
@ -206,11 +192,6 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{#if projectId}
|
{#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">
|
<div class="content-wrapper__checkbox">
|
||||||
<Checkbox name="project-repository" bind:checked={sendProjectRepository} />
|
<Checkbox name="project-repository" bind:checked={sendProjectRepository} />
|
||||||
<label class="text-13" for="project-repository">Share project repository</label>
|
<label class="text-13" for="project-repository">Share project repository</label>
|
||||||
|
@ -24,11 +24,6 @@ impl Archival {
|
|||||||
self.zipper().zip(project.path).map_err(Into::into)
|
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> {
|
pub fn logs_archive(&self) -> Result<PathBuf> {
|
||||||
self.zipper().zip(&self.logs_dir).map_err(Into::into)
|
self.zipper().zip(&self.logs_dir).map_err(Into::into)
|
||||||
}
|
}
|
||||||
|
@ -141,7 +141,6 @@ fn main() {
|
|||||||
commands::git_index_size,
|
commands::git_index_size,
|
||||||
zip::commands::get_logs_archive_path,
|
zip::commands::get_logs_archive_path,
|
||||||
zip::commands::get_project_archive_path,
|
zip::commands::get_project_archive_path,
|
||||||
zip::commands::get_project_data_archive_path,
|
|
||||||
users::commands::set_user,
|
users::commands::set_user,
|
||||||
users::commands::delete_user,
|
users::commands::delete_user,
|
||||||
users::commands::get_user,
|
users::commands::get_user,
|
||||||
|
@ -23,19 +23,6 @@ pub mod commands {
|
|||||||
archival.archive(project_id).map_err(Into::into)
|
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)]
|
#[tauri::command(async)]
|
||||||
#[instrument(skip(archival), err(Debug))]
|
#[instrument(skip(archival), err(Debug))]
|
||||||
pub fn get_logs_archive_path(archival: State<'_, Archival>) -> Result<PathBuf, Error> {
|
pub fn get_logs_archive_path(archival: State<'_, Archival>) -> Result<PathBuf, Error> {
|
||||||
|
Loading…
Reference in New Issue
Block a user