@@ -19,9 +19,10 @@ export default class List extends Component {
19
19
@tracked showDeletionModal = false ;
20
20
21
21
@service currentUser;
22
+ @service intl;
22
23
23
- get isAdminInOrganization () {
24
- return !! this .currentUser .isAdminInOrganization
24
+ get isAdminInOrganization () {
25
+ return !! this .currentUser .isAdminInOrganization ;
25
26
}
26
27
27
28
get showCheckbox () {
@@ -60,6 +61,10 @@ export default class List extends Component {
60
61
return this .args .participants .meta .customFilters ;
61
62
}
62
63
64
+ get hasActionColumn () {
65
+ return this .currentUser .canActivateOralizationLearner ;
66
+ }
67
+
63
68
@action
64
69
openDeletionModal () {
65
70
this .showDeletionModal = true ;
@@ -90,9 +95,26 @@ export default class List extends Component {
90
95
}
91
96
92
97
@action
93
- openEditStudentNumberModal () {
94
- window .alert (' wesh' );
98
+ actionsForParticipant (participant ) {
99
+ if (! this .currentUser .canActivateOralizationLearner ) {
100
+ return [];
101
+ }
102
+ const oralizationActivated = participant .extraColumns [' ORALIZATION' ];
103
+ return [
104
+ {
105
+ label: oralizationActivated
106
+ ? this .intl .t (' pages.organization-participants.table.actions.disable-oralization' )
107
+ : this .intl .t (' pages.organization-participants.table.actions.enable-oralization' ),
108
+ onClick : () =>
109
+ this .args .toggleOralizationFeatureForParticipant (
110
+ participant .id ,
111
+ this .currentUser .organization .id ,
112
+ ! oralizationActivated,
113
+ ),
114
+ },
115
+ ];
95
116
}
117
+
96
118
<template >
97
119
<div id ={{this .filtersId }} />
98
120
@@ -104,18 +126,13 @@ export default class List extends Component {
104
126
<tbody >
105
127
<SelectableList @ items ={{@ participants }} >
106
128
<: manager as | allSelected someSelected toggleAll selectedParticipants reset | >
107
- {{log " allSelected" allSelected }}
108
- {{log " someSelected" someSelected }}
109
- {{log " toggleAll" toggleAll }}
110
- {{log " selectedParticipants" selectedParticipants }}
111
- {{log " reset" reset }}
112
129
<InElement @ destinationId ={{this .headerId }} >
113
130
<TableHeaders
114
131
@ allSelected ={{allSelected }}
115
132
@ someSelected ={{someSelected }}
116
133
@ showCheckbox ={{this .showCheckbox }}
117
134
@ hasParticipants ={{this .hasParticipants }}
118
- @ isAdminInOrganization ={{this .isAdminInOrganization }}
135
+ @ hasActionColumn ={{this .hasActionColumn }}
119
136
@ onToggleAll ={{toggleAll }}
120
137
@ lastnameSort ={{@ lastnameSort }}
121
138
@ customHeadings ={{this .customColumns }}
@@ -194,8 +211,7 @@ export default class List extends Component {
194
211
@ customRows ={{this .customColumns }}
195
212
@ hideCertifiableDate ={{@ hasComputeOrganizationLearnerCertificabilityEnabled }}
196
213
@ hasOrganizationParticipantPage ={{@ hasOrganizationParticipantPage }}
197
- @ isAdminInOrganization ={{this .isAdminInOrganization }}
198
- @ openEditStudentNumberModal ={{this .openEditStudentNumberModal }}
214
+ @ actionsForParticipant ={{this .actionsForParticipant participant }}
199
215
/>
200
216
</: item >
201
217
</SelectableList >
0 commit comments