Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
rouxxi committed Oct 22, 2024
1 parent 09cd29e commit 5c6896e
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 2 deletions.
18 changes: 17 additions & 1 deletion orga/app/components/organization-participant/list.gjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,12 @@ export default class List extends Component {

@service currentUser;

get isAdminInOrganization () {
return !!this.currentUser.isAdminInOrganization
}

get showCheckbox() {
return this.currentUser.isAdminInOrganization && !this.currentUser.hasLearnerImportFeature;
return this.isAdminInOrganization && !this.currentUser.hasLearnerImportFeature;
}

get headerId() {
Expand Down Expand Up @@ -85,6 +89,10 @@ export default class List extends Component {
toggleParticipant();
}

@action
openEditStudentNumberModal() {
window.alert('wesh');
}
<template>
<div id={{this.filtersId}} />

Expand All @@ -96,12 +104,18 @@ export default class List extends Component {
<tbody>
<SelectableList @items={{@participants}}>
<:manager as |allSelected someSelected toggleAll selectedParticipants reset|>
{{log "allSelected" allSelected}}
{{log "someSelected" someSelected}}
{{log "toggleAll" toggleAll}}
{{log "selectedParticipants" selectedParticipants}}
{{log "reset" reset}}
<InElement @destinationId={{this.headerId}}>
<TableHeaders
@allSelected={{allSelected}}
@someSelected={{someSelected}}
@showCheckbox={{this.showCheckbox}}
@hasParticipants={{this.hasParticipants}}
@isAdminInOrganization={{this.isAdminInOrganization}}
@onToggleAll={{toggleAll}}
@lastnameSort={{@lastnameSort}}
@customHeadings={{this.customColumns}}
Expand Down Expand Up @@ -180,6 +194,8 @@ export default class List extends Component {
@customRows={{this.customColumns}}
@hideCertifiableDate={{@hasComputeOrganizationLearnerCertificabilityEnabled}}
@hasOrganizationParticipantPage={{@hasOrganizationParticipantPage}}
@isAdminInOrganization={{this.isAdminInOrganization}}
@openEditStudentNumberModal={{this.openEditStudentNumberModal}}
/>
</:item>
</SelectableList>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@ export default class TableHeaders extends Component {
</div>
</Header>
{{/unless}}
</tr>

{{#if @isAdminInOrganization}}
<Header @size="small" class="table__column--last-col">
{{t "common.actions.global"}}
</Header>
{{/if}}
</tr>
</template>
}
16 changes: 16 additions & 0 deletions orga/app/components/organization-participant/table-row.gjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@ import { service } from '@ember/service';
import Component from '@glimmer/component';
import dayjs from 'dayjs';
import { t } from 'ember-intl';
import Dropdown from '../dropdown/icon-trigger'
import DropdownItemp from '../dropdown/item.hbs'

import CertificabilityCell from '../certificability/cell';
import LastParticipationDateTooltip from '../ui/last-participation-date-tooltip';
import { fn } from "@ember/helper";

export default class TableRow extends Component {
@service currentUser;
Expand Down Expand Up @@ -111,6 +114,19 @@ export default class TableRow extends Component {
/>
</td>
{{/unless}}

{{#if @isAdminInOrganization}}
<Dropdown
@icon="ellipsis-vertical"
@dropdownButtonClass="organization-participant-list-page__dropdown-button"
@dropdownContentClass="organization-participant-list-page__dropdown-content"
@ariaLabel={{t "pages.sup-organization-participants.actions.show-actions"}}
>
<DropdownItemp @onClick={{fn @openEditStudentNumberModal @participant}}>
{{t "pages.sup-organization-participants.actions.edit-student-number"}}
</DropdownItemp>
</Dropdown>
{{/if}}
</tr>
</template>
}
4 changes: 4 additions & 0 deletions orga/app/styles/globals/tables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ th::first-letter {
min-width: 100px;
}

&--last-col {
padding-left: 0px;
}

&--center {
text-align: center;
}
Expand Down

0 comments on commit 5c6896e

Please sign in to comment.