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 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 {
<div className="col s8 12">
{/* <p>Current availability for {Date()}</p>
<UList listItems={builfArrayFromObject(this.state.timeslots)} /> */}
{/* <TimeSlotHelper /> */}
<TimeSlotHelper />
</div>
<div className="row">
<div className="col s12">

View File

@ -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 (
<div>
{/* {this.state.migs} */}

View File

@ -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 (
<div>
<ReportSingleMigration
key={this.state.migs.id}
item={this.state.migs}
/>
<ReportSingleMigration />
</div>
);
}

View File

@ -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) => (
<div>
@ -153,6 +155,8 @@ const CompTable = (props) => {
condensed
key={columns.id}
keyField="id"
wrapperClasses="table-responsive"
rowClasses="text-nowrap"
/>
</div>
<ExportCSVButton {...props.csvProps} key={columns}>