Skip to content
This repository was archived by the owner on Jul 30, 2025. It is now read-only.

Commit f6dc8d0

Browse files
committed
fix(plugins/plugin-client-common): sidecar delete button from right split executes command in left split
this is annoying. if i have a table on the left, and a sidecar drilldown on the right, then click the delete button in the sidecar... the delete command is executed on the left, which scrolls my table offscreen. if i'm trying to delete multiple elements, this is annoying
1 parent 84e1e26 commit f6dc8d0

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

plugins/plugin-client-common/src/components/Views/Confirm.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@ export default class Confirm extends React.PureComponent<Props, State | ActiveSt
8181
}
8282
}
8383

84+
private readonly _onSubmit = this.onConfirm.bind(this, true)
85+
private readonly _onClose = this.onConfirm.bind(this, false)
86+
8487
public render() {
8588
if (!isActive(this.state)) {
8689
return <React.Fragment />
@@ -93,8 +96,8 @@ export default class Confirm extends React.PureComponent<Props, State | ActiveSt
9396
title={strings('pleaseConfirm')}
9497
primaryButtonText={strings('yesIAmSure')}
9598
secondaryButtonText={strings('cancel')}
96-
onSubmit={() => this.onConfirm(true)}
97-
onClose={() => this.onConfirm(false)}
99+
onSubmit={this._onSubmit}
100+
onClose={this._onClose}
98101
>
99102
<p className="bx--modal-content__text">{strings('aboutToExecute')}</p>
100103
<p className="bx--modal-content__text">

plugins/plugin-client-common/src/controller/confirm.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
import {
18-
Events,
19-
getPrimaryTabId,
20-
Registrar,
21-
ExecType,
22-
UsageModel,
23-
i18n,
24-
pexecInCurrentTab
25-
} from '@kui-shell/core'
17+
import { Events, getPrimaryTabId, Registrar, ExecType, UsageModel, i18n, pexecInCurrentTab } from '@kui-shell/core'
2618

2719
const strings = i18n('plugin-core-support')
2820

@@ -65,7 +57,7 @@ export default async (commandTree: Registrar) => {
6557
if (!confirmed) {
6658
reject(strings('operationCancelled'))
6759
} else if (execOptions.type === ExecType.Nested) {
68-
pexecInCurrentTab(command).then(resolve, reject)
60+
pexecInCurrentTab(command, tab).then(resolve, reject)
6961
} else {
7062
REPL.qexec(command, undefined, undefined, { tab }).then(resolve, reject)
7163
}

0 commit comments

Comments
 (0)