Skip to content

Commit

Permalink
Rename/split modalities with or without france connect
Browse files Browse the repository at this point in the history
Better that way, clearer.
Make a symlink for the display block, in order to keep the same code,
drying things.
  • Loading branch information
skelz0r committed Jan 22, 2025
1 parent 65ffbb2 commit 42c7060
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 16 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,24 @@

<%= f.info_for(:modalities) %>

<div data-controller="choose-modalite-impot-particulier">
<div data-controller="choose-modalite-with-france-connect">
<div class="fr-col-lg-9">
<%=
f.dsfr_radio_buttons :modalities,
@authorization_request.available_modalities,
<%=
f.dsfr_radio_buttons :modalities,
@authorization_request.available_modalities,
required: true,
multiple: true,
radio_group_class: "fr-radio-rich",
radio_group_class: "fr-radio-rich",
fieldset_element_class: "small",
checked: ->(value) { @authorization_request.modalities.include?(value) },
input_options: {
"data-action": "click->choose-modalite-impot-particulier#trigger",
"data-choose-modalite-impot-particulier-target": "modality"
input_options: {
"data-action": "click->choose-modalite-with-france-connect#trigger",
"data-choose-modalite-with-france-connect-target": "modality"
}
%>
</div>

<div class="fr-col-lg-9 fr-mb-5w <%= 'fr-hidden' unless @authorization_request.with_france_connect? %>" data-choose-modalite-impot-particulier-target="franceConnectContainer">
<div class="fr-col-lg-9 fr-mb-5w <%= 'fr-hidden' unless @authorization_request.with_france_connect? %>" data-choose-modalite-with-france-connect-target="franceConnectContainer">
<% france_connect_authorizations = current_organization.valid_authorizations_of(AuthorizationRequest::FranceConnect).map(&:decorate) %>

<% if france_connect_authorizations.empty? %>
Expand All @@ -38,7 +38,7 @@
<% else %>
<% options = france_connect_authorizations.map{ |authorization| [authorization.name_for_select, authorization.id] } %>
<% selected_option = @authorization_request.france_connect_authorization_id || france_connect_authorizations.first.id %>
<%= f.dsfr_select :france_connect_authorization_id, options_for_select(options, selected_option), class: %w[fr-select], include_blank: "Sélectionner une option", required: true, input_options: { "data-choose-modalite-impot-particulier-target": "franceConnectSelector" } %>
<%= f.dsfr_select :france_connect_authorization_id, options_for_select(options, selected_option), class: %w[fr-select], include_blank: "Sélectionner une option", required: true, input_options: { "data-choose-modalite-with-france-connect-target": "franceConnectSelector" } %>
<% end %>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<% if f.wording_for('modalities.intro') %>
<%= f.wording_for('modalities.intro').html_safe %>
<% end %>

<% modalities = @authorization_request.modalities.is_a?(Array) ? @authorization_request.modalities : [@authorization_request.modalities] %>
<ul>
<% modalities.each do |modality| %>
Expand Down
4 changes: 2 additions & 2 deletions config/authorization_definitions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ shared:
- name: basic_infos
- name: personal_data
- name: legal
- name: modalities
- name: modalities_with_france_connect
- name: scopes
- name: contacts
- name: operational_acceptance
Expand Down Expand Up @@ -482,7 +482,7 @@ shared:
- name: basic_infos
- name: personal_data
- name: legal
- name: modalities
- name: modalities_with_france_connect
- name: scopes
- name: contacts
scopes: *api_impot_particulier_scopes
Expand Down
4 changes: 2 additions & 2 deletions config/authorization_request_forms/api_impot_particulier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ api-impot-particulier-sandbox:
- name: basic_infos
- name: personal_data
- name: legal
- name: modalities
- name: modalities_with_france_connect
- name: scopes
- name: contacts

Expand Down Expand Up @@ -89,7 +89,7 @@ api-impot-particulier-production-editeur:
- name: basic_infos
- name: personal_data
- name: legal
- name: modalities
- name: modalities_with_france_connect
- name: scopes
- name: contacts
- name: operational_acceptance
Expand Down

0 comments on commit 42c7060

Please sign in to comment.