From c057c4a9cc773fe6af6b15981a8f65ff5032b7ba Mon Sep 17 00:00:00 2001 From: Alex Windett Date: Wed, 25 Jan 2017 11:14:49 +0000 Subject: [PATCH] reconstructing dispatch payload to seperate person object and person index; also only sending uuid,status,role as props --- .../components/people-list/table/person-role.js | 10 +++++++--- .../src/components/people-list/table/tooltip.js | 16 ++++++++++++---- frontend/src/state/reducers/orgs.js | 3 ++- 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/frontend/src/components/people-list/table/person-role.js b/frontend/src/components/people-list/table/person-role.js index 9fb2c543..da48ed25 100644 --- a/frontend/src/components/people-list/table/person-role.js +++ b/frontend/src/components/people-list/table/person-role.js @@ -60,9 +60,12 @@ const PersonRole = (props) => { const toggled = toggledID; const handleClick = () => handleRoleTooltip(person.uuid); const handleOptionSelect = (updatedMember) => handleRoleUpdate(updatedMember); - const _person = { - ...person, - personIndex + + // Only send relevent info as props + const _person = { + uuid: person.uuid, + status: person.status, + role: person.role }; return ( @@ -76,6 +79,7 @@ const PersonRole = (props) => { handleSelect={handleOptionSelect} options={membersRolesOptions} person={_person} + personIndex={personIndex} /> : null } diff --git a/frontend/src/components/people-list/table/tooltip.js b/frontend/src/components/people-list/table/tooltip.js index 69a5681b..80cc6294 100644 --- a/frontend/src/components/people-list/table/tooltip.js +++ b/frontend/src/components/people-list/table/tooltip.js @@ -16,15 +16,22 @@ const arrowPosition = { module.exports = ({ handleSelect, person = {}, + personIndex, options = [], }) => { const _options = options.map( (option, i) => { - const _onClick = () => handleSelect({ - ...person, - role: option - }); + const payload = { + person: { + uuid: person.uuid, + status: person.status, + role: option + }, + personIndex + }; + + const _onClick = () => handleSelect(payload); return (