Skip to content

Commit

Permalink
[FEATURE] Masquer le champ "Code de prépaiement" tant que l'option "P…
Browse files Browse the repository at this point in the history
…répayée" n'est pas cochée (PIX-13932)

 #10155
  • Loading branch information
pix-service-auto-merge committed Sep 23, 2024
2 parents 0f3ebe6 + 90cbe99 commit c9c90c0
Show file tree
Hide file tree
Showing 3 changed files with 167 additions and 210 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ export default class CandidateCreationModal extends Component {
return false;
}

get isPrepaidBillingMode() {
return this.selectedBillingMode === 'PREPAID';
}

get countryOptions() {
return this.args.countries?.map((country) => {
return { label: country.name, value: country.code };
Expand Down Expand Up @@ -459,31 +463,34 @@ export default class CandidateCreationModal extends Component {
<:label>{{t 'common.forms.certification-labels.pricing'}}</:label>
</PixSelect>

<div class='new-candidate-modal-form__tooltip'>
<label for='prepayment-code' class='label'>
{{t 'common.forms.certification-labels.prepayment-code'}}
</label>
<PixTooltip @id='tooltip-prepayment-code' @position='left'>
<:triggerElement>
<FaIcon
@icon='info-circle'
tabindex='0'
aria-describedby='tooltip-prepayment-code'
aria-label={{t 'pages.sessions.detail.candidates.add-modal.prepayment-information'}}
/>
</:triggerElement>
<:tooltip>
{{t 'pages.sessions.detail.candidates.add-modal.prepayment-tooltip' htmlSafe=true}}
</:tooltip>
</PixTooltip>

<PixInput
@id='prepayment-code'
type='text'
{{on 'input' (fn @updateCandidateData @candidateData 'prepaymentCode')}}
autocomplete='off'
/>
</div>
{{#if this.isPrepaidBillingMode}}

<div class='new-candidate-modal-form__tooltip'>
<label for='prepayment-code' class='label'>
{{t 'common.forms.certification-labels.prepayment-code'}}
</label>
<PixTooltip @id='tooltip-prepayment-code' @position='left'>
<:triggerElement>
<FaIcon
@icon='info-circle'
tabindex='0'
aria-describedby='tooltip-prepayment-code'
aria-label={{t 'pages.sessions.detail.candidates.add-modal.prepayment-information'}}
/>
</:triggerElement>
<:tooltip>
{{t 'pages.sessions.detail.candidates.add-modal.prepayment-tooltip' htmlSafe=true}}
</:tooltip>
</PixTooltip>

<PixInput
@id='prepayment-code'
type='text'
{{on 'input' (fn @updateCandidateData @candidateData 'prepaymentCode')}}
autocomplete='off'
/>
</div>
{{/if}}
</div>
{{/if}}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ module('Acceptance | Session Details Certification Candidates', function (hooks)
assert.strictEqual(screen.getByLabelText('* Code INSEE de naissance').value, '');
assert.strictEqual(screen.getByLabelText('Temps majoré (%)').value, '');
assert.strictEqual(screen.getByLabelText('* Tarification part Pix').value, '');
assert.strictEqual(screen.getByLabelText('Code de prépaiement').value, '');
assert.dom(screen.queryByLabelText('Code de prépaiement')).doesNotExist();
assert.strictEqual(
screen.getByLabelText('E-mail du destinataire des résultats (formateur, enseignant...)').value,
'',
Expand Down
Loading

0 comments on commit c9c90c0

Please sign in to comment.