From cf8b02081594bea774c71534bdeb9b145a4e0b96 Mon Sep 17 00:00:00 2001 From: Alex Windett Date: Mon, 23 Jan 2017 12:01:49 +0000 Subject: [PATCH] reworking fake data structure for org members and the selector to represent this --- frontend/src/components/people-list/index.js | 8 ++++---- frontend/src/mock-state.json | 12 ++++++++++-- frontend/src/state/selectors.js | 8 ++++++-- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/frontend/src/components/people-list/index.js b/frontend/src/components/people-list/index.js index f5e8336f..5f52a1dd 100644 --- a/frontend/src/components/people-list/index.js +++ b/frontend/src/components/people-list/index.js @@ -7,7 +7,7 @@ const PeopleList = ({ people = [] }) => { const columns = [{ - title: 'Memeber', + title: 'Member', }, { title: 'Status', }, { @@ -20,9 +20,9 @@ const PeopleList = ({ people.forEach( (person) => { data.push({ - name: person.uuid, - status: person.uuid, - role: person.uuid, + name: person.name, + status: person.status, + role: person.role, }); }); diff --git a/frontend/src/mock-state.json b/frontend/src/mock-state.json index c56e7684..1fa3e146 100644 --- a/frontend/src/mock-state.json +++ b/frontend/src/mock-state.json @@ -219,8 +219,16 @@ "id": "biz-tech", "name": "BizTech", "members": [ - "fd853d8f-e1dd-49b5-b7b3-ae9adfea1e2f", - "6deddbaa-3b94-4373-8cf7-97129507a872" + { + "uuid": "fd853d8f-e1dd-49b5-b7b3-ae9adfea1e2f", + "role": "Owner", + "status": "Active" + }, + { + "uuid": "6deddbaa-3b94-4373-8cf7-97129507a872", + "role": "Unassigned", + "status": "Sent invitation" + } ] }, { "owner": "b94033c1-3665-4c36-afab-d9c3d0b51c01", diff --git a/frontend/src/state/selectors.js b/frontend/src/state/selectors.js index 06aec62f..c02682ad 100644 --- a/frontend/src/state/selectors.js +++ b/frontend/src/state/selectors.js @@ -114,8 +114,12 @@ const instancesByProjectId = (projectId) => createSelector( const peopleByOrgId = (orgId) => createSelector( [members, orgById(orgId)], (members, org) => { const matched = []; - org.members.filter((UUID) => - matched.push(find(members, ['uuid', UUID]))); + org.members.filter((m) => { + matched.push({ + ...find(members, ['uuid', m.uuid]), + ...m + }); + }); return matched; } );