-
Notifications
You must be signed in to change notification settings - Fork 283
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
ui - improve self review member approval #2849
Conversation
5db870e
to
2233425
Compare
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.
adding comment from offline conversation:
-
instead of using getRoles and getGroups to get details of all roles/groups in a domain, it would be better to do a getRole/Group call for specific collection which have a pending member
-
It will also be useful to check if the role/group data is already present in store, if not then make API call to get role/group and then store it in redux store.
will make changes to cover both points |
@chandrasekhar1996 |
d7624d3
to
a3a1681
Compare
…oles and grops Signed-off-by: aporss <art.porss@yahooinc.com>
a3a1681
to
44d413a
Compare
|
||
const getPendingMemberRole = async (dispatch, state, domainName, roleName) => { | ||
let role = selectPendingMemberRole(state, domainName, roleName); | ||
if (!role || isExpired(role.expiry)) { | ||
role = await API().getRole(domainName, roleName, false, false, true); | ||
role.expiry = getExpiryTime(); | ||
dispatch(storePendingRole(role, domainName, roleName)); | ||
} | ||
return role; | ||
}; | ||
const getPendingMemberGroup = async ( | ||
dispatch, | ||
state, | ||
domainName, | ||
groupName | ||
) => { | ||
let group = selectPendingMemberGroup(state, domainName, groupName); | ||
if (!group || isExpired(group.expiry)) { | ||
group = await API().getGroup(domainName, groupName, false, true); | ||
group.expiry = getExpiryTime(); | ||
dispatch(storePendingGroup(group, domainName, groupName)); | ||
} |
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.
@chandrasekhar1996 this part covers selecting specific role/group data from state, if not present or expired - get role/group and store in state for later
if (category === ROLE) { | ||
promises.push(getPendingMemberRole(dispatch, state, domain, role)); | ||
} else if (category === GROUP) { | ||
promises.push(getPendingMemberGroup(dispatch, state, domain, role)); | ||
} | ||
}); | ||
|
||
let data = await Promise.all(promises); |
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.
getting unique roles/groups for selfReview check is done in parallel
Description
use member comment to auto populate justification textarea when approving self review roles and groups
Contribution Checklist: