Skip to content

Commit

Permalink
Making sure group names container loads also archived groups.
Browse files Browse the repository at this point in the history
  • Loading branch information
krulis-martin committed Oct 3, 2021
1 parent 72732cc commit 6290338
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
5 changes: 4 additions & 1 deletion src/containers/GroupsNameContainer/GroupsNameContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ export default connect(
groupAccessor: groupAccessorSelector(state),
}),
dispatch => ({
loadAsync: groupId => dispatch(fetchGroupIfNeeded(groupId)),
loadAsync: groupId =>
dispatch(fetchGroupIfNeeded(groupId)).then(({ value: group }) =>
Promise.all(group && group.archived ? group.parentGroupsIds.map(id => dispatch(fetchGroupIfNeeded(id))) : [])
),
})
)(GroupsNameContainer);
1 change: 0 additions & 1 deletion src/pages/GroupInfo/GroupInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ class GroupInfo extends Component {
dispatch(fetchByIds(safeGet(group, ['primaryAdminsIds'], []))),
dispatch(fetchByIds(safeGet(group, ['privateData', 'supervisors'], []))),
dispatch(fetchByIds(safeGet(group, ['privateData', 'observers'], []))),
group.archived ? dispatch(fetchAllGroups({ archived: true })) : null,
])
);

Expand Down
11 changes: 5 additions & 6 deletions src/pages/GroupUserSolutions/GroupUserSolutions.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,12 +253,11 @@ class GroupUserSolutions extends Component {
Promise.all([
dispatch(fetchUserIfNeeded(userId)),
dispatch(fetchGroupIfNeeded(groupId)).then(({ value: group }) =>
hasPermissions(group, 'viewAssignments')
? Promise.all([
dispatch(fetchAssignmentsForGroup(groupId)),
dispatch(fetchGroupStudentsSolutions(groupId, userId)),
])
: Promise.resolve()
Promise.all(
hasPermissions(group, 'viewAssignments')
? [dispatch(fetchAssignmentsForGroup(groupId)), dispatch(fetchGroupStudentsSolutions(groupId, userId))]
: []
)
),
dispatch(fetchRuntimeEnvironments()),
]);
Expand Down

0 comments on commit 6290338

Please sign in to comment.