cleaned redundant code

This commit is contained in:
pepper 2021-01-21 01:27:27 -05:00
parent 452327ea9b
commit 3f2e611ce1
4 changed files with 8 additions and 38 deletions

View File

@ -5,9 +5,6 @@ import Cards from "./Pages/Cards";
import GenericList from "../root/Pages/GenericList"; import GenericList from "../root/Pages/GenericList";
import TimeSlotHelper from "./Pages/TimeSlotHelper"; 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 // Homepage/Cards, first API call here to pass down to cards
// and the pending migration list, if there's no data, nothing will show // 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 // This would benefit from an error/notification if there is no data
@ -66,7 +63,7 @@ export class Home extends Component {
<div className="col s8 12"> <div className="col s8 12">
{/* <p>Current availability for {Date()}</p> {/* <p>Current availability for {Date()}</p>
<UList listItems={builfArrayFromObject(this.state.timeslots)} /> */} <UList listItems={builfArrayFromObject(this.state.timeslots)} /> */}
{/* <TimeSlotHelper /> */} <TimeSlotHelper />
</div> </div>
<div className="row"> <div className="row">
<div className="col s12"> <div className="col s12">

View File

@ -21,7 +21,7 @@ export default class Reports extends Component {
match: { params }, match: { params },
} = this.props; } = this.props;
const urlID = callAPI callAPI
.get(`/${params.migrationId}/`) .get(`/${params.migrationId}/`)
.then((response) => .then((response) =>
this.setState({ this.setState({
@ -31,14 +31,9 @@ export default class Reports extends Component {
.catch(function (error) { .catch(function (error) {
console.log(error); console.log(error);
}); });
console.log(urlID);
} }
render() { render() {
// const urlID = ({ migrationId }) => {
// console.log(migrationId.migrationId);
// };
return ( return (
<div> <div>
{/* {this.state.migs} */} {/* {this.state.migs} */}

View File

@ -1,7 +1,6 @@
import React, { Component } from "react"; import React, { Component } from "react";
import ReportSingleMigration from "../common/Forms/ReportSingleMigration"; import ReportSingleMigration from "../common/Forms/ReportSingleMigration";
import { callAPI } from "../../actions/API";
// /migrations in the address bar, // /migrations in the address bar,
// Allows the modification of migrations, and also populating a form // 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. // ReportSingleMigration is the actual form, witha PUT API request on that page.
export default class Migrations extends Component { export default class Migrations extends Component {
constructor(props) {
super(props);
this.state = {
migs: [],
redirect: false,
};
}
render() { 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 ( return (
<div> <div>
<ReportSingleMigration <ReportSingleMigration />
key={this.state.migs.id}
item={this.state.migs}
/>
</div> </div>
); );
} }

View File

@ -99,6 +99,7 @@ const CompTable = (props) => {
: null : null
} }
target="_blank" target="_blank"
rel="noreferrer"
> >
{" "} {" "}
{cell}{" "} {cell}{" "}
@ -118,7 +119,7 @@ const CompTable = (props) => {
{ dataField: "migration_type", text: "Type", sort: true }, { dataField: "migration_type", text: "Type", sort: true },
{ dataField: "original_server", text: "Original Server", sort: true }, { dataField: "original_server", text: "Original Server", sort: true },
{ dataField: "new_server", text: "New Server", sort: true }, { dataField: "new_server", text: "New Server", sort: true },
{ dataField: "notes", text: "Notes", sort: true }, // { dataField: "notes", text: "Notes", sort: true },
]; ];
useEffect(() => { useEffect(() => {
@ -135,6 +136,7 @@ const CompTable = (props) => {
search search
exportCSV exportCSV
key={columns.id} key={columns.id}
width="100%"
> >
{(props) => ( {(props) => (
<div> <div>
@ -153,6 +155,8 @@ const CompTable = (props) => {
condensed condensed
key={columns.id} key={columns.id}
keyField="id" keyField="id"
wrapperClasses="table-responsive"
rowClasses="text-nowrap"
/> />
</div> </div>
<ExportCSVButton {...props.csvProps} key={columns}> <ExportCSVButton {...props.csvProps} key={columns}>