adding in check for member/people length to be greater then 0
This commit is contained in:
parent
9e302e093a
commit
2093530f17
@ -16,6 +16,7 @@ const People = (props) => {
|
||||
const {
|
||||
orgUI = {},
|
||||
handleToggle,
|
||||
people
|
||||
} = props;
|
||||
|
||||
return (
|
||||
@ -36,7 +37,9 @@ const People = (props) => {
|
||||
|
||||
<Row>
|
||||
<Column xs={12}>
|
||||
<PeopleTable {...props} />
|
||||
{ people.length > 0
|
||||
? <PeopleTable {...props} />
|
||||
: <h3>There is nobody in this orgnaisation</h3> }
|
||||
</Column>
|
||||
</Row>
|
||||
</div>
|
||||
@ -46,6 +49,7 @@ const People = (props) => {
|
||||
People.propTypes = {
|
||||
handleToggle: React.PropTypes.func,
|
||||
orgUI: React.PropTypes.object,
|
||||
people: React.PropTypes.array
|
||||
};
|
||||
|
||||
module.exports = People;
|
@ -129,12 +129,14 @@ const instancesByProjectId = (projectId) => createSelector(
|
||||
const peopleByOrgId = (orgId) => createSelector(
|
||||
[members, orgById(orgId)], (members, org) => {
|
||||
const matched = [];
|
||||
if (Object.keys(org.members).length > 0) {
|
||||
org.members.filter((m) => {
|
||||
matched.push({
|
||||
...find(members, ['uuid', m.uuid]),
|
||||
...m
|
||||
});
|
||||
});
|
||||
}
|
||||
return matched;
|
||||
}
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user