Skip to content

Commit

Permalink
refactor(orga): migrate target-profile-details component to gjs file
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexandre-Monney committed Oct 8, 2024
1 parent b5cc6ca commit c5eb88b
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 43 deletions.
50 changes: 50 additions & 0 deletions orga/app/components/campaign/target-profile-details.gjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import FaIcon from '@fortawesome/ember-fontawesome/components/fa-icon';
import Component from '@glimmer/component';
import { t } from 'ember-intl';

import SafeMarkdownToHtml from '../safe-markdown-to-html';

export default class CampaignTargetProfileDetails extends Component {
get displayResultInfo() {
return this.args.hasStages
? {
icon: 'star',
label: 'common.target-profile-details.results.star',
}
: {
icon: 'percent',
label: 'common.target-profile-details.results.percent',
};
}

<template>
<span class="target-profile-details" ...attributes>
{{#if @targetProfileDescription}}
<SafeMarkdownToHtml class="target-profile-details__description" @markdown={{@targetProfileDescription}} />
{{/if}}
<ul class="target-profile-details__specificity">
<li class="target-profile-details__specificity__row">
<FaIcon @fixedWidth={{true}} @icon="book" />
{{t "common.target-profile-details.subjects" value=@targetProfileTubesCount}}
</li>
{{#if @hasBadges}}
<li class="target-profile-details__specificity__row target-profile-details__specificity__row--add-separator">
<FaIcon @fixedWidth={{true}} @icon="award" />
{{t "common.target-profile-details.thematic-results" value=@targetProfileThematicResultCount}}
</li>
{{/if}}
<li class="target-profile-details__specificity__row target-profile-details__specificity__row--break-line">
<span class="target-profile-details__specificity__white-space">
{{t "common.target-profile-details.results.common"}}
</span>
<FaIcon
@fixedWidth={{true}}
@aria-hidden={{false}}
aria-label={{t this.displayResultInfo.label}}
@icon={{this.displayResultInfo.icon}}
/>
</li>
</ul>
</span>
</template>
}
28 changes: 0 additions & 28 deletions orga/app/components/campaign/target-profile-details.hbs

This file was deleted.

15 changes: 0 additions & 15 deletions orga/app/components/campaign/target-profile-details.js

This file was deleted.

0 comments on commit c5eb88b

Please sign in to comment.