-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Employees - Homepage #46
base: develop
Are you sure you want to change the base?
Conversation
Added employees list &filter by different criteria.
@@ -19,13 +19,14 @@ export class FilterDropdown extends React.Component { | |||
render() { | |||
let criteria = this.state.criteria; | |||
let elements = this.state.elements; | |||
debugger; |
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.
No comments needed.
Fix it please.
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 fix all issues brought to attention.
@@ -0,0 +1,117 @@ | |||
// import React, { PropTypes } from 'react'; |
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 include files that are not used.
return ( | ||
<select onChange={this.filterByCriteria}> | ||
<option value="empty"> | ||
Filter by {criteria} | ||
</option> | ||
{elements.map(filter => | ||
<option value={filter}> | ||
<option key={filter} value={filter}> |
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.
Even thought it works, there are much better choises for an element key.
An index (although it's not recomanded) would be a better solution.
@@ -79,6 +79,12 @@ export class EmployeesList extends React.Component { | |||
)} | |||
</tbody> | |||
</table> | |||
{/* |
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 include commented code.
|
||
export class EmployeesList extends React.Component { | ||
constructor(props, context) { | ||
super(props, context); |
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.
The context parameter isn't needed here.
} | ||
|
||
render() { | ||
let employeesFiltered = this.state.employeesFiltered; |
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.
Using let that often in any function is a big code smell.
The render function is called at every state/props change. So everything used inside it can be immutable.
Description: Implement EmployeesHomepage
Benefits: you can filter employees by multiple criterias (position, manager, project)
Possible Drawbacks: n/a
Applicable Issues: multiple filters don't work at the same time