From 3f2e611ce1f00693841aae46c4a09eb8f5b0940b Mon Sep 17 00:00:00 2001 From: pepper Date: Thu, 21 Jan 2021 01:27:27 -0500 Subject: [PATCH] cleaned redundant code --- src/components/root/Home.js | 5 +--- src/components/root/Pages/IDSingle.js | 7 +---- src/components/root/Pages/Migrations.js | 28 +------------------ .../root/common/Tables/CompTable.js | 6 +++- 4 files changed, 8 insertions(+), 38 deletions(-) diff --git a/src/components/root/Home.js b/src/components/root/Home.js index 3f8b370..c4fee83 100644 --- a/src/components/root/Home.js +++ b/src/components/root/Home.js @@ -5,9 +5,6 @@ import Cards from "./Pages/Cards"; import GenericList from "../root/Pages/GenericList"; import TimeSlotHelper from "./Pages/TimeSlotHelper"; -import { UList } from "../root/common/Functionality/UnorderedList"; -import { builfArrayFromObject } from "../actions/Error"; - // Homepage/Cards, first API call here to pass down to cards // and the pending migration list, if there's no data, nothing will show // This would benefit from an error/notification if there is no data @@ -66,7 +63,7 @@ export class Home extends Component {
{/*

Current availability for {Date()}

*/} - {/* */} +
diff --git a/src/components/root/Pages/IDSingle.js b/src/components/root/Pages/IDSingle.js index 2a0a803..44f6fa8 100644 --- a/src/components/root/Pages/IDSingle.js +++ b/src/components/root/Pages/IDSingle.js @@ -21,7 +21,7 @@ export default class Reports extends Component { match: { params }, } = this.props; - const urlID = callAPI + callAPI .get(`/${params.migrationId}/`) .then((response) => this.setState({ @@ -31,14 +31,9 @@ export default class Reports extends Component { .catch(function (error) { console.log(error); }); - console.log(urlID); } render() { - // const urlID = ({ migrationId }) => { - // console.log(migrationId.migrationId); - - // }; return (
{/* {this.state.migs} */} diff --git a/src/components/root/Pages/Migrations.js b/src/components/root/Pages/Migrations.js index 210fc6f..79c3f1d 100644 --- a/src/components/root/Pages/Migrations.js +++ b/src/components/root/Pages/Migrations.js @@ -1,7 +1,6 @@ import React, { Component } from "react"; import ReportSingleMigration from "../common/Forms/ReportSingleMigration"; -import { callAPI } from "../../actions/API"; // /migrations in the address bar, // Allows the modification of migrations, and also populating a form @@ -9,35 +8,10 @@ import { callAPI } from "../../actions/API"; // ReportSingleMigration is the actual form, witha PUT API request on that page. export default class Migrations extends Component { - constructor(props) { - super(props); - this.state = { - migs: [], - redirect: false, - }; - } - render() { - const onSubmit = async (migrationId, { setSubmitting }) => { - callAPI - .get(`/${migrationId.migrationId}/`) - .then((response) => - this.setState({ - redirect: true, - migs: response.data, - }) - ) - .catch(function (error) { - console.log(error); - }); - setSubmitting(false); - }; return (
- +
); } diff --git a/src/components/root/common/Tables/CompTable.js b/src/components/root/common/Tables/CompTable.js index e584a2b..24d422a 100644 --- a/src/components/root/common/Tables/CompTable.js +++ b/src/components/root/common/Tables/CompTable.js @@ -99,6 +99,7 @@ const CompTable = (props) => { : null } target="_blank" + rel="noreferrer" > {" "} {cell}{" "} @@ -118,7 +119,7 @@ const CompTable = (props) => { { dataField: "migration_type", text: "Type", sort: true }, { dataField: "original_server", text: "Original Server", sort: true }, { dataField: "new_server", text: "New Server", sort: true }, - { dataField: "notes", text: "Notes", sort: true }, + // { dataField: "notes", text: "Notes", sort: true }, ]; useEffect(() => { @@ -135,6 +136,7 @@ const CompTable = (props) => { search exportCSV key={columns.id} + width="100%" > {(props) => (
@@ -153,6 +155,8 @@ const CompTable = (props) => { condensed key={columns.id} keyField="id" + wrapperClasses="table-responsive" + rowClasses="text-nowrap" />