Skip to content

Commit 32a825a

Browse files
committed
move force install to main connection screen, remove edit/delete from edit screen
1 parent 0ece51e commit 32a825a

1 file changed

Lines changed: 19 additions & 39 deletions

File tree

src/app/common/modals/modals.tsx

Lines changed: 19 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -879,6 +879,11 @@ class ViewRemoteConnDetailModal extends React.Component<{}, {}> {
879879
});
880880
}
881881

882+
@boundMethod
883+
clickReinstall(): void {
884+
GlobalCommandRunner.installRemote(this.selectedRemote?.remoteid);
885+
}
886+
882887
@boundMethod
883888
handleClose(): void {
884889
this.model.closeModal();
@@ -911,11 +916,6 @@ class ViewRemoteConnDetailModal extends React.Component<{}, {}> {
911916

912917
renderHeaderBtns(remote: T.RemoteType): React.ReactNode {
913918
let buttons: React.ReactNode[] = [];
914-
const archiveButton = (
915-
<Button theme="secondary" onClick={() => this.clickArchive()}>
916-
Delete
917-
</Button>
918-
);
919919
const disconnectButton = (
920920
<Button theme="secondary" onClick={() => this.disconnectRemote(remote.remoteid)}>
921921
Disconnect Now
@@ -946,12 +946,21 @@ class ViewRemoteConnDetailModal extends React.Component<{}, {}> {
946946
Install Now
947947
</Button>
948948
);
949+
const archiveButton = (
950+
<Button theme="secondary" onClick={() => this.clickArchive()}>
951+
Delete
952+
</Button>
953+
);
954+
const reinstallButton = (
955+
<Button theme="secondary" onClick={this.clickReinstall}>
956+
Reinstall
957+
</Button>
958+
);
949959
if (remote.local) {
950-
installNowButton = <></>;
960+
installNowButton = <></>;
951961
updateAuthButton = <></>;
952962
cancelInstallButton = <></>;
953963
}
954-
buttons = [archiveButton, updateAuthButton];
955964
if (remote.status == "connected" || remote.status == "connecting") {
956965
buttons.push(disconnectButton);
957966
} else if (remote.status == "disconnected") {
@@ -967,6 +976,9 @@ class ViewRemoteConnDetailModal extends React.Component<{}, {}> {
967976
buttons.push(tryReconnectButton);
968977
}
969978
}
979+
buttons.push(reinstallButton);
980+
buttons.push(updateAuthButton);
981+
buttons.push(archiveButton);
970982

971983
let i = 0;
972984
let button: React.ReactNode = null;
@@ -1177,30 +1189,6 @@ class EditRemoteConnModal extends React.Component<{}, {}> {
11771189
}
11781190
}
11791191

1180-
@boundMethod
1181-
clickArchive(): void {
1182-
if (this.selectedRemote?.status == "connected") {
1183-
GlobalModel.showAlert({ message: "Cannot delete while connected. Disconnect and try again." });
1184-
return;
1185-
}
1186-
let prtn = GlobalModel.showAlert({
1187-
message: "Are you sure you want to delete this connection?",
1188-
confirm: true,
1189-
});
1190-
1191-
prtn.then((confirm) => {
1192-
if (!confirm) {
1193-
return;
1194-
}
1195-
GlobalCommandRunner.archiveRemote(this.selectedRemote?.remoteid);
1196-
});
1197-
}
1198-
1199-
@boundMethod
1200-
clickForceInstall(): void {
1201-
GlobalCommandRunner.installRemote(this.selectedRemote?.remoteid);
1202-
}
1203-
12041192
@boundMethod
12051193
handleChangeKeyFile(value: string): void {
12061194
mobx.action(() => {
@@ -1312,14 +1300,6 @@ class EditRemoteConnModal extends React.Component<{}, {}> {
13121300
<div className="wave-modal-body">
13131301
<div className="name-actions-section">
13141302
<div className="name text-primary">{getName(this.selectedRemote)}</div>
1315-
<div className="header-actions">
1316-
<Button theme="secondary" onClick={this.clickArchive}>
1317-
Delete
1318-
</Button>
1319-
<Button theme="secondary" onClick={this.clickForceInstall}>
1320-
Force Install
1321-
</Button>
1322-
</div>
13231303
</div>
13241304
<div className="alias-section">
13251305
<TextField

0 commit comments

Comments
 (0)