@@ -14,11 +14,17 @@ import {
1414 addSupervisor ,
1515 addObserver ,
1616 removeMember ,
17+ fetchGroupAttributes ,
1718} from '../../redux/modules/groups.js' ;
1819import { fetchByIds , fetchUser } from '../../redux/modules/users.js' ;
1920import { loggedInUserIdSelector } from '../../redux/selectors/auth.js' ;
2021import { isLoggedAsSuperAdmin , loggedInUserSelector } from '../../redux/selectors/users.js' ;
21- import { groupSelector , groupDataAccessorSelector , groupsSelector } from '../../redux/selectors/groups.js' ;
22+ import {
23+ groupSelector ,
24+ groupDataAccessorSelector ,
25+ groupsSelector ,
26+ groupAttributesSelector ,
27+ } from '../../redux/selectors/groups.js' ;
2228import {
2329 primaryAdminsOfGroupSelector ,
2430 supervisorsOfGroupSelector ,
@@ -55,6 +61,7 @@ class GroupInfo extends Component {
5561 . then ( res => res . value )
5662 . then ( group =>
5763 Promise . all ( [
64+ hasPermissions ( group , 'viewPublicDetail' ) ? dispatch ( fetchGroupAttributes ( groupId ) ) : Promise . resolve ( ) ,
5865 dispatch ( fetchByIds ( safeGet ( group , [ 'primaryAdminsIds' ] ) || [ ] ) ) ,
5966 dispatch ( fetchByIds ( safeGet ( group , [ 'privateData' , 'supervisors' ] ) || [ ] ) ) ,
6067 dispatch ( fetchByIds ( safeGet ( group , [ 'privateData' , 'observers' ] ) || [ ] ) ) ,
@@ -109,6 +116,7 @@ class GroupInfo extends Component {
109116 isOrganizational,
110117 isExam,
111118 pendingMemberships,
119+ externalAttributes,
112120 addAdmin,
113121 addSupervisor,
114122 addObserver,
@@ -175,6 +183,7 @@ class GroupInfo extends Component {
175183 supervisors = { supervisors }
176184 isAdmin = { isAdminOrSuperadmin }
177185 groups = { groups }
186+ externalAttributes = { externalAttributes }
178187 locale = { locale }
179188 />
180189 ) }
@@ -294,19 +303,20 @@ GroupInfo.propTypes = {
294303 isSupervisor : PropTypes . bool ,
295304 isSuperAdmin : PropTypes . bool ,
296305 isStudent : PropTypes . bool ,
306+ hasThreshold : PropTypes . bool ,
307+ threshold : PropTypes . oneOfType ( [ PropTypes . string , PropTypes . number ] ) ,
308+ pointsLimit : PropTypes . oneOfType ( [ PropTypes . string , PropTypes . number ] ) ,
309+ isOrganizational : PropTypes . bool ,
310+ isExam : PropTypes . bool ,
311+ pendingMemberships : ImmutablePropTypes . list ,
312+ externalAttributes : ImmutablePropTypes . map ,
297313 addSubgroup : PropTypes . func ,
298314 loadAsync : PropTypes . func ,
299315 refetchUsers : PropTypes . func . isRequired ,
300316 addAdmin : PropTypes . func . isRequired ,
301317 addSupervisor : PropTypes . func . isRequired ,
302318 addObserver : PropTypes . func . isRequired ,
303319 removeMember : PropTypes . func . isRequired ,
304- hasThreshold : PropTypes . bool ,
305- threshold : PropTypes . oneOfType ( [ PropTypes . string , PropTypes . number ] ) ,
306- pointsLimit : PropTypes . oneOfType ( [ PropTypes . string , PropTypes . number ] ) ,
307- isOrganizational : PropTypes . bool ,
308- isExam : PropTypes . bool ,
309- pendingMemberships : ImmutablePropTypes . list ,
310320 links : PropTypes . object ,
311321 intl : PropTypes . shape ( { locale : PropTypes . string . isRequired } ) . isRequired ,
312322} ;
@@ -336,6 +346,7 @@ const mapStateToProps = (state, { params: { groupId } }) => {
336346 isOrganizational : addSubgroupFormSelector ( state , 'isOrganizational' ) ,
337347 isExam : addSubgroupFormSelector ( state , 'isExam' ) ,
338348 pendingMemberships : pendingMembershipsSelector ( state , groupId ) ,
349+ externalAttributes : groupAttributesSelector ( state , groupId ) ,
339350 } ;
340351} ;
341352
0 commit comments