-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(mon-pix): add hasCustomResultPageButton getter
- Loading branch information
Showing
6 changed files
with
268 additions
and
109 deletions.
There are no files selected for viewing
58 changes: 23 additions & 35 deletions
58
...s/campaigns/assessment/skill-review/evaluation-results-hero/custom-organization-block.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 |
---|---|---|
@@ -1,41 +1,29 @@ | ||
import PixButtonLink from '@1024pix/pix-ui/components/pix-button-link'; | ||
import Component from '@glimmer/component'; | ||
import { t } from 'ember-intl'; | ||
import { and } from 'ember-truth-helpers'; | ||
|
||
import MarkdownToHtml from '../../../../markdown-to-html'; | ||
|
||
export default class EvaluationResultsHeroCustomOrganizationBlock extends Component { | ||
get hasCustomOrganizationLink() { | ||
return this.args.customResultPageButtonUrl && this.args.customResultPageButtonText; | ||
} | ||
|
||
get showOrganizationContent() { | ||
return this.args.customResultPageText || this.hasCustomOrganizationLink; | ||
} | ||
|
||
<template> | ||
{{#if this.showOrganizationContent}} | ||
<div class="evaluation-results-hero__organization-block"> | ||
<h3 class="evaluation-results-hero-organization-block__title"> | ||
{{t "pages.skill-review.organization-message"}} | ||
</h3> | ||
{{#if @customResultPageText}} | ||
<MarkdownToHtml | ||
class="evaluation-results-hero-organization-block__message" | ||
@isInline={{true}} | ||
@markdown={{@customResultPageText}} | ||
/> | ||
{{/if}} | ||
{{#if this.hasCustomOrganizationLink}} | ||
<PixButtonLink | ||
class="evaluation-results-hero-organization-block__link" | ||
@href={{@customResultPageButtonUrl}} | ||
@variant="secondary" | ||
> | ||
{{@customResultPageButtonText}} | ||
</PixButtonLink> | ||
{{/if}} | ||
</div> | ||
<template> | ||
<div class="evaluation-results-hero__organization-block"> | ||
<h3 class="evaluation-results-hero-organization-block__title"> | ||
{{t "pages.skill-review.organization-message"}} | ||
</h3> | ||
{{#if @customResultPageText}} | ||
<MarkdownToHtml | ||
class="evaluation-results-hero-organization-block__message" | ||
@isInline={{true}} | ||
@markdown={{@customResultPageText}} | ||
/> | ||
{{/if}} | ||
{{#if (and @customResultPageButtonUrl @customResultPageButtonText)}} | ||
<PixButtonLink | ||
class="evaluation-results-hero-organization-block__link" | ||
@href={{@customResultPageButtonUrl}} | ||
@variant="secondary" | ||
> | ||
{{@customResultPageButtonText}} | ||
</PixButtonLink> | ||
{{/if}} | ||
</template> | ||
} | ||
</div> | ||
</template> |
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
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
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
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
Oops, something went wrong.