-
Notifications
You must be signed in to change notification settings - Fork 38
Conversation
make separated Table component for JSInterview parsing result
added opportunity set assignments fields to each xlsx column
export default connect( | ||
mapStateToProps, | ||
mapDispatchToProps, | ||
)(BatchUpdate); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please separate the file into simpler components
<div className={'row justify-content-lg-center'} style={{ marginTop: '20px' }}> | ||
{this.showOperationsResult()} | ||
</div> | ||
<div className={'row justify-content-lg-center'} style={{ marginTop: '20px' }}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you use inline styles?
<div className="col-md-3"> | ||
<Dropdown | ||
defaultValue="Select Task" | ||
onSelect={(task: any) => this.setState({ selectedTask: task.id })} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't use arrow functions into render method
saveTable = async (): Promise<any> => { | ||
const formData = this.prepareFormDataForSaving(); | ||
|
||
const res = await axios.patch('/api/batch-update/save-table', formData, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move AJAX query to core/api
parseTable = async (): Promise<any> => { | ||
const formData = new FormData(); | ||
formData.set('table', this.state.files[0]); | ||
const res = await axios.post('/api/batch-update/parse-table', formData, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move AJAX query to core/api
style: cellStyle, | ||
}, | ||
{ Header: 'Select field', accessor: 'dropdown', style: cellStyle, minWidth: 300 }, | ||
]} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Create constant for table config
|
||
const cn = classNames(require('./index.scss')); | ||
|
||
class Dropdown extends React.Component<any, any> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add types
return ( | ||
<ButtonDropdown | ||
isOpen={this.state.isOpen} | ||
toggle={() => this.setState((prevState: any) => ({ isOpen: !prevState.isOpen }))} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't use arrow functions into render method
}; | ||
}; | ||
|
||
const mapDispatchToProps = (dispatch: any, props: any): any => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[mapDispatchToProps(dispatch, [ownProps]): dispatchProps] (Object or Function): If an object is passed, each function inside it is assumed to be a Redux action creator. An object with the same function names, but with every action creator wrapped into a dispatch call so they may be invoked directly, will be merged into the component’s props.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
import { makeErrorsList, messageMaker } from '../utils'; | ||
|
||
const dataRetriever = (...what: any[]) => (data: any) => | ||
what.reduce((needRetrievedData: any[], needValue: any) => needRetrievedData.concat(data[needValue]), []); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If i got the point you can do same thing easily with map
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done)
Used stubs for Tasks and Assignments parts(they are not implemented; they will be implemented in other tasks, how i understood). So, when they will be implemented need make integration and write tests