Merge branch 'dev'

This commit is contained in:
gregoirenovel 2018-10-01 16:18:55 +02:00
commit c7cb1ac6e0
54 changed files with 293 additions and 165 deletions

View file

@ -6,6 +6,7 @@
padding: 8px 16px;
border-radius: 30px;
border: 1px solid $border-grey;
font-family: "Muli";
font-size: 14px;
line-height: 20px;
background-color: #FFFFFF;
@ -113,9 +114,20 @@
margin-right: $default-spacer;
}
&.dropdown {
position: relative;
&.icon-only {
padding: 9px 16px;
.icon {
margin-right: 0;
}
}
}
.dropdown {
display: inline-block;
position: relative;
.dropdown-button {
&::after {
content: "";
margin-left: $default-spacer;
@ -128,24 +140,14 @@
color: $blue;
}
}
.dropdown-content {
display: none;
}
&.open {
.dropdown-content {
display: block;
}
}
}
&.icon-only {
padding: 9px 16px;
.dropdown-content {
display: none;
}
.icon {
margin-right: 0;
}
&.open .dropdown-content {
display: block;
}
}

View file

@ -159,6 +159,19 @@ $landing-breakpoint: 1040px;
}
}
.header-menu-button {
border: none;
padding: 0;
&:hover {
background: none;
}
&::after {
display: none;
}
}
.header-menu {
display: none;
position: absolute;

View file

@ -16,7 +16,10 @@ class Admin::InstructeursController < AdminController
array: true
not_assign_scope = current_administrateur.gestionnaires.where.not(id: assign_scope.ids)
not_assign_scope = not_assign_scope.where("email LIKE ?", "%#{params[:filter]}%") if params[:filter]
if params[:filter]
not_assign_scope = not_assign_scope.where("email LIKE ?", "%#{params[:filter]}%")
end
@instructeurs_not_assign = smart_listing_create :instructeurs_not_assign,
not_assign_scope,

View file

@ -55,7 +55,9 @@ class Admin::ProceduresController < AdminController
def destroy
procedure = current_administrateur.procedures.find(params[:id])
return render json: {}, status: 401 if procedure.publiee_ou_archivee?
if procedure.publiee_ou_archivee?
return render json: {}, status: 401
end
procedure.destroy
@ -72,7 +74,11 @@ class Admin::ProceduresController < AdminController
def create
@procedure = Procedure.new(procedure_params)
@procedure.module_api_carto = ModuleAPICarto.new(create_module_api_carto_params) if @procedure.valid?
if @procedure.valid?
@procedure.module_api_carto = ModuleAPICarto.new(create_module_api_carto_params)
end
@path = params.require(:procedure).permit(:path)[:path]
@available = !ProcedurePath.exists?(path: @path)
@mine = ProcedurePath.mine?(current_administrateur, @path)

View file

@ -5,7 +5,10 @@ class Administrations::SessionsController < ApplicationController
end
def destroy
sign_out :administration if administration_signed_in?
if administration_signed_in?
sign_out :administration
end
redirect_to root_path
end
end

View file

@ -1,7 +1,10 @@
class CommentairesController < ApplicationController
def create
@commentaire = Commentaire.new
@commentaire.champ = @commentaire.dossier.champs.find(params[:champ_id]) if params[:champ_id]
if params[:champ_id]
@commentaire.champ = @commentaire.dossier.champs.find(params[:champ_id])
end
dossier_id = params['dossier_id']
@commentaire.email = current_user.email

View file

@ -36,9 +36,17 @@ class FranceConnect::ParticulierController < ApplicationController
end
def connect_france_connect_particulier(user)
sign_out :user if user_signed_in?
sign_out :gestionnaire if gestionnaire_signed_in?
sign_out :administrateur if administrateur_signed_in?
if user_signed_in?
sign_out :user
end
if gestionnaire_signed_in?
sign_out :gestionnaire
end
if administrateur_signed_in?
sign_out :administrateur
end
sign_in user

View file

@ -36,14 +36,20 @@ class Gestionnaires::PasswordsController < Devise::PasswordsController
def try_to_authenticate_user
if gestionnaire_signed_in?
user = User.find_by(email: current_gestionnaire.email)
sign_in user if user
if user
sign_in user
end
end
end
def try_to_authenticate_administrateur
if gestionnaire_signed_in?
administrateur = Administrateur.find_by(email: current_gestionnaire.email)
sign_in administrateur if administrateur
if administrateur
sign_in administrateur
end
end
end
end

View file

@ -131,7 +131,10 @@ module NewGestionnaire
def position
etablissement = dossier.etablissement
point = Carto::Geocodeur.convert_adresse_to_point(etablissement.geo_adresse) if etablissement.present?
if etablissement.present?
point = Carto::Geocodeur.convert_adresse_to_point(etablissement.geo_adresse)
end
lon = "2.428462"
lat = "46.538192"

View file

@ -2,9 +2,20 @@ class Sessions::SessionsController < Devise::SessionsController
before_action :before_sign_in, only: [:create]
def before_sign_in
sign_out :user if user_signed_in?
sign_out :gestionnaire if gestionnaire_signed_in?
sign_out :administrateur if administrateur_signed_in?
sign_out :administration if administration_signed_in?
if user_signed_in?
sign_out :user
end
if gestionnaire_signed_in?
sign_out :gestionnaire
end
if administrateur_signed_in?
sign_out :administrateur
end
if administration_signed_in?
sign_out :administration
end
end
end

View file

@ -9,7 +9,7 @@ class SupportController < ApplicationController
if direct_message? && create_commentaire
flash.notice = "Votre message a été envoyé sur la messagerie de votre dossier."
redirect_to helpers.url_for_dossier(dossier)
redirect_to messagerie_dossier_path(dossier)
elsif create_conversation
flash.notice = "Votre message a été envoyé."

View file

@ -35,7 +35,9 @@ class Users::CarteController < UsersController
etablissement = nil
end
point = Carto::Geocodeur.convert_adresse_to_point(etablissement.geo_adresse) if etablissement.present?
if etablissement.present?
point = Carto::Geocodeur.convert_adresse_to_point(etablissement.geo_adresse)
end
lon = '2.428462'
lat = '46.538192'

View file

@ -2,7 +2,10 @@ class Users::DescriptionController < UsersController
def pieces_justificatives
invite = current_user.invite? params[:dossier_id]
@dossier ||= Dossier.find(params[:dossier_id]) if invite
if invite
@dossier ||= Dossier.find(params[:dossier_id])
end
@dossier ||= current_user_dossier
if (errors_upload = PiecesJustificativesService.upload!(@dossier, current_user, params)).present?
@ -13,10 +16,14 @@ class Users::DescriptionController < UsersController
end
else
flash.notice = 'Nouveaux fichiers envoyés' if flash.alert.nil?
if flash.alert.nil?
flash.notice = 'Nouveaux fichiers envoyés'
end
end
return redirect_to users_dossiers_invite_path(id: current_user.invites.find_by(dossier_id: @dossier.id).id) if invite
if invite
return redirect_to users_dossiers_invite_path(id: current_user.invites.find_by(dossier_id: @dossier.id).id)
end
redirect_to users_dossier_recapitulatif_path
end

View file

@ -2,10 +2,13 @@ class Users::Dossiers::AddSiretController < ApplicationController
def show
@facade = DossierFacades.new params[:dossier_id], current_user.email
raise ActiveRecord::RecordNotFound if !@facade.procedure.individual_with_siret?
@siret = current_user.siret if current_user.siret.present?
if !@facade.procedure.individual_with_siret?
raise ActiveRecord::RecordNotFound
end
if current_user.siret.present?
@siret = current_user.siret
end
rescue ActiveRecord::RecordNotFound
flash.alert = t('errors.messages.dossier_not_found')
redirect_to url_for dossiers_path

View file

@ -12,12 +12,10 @@ class Users::Dossiers::InvitesController < UsersController
def show
@facade = InviteDossierFacades.new params[:id].to_i, current_user.email
if Flipflop.new_dossier_details?
return redirect_to dossier_path(@facade.dossier)
end
if @facade.dossier.brouillon?
redirect_to brouillon_dossier_path(@facade.dossier)
elsif Flipflop.new_dossier_details?
return redirect_to dossier_path(@facade.dossier)
else
render 'users/recapitulatif/show'
end

View file

@ -54,7 +54,9 @@ class Users::DossiersController < UsersController
dossier = Dossier.create!(procedure: procedure, user: current_user, state: Dossier.states.fetch(:brouillon))
siret = params[:siret] || current_user.siret
update_current_user_siret! siret if siret.present?
if siret.present?
update_current_user_siret! siret
end
if dossier.procedure.for_individual
redirect_to identite_dossier_path(dossier)
@ -67,7 +69,9 @@ class Users::DossiersController < UsersController
def show
@facade = facade
@siret = current_user.siret if current_user.siret.present?
if current_user.siret.present?
@siret = current_user.siret
end
if @facade.procedure.for_individual? && current_user.loged_in_with_france_connect?
individual = @facade.dossier.individual
@ -165,7 +169,9 @@ class Users::DossiersController < UsersController
private
def check_siret
errors_valid_siret if !Siret.new(siret: siret).valid?
if !Siret.new(siret: siret).valid?
errors_valid_siret
end
end
def errors_valid_siret

View file

@ -36,14 +36,20 @@ class Users::PasswordsController < Devise::PasswordsController
def try_to_authenticate_gestionnaire
if user_signed_in?
gestionnaire = Gestionnaire.find_by(email: current_user.email)
sign_in gestionnaire if gestionnaire
if gestionnaire
sign_in gestionnaire
end
end
end
def try_to_authenticate_administrateur
if user_signed_in?
administrateur = Administrateur.find_by(email: current_user.email)
sign_in administrateur if administrateur
if administrateur
sign_in administrateur
end
end
end
end

View file

@ -13,7 +13,10 @@ class Users::RegistrationsController < Devise::RegistrationsController
# Allow pre-filling the user email from a query parameter
build_resource({ email: sign_up_params[:email] })
yield resource if block_given?
if block_given?
yield resource
end
respond_with resource
end

View file

@ -39,8 +39,13 @@ class Users::SessionsController < Sessions::SessionsController
# DELETE /resource/sign_out
def destroy
sign_out :gestionnaire if gestionnaire_signed_in?
sign_out :administrateur if administrateur_signed_in?
if gestionnaire_signed_in?
sign_out :gestionnaire
end
if administrateur_signed_in?
sign_out :administrateur
end
if user_signed_in?
connected_with_france_connect = current_user.loged_in_with_france_connect
@ -72,7 +77,9 @@ class Users::SessionsController < Sessions::SessionsController
end
def user_return_to_procedure_id
return nil if session["user_return_to"].nil?
if session["user_return_to"].nil?
return nil
end
NumberService.to_number session["user_return_to"].split("?procedure_id=").second
end

View file

@ -30,6 +30,8 @@ class ChampDecorator < Draper::Decorator
end
def description_with_links
description.gsub(URI.regexp, '<a target="_blank" href="\0">\0</a>') if description
if description
description.gsub(URI.regexp, '<a target="_blank" href="\0">\0</a>')
end
end
end

View file

@ -1,11 +1,15 @@
class TypeDePieceJustificativeDecorator < Draper::Decorator
delegate_all
def button_up(params)
h.link_to '', params[:url], class: up_classes, id: "btn_up_#{params[:index]}", remote: true, method: :post if display_up_button?(params[:index])
if display_up_button?(params[:index])
h.link_to '', params[:url], class: up_classes, id: "btn_up_#{params[:index]}", remote: true, method: :post
end
end
def button_down(params)
h.link_to '', params[:url], class: down_classes, id: "btn_down_#{params[:index]}", remote: true, method: :post if display_down_button?(params[:index])
if display_down_button?(params[:index])
h.link_to '', params[:url], class: down_classes, id: "btn_down_#{params[:index]}", remote: true, method: :post
end
end
private

View file

@ -1,13 +0,0 @@
import $ from 'jquery';
$(document).on('click', 'body', () => {
$('.button.dropdown').removeClass('open');
});
$(document).on('click', '.button.dropdown', event => {
event.stopPropagation();
const $target = $(event.target);
if ($target.hasClass('button', 'dropdown')) {
$target.toggleClass('open');
}
});

View file

@ -1,10 +0,0 @@
import $ from 'jquery';
$(document).on('click', 'body', () => {
$('.print-menu').removeClass('open fade-in-down');
});
export function togglePrintMenu(event) {
event.stopPropagation();
$('.print-menu').toggleClass('open fade-in-down');
}

View file

@ -0,0 +1,19 @@
import Rails from 'rails-ujs';
const { delegate } = Rails;
delegate(document, 'body', 'click', event => {
if (!event.target.closest('.dropdown')) {
[...document.querySelectorAll('.dropdown')].forEach(element =>
element.classList.remove('open', 'fade-in-down')
);
}
});
delegate(document, '.dropdown-button', 'click', event => {
event.stopPropagation();
const parent = event.target.closest('.dropdown-button').parentElement;
if (parent.classList.contains('dropdown')) {
parent.classList.toggle('open');
}
});

View file

@ -1,10 +0,0 @@
import $ from 'jquery';
$(document).on('click', 'body', () => {
$('.header-menu').removeClass('open fade-in-down');
});
export function toggleHeaderMenu(event) {
event.stopPropagation();
$('.header-menu').toggleClass('open fade-in-down');
}

View file

@ -13,7 +13,7 @@ import '../shared/autocomplete';
import '../shared/remote-input';
import '../new_design/spinner';
import '../new_design/buttons';
import '../new_design/dropdown';
import '../new_design/form-validation';
import '../new_design/carto';
import '../new_design/select2';
@ -21,8 +21,6 @@ import '../new_design/select2';
import '../new_design/champs/linked-drop-down-list';
import { toggleCondidentielExplanation } from '../new_design/avis';
import { togglePrintMenu } from '../new_design/dossier';
import { toggleHeaderMenu } from '../new_design/header';
import { scrollMessagerie } from '../new_design/messagerie';
import { showMotivation, motivationCancel } from '../new_design/state-button';
import { toggleChart } from '../new_design/toggle-chart';
@ -30,8 +28,6 @@ import { toggleChart } from '../new_design/toggle-chart';
// This is the global application namespace where we expose helpers used from rails views
const DS = {
toggleCondidentielExplanation,
togglePrintMenu,
toggleHeaderMenu,
scrollMessagerie,
showMotivation,
motivationCancel,

View file

@ -10,9 +10,15 @@ class FileSizeValidator < ActiveModel::EachValidator
range = options.delete(:in) || options.delete(:within)
if range.present?
raise ArgumentError, ":in and :within must be a Range" if !range.is_a?(Range)
if !range.is_a?(Range)
raise ArgumentError, ":in and :within must be a Range"
end
options[:minimum], options[:maximum] = range.begin, range.end
options[:maximum] -= 1 if range.exclude_end?
if range.exclude_end?
options[:maximum] -= 1
end
end
super
@ -35,12 +41,18 @@ class FileSizeValidator < ActiveModel::EachValidator
end
def validate_each(record, attribute, value)
raise(ArgumentError, "A CarrierWave::Uploader::Base object was expected") if !value.kind_of? CarrierWave::Uploader::Base
if !value.kind_of? CarrierWave::Uploader::Base
raise(ArgumentError, "A CarrierWave::Uploader::Base object was expected")
end
value = (options[:tokenizer] || DEFAULT_TOKENIZER).call(value) if value.kind_of?(String)
if value.kind_of?(String)
value = (options[:tokenizer] || DEFAULT_TOKENIZER).call(value)
end
CHECKS.each do |key, validity_check|
next if !check_value = options[key]
if !check_value = options[key]
next
end
check_value =
case check_value
@ -50,16 +62,22 @@ class FileSizeValidator < ActiveModel::EachValidator
record.send(check_value)
end
value ||= [] if key == :maximum
if key == :maximum
value ||= []
end
value_size = value.size
next if value_size.send(validity_check, check_value)
if value_size.send(validity_check, check_value)
next
end
errors_options = options.except(*RESERVED_OPTIONS)
errors_options[:file_size] = help.number_to_human_size check_value
default_message = options[MESSAGES[key]]
errors_options[:message] ||= default_message if default_message
if default_message
errors_options[:message] ||= default_message
end
record.errors.add(attribute, MESSAGES[key], errors_options)
end

View file

@ -47,7 +47,7 @@ module TagsSubstitutionConcern
{
libelle: 'lien dossier',
description: '',
lambda: -> (d) { external_link(users_dossier_recapitulatif_url(d)) },
lambda: -> (d) { external_link(dossier_url(d)) },
available_for_states: Dossier::SOUMIS
},
{

View file

@ -31,7 +31,9 @@ class Gestionnaire < ApplicationRecord
end
def follow(dossier)
return if follow?(dossier)
if follow?(dossier)
return
end
followed_dossiers << dossier
end

View file

@ -6,10 +6,15 @@ class ModuleAPICarto < ApplicationRecord
validates :cadastre, presence: true, allow_blank: true, allow_nil: false
def classes
modules = ''
modules = ''
modules += 'qp ' if quartiers_prioritaires?
modules += 'cadastre ' if cadastre?
if quartiers_prioritaires?
modules += 'qp '
end
if cadastre?
modules += 'cadastre '
end
modules
end

View file

@ -10,6 +10,8 @@ class Siret
before_validation :remove_whitespace
def remove_whitespace
siret.delete!(' ') if siret.present?
if siret.present?
siret.delete!(' ')
end
end
end

View file

@ -1,7 +1,9 @@
class ClamavService
def self.safe_file?(file_path)
if Rails.env == 'development'
return CLAMAV[:response] if CLAMAV[:mock?]
if CLAMAV[:mock?]
return CLAMAV[:response]
end
end
FileUtils.chmod 0666, file_path
@ -9,7 +11,10 @@ class ClamavService
client = ClamAV::Client.new
response = client.execute(ClamAV::Commands::ScanCommand.new(file_path))
return false if response.first.class == ClamAV::VirusResponse
if response.first.class == ClamAV::VirusResponse
return false
end
true
end
end

View file

@ -1,5 +1,5 @@
class NumberService
def self.to_number(string)
string.to_s if Float(string) rescue nil
string.to_s
end
end

View file

@ -48,6 +48,8 @@ class PieceJustificativeUploader < BaseUploader
end
def set_original_filename(file)
model.original_filename ||= file.original_filename if file.respond_to?(:original_filename)
if file.respond_to?(:original_filename)
model.original_filename ||= file.original_filename
end
end
end

View file

@ -4,7 +4,12 @@ class ProcedurePathFormatValidator < ActiveModel::Validator
end
def validate(record)
return false if record.path.blank?
record.errors[:path] << "Path invalide" if !path_regex.match(record.path)
if record.path.blank?
return false
end
if !path_regex.match(record.path)
record.errors[:path] << "Path invalide"
end
end
end

View file

@ -1,10 +1,11 @@
%span.button.dropdown.invite-user-action
%span.icon.person
- if dossier.invites.count > 0
Voir les personnes invitées
%span.badge= dossier.invites.count
- else
Inviter une personne à modifier ce dossier
%span.dropdown.invite-user-action
%button.button.dropdown-button
%span.icon.person
- if dossier.invites.count > 0
Voir les personnes invitées
%span.badge= dossier.invites.count
- else
Inviter une personne à modifier ce dossier
.dropdown-content.fade-in-down
= render partial: "invites/form", locals: { dossier: dossier }

View file

@ -1,3 +1,3 @@
%div{ style: 'float: right;' }
%a.btn{ href: "/users/dossiers/#{@dossier.id}/recapitulatif" } Retour
%a.btn{ href: dossier_path(@dossier) } Retour
= submit_tag 'Modification terminée', class: %w(btn btn btn-info), id: 'modification_terminee', data: { disable: true, submit: true }

View file

@ -57,9 +57,10 @@
- if gestionnaire_signed_in? || user_signed_in?
%li
.header-menu-opener
= image_tag "icons/account-circle.svg", onclick: "javascript:DS.toggleHeaderMenu(event);", title: "Mon compte"
%ul.header-menu
%span.dropdown.header-menu-opener
%button.button.dropdown-button.header-menu-button
= image_tag "icons/account-circle.svg", title: "Mon compte"
%ul.header-menu.dropdown-content
%li
.menu-item{ title: current_email }
= current_email

View file

@ -6,4 +6,4 @@
%strong
Merci de ne pas répondre à cet email. Pour vous adresser à votre administration, passez directement par votre
= succeed '.' do
= link_to 'messagerie', users_dossier_recapitulatif_url(@dossier), target: '_blank'
= link_to 'messagerie', messagerie_dossier_url(@dossier), target: '_blank'

View file

@ -7,13 +7,14 @@
%li
= "Dossier nº #{dossier.id}"
.mixed-buttons-bar
.button.dropdown.icon-only.print-menu-opener{ onclick: "javascript:DS.togglePrintMenu(event);" }
%span.icon.printer
%ul.print-menu
%span.dropdown.print-menu-opener
%button.button.dropdown-button.icon-only
%span.icon.printer
%ul.print-menu.dropdown-content
%li
= link_to "Tout le dossier", print_gestionnaire_dossier_path(dossier.procedure, dossier), target: "_blank", class: "menu-item menu-link"
%li
= link_to "Uniquement cet onglet", "#", onclick: "DS.togglePrintMenu; window.print()", class: "menu-item menu-link"
= link_to "Uniquement cet onglet", "#", onclick: "window.print()", class: "menu-item menu-link"
= render partial: "new_gestionnaire/procedures/dossier_actions", locals: { procedure: dossier.procedure, dossier: dossier, dossier_is_followed: current_gestionnaire&.follow?(dossier) }
= render partial: "state_button", locals: { dossier: dossier }

View file

@ -1,6 +1,7 @@
- if dossier.en_construction? || dossier.en_instruction?
%span.button.primary.dropdown
= dossier.decorate.display_state
%span.dropdown
%button.button.primary.dropdown-button
= dossier.decorate.display_state
.dropdown-content.fade-in-down
%ul.dropdown-items
- if dossier.en_construction?
@ -49,8 +50,9 @@
- else
- if dossier.motivation.present? || dossier.attestation.present?
%span.button.dropdown{ class: button_or_label_class(dossier) }
= dossier.statut
%span.dropdown
%button.button.dropdown-button{ class: button_or_label_class(dossier) }
= dossier.statut
.dropdown-content.fade-in-down.terminated
- if dossier.motivation.present?
%h4 Motivation

View file

@ -1,6 +1,7 @@
- if procedure.dossiers.state_not_brouillon.any?
%span.button.dropdown
Télécharger tous les dossiers
%span.dropdown
%button.button.dropdown-button
Télécharger tous les dossiers
.dropdown-content.fade-in-down
%ul.dropdown-items
%li

View file

@ -43,8 +43,9 @@
.container
- if @dossiers.present? || @current_filters.count > 0
%span.button.dropdown
Filtrer
%span.dropdown
%button.button.dropdown-button
Filtrer
.dropdown-content.left-aligned.fade-in-down
= form_tag add_filter_gestionnaire_procedure_path(@procedure), method: :post, class: 'dropdown-form large' do
= label_tag :field, "Colonne"
@ -78,8 +79,9 @@
= render partial: "header_field", locals: { field: { "label" => "Statut", "table" => "self", "column" => "state" }, classname: "status-col" }
%th.follow-col
%span.button.dropdown
Personnaliser
%span.dropdown
%button.button.dropdown-button
Personnaliser
.dropdown-content.fade-in-down
= form_tag update_displayed_fields_gestionnaire_procedure_path(@procedure), method: :patch, class: 'dropdown-form columns-form' do
= select_tag :values,

View file

@ -6,7 +6,7 @@
%p
Pour le consulter, merci de vous rendre sur
= users_dossier_recapitulatif_url(dossier_id: @dossier.id)
= messagerie_dossier_url(@dossier)
%p
Bonne journée,

View file

@ -13,8 +13,9 @@
= link_to "Télécharger", pj.content_url, class: "link", target: :blank
- if pjs.present?
%br
%span.button.dropdown
anciennes versions
%span.dropdown
%button.button.dropdown-button
anciennes versions
.dropdown-content.fade-in-down
%ul.dropdown-items
- pjs.each do |pj|

View file

@ -58,7 +58,7 @@
%li
= link_to("Étape Occitanie, le 15 octobre à Toulouse", "https://www.demarches-simplifiees.fr/commencer/tour-de-france-demarches-simplifiees-fr-occitanie", target: "_blank")
%li
= link_to("Étape Nouvelle-Aquitaine, le 17 octobre à Bordeaux", "https://www.demarches-simplifiees.fr/commencer/tour-de-france-demarches-simplifiees-fr-aquitaine", target: "_blank")
= link_to("Étape Nouvelle-Aquitaine, le 18 octobre à Bordeaux", "https://www.demarches-simplifiees.fr/commencer/tour-de-france-demarches-simplifiees-fr-aquitaine", target: "_blank")
%li
= link_to("Étape Martinique, le 24 octobre à Fort-de-France", "https://www.demarches-simplifiees.fr/commencer/tour-de-france-demarches-simplifiees-fr-martinique", target: "_blank")
%li

View file

@ -18,15 +18,17 @@ class CreateFranceConnectInformation < ActiveRecord::Migration
add_reference :france_connect_informations, :user, references: :users
User.all.each do |user|
FranceConnectInformation.create({
gender: user.gender,
given_name: user.given_name,
family_name: user.family_name,
birthdate: user.birthdate,
birthplace: user.birthplace,
france_connect_particulier_id: user.france_connect_particulier_id,
user_id: user.id
}) if user.france_connect_particulier_id.present?
if user.france_connect_particulier_id.present?
FranceConnectInformation.create({
gender: user.gender,
given_name: user.given_name,
family_name: user.family_name,
birthdate: user.birthdate,
birthplace: user.birthplace,
france_connect_particulier_id: user.france_connect_particulier_id,
user_id: user.id
})
end
end
remove_column :users, :gender

View file

@ -98,7 +98,7 @@ describe SupportController, type: :controller do
}
expect(flash[:notice]).to match('Votre message a été envoyé sur la messagerie de votre dossier.')
expect(response).to redirect_to users_dossier_recapitulatif_path(dossier)
expect(response).to redirect_to messagerie_dossier_path(dossier)
end
end
end

View file

@ -82,23 +82,23 @@ feature "procedure filters" do
end
def add_filter(column_name, filter_value)
find(:xpath, "//span[contains(text(), 'Filtrer')]").click
click_on 'Filtrer'
select column_name, from: "Colonne"
fill_in "Valeur", with: filter_value
click_button "Ajouter le filtre"
end
def add_column(column_name)
find(:xpath, "//span[contains(text(), 'Personnaliser')]").click
click_on 'Personnaliser'
find("span.select2-container").click
find(:xpath, "//li[text()='#{column_name}']").click
click_button "Enregistrer"
end
def remove_column(column_name)
find(:xpath, "//span[contains(text(), 'Personnaliser')]").click
click_on 'Personnaliser'
find(:xpath, "//li[contains(@title, '#{column_name}')]/span[contains(text(), '×')]").click
find(:xpath, "//span[contains(text(), 'Personnaliser')]//span[contains(@class, 'select2-container')]").click
find(:xpath, "//form[contains(@class, 'columns-form')]//span[contains(@class, 'select2-container')]").click
click_button "Enregistrer"
end
end

View file

@ -178,7 +178,7 @@ feature 'Invitations' do
end
def send_invite_to(invited_email)
find('.button.invite-user-action').click()
click_on "Inviter une personne à modifier ce dossier"
expect(page).to have_button("Envoyer une invitation", visible: true)
fill_in 'invite_email', with: invited_email

View file

@ -60,7 +60,7 @@ RSpec.describe NotificationMailer, type: :mailer do
subject(:subject) { described_class.new_answer(dossier) }
it { expect(subject.body).to match('Un nouveau message est disponible dans votre espace demarches-simplifiees.fr.') }
it { expect(subject.body).to include(users_dossier_recapitulatif_url(dossier_id: dossier.id)) }
it { expect(subject.body).to include(messagerie_dossier_url(dossier)) }
it { expect(subject.subject).to eq("Nouveau message pour votre dossier nº #{dossier.id}") }
end
end

View file

@ -26,7 +26,7 @@ describe MailTemplateConcern do
it do
expected =
"[demarches-simplifiees.fr] #{dossier.id} #{dossier.procedure.libelle} " +
"<a target=\"_blank\" href=\"http://localhost:3000/users/dossiers/#{dossier.id}/recapitulatif\">http://localhost:3000/users/dossiers/#{dossier.id}/recapitulatif</a>"
"<a target=\"_blank\" href=\"http://localhost:3000/dossiers/#{dossier.id}\">http://localhost:3000/dossiers/#{dossier.id}</a>"
is_expected.to eq(expected)
end

View file

@ -27,7 +27,7 @@ describe 'users/carte/show.html.haml', type: :view do
end
end
context 'si la page précédente n\'est pas recapitulatif' do
context 'si la page précédente n\'est pas la page du dossier' do
it 'le bouton "Etape suivante" est présent' do
expect(rendered).to have_selector('#etape_suivante')
end
@ -37,7 +37,7 @@ describe 'users/carte/show.html.haml', type: :view do
# end
end
context 'si la page précédente est recapitularif' do
context 'si la page précédente est la page du dossier' do
let(:state) { Dossier.states.fetch(:en_construction) }
it 'le bouton "Etape suivante" n\'est pas présent' do
@ -52,8 +52,8 @@ describe 'users/carte/show.html.haml', type: :view do
# expect(rendered).to have_selector('input[type=submit][id=modification_terminee][onclick=\'submit_check_draw(event)\']')
# end
it 'le lien de retour au récapitulatif est présent' do
expect(rendered).to have_selector("a[href='/users/dossiers/#{dossier_id}/recapitulatif']")
it 'le lien de retour à la page du dossier est présent' do
expect(rendered).to have_selector("a[href='/dossiers/#{dossier_id}']")
end
end
end