Skip to content

Commit

Permalink
fix(plugins/plugin-client-common): clicking on pod delete button can …
Browse files Browse the repository at this point in the history
…cause command to be executed in minisplit

Fixes #5247
  • Loading branch information
myan9 authored and starpit committed Jul 23, 2020
1 parent 3850efd commit e76f8a0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
ResourceWithMetadata,
isViewButton,
MultiModalResponse,
pexecInCurrentTab,
ParsedOptions
} from '@kui-shell/core'

Expand Down Expand Up @@ -59,7 +60,7 @@ export default class ToolbarButton<T extends ResourceWithMetadata = ResourceWith
if (isViewButton(button) || button.confirm) {
return tab.REPL.qexec(cmd, undefined, undefined, { rethrowErrors: true })
} else {
return tab.REPL.pexec(cmd)
return pexecInCurrentTab(cmd)
}
} else {
cmd(tab, response, args)
Expand Down
12 changes: 10 additions & 2 deletions plugins/plugin-client-common/src/controller/confirm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,15 @@
* limitations under the License.
*/

import { eventChannelUnsafe, getPrimaryTabId, Registrar, ExecType, UsageModel, i18n } from '@kui-shell/core'
import {
eventChannelUnsafe,
getPrimaryTabId,
Registrar,
ExecType,
UsageModel,
i18n,
pexecInCurrentTab
} from '@kui-shell/core'

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

Expand Down Expand Up @@ -57,7 +65,7 @@ export default async (commandTree: Registrar) => {
if (!confirmed) {
reject(strings('operationCancelled'))
} else if (execOptions.type === ExecType.Nested) {
REPL.pexec(command, { tab }).then(resolve, reject)
pexecInCurrentTab(command).then(resolve, reject)
} else {
REPL.qexec(command, undefined, undefined, { tab }).then(resolve, reject)
}
Expand Down

0 comments on commit e76f8a0

Please sign in to comment.