Skip to content

Commit

Permalink
Cleanup unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
meissadia committed Nov 19, 2021
1 parent 8a75935 commit c513c68
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 84 deletions.
4 changes: 2 additions & 2 deletions src/filing/submission/upload/FileProcessingProgress.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useEffect, useState } from 'react';
import React, { useEffect } from 'react';
import { UPLOADING } from '../../constants/statusCodes'
import { UploadBar } from './UploadBar'
import ProgressBar from './ProgressBar/'
Expand All @@ -25,7 +25,7 @@ const getStatus = (str, prevErrors, isSV) => {
const hasError = str => str.match(/Err/)

const FileProcessingProgress = ({ progress, uploading, code, watchProgress, filingPeriod, lei }) => {
const { done, syntactical, macro, quality, fetched } = progress
const { syntactical, macro, quality, fetched } = progress

useEffect(() => {
if (!fetched) watchProgress()
Expand Down
2 changes: 1 addition & 1 deletion src/filing/submission/upload/ProgressBar/ProgressBar.css
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
.meter.progress { background: #75afe9; }
.meter.progress .fill { background: #308ae4; }

/* Stripped Overlay */
/* Striped Overlay */
.meter.striped > .fill::after {
content: '';
position: absolute;
Expand Down
73 changes: 1 addition & 72 deletions src/filing/submission/upload/UploadBar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ export class UploadBar extends Component {
}

saveWidth(filingPeriod, lei, width) {
// if (this.props.errorUpload || this.props.errorApp) width = 0
localStorage.setItem(`HMDA_UPLOAD_PROGRESS/${filingPeriod}/${lei}`, JSON.stringify(width))
}

Expand Down Expand Up @@ -85,74 +84,4 @@ export class UploadBar extends Component {
/>
)
}
}























// const UploadBar = props => {
// const [state, updateState] = useState({ fillWidth: '10', firstRender: true, scalingFactor: 1 })

// const setState = obj => updateState(state => ({ ...state, ...obj }))

// useEffect(() => {
// if(state.firstRender) setState({ firstRender: false })
// }, [state.firstRender])

// useEffect(() => {
// return function onUnmount() {
// console.log('UploadBar will unmount')
// }
// }, [])

// function getNextWidth() {
// const fillWidth = state.fillWidth
// setState({ timeout: setTimeout(
// setNextWidth(fillWidth),
// state.SCALING_FACTOR * 200 * Math.pow(2, 50 / (100 - fillWidth))
// )})
// }

// function setNextWidth(currWidth) {
// return () => {
// state.timeout = null
// let nextWidth = parseInt(currWidth) + 1
// if (nextWidth > 100) nextWidth = '100'
// setState({ fillWidth: nextWidth.toString() })
// }
// }

// function getFillWidth() {
// if(state.firstRender) return '0'
// if (parseInt(state.fillWidth) > 100) return '100'
// if (!props.uploading) return '100'
// else if (!state.timeout) getNextWidth()

// return state.fillWidth
// }


// console.log('First render: ', state.firstRender)
// console.log('fillWidth: ', state.fillWidth)

// return <ProgressBar percent={getFillWidth()} label='Upload' />
// }
}
8 changes: 0 additions & 8 deletions src/filing/submission/upload/ValidationProgress.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,6 @@ export default class ValidationProgress extends PureComponent {
if (code < UPLOADING && !uploading) return null
return (
<section className="ValidationProgress">
{/* TODO: Cleanup unused styles */}
{/* the background bar */}
{/* <div className="progressTotal" /> */}
{/* the progress bar */}
{/* <div
className={`progressFill ${this.getFillError()}`}
style={{ width: this.getFillWidth() + '%' }}
/> */}
<ProgressText
errorApp={errorApp}
errorUpload={errorUpload}
Expand Down
2 changes: 1 addition & 1 deletion src/filing/submission/upload/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export default class Upload extends Component {
filingPeriod={filingPeriod}
lei={lei}
uploading={uploading}
/>
/>
</section>
)
}
Expand Down

0 comments on commit c513c68

Please sign in to comment.