Added delete all EMS functionality RPS-11

This commit is contained in:
Patrick Fic
2020-10-26 10:22:21 -07:00
parent 89a8ad380f
commit 6359641b8c
6 changed files with 68 additions and 16 deletions

View File

@@ -0,0 +1,17 @@
import { Button, Popconfirm } from "antd";
import React from "react";
import ipcTypes from "../../../ipc.types";
const { ipcRenderer } = window;
export default function DeleteAllEmsAtom() {
return (
<Popconfirm
title="Are you sure you want to delete all EMS files? This cannot be undone."
onConfirm={() =>
ipcRenderer.send(ipcTypes.default.fileScan.toMain.deleteAllEms)
}
>
<Button>Delete All EMS</Button>
</Popconfirm>
);
}

View File

@@ -1,4 +1,4 @@
import { Button, Input, Table } from "antd";
import { Button, Input, message, Table } from "antd";
import React, { useState } from "react";
import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
@@ -8,6 +8,7 @@ import {
selectScanLoading,
} from "../../../redux/scan/scan.selectors";
import { alphaSort } from "../../../util/sorters";
import DeleteAllEmsAtom from "../../atoms/delete-all-ems/delete-all-ems.atom";
import LastScannedAtom from "../../atoms/last-scanned/last-scanned.atom";
import ScanRefreshAtom from "../../atoms/scan-refresh/scan-refresh.atom";
@@ -64,12 +65,13 @@ export function ScanEstimateListMolecule({ scanLoading, estimates }) {
key: "import",
render: (text, record) => (
<Button
onClick={() =>
onClick={() => {
message.info("Attempting to import job...");
ipcRenderer.send(
ipcTypes.default.fileScan.toMain.importJob,
record.filepath
)
}
);
}}
>
Import
</Button>
@@ -96,6 +98,7 @@ export function ScanEstimateListMolecule({ scanLoading, estimates }) {
<div className="imex-table-header">
<ScanRefreshAtom />
<LastScannedAtom />
<DeleteAllEmsAtom />
<Input.Search
className="imex-table-header__search"
placeholder="Search"