From 0d3edfa7bea1a6f5e90ba03ffe72ec6797edb8a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marie-H=C3=A9l=C3=A8ne?= Date: Mon, 16 Dec 2024 17:44:20 +0100 Subject: [PATCH] migrate organization-learner participation-row to gjs --- .../activity/participation-row.gjs | 67 +++++++++++++++++++ .../activity/participation-row.hbs | 26 ------- .../activity/participation-row.js | 30 --------- 3 files changed, 67 insertions(+), 56 deletions(-) create mode 100644 orga/app/components/organization-learner/activity/participation-row.gjs delete mode 100644 orga/app/components/organization-learner/activity/participation-row.hbs delete mode 100644 orga/app/components/organization-learner/activity/participation-row.js diff --git a/orga/app/components/organization-learner/activity/participation-row.gjs b/orga/app/components/organization-learner/activity/participation-row.gjs new file mode 100644 index 00000000000..8bb92ec35a3 --- /dev/null +++ b/orga/app/components/organization-learner/activity/participation-row.gjs @@ -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, + ); + } + + +} diff --git a/orga/app/components/organization-learner/activity/participation-row.hbs b/orga/app/components/organization-learner/activity/participation-row.hbs deleted file mode 100644 index 026610a59b1..00000000000 --- a/orga/app/components/organization-learner/activity/participation-row.hbs +++ /dev/null @@ -1,26 +0,0 @@ - - - - {{@participation.campaignName}} - - - - - - - - - - - - - - - - {{@participation.participationCount}} - - \ No newline at end of file diff --git a/orga/app/components/organization-learner/activity/participation-row.js b/orga/app/components/organization-learner/activity/participation-row.js deleted file mode 100644 index 24239c16a62..00000000000 --- a/orga/app/components/organization-learner/activity/participation-row.js +++ /dev/null @@ -1,30 +0,0 @@ -import { action } from '@ember/object'; -import { service } from '@ember/service'; -import Component from '@glimmer/component'; - -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, - ); - } -}