From 32a825aea12bf43da2429b27dc89f9b2152c9395 Mon Sep 17 00:00:00 2001 From: sawka Date: Tue, 5 Dec 2023 17:42:43 -0800 Subject: [PATCH] move force install to main connection screen, remove edit/delete from edit screen --- src/app/common/modals/modals.tsx | 58 +++++++++++--------------------- 1 file changed, 19 insertions(+), 39 deletions(-) diff --git a/src/app/common/modals/modals.tsx b/src/app/common/modals/modals.tsx index 28c7e8ed..e281cf8c 100644 --- a/src/app/common/modals/modals.tsx +++ b/src/app/common/modals/modals.tsx @@ -879,6 +879,11 @@ class ViewRemoteConnDetailModal extends React.Component<{}, {}> { }); } + @boundMethod + clickReinstall(): void { + GlobalCommandRunner.installRemote(this.selectedRemote?.remoteid); + } + @boundMethod handleClose(): void { this.model.closeModal(); @@ -911,11 +916,6 @@ class ViewRemoteConnDetailModal extends React.Component<{}, {}> { renderHeaderBtns(remote: T.RemoteType): React.ReactNode { let buttons: React.ReactNode[] = []; - const archiveButton = ( - - ); const disconnectButton = ( ); + const archiveButton = ( + + ); + const reinstallButton = ( + + ); if (remote.local) { - installNowButton = <>; + installNowButton = <>; updateAuthButton = <>; cancelInstallButton = <>; } - buttons = [archiveButton, updateAuthButton]; if (remote.status == "connected" || remote.status == "connecting") { buttons.push(disconnectButton); } else if (remote.status == "disconnected") { @@ -967,6 +976,9 @@ class ViewRemoteConnDetailModal extends React.Component<{}, {}> { buttons.push(tryReconnectButton); } } + buttons.push(reinstallButton); + buttons.push(updateAuthButton); + buttons.push(archiveButton); let i = 0; let button: React.ReactNode = null; @@ -1177,30 +1189,6 @@ class EditRemoteConnModal extends React.Component<{}, {}> { } } - @boundMethod - clickArchive(): void { - if (this.selectedRemote?.status == "connected") { - GlobalModel.showAlert({ message: "Cannot delete while connected. Disconnect and try again." }); - return; - } - let prtn = GlobalModel.showAlert({ - message: "Are you sure you want to delete this connection?", - confirm: true, - }); - - prtn.then((confirm) => { - if (!confirm) { - return; - } - GlobalCommandRunner.archiveRemote(this.selectedRemote?.remoteid); - }); - } - - @boundMethod - clickForceInstall(): void { - GlobalCommandRunner.installRemote(this.selectedRemote?.remoteid); - } - @boundMethod handleChangeKeyFile(value: string): void { mobx.action(() => { @@ -1312,14 +1300,6 @@ class EditRemoteConnModal extends React.Component<{}, {}> {
{getName(this.selectedRemote)}
-
- - -