update wording and order in types de champ select

This commit is contained in:
Eric Leroy-Terquem 2022-11-28 17:41:46 +01:00
parent e1cdbbda0b
commit 2645ac85f7
9 changed files with 131 additions and 121 deletions

View file

@ -2222,7 +2222,7 @@ enum TypeDeChamp {
carte carte
""" """
Case à cocher Case à cocher seule
""" """
checkbox checkbox
@ -2272,12 +2272,12 @@ enum TypeDeChamp {
dossier_link dossier_link
""" """
Choix unique Choix simple
""" """
drop_down_list drop_down_list
""" """
Email Adresse électronique
""" """
email email
@ -2292,7 +2292,7 @@ enum TypeDeChamp {
header_section header_section
""" """
Iban Numéro Iban
""" """
iban iban
@ -2312,7 +2312,7 @@ enum TypeDeChamp {
mesri mesri
""" """
Choix multiples Choix multiple
""" """
multiple_drop_down_list multiple_drop_down_list
@ -2357,17 +2357,17 @@ enum TypeDeChamp {
rna rna
""" """
SIRET Numéro Siret
""" """
siret siret
""" """
Texte Texte court
""" """
text text
""" """
Zone de texte Texte long
""" """
textarea textarea

View file

@ -20,48 +20,49 @@ class TypeDeChamp < ApplicationRecord
FILE_MAX_SIZE = 200.megabytes FILE_MAX_SIZE = 200.megabytes
FEATURE_FLAGS = {} FEATURE_FLAGS = {}
CADRE = :cadre STRUCTURE = :structure
STANDARD = :standard
CHOICE = :choice
ETAT_CIVIL = :etat_civil ETAT_CIVIL = :etat_civil
PAIEMENT_IDENTIFICATION = :paiement_identification
REFERENTIEL_EXTERNE = :referentiel_externe
LOCALISATION = :localisation LOCALISATION = :localisation
PAIEMENT_IDENTIFICATION = :paiement_identification
STANDARD = :standard
PIECES_JOINTES = :pieces_jointes
CHOICE = :choice
REFERENTIEL_EXTERNE = :referentiel_externe
CATEGORIES = [CADRE, ETAT_CIVIL, LOCALISATION, PAIEMENT_IDENTIFICATION, STANDARD, CHOICE, REFERENTIEL_EXTERNE] CATEGORIES = [STRUCTURE, ETAT_CIVIL, LOCALISATION, PAIEMENT_IDENTIFICATION, STANDARD, PIECES_JOINTES, CHOICE, REFERENTIEL_EXTERNE]
TYPE_DE_CHAMP_TO_CATEGORIE = { TYPE_DE_CHAMP_TO_CATEGORIE = {
text: STANDARD, header_section: STRUCTURE,
textarea: STANDARD, repetition: STRUCTURE,
date: STANDARD, dossier_link: STRUCTURE,
datetime: STANDARD, explication: STRUCTURE,
number: STANDARD,
decimal_number: STANDARD,
integer_number: STANDARD,
checkbox: CHOICE,
civilite: ETAT_CIVIL, civilite: ETAT_CIVIL,
email: ETAT_CIVIL, email: ETAT_CIVIL,
phone: ETAT_CIVIL, phone: ETAT_CIVIL,
address: LOCALISATION, address: LOCALISATION,
yes_no: CHOICE, communes: LOCALISATION,
departements: LOCALISATION,
regions: LOCALISATION,
pays: LOCALISATION,
iban: PAIEMENT_IDENTIFICATION,
siret: PAIEMENT_IDENTIFICATION,
text: STANDARD,
textarea: STANDARD,
number: STANDARD,
decimal_number: STANDARD,
integer_number: STANDARD,
date: STANDARD,
datetime: STANDARD,
piece_justificative: PIECES_JOINTES,
titre_identite: PIECES_JOINTES,
checkbox: CHOICE,
drop_down_list: CHOICE, drop_down_list: CHOICE,
multiple_drop_down_list: CHOICE, multiple_drop_down_list: CHOICE,
linked_drop_down_list: CHOICE, linked_drop_down_list: CHOICE,
pays: LOCALISATION, yes_no: CHOICE,
regions: LOCALISATION,
departements: LOCALISATION,
communes: LOCALISATION,
header_section: CADRE,
explication: CADRE,
dossier_link: CADRE,
piece_justificative: STANDARD,
rna: REFERENTIEL_EXTERNE,
siret: PAIEMENT_IDENTIFICATION,
carte: REFERENTIEL_EXTERNE,
repetition: CADRE,
titre_identite: ETAT_CIVIL,
iban: PAIEMENT_IDENTIFICATION,
annuaire_education: REFERENTIEL_EXTERNE, annuaire_education: REFERENTIEL_EXTERNE,
rna: REFERENTIEL_EXTERNE,
carte: REFERENTIEL_EXTERNE,
cnaf: REFERENTIEL_EXTERNE, cnaf: REFERENTIEL_EXTERNE,
dgfip: REFERENTIEL_EXTERNE, dgfip: REFERENTIEL_EXTERNE,
pole_emploi: REFERENTIEL_EXTERNE, pole_emploi: REFERENTIEL_EXTERNE,
@ -69,37 +70,37 @@ class TypeDeChamp < ApplicationRecord
} }
enum type_champs: { enum type_champs: {
text: 'text', header_section: 'header_section',
textarea: 'textarea', repetition: 'repetition',
date: 'date', dossier_link: 'dossier_link',
datetime: 'datetime', explication: 'explication',
number: 'number',
decimal_number: 'decimal_number',
integer_number: 'integer_number',
checkbox: 'checkbox',
civilite: 'civilite', civilite: 'civilite',
email: 'email', email: 'email',
phone: 'phone', phone: 'phone',
address: 'address', address: 'address',
yes_no: 'yes_no',
drop_down_list: 'drop_down_list',
multiple_drop_down_list: 'multiple_drop_down_list',
linked_drop_down_list: 'linked_drop_down_list',
communes: 'communes', communes: 'communes',
departements: 'departements', departements: 'departements',
regions: 'regions', regions: 'regions',
pays: 'pays', pays: 'pays',
header_section: 'header_section',
explication: 'explication',
dossier_link: 'dossier_link',
piece_justificative: 'piece_justificative',
rna: 'rna',
carte: 'carte',
repetition: 'repetition',
titre_identite: 'titre_identite',
iban: 'iban', iban: 'iban',
siret: 'siret', siret: 'siret',
text: 'text',
textarea: 'textarea',
number: 'number',
decimal_number: 'decimal_number',
integer_number: 'integer_number',
date: 'date',
datetime: 'datetime',
piece_justificative: 'piece_justificative',
titre_identite: 'titre_identite',
checkbox: 'checkbox',
drop_down_list: 'drop_down_list',
multiple_drop_down_list: 'multiple_drop_down_list',
linked_drop_down_list: 'linked_drop_down_list',
yes_no: 'yes_no',
annuaire_education: 'annuaire_education', annuaire_education: 'annuaire_education',
rna: 'rna',
carte: 'carte',
cnaf: 'cnaf', cnaf: 'cnaf',
dgfip: 'dgfip', dgfip: 'dgfip',
pole_emploi: 'pole_emploi', pole_emploi: 'pole_emploi',

View file

@ -4,39 +4,48 @@ fr:
type_de_champ: 'Field type' type_de_champ: 'Field type'
attributes: attributes:
type_de_champ: type_de_champ:
categorie:
structure: 'Field structure'
etat_civil: 'Civil status'
localisation: 'Location'
paiement_identification: 'Payment and identification'
standard: 'Standard field'
pieces_jointes: 'Attachments'
choice: 'Choice'
referentiel_externe: 'External referential'
type_champs: type_champs:
text: 'Text' header_section: 'Header section'
textarea: 'Text area' repetition: 'Repetition'
date: 'Date' dossier_link: 'File link'
datetime: 'Datetime' explication: 'Explication'
number: 'Number'
decimal_number: 'Decimal number'
integer_number: 'Integer number'
checkbox: 'Checkbox'
civilite: 'Civility' civilite: 'Civility'
email: 'Email' email: 'Email'
phone: 'Phone' phone: 'Phone'
address: 'Adress' address: 'Adress'
yes_no: 'Yes/No' communes: 'Municipality'
departements: 'County'
regions: 'Region'
pays: 'Country'
iban: 'Iban'
siret: 'Siret'
text: 'Text'
textarea: 'Text area'
number: 'Number'
decimal_number: 'Decimal number'
integer_number: 'Integer number'
date: 'Date'
datetime: 'Datetime'
piece_justificative: 'Supporting document'
titre_identite: 'Identity title'
checkbox: 'Checkbox'
drop_down_list: 'Dropdown list' drop_down_list: 'Dropdown list'
multiple_drop_down_list: 'Multiple dropdown list' multiple_drop_down_list: 'Multiple dropdown list'
linked_drop_down_list: 'Linked dropdown list' linked_drop_down_list: 'Linked dropdown list'
pays: 'Country' yes_no: 'Yes/No'
regions: 'Regions' annuaire_education: 'Schooling directory'
departements: 'County'
communes: 'Municipality'
engagement: 'Commitment'
header_section: 'Header section'
explication: 'Explication'
dossier_link: 'File link'
piece_justificative: 'Supporting document'
siret: 'SIRET'
rna: 'RNA' rna: 'RNA'
carte: 'Card' carte: 'Card'
repetition: 'Repetition' engagement: 'Commitment'
titre_identite: 'Identity title'
iban: 'Iban'
annuaire_education: 'Schooling directory'
cnaf: 'Data from Caisse nationale des allocations familiales' cnaf: 'Data from Caisse nationale des allocations familiales'
dgfip: 'Data from Direction générale des Finances publiques' dgfip: 'Data from Direction générale des Finances publiques'
pole_emploi: 'Pôle emploi status' pole_emploi: 'Pôle emploi status'

View file

@ -5,47 +5,47 @@ fr:
attributes: attributes:
type_de_champ: type_de_champ:
categorie: categorie:
standard: 'Standard' structure: 'Structure des champs'
choice: 'Choix'
etat_civil: 'État civil' etat_civil: 'État civil'
cadre: 'Cadre'
file: 'Fichier'
paiement_identification: 'Paiement - Identification'
referentiel_externe: 'Référentiel externe'
localisation: 'Localisation' localisation: 'Localisation'
paiement_identification: 'Paiement et Identification'
standard: 'Champ standard'
pieces_jointes: 'Pièces jointes'
choice: 'Choix'
referentiel_externe: 'Référentiel externe'
type_champs: type_champs:
text: 'Texte' header_section: 'Titre de section'
textarea: 'Zone de texte' repetition: 'Bloc répétable'
date: 'Date' dossier_link: 'Lien vers un autre dossier'
datetime: 'Date et Heure' explication: 'Explication'
civilite: 'Civilité'
email: 'Adresse électronique'
phone: 'Téléphone'
address: 'Adresse'
communes: 'Communes'
departements: 'Départements'
regions: 'Régions'
pays: 'Pays'
iban: 'Numéro Iban'
siret: 'Numéro Siret'
text: 'Texte court'
textarea: 'Texte long'
number: 'Nombre' number: 'Nombre'
decimal_number: 'Nombre décimal' decimal_number: 'Nombre décimal'
integer_number: 'Nombre entier' integer_number: 'Nombre entier'
checkbox: 'Case à cocher' date: 'Date'
civilite: 'Civilité' datetime: 'Date et Heure'
email: 'Email'
phone: 'Téléphone'
address: 'Adresse'
yes_no: 'Oui/Non'
drop_down_list: 'Choix unique'
multiple_drop_down_list: 'Choix multiples'
linked_drop_down_list: 'Deux menus déroulants liés'
pays: 'Pays'
regions: 'Régions'
departements: 'Départements'
communes: 'Communes'
header_section: 'Titre de section'
explication: 'Explication'
engagement: 'Engagement'
dossier_link: 'Lien vers un autre dossier'
piece_justificative: 'Pièce justificative' piece_justificative: 'Pièce justificative'
siret: 'SIRET' titre_identite: 'Titre identité'
checkbox: 'Case à cocher seule'
drop_down_list: 'Choix simple'
multiple_drop_down_list: 'Choix multiple'
linked_drop_down_list: 'Deux menus déroulants liés'
yes_no: 'Oui/Non'
annuaire_education: 'Annuaire de léducation'
rna: 'RNA' rna: 'RNA'
carte: 'Carte' carte: 'Carte'
repetition: 'Bloc répétable' engagement: 'Engagement'
titre_identite: 'Titre identité'
iban: 'Iban'
annuaire_education: 'Annuaire de léducation'
cnaf: 'Données de la Caisse nationale des allocations familiales' cnaf: 'Données de la Caisse nationale des allocations familiales'
dgfip: 'Données de la Direction générale des Finances publiques' dgfip: 'Données de la Direction générale des Finances publiques'
pole_emploi: 'Situation Pôle emploi' pole_emploi: 'Situation Pôle emploi'

View file

@ -1482,7 +1482,7 @@ describe API::V2::GraphqlController do
"mutation { "mutation {
dossierModifierAnnotationText(input: { dossierModifierAnnotationText(input: {
dossierId: \"#{dossier.to_typed_id}\", dossierId: \"#{dossier.to_typed_id}\",
annotationId: \"#{dossier.champs_private.first.to_typed_id}\", annotationId: \"#{dossier.champs_private.find { |c| c.type == 'Champs::TextChamp' }.to_typed_id}\",
instructeurId: \"#{instructeur.to_typed_id}\", instructeurId: \"#{instructeur.to_typed_id}\",
value: \"hello\" value: \"hello\"
}) { }) {

View file

@ -32,6 +32,6 @@ describe Manager::DossiersController, type: :controller do
subject { strip_tags(response.body) } subject { strip_tags(response.body) }
it { expect(subject).to match(%r{Nom\s+\*\s+Texte\s+🟢\s+rempli}) } it { expect(subject).to match(%r{Nom\s+\*\s+Texte court\s+🟢\s+rempli}) }
end end
end end

View file

@ -87,7 +87,7 @@ describe ProcedureExportService do
end end
it 'should have headers' do it 'should have headers' do
expect(dossiers_sheet.headers).to match(nominal_headers) expect(dossiers_sheet.headers).to match_array(nominal_headers)
end end
it 'should have data' do it 'should have data' do
@ -108,7 +108,7 @@ describe ProcedureExportService do
let(:birthdate_headers) { nominal_headers.insert(nominal_headers.index('Archivé'), 'Date de naissance') } let(:birthdate_headers) { nominal_headers.insert(nominal_headers.index('Archivé'), 'Date de naissance') }
it { expect(dossiers_sheet.headers).to match(birthdate_headers) } it { expect(dossiers_sheet.headers).to match_array(birthdate_headers) }
it { expect(dossiers_sheet.data[0][dossiers_sheet.headers.index('Date de naissance')]).to be_a(Date) } it { expect(dossiers_sheet.data[0][dossiers_sheet.headers.index('Date de naissance')]).to be_a(Date) }
end end
@ -117,7 +117,7 @@ describe ProcedureExportService do
let(:routee_headers) { nominal_headers.insert(nominal_headers.index('textarea'), 'Groupe instructeur') } let(:routee_headers) { nominal_headers.insert(nominal_headers.index('textarea'), 'Groupe instructeur') }
it { expect(dossiers_sheet.headers).to match(routee_headers) } it { expect(dossiers_sheet.headers).to match_array(routee_headers) }
it { expect(dossiers_sheet.data[0][dossiers_sheet.headers.index('Groupe instructeur')]).to eq('défaut') } it { expect(dossiers_sheet.data[0][dossiers_sheet.headers.index('Groupe instructeur')]).to eq('défaut') }
end end
@ -280,12 +280,12 @@ describe ProcedureExportService do
let(:dossiers_sheet_headers) { subject.first } let(:dossiers_sheet_headers) { subject.first }
it 'should have headers' do it 'should have headers' do
expect(dossiers_sheet_headers).to match(nominal_headers) expect(dossiers_sheet_headers).to match_array(nominal_headers)
end end
end end
it 'should have headers' do it 'should have headers' do
expect(dossiers_sheet.headers).to match(nominal_headers) expect(dossiers_sheet.headers).to match_array(nominal_headers)
expect(etablissements_sheet.headers).to eq([ expect(etablissements_sheet.headers).to eq([
"Dossier ID", "Dossier ID",

View file

@ -38,7 +38,7 @@ describe 'Creating a new procedure', js: true do
fill_in 'Libellé du champ', with: 'libelle de champ' fill_in 'Libellé du champ', with: 'libelle de champ'
blur blur
expect(page).to have_content('Formulaire enregistré') expect(page).to have_content('Formulaire enregistré')
expect(page).to have_selector('select > optgroup', count: 7) expect(page).to have_selector('select > optgroup', count: 8)
add_champ add_champ
expect(page).to have_selector('.type-de-champ', count: 1) expect(page).to have_selector('.type-de-champ', count: 1)

View file

@ -142,7 +142,7 @@ describe 'As an administrateur I can edit types de champ', js: true do
scenario "adding a dropdown champ" do scenario "adding a dropdown champ" do
add_champ(remove_flash_message: true) add_champ(remove_flash_message: true)
select('Choix unique', from: 'Type de champ') select('Choix simple', from: 'Type de champ')
fill_in 'Libellé du champ', with: 'Libellé de champ menu déroulant', fill_options: { clear: :backspace } fill_in 'Libellé du champ', with: 'Libellé de champ menu déroulant', fill_options: { clear: :backspace }
fill_in 'Options de la liste', with: 'Un menu', fill_options: { clear: :backspace } fill_in 'Options de la liste', with: 'Un menu', fill_options: { clear: :backspace }
check "Proposer une option « autre » avec un texte libre" check "Proposer une option « autre » avec un texte libre"