2020-08-27 15:39:16 +00:00
|
|
|
import React from "react";
|
|
|
|
|
import { connect } from "react-redux";
|
|
|
|
|
import { AppState } from "reducers";
|
|
|
|
|
import { Dialog, Classes } from "@blueprintjs/core";
|
|
|
|
|
import Button from "components/editorComponents/Button";
|
|
|
|
|
import {
|
|
|
|
|
showRunActionConfirmModal,
|
|
|
|
|
cancelRunActionConfirmModal,
|
|
|
|
|
acceptRunActionConfirmModal,
|
2021-08-27 09:25:28 +00:00
|
|
|
} from "actions/pluginActionActions";
|
2020-08-27 15:39:16 +00:00
|
|
|
|
|
|
|
|
type Props = {
|
|
|
|
|
isModalOpen: boolean;
|
|
|
|
|
dispatch: any;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class ConfirmRunModal extends React.Component<Props> {
|
|
|
|
|
render() {
|
|
|
|
|
const { dispatch, isModalOpen } = this.props;
|
|
|
|
|
const handleClose = () => {
|
|
|
|
|
dispatch(showRunActionConfirmModal(false));
|
2020-09-08 04:57:13 +00:00
|
|
|
|
|
|
|
|
dispatch(cancelRunActionConfirmModal());
|
2020-08-27 15:39:16 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return (
|
2021-04-28 10:28:39 +00:00
|
|
|
<Dialog isOpen={isModalOpen} onClose={handleClose} title="Confirm Action">
|
2020-08-27 15:39:16 +00:00
|
|
|
<div className={Classes.DIALOG_BODY}>
|
2020-09-10 07:26:55 +00:00
|
|
|
Are you sure you want to perform this action?
|
2020-08-27 15:39:16 +00:00
|
|
|
</div>
|
|
|
|
|
<div className={Classes.DIALOG_FOOTER}>
|
|
|
|
|
<div className={Classes.DIALOG_FOOTER_ACTIONS}>
|
|
|
|
|
<Button
|
|
|
|
|
filled
|
|
|
|
|
onClick={() => {
|
|
|
|
|
dispatch(cancelRunActionConfirmModal());
|
|
|
|
|
|
|
|
|
|
handleClose();
|
|
|
|
|
}}
|
2021-04-28 10:28:39 +00:00
|
|
|
text="Cancel"
|
2020-08-27 15:39:16 +00:00
|
|
|
/>
|
|
|
|
|
<Button
|
|
|
|
|
filled
|
|
|
|
|
intent="primary"
|
|
|
|
|
onClick={() => {
|
|
|
|
|
dispatch(acceptRunActionConfirmModal());
|
|
|
|
|
|
|
|
|
|
handleClose();
|
|
|
|
|
}}
|
2021-04-28 10:28:39 +00:00
|
|
|
text="Confirm"
|
2020-08-27 15:39:16 +00:00
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</Dialog>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const mapStateToProps = (state: AppState) => ({
|
|
|
|
|
isModalOpen: state.ui.confirmRunAction.modalOpen,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
export default connect(mapStateToProps)(ConfirmRunModal);
|