Merge pull request #8147 from E-L-T/feat-update-types-de-champ-select-elt

feat(type_de_champ) update wording and order in select
This commit is contained in:
Eric Leroy-Terquem 2022-12-16 09:52:17 +01:00 committed by GitHub
commit 36bc1d200e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 131 additions and 121 deletions

View file

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

View file

@ -20,48 +20,49 @@ class TypeDeChamp < ApplicationRecord
FILE_MAX_SIZE = 200.megabytes
FEATURE_FLAGS = {}
CADRE = :cadre
STANDARD = :standard
CHOICE = :choice
STRUCTURE = :structure
ETAT_CIVIL = :etat_civil
PAIEMENT_IDENTIFICATION = :paiement_identification
REFERENTIEL_EXTERNE = :referentiel_externe
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 = {
text: STANDARD,
textarea: STANDARD,
date: STANDARD,
datetime: STANDARD,
number: STANDARD,
decimal_number: STANDARD,
integer_number: STANDARD,
checkbox: CHOICE,
header_section: STRUCTURE,
repetition: STRUCTURE,
dossier_link: STRUCTURE,
explication: STRUCTURE,
civilite: ETAT_CIVIL,
email: ETAT_CIVIL,
phone: ETAT_CIVIL,
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,
multiple_drop_down_list: CHOICE,
linked_drop_down_list: CHOICE,
pays: LOCALISATION,
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,
yes_no: CHOICE,
annuaire_education: REFERENTIEL_EXTERNE,
rna: REFERENTIEL_EXTERNE,
carte: REFERENTIEL_EXTERNE,
cnaf: REFERENTIEL_EXTERNE,
dgfip: REFERENTIEL_EXTERNE,
pole_emploi: REFERENTIEL_EXTERNE,
@ -69,37 +70,37 @@ class TypeDeChamp < ApplicationRecord
}
enum type_champs: {
text: 'text',
textarea: 'textarea',
date: 'date',
datetime: 'datetime',
number: 'number',
decimal_number: 'decimal_number',
integer_number: 'integer_number',
checkbox: 'checkbox',
header_section: 'header_section',
repetition: 'repetition',
dossier_link: 'dossier_link',
explication: 'explication',
civilite: 'civilite',
email: 'email',
phone: 'phone',
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',
departements: 'departements',
regions: 'regions',
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',
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',
rna: 'rna',
carte: 'carte',
cnaf: 'cnaf',
dgfip: 'dgfip',
pole_emploi: 'pole_emploi',

View file

@ -4,39 +4,48 @@ fr:
type_de_champ: 'Field type'
attributes:
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:
text: 'Text'
textarea: 'Text area'
date: 'Date'
datetime: 'Datetime'
number: 'Number'
decimal_number: 'Decimal number'
integer_number: 'Integer number'
checkbox: 'Checkbox'
header_section: 'Header section'
repetition: 'Repetition'
dossier_link: 'File link'
explication: 'Explication'
civilite: 'Civility'
email: 'Email'
phone: 'Phone'
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'
multiple_drop_down_list: 'Multiple dropdown list'
linked_drop_down_list: 'Linked dropdown list'
pays: 'Country'
regions: 'Regions'
departements: 'County'
communes: 'Municipality'
engagement: 'Commitment'
header_section: 'Header section'
explication: 'Explication'
dossier_link: 'File link'
piece_justificative: 'Supporting document'
siret: 'SIRET'
yes_no: 'Yes/No'
annuaire_education: 'Schooling directory'
rna: 'RNA'
carte: 'Card'
repetition: 'Repetition'
titre_identite: 'Identity title'
iban: 'Iban'
annuaire_education: 'Schooling directory'
engagement: 'Commitment'
cnaf: 'Data from Caisse nationale des allocations familiales'
dgfip: 'Data from Direction générale des Finances publiques'
pole_emploi: 'Pôle emploi status'

View file

@ -5,47 +5,47 @@ fr:
attributes:
type_de_champ:
categorie:
standard: 'Standard'
choice: 'Choix'
structure: 'Structure des champs'
etat_civil: 'État civil'
cadre: 'Cadre'
file: 'Fichier'
paiement_identification: 'Paiement - Identification'
referentiel_externe: 'Référentiel externe'
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:
text: 'Texte'
textarea: 'Zone de texte'
date: 'Date'
datetime: 'Date et Heure'
header_section: 'Titre de section'
repetition: 'Bloc répétable'
dossier_link: 'Lien vers un autre dossier'
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'
decimal_number: 'Nombre décimal'
integer_number: 'Nombre entier'
checkbox: 'Case à cocher'
civilite: 'Civilité'
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'
date: 'Date'
datetime: 'Date et Heure'
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'
carte: 'Carte'
repetition: 'Bloc répétable'
titre_identite: 'Titre identité'
iban: 'Iban'
annuaire_education: 'Annuaire de léducation'
engagement: 'Engagement'
cnaf: 'Données de la Caisse nationale des allocations familiales'
dgfip: 'Données de la Direction générale des Finances publiques'
pole_emploi: 'Situation Pôle emploi'

View file

@ -1482,7 +1482,7 @@ describe API::V2::GraphqlController do
"mutation {
dossierModifierAnnotationText(input: {
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}\",
value: \"hello\"
}) {

View file

@ -32,6 +32,6 @@ describe Manager::DossiersController, type: :controller do
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

View file

@ -87,7 +87,7 @@ describe ProcedureExportService do
end
it 'should have headers' do
expect(dossiers_sheet.headers).to match(nominal_headers)
expect(dossiers_sheet.headers).to match_array(nominal_headers)
end
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') }
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) }
end
@ -117,7 +117,7 @@ describe ProcedureExportService do
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') }
end
@ -280,12 +280,12 @@ describe ProcedureExportService do
let(:dossiers_sheet_headers) { subject.first }
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 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([
"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'
blur
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
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
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 'Options de la liste', with: 'Un menu', fill_options: { clear: :backspace }
check "Proposer une option « autre » avec un texte libre"