-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
migrate organization-learner participation-row to gjs
- Loading branch information
Showing
3 changed files
with
67 additions
and
56 deletions.
There are no files selected for viewing
67 changes: 67 additions & 0 deletions
67
orga/app/components/organization-learner/activity/participation-row.gjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import { array } from '@ember/helper'; | ||
import { on } from '@ember/modifier'; | ||
import { action } from '@ember/object'; | ||
import { LinkTo } from '@ember/routing'; | ||
import { service } from '@ember/service'; | ||
import Component from '@glimmer/component'; | ||
import { t } from 'ember-intl'; | ||
|
||
import CampaignType from '../../campaign/detail/type'; | ||
import Date from '../../ui/date'; | ||
import ParticipationStatus from '../../ui/participation-status'; | ||
|
||
export default class ParticipationRow extends Component { | ||
@service router; | ||
|
||
get routeName() { | ||
return this.args.participation.campaignType === 'ASSESSMENT' | ||
? 'authenticated.campaigns.participant-assessment' | ||
: 'authenticated.campaigns.participant-profile'; | ||
} | ||
|
||
get labels() { | ||
return { | ||
ASSESSMENT: 'components.campaign.type.information.ASSESSMENT', | ||
PROFILES_COLLECTION: 'components.campaign.type.information.PROFILES_COLLECTION', | ||
}; | ||
} | ||
|
||
@action | ||
goToParticipationDetail(event) { | ||
event.preventDefault(); | ||
this.router.transitionTo( | ||
this.routeName, | ||
this.args.participation.campaignId, | ||
this.args.participation.lastCampaignParticipationId, | ||
); | ||
} | ||
|
||
<template> | ||
<tr | ||
aria-label={{t "pages.organization-learner.activity.participation-list.table.row-title"}} | ||
{{on "click" this.goToParticipationDetail}} | ||
class="tr--clickable" | ||
> | ||
<td class="ellipsis"> | ||
<LinkTo @route={{this.routeName}} @models={{array @participation.campaignId @participation.id}}> | ||
{{@participation.campaignName}} | ||
</LinkTo> | ||
</td> | ||
<td class="ellipsis"> | ||
<CampaignType @labels={{this.labels}} @campaignType={{@participation.campaignType}} /> | ||
</td> | ||
<td class="table__column--left"> | ||
<Date @date={{@participation.createdAt}} /> | ||
</td> | ||
<td class="table__column--left"> | ||
<Date @date={{@participation.sharedAt}} /> | ||
</td> | ||
<td class="table__column--left"> | ||
<ParticipationStatus @status={{@participation.status}} @campaignType={{@participation.campaignType}} /> | ||
</td> | ||
<td class="table__column--left"> | ||
{{@participation.participationCount}} | ||
</td> | ||
</tr> | ||
</template> | ||
} |
26 changes: 0 additions & 26 deletions
26
orga/app/components/organization-learner/activity/participation-row.hbs
This file was deleted.
Oops, something went wrong.
30 changes: 0 additions & 30 deletions
30
orga/app/components/organization-learner/activity/participation-row.js
This file was deleted.
Oops, something went wrong.