From 964e8630899afe566f94b2dc6a3670e2a76399f8 Mon Sep 17 00:00:00 2001 From: pepper Date: Thu, 14 Jan 2021 00:10:31 -0500 Subject: [PATCH] Added link handling --- src/components/root/Pages/Historical.js | 15 +------------ .../root/common/Tables/HistoricalSingle.js | 21 +++++++++++-------- 2 files changed, 13 insertions(+), 23 deletions(-) diff --git a/src/components/root/Pages/Historical.js b/src/components/root/Pages/Historical.js index 982e4ee..f54bafd 100644 --- a/src/components/root/Pages/Historical.js +++ b/src/components/root/Pages/Historical.js @@ -18,20 +18,7 @@ class Historical extends Component { error: false, }; } - componentDidMount() { - callAPI - .get("/all") - .then((request) => { - this.setState({ - migs: request.data, - }); - }) - .catch((error) => { - this.setState({ - error: true, - }); - }); - } + renderItems() { if (!this.props.error) { return ; diff --git a/src/components/root/common/Tables/HistoricalSingle.js b/src/components/root/common/Tables/HistoricalSingle.js index dc346e4..967b14f 100644 --- a/src/components/root/common/Tables/HistoricalSingle.js +++ b/src/components/root/common/Tables/HistoricalSingle.js @@ -15,6 +15,7 @@ import ToolkitProvider, { const HistoricalSingle = () => { const [list, setList] = useState([]); const [loading, setLoading] = useState(false); + const [ticURl, setURL] = useState(null) const { SearchBar } = Search; const { ExportCSVButton } = CSVExport; const sizePerPageRenderer = ({ @@ -45,6 +46,11 @@ const HistoricalSingle = () => { console.log(data); setList(data.data); setLoading(true); + // Determine brand and set URL based on brand + console.log(data.data.brand) + if (data.data.brand === "VentraIP" ) { + console.log("memes") + } } catch (e) { console.log(e); } @@ -78,6 +84,7 @@ const HistoricalSingle = () => { ], sizePerPageRenderer, // A numeric array is also available. the purpose of above example is custom the text }; + const columns = [ { dataField: "id", text: "ID", hidden: true }, { dataField: "brand", text: "Brand", sort: true }, @@ -89,8 +96,9 @@ const HistoricalSingle = () => { formatter: (cell, row) => ( {" "} {cell}{" "} @@ -98,7 +106,7 @@ const HistoricalSingle = () => { ), }, { dataField: "booked_date", text: "Booked Date", sort: true }, - { dataField: "booked_time", text: "Booked Time", sort: true }, + // { dataField: "booked_time", text: "Booked Time", sort: true }, { dataField: "agent_booked", text: "Agent initials", sort: true }, { dataField: "domain", @@ -112,14 +120,9 @@ const HistoricalSingle = () => { { dataField: "original_server", text: "Original Server", sort: true }, { dataField: "new_server", text: "New Server", sort: true }, { dataField: "migration_status", text: "Status", sort: true }, - { dataField: "term_date", text: "Termination Date", sort: true }, + // { dataField: "term_date", text: "Termination Date", sort: true }, { dataField: "notes", text: "Notes", sort: true }, - { dataField: "submit_time", text: "Submit Time", sort: true }, - { - dataField: "report", - text: "Show Detailed Report", - formatter: (cell, row) => {cell} , - }, + // { dataField: "submit_time", text: "Submit Time", sort: true }, ]; useEffect(() => {