-
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.
refactor(orga): migrate target-profile-details component to gjs file
- Loading branch information
1 parent
b5cc6ca
commit c5eb88b
Showing
3 changed files
with
50 additions
and
43 deletions.
There are no files selected for viewing
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,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> | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.