Skip to content
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

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open

Conversation

MihaelaLazar
Copy link

employeeshomepage

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

MihaelaLazar and others added 2 commits August 1, 2017 09:00
Added employees list &filter by different criteria.
@ghost ghost added the needs review label Aug 31, 2017
@@ -19,13 +19,14 @@ export class FilterDropdown extends React.Component {
render() {
let criteria = this.state.criteria;
let elements = this.state.elements;
debugger;
Copy link
Contributor

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.

Copy link
Contributor

@lau32 lau32 left a 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';
Copy link
Contributor

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}>
Copy link
Contributor

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>
{/*
Copy link
Contributor

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);
Copy link
Contributor

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;
Copy link
Contributor

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.

@aefox aefox changed the title Implement EmployeesHomepage Employees - Homepage Oct 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants