Enable the Layout/FirstArrayElementLineBreak cop

This commit is contained in:
gregoirenovel 2018-01-15 14:42:48 +01:00
parent 8f08e2fdf9
commit 08ed400ec2
17 changed files with 201 additions and 149 deletions

View file

@ -1,8 +1,10 @@
class FindDubiousProceduresJob < ApplicationJob
queue_as :cron
FORBIDDEN_KEYWORDS = ['IBAN', 'NIR', 'NIRPP', 'race', 'religion',
'carte bancaire', 'carte bleue', 'sécurité sociale']
FORBIDDEN_KEYWORDS = [
'IBAN', 'NIR', 'NIRPP', 'race', 'religion',
'carte bancaire', 'carte bleue', 'sécurité sociale'
]
def perform(*args)
# \\y is a word boundary

View file

@ -23,18 +23,20 @@ class SIADE::EntrepriseAdapter
end
def attr_to_fetch
[:siren,
:capital_social,
:numero_tva_intracommunautaire,
:forme_juridique,
:forme_juridique_code,
:nom_commercial,
:raison_sociale,
:siret_siege_social,
:code_effectif_entreprise,
:date_creation,
:nom,
:prenom]
[
:siren,
:capital_social,
:numero_tva_intracommunautaire,
:forme_juridique,
:forme_juridique_code,
:nom_commercial,
:raison_sociale,
:siret_siege_social,
:code_effectif_entreprise,
:date_creation,
:nom,
:prenom
]
end
def mandataires_sociaux

View file

@ -23,10 +23,11 @@ class SIADE::EtablissementAdapter
end
def attr_to_fetch
[:siret,
:siege_social,
:naf,
:libelle_naf
[
:siret,
:siege_social,
:naf,
:libelle_naf
]
end
@ -41,12 +42,14 @@ class SIADE::EtablissementAdapter
end
def address_attribut_to_fetch
[:numero_voie,
:type_voie,
:nom_voie,
:complement_adresse,
:code_postal,
:localite,
:code_insee_localite]
[
:numero_voie,
:type_voie,
:nom_voie,
:complement_adresse,
:code_postal,
:localite,
:code_insee_localite
]
end
end

View file

@ -23,12 +23,13 @@ class SIADE::RNAAdapter
end
def attr_to_fetch
[:id,
:titre,
:objet,
:date_creation,
:date_declaration,
:date_publication
[
:id,
:titre,
:objet,
:date_creation,
:date_declaration,
:date_publication
]
end
end

View file

@ -28,22 +28,24 @@ module TagsSubstitutionConcern
end
def dossier_tags
[{ libelle: 'motivation',
description: 'Motivation facultative associée à la décision finale dacceptation, refus ou classement sans suite',
target: :motivation,
dossier_termine_only: true },
{ libelle: 'date de dépôt',
description: 'Date du passage en construction du dossier par lusager',
lambda: -> (d) { format_date(d.en_construction_at) } },
{ libelle: 'date de passage en instruction',
description: '',
lambda: -> (d) { format_date(d.en_instruction_at) } },
{ libelle: 'date de décision',
description: 'Date de la décision dacceptation, refus, ou classement sans suite',
lambda: -> (d) { format_date(d.processed_at) },
dossier_termine_only: true },
{ libelle: 'libellé procédure', description: '', lambda: -> (d) { d.procedure.libelle } },
{ libelle: 'numéro du dossier', description: '', target: :id }]
[
{ libelle: 'motivation',
description: 'Motivation facultative associée à la décision finale dacceptation, refus ou classement sans suite',
target: :motivation,
dossier_termine_only: true },
{ libelle: 'date de dépôt',
description: 'Date du passage en construction du dossier par lusager',
lambda: -> (d) { format_date(d.en_construction_at) } },
{ libelle: 'date de passage en instruction',
description: '',
lambda: -> (d) { format_date(d.en_instruction_at) } },
{ libelle: 'date de décision',
description: 'Date de la décision dacceptation, refus, ou classement sans suite',
lambda: -> (d) { format_date(d.processed_at) },
dossier_termine_only: true },
{ libelle: 'libellé procédure', description: '', lambda: -> (d) { d.procedure.libelle } },
{ libelle: 'numéro du dossier', description: '', target: :id }
]
end
def format_date(date)
@ -55,16 +57,20 @@ module TagsSubstitutionConcern
end
def individual_tags
[{ libelle: 'civilité', description: 'M., Mme', target: :gender },
{ libelle: 'nom', description: "nom de l'usager", target: :nom },
{ libelle: 'prénom', description: "prénom de l'usager", target: :prenom }]
[
{ libelle: 'civilité', description: 'M., Mme', target: :gender },
{ libelle: 'nom', description: "nom de l'usager", target: :nom },
{ libelle: 'prénom', description: "prénom de l'usager", target: :prenom }
]
end
def entreprise_tags
[{ libelle: 'SIREN', description: '', target: :siren },
{ libelle: 'numéro de TVA intracommunautaire', description: '', target: :numero_tva_intracommunautaire },
{ libelle: 'SIRET du siège social', description: '', target: :siret_siege_social },
{ libelle: 'raison sociale', description: '', target: :raison_sociale }]
[
{ libelle: 'SIREN', description: '', target: :siren },
{ libelle: 'numéro de TVA intracommunautaire', description: '', target: :numero_tva_intracommunautaire },
{ libelle: 'SIRET du siège social', description: '', target: :siret_siege_social },
{ libelle: 'raison sociale', description: '', target: :raison_sociale }
]
end
def etablissement_tags

View file

@ -154,22 +154,28 @@ class Gestionnaire < ActiveRecord::Base
private
def valid_couple_table_attr? table, column
couples = [{
table: :dossier,
column: :dossier_id
}, {
table: :procedure,
column: :libelle
}, {
table: :etablissement,
column: :siret
}, {
table: :entreprise,
column: :raison_sociale
}, {
table: :dossier,
column: :state
}]
couples = [
{
table: :dossier,
column: :dossier_id
},
{
table: :procedure,
column: :libelle
},
{
table: :etablissement,
column: :siret
},
{
table: :entreprise,
column: :raison_sociale
},
{
table: :dossier,
column: :state
}
]
couples.include?({table: table, column: column})
end
@ -205,10 +211,12 @@ class Gestionnaire < ActiveRecord::Base
.where('commentaires.updated_at > follows.messagerie_seen_at')
.where.not(commentaires: { email: 'contact@tps.apientreprise.fr' })
[updated_demandes,
updated_pieces_justificatives,
updated_annotations,
updated_avis,
updated_messagerie].map { |query| query.distinct.ids }.flatten.uniq
[
updated_demandes,
updated_pieces_justificatives,
updated_annotations,
updated_avis,
updated_messagerie
].map { |query| query.distinct.ids }.flatten.uniq
end
end

View file

@ -30,9 +30,11 @@ class ProcedureOverview
end
def had_some_activities?
[@dossiers_en_instruction_count,
@dossiers_en_construction_count,
@created_dossiers_count].reduce(:+) > 0
[
@dossiers_en_instruction_count,
@dossiers_en_construction_count,
@created_dossiers_count
].reduce(:+) > 0
end
def dossiers_en_construction_description

View file

@ -6,8 +6,16 @@ class TypesDeChampService
parameters = params_with_ordered_champs
.require(:procedure)
.permit("#{attributes}" => [:libelle, :description, :order_place, :type_champ, :id, :mandatory, :type,
drop_down_list_attributes: [:value, :id]])
.permit("#{attributes}" => [
:libelle,
:description,
:order_place,
:type_champ,
:id,
:mandatory,
:type,
drop_down_list_attributes: [:value, :id]
])
parameters[attributes].each do |param_first, param_second|
if param_second[:libelle].empty?