@@ -38,7 +38,7 @@ import ProfileSelect from "./ProfileSelect"
3838import ProfileWatcher from "../tray/watchers/profile/list"
3939// import ProfileStatusWatcher from "../tray/watchers/profile/status"
4040// import UpdateFunction from "../tray/update"
41- import { handleNew , handleDelete , handleReset } from "../controller/profile/actions"
41+ import { handleNew } from "../controller/profile/actions"
4242
4343import Icon from "@patternfly/react-icons/dist/esm/icons/clipboard-list-icon"
4444
@@ -278,12 +278,26 @@ class ProfileCard extends React.PureComponent<ProfileCardProps, ProfileCardState
278278 /** Delete selected profile */
279279 private readonly _onDelete = async ( ) => {
280280 if ( this . props . profile ) {
281- await handleDelete ( this . props . profile )
281+ await this . executeKuiCommand (
282+ `Are you sure you wish to delete the profile named ${ this . props . profile } ?` ,
283+ `codeflare delete profile ${ this . props . profile } `
284+ )
282285 this . props . onSelectProfile ( null )
283286 }
284287 }
285288
286- private readonly _onReset = ( ) => this . props . profile && handleReset ( this . props . profile )
289+ private executeKuiCommand ( question : string , cmdline : string ) {
290+ import ( "@kui-shell/core" ) . then ( ( _ ) =>
291+ _ . pexecInCurrentTab ( `confirm --asking "${ question } " "${ cmdline } "` , undefined , false , true )
292+ )
293+ }
294+
295+ private readonly _onReset = ( ) =>
296+ this . props . profile &&
297+ this . executeKuiCommand (
298+ `Are you sure you wish to reset the profile named ${ this . props . profile } ?` ,
299+ `codeflare reset profile ${ this . props . profile } `
300+ )
287301
288302 private title ( ) {
289303 return (
0 commit comments