Skip to content

Commit

Permalink
amelioration(design): ETQ usager la cohabitation du design d'un form …
Browse files Browse the repository at this point in the history
…mi-DSFR, mi-DS n'est pas trop moche

amelioration(design): ETQ usager la cohabitation du design d'un form mi-DSFR, mi-DS n'est pas trop moche
  • Loading branch information
Martin authored and mfo committed Jul 26, 2023
1 parent 93dca29 commit cf6fc2e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
3 changes: 1 addition & 2 deletions app/assets/stylesheets/forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@
.fr-label {
// la description d'un champ peut contenir du markup (markdown->html),
// on herite donc la fontsize/mrgin/padding du fr-hint-text
.fr-hint-text > *{
.fr-hint-text > * {
font-size: inherit;
margin: inherit;
padding: inherit;
Expand All @@ -223,7 +223,6 @@
input[type=password],
select {
display: block;
margin-bottom: $default-fields-spacer;
margin-bottom: 0;

&.small-margin {
Expand Down
1 change: 0 additions & 1 deletion app/components/dsfr/input_errorable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ def email?
def hint?
I18n.exists?("activerecord.attributes.#{object.class.name.underscore}.hints.#{@attribute}")
end

end
end
end
12 changes: 6 additions & 6 deletions spec/system/users/brouillon_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@
let(:procedure) do
create(:procedure, :published, :for_individual,
types_de_champ_public: [
{ type: :integer_number, libelle: 'age', stable_id: age_stable_id },
{ type: :integer_number, libelle: 'age du candidat', stable_id: age_stable_id },
{ type: :yes_no, libelle: 'permis de conduire', stable_id: permis_stable_id, condition: permis_condition },
{ type: :header_section, libelle: 'info voiture', condition: permis_condition },
{ type: :integer_number, libelle: 'tonnage', stable_id: tonnage_stable_id, condition: tonnage_condition },
Expand All @@ -432,12 +432,12 @@

fill_individual

expect(page).to have_css('label', text: 'age', visible: true)
expect(page).to have_css('label', text: 'age du candidat', visible: true)
expect(page).to have_no_css('label', text: 'permis de conduire', visible: true)
expect(page).to have_no_css('legend h2', text: 'info voiture', visible: true)
expect(page).to have_no_css('label', text: 'tonnage', visible: true)

fill_in('age (facultatif)', with: '18')
fill_in('age du candidat (facultatif)', with: '18')
expect(page).to have_css('label', text: 'permis de conduire', visible: true)
expect(page).to have_css('legend h2', text: 'info voiture', visible: true)
expect(page).to have_no_css('label', text: 'tonnage', visible: true)
Expand All @@ -453,19 +453,19 @@
fill_in('tonnage (facultatif)', with: 'a')
expect(page).to have_no_css('label', text: 'parking', visible: true)

fill_in('age (facultatif)', with: '2')
fill_in('age du candidat (facultatif)', with: '2')
expect(page).to have_no_css('label', text: 'permis de conduire', visible: true)
expect(page).to have_no_css('label', text: 'tonnage', visible: true)

click_on 'Déposer le dossier'
click_on 'Accéder à votre dossier'
click_on 'Modifier mon dossier'

expect(page).to have_css('label', text: 'age', visible: true)
expect(page).to have_css('label', text: 'age du candidat', visible: true)
expect(page).to have_no_css('label', text: 'permis de conduire', visible: true)
expect(page).to have_no_css('label', text: 'tonnage', visible: true)

fill_in('age (facultatif)', with: '18')
fill_in('age du candidat (facultatif)', with: '18')
wait_for_autosave(false)

# the champ keeps their previous value so they are all displayed
Expand Down

0 comments on commit cf6fc2e

Please sign in to comment.