Merge pull request #2734 from betagouv/remove-old-dossier-details

[Dossier] Suppression de l'ancien code
This commit is contained in:
Pierre de La Morinerie 2018-10-02 16:04:28 +02:00 committed by GitHub
commit 776e684b1b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
54 changed files with 6 additions and 195893 deletions

View file

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" width="550.801" height="550.801" viewBox="0 0 550.801 550.801"><path d="M160.381 282.225c0-14.832-10.299-23.684-28.474-23.684-7.414 0-12.437.715-15.071 1.432V307.6c3.114.707 6.942.949 12.192.949 19.391 0 31.353-9.809 31.353-26.324zM272.875 259.019c-8.145 0-13.397.717-16.519 1.435v105.523c3.116.729 8.142.729 12.69.729 33.017.231 54.554-17.946 54.554-56.474.242-33.513-19.385-51.213-50.725-51.213z"/><path d="M488.426 197.019H475.2v-63.816c0-.398-.063-.799-.116-1.202-.021-2.534-.827-5.023-2.562-6.995L366.325 3.694c-.032-.031-.063-.042-.085-.076-.633-.707-1.371-1.295-2.151-1.804a9.495 9.495 0 0 0-.706-.419 11.131 11.131 0 0 0-2.131-.896c-.2-.056-.38-.138-.58-.19A10.774 10.774 0 0 0 358.193 0H97.2C85.282 0 75.6 9.693 75.6 21.601v175.413H62.377c-17.049 0-30.873 13.818-30.873 30.873v160.545c0 17.043 13.824 30.87 30.873 30.87h13.224V529.2c0 11.907 9.682 21.601 21.6 21.601h356.4c11.907 0 21.6-9.693 21.6-21.601V419.302h13.226c17.044 0 30.871-13.827 30.871-30.87v-160.54c-.001-17.054-13.828-30.873-30.872-30.873zM97.2 21.605h250.193v110.513c0 5.967 4.841 10.8 10.8 10.8H453.6v54.108H97.2V21.605zm265.159 287.418c0 30.876-11.243 52.165-26.82 65.333-16.971 14.117-42.82 20.814-74.396 20.814-18.9 0-32.297-1.197-41.401-2.389V234.365c13.399-2.149 30.878-3.346 49.304-3.346 30.612 0 50.478 5.508 66.039 17.226 16.743 12.445 27.274 32.302 27.274 60.778zM80.7 393.499V234.365c11.241-1.904 27.042-3.346 49.296-3.346 22.491 0 38.527 4.308 49.291 12.928 10.292 8.131 17.215 21.534 17.215 37.328 0 15.799-5.25 29.198-14.829 38.285-12.442 11.728-30.865 16.996-52.407 16.996-4.778 0-9.1-.243-12.435-.723v57.67H80.7v-.004zm372.901 129.854H97.2V419.302h356.4v104.051zm31.297-261.226h-61.989v36.851h57.913v29.674h-57.913V393.5h-36.593V232.216h98.582v29.911z"/></svg>

Before

Width:  |  Height:  |  Size: 1.8 KiB

View file

@ -21,9 +21,7 @@
// = require carte
// = require custom_mails
// = require default_data_block
// = require description
// = require direct_uploads
// = require dossier_show
// = require dossiers
// = require etapes
// = require france_connect_particulier
@ -35,7 +33,6 @@
// = require pj_modal
// = require print
// = require procedure
// = require recapitulatif
// = require search
// = require siret
// = require outdated_browser_banner
@ -43,7 +40,6 @@
// = require autocomplete
// = require users
// = require attestation_template_edit
// = require attestation_recapitulatif
// = require_self
// = require leaflet

View file

@ -1,31 +0,0 @@
#attestation-recapitulatif {
margin-top: 40px;
.details {
padding: 15px;
display: flex;
align-items: center;
justify-content: space-between;
background-color: #FFFFFF;
.left {
position: relative;
padding-left: 30px;
img {
position: absolute;
left: 0px;
top: 15px;
}
.title {
font-weight: bold;
margin: 0;
}
.delivery {
color: #999999;
}
}
}
}

View file

@ -1,147 +0,0 @@
@import "bootstrap";
#description-page #liste-champs {
.default-data-block {
.show-block {
width: 90%;
.body {
padding: 15px;
}
}
}
h4 {
padding-top: 35px;
margin: 0;
}
}
.page-header {
border-bottom: 1px solid #CCCCCC !important;
}
.input-error {
color: #8B0000 !important;
border-color: #8B0000 !important;
}
.type-champ-text {
@extend .col-md-6;
@extend .col-lg-6;
input[type='text'] {
width: 100%;
}
}
.type-champ-header-section {
@extend .col-md-12;
@extend .col-lg-12;
}
.type-champ-address {
@extend .col-md-6;
@extend .col-lg-6;
.algolia-autocomplete {
width: 100%;
input {
width: 100%;
display: block !important;
}
}
.aa-dropdown-menu {
width: 100%;
}
}
.type-champ-email {
@extend .col-md-4;
@extend .col-lg-4;
input[type='email'] {
width: 100%;
}
}
.type-champ-drop-down-list,
.type-champ-regions,
.type-champ-departements,
.type-champ-pays {
@extend .col-md-4;
@extend .col-lg-4;
}
.type-champ-civilite {
@extend .col-md-3;
@extend .col-lg-3;
}
.type-champ-yes-no {
@extend .col-md-3;
@extend .col-lg-3;
}
.type-champ-phone {
@extend .col-md-2;
@extend .col-lg-2;
input[type='phone'] {
width: 100%;
}
}
.datepicker-switch {
color: #0086B3;
text-decoration: underline;
}
.type-champ-textarea {
@extend .col-md-8;
@extend .col-lg-8;
textarea.form-control {
width: 100%;
height: 133px;
}
}
.type-champ-number {
@extend .col-md-3;
@extend .col-lg-3;
input[type='number'] {
width: 100%;
}
}
.type-champ-date {
@extend .col-md-2;
@extend .col-lg-2;
input[type='date'] {
width: 160px;
}
}
.type-champ-datetime {
@extend .col-md-5;
@extend .col-lg-5;
input[type='datetime'] {
width: 160px;
}
}
.piece-description {
display: block;
margin-top: 5px;
margin-bottom: 10px;
color: #737373;
font-weight: normal;
}

View file

@ -1,207 +0,0 @@
#users-recapitulatif-dossier-show {
#messages {
.last-commentaire {
display: block;
background-color: #FFFFFF;
.content,
.new-action {
margin-bottom: 20px;
}
}
.body {
.commentaires {
max-height: 350px;
overflow-y: scroll;
background: linear-gradient(to bottom, rgba(0, 0, 0, 0.075) 0%, rgba(219, 219, 219, 0) 50%, rgba(250, 251, 253, 0.18) 51%, #FFFFFF 100%);
}
.no-commentaires {
text-align: center;
font-size: 18px;
padding-top: 20px;
}
}
.last-commentaire,
.commentaire {
padding: 20px 0 0 20px;
.comment-header {
font-family: Arial;
font-size: 14px;
font-weight: bold;
line-height: 16px;
color: #000000;
margin-bottom: 10px;
}
.file {
padding-right: 70px;
text-align: center;
margin-bottom: 20px;
.link {
span {
width: 100%;
font-size: 40px;
}
}
}
}
.split-hr {
margin: 20px 20px 0 20px;
border-bottom: 1px solid #979797;
}
#new-commentaire {
padding: 15px;
}
}
.infos {
.split-row {
margin: 0 0 20px 0;
}
.entreprise-info {
font-size: 14px;
}
.entreprise-label {
font-weight: bold;
text-align: end;
}
}
#private-fields {
.text-primary {
color: #337AB7;
}
}
#pieces-jointes {
.piece-row {
margin: 20px;
.piece-label {
text-align: right;
font-weight: bold;
}
}
.modal-title {
color: #000000;
}
}
#carto {
#map {
margin-bottom: 20px;
height: 350px;
}
}
#dossier,
#pieces-jointes,
.infos,
#carto,
#private-fields {
.body {
padding: 20px 20px 0 20px;
color: #000000;
.libelle-procedure {
font-style: italic;
padding: 10px;
}
.depositaire-label {
font-weight: bold;
text-align: end;
}
.btn-action {
border: none;
margin: 20px 0 40px 0;
}
.btn-action:hover {
color: #EEEEEE;
}
.action {
margin: 50px 0 0 15px;
}
.action,
.btn-action {
background-color: #E45B51;
text-align: center;
cursor: pointer;
color: #FFFFFF;
width: 253px;
height: 40px;
line-height: 40px;
font-family: Arial;
font-size: 16px;
font-weight: bold;
text-decoration: none;
a:hover {
color: #EEEEEE;
}
}
.historique {
color: #000000;
margin-left: 20px;
}
.comments {
margin-right: -10px;
}
.comments-off {
margin-right: -35px;
}
.dossier-title {
font-size: 16px;
min-height: 40px;
text-align: center;
}
.split-hr {
border-bottom: 1px solid #979797;
height: 12px;
min-height: 10px;
}
.title-row {
margin: 20px 10px 10px 10px;
}
.margin-top-40 {
margin-top: 40px;
}
.margin-top-20 {
margin-top: 20px;
}
.margin-bot-40 {
margin-bottom: 40px;
}
}
#pieces-justificatives {
.piece-row {
margin: 0 0 0 0;
}
}
}
}

View file

@ -1,9 +0,0 @@
#upload-pj-modal {
text-align: left;
table {
width: 100% !important;
margin-left: 0 !important;
margin-bottom: 0;
}
}

View file

@ -32,7 +32,6 @@
.white-back,
#users-siret-index,
#description-page,
#carto-page {
background-color: #FFFFFF;
box-shadow: 0 0 1px 0 rgba(0, 0, 0, 0.5);

View file

@ -1,29 +0,0 @@
class CommentairesController < ApplicationController
def create
@commentaire = Commentaire.new
if params[:champ_id]
@commentaire.champ = @commentaire.dossier.champs.find(params[:champ_id])
end
dossier_id = params['dossier_id']
@commentaire.email = current_user.email
@commentaire.dossier = current_user.dossiers.find_by(id: dossier_id) || current_user.invites.find_by!(dossier_id: dossier_id).dossier
@commentaire.file = params["file"]
@commentaire.body = params['texte_commentaire']
if @commentaire.save
flash.notice = "Votre message a été envoyé"
else
flash.alert = "Veuillez rédiger un message ou ajouter une pièce jointe (maximum 20 Mo)"
end
if current_user.email != @commentaire.dossier.user.email
invite = Invite.where(dossier: @commentaire.dossier, email: current_user.email).first
redirect_to url_for(controller: 'users/dossiers/invites', action: :show, id: invite.id)
else
redirect_to users_dossier_recapitulatif_path(params['dossier_id'])
end
end
end

View file

@ -1,3 +0,0 @@
class Users::CommentairesController < CommentairesController
before_action :authenticate_user!
end

View file

@ -1,30 +0,0 @@
class Users::DescriptionController < UsersController
def pieces_justificatives
invite = current_user.invite? params[:dossier_id]
if invite
@dossier ||= Dossier.find(params[:dossier_id])
end
@dossier ||= current_user_dossier
if (errors_upload = PiecesJustificativesService.upload!(@dossier, current_user, params)).present?
if flash.alert.nil?
flash.alert = errors_upload
else
flash.alert = [flash.alert] + errors_upload
end
else
if flash.alert.nil?
flash.notice = 'Nouveaux fichiers envoyés'
end
end
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
end

View file

@ -1,3 +0,0 @@
class Users::Dossiers::CommentairesController < CommentairesController
before_action :authenticate_user!
end

View file

@ -1,40 +0,0 @@
class Users::RecapitulatifController < UsersController
before_action only: [:show] do
authorized_routes? self.class
end
def show
redirect_to dossier_url(current_user_dossier)
end
def initiate
create_dossier_facade
@facade.dossier.en_construction!
flash.notice = 'Dossier soumis avec succès.'
redirect_to users_dossier_recapitulatif_path
end
def self.route_authorization
{
states: [
Dossier.states.fetch(:en_construction),
Dossier.states.fetch(:en_instruction),
Dossier.states.fetch(:sans_suite),
Dossier.states.fetch(:accepte),
Dossier.states.fetch(:refuse)
]
}
end
private
def create_dossier_facade
@facade = DossierFacades.new current_user_dossier.id, current_user.email
rescue ActiveRecord::RecordNotFound
flash.alert = t('errors.messages.dossier_not_found')
redirect_to url_for(root_path)
end
end

View file

@ -1,7 +0,0 @@
class CommentaireDecorator < Draper::Decorator
delegate_all
def created_at_fr
created_at.localtime.strftime('%d/%m/%Y - %H:%M')
end
end

View file

@ -1,17 +0,0 @@
- if dossier.attestation.present?
#attestation-recapitulatif.default-data-block
.row.show-block.clearfix
.header
.title
.carret-right
.carret-down
ATTESTATION
.details
.left
= image_tag('pdf.svg', width: '20px')
%p.title= dossier.attestation.title
%p.delivery Délivrée le #{l(dossier.attestation.created_at, format: '%d %B %Y')}
- if user_signed_in? && current_user == dossier.user
= link_to 'Télécharger', attestation_dossier_path(dossier), target: '_blank', class: 'btn btn-primary'
- else
= link_to 'Télécharger', attestation_gestionnaire_dossier_path(dossier.procedure, dossier), target: '_blank', class: 'btn btn-primary'

View file

@ -1,56 +0,0 @@
= render partial: 'dossiers/attestation', locals: { dossier: @facade.dossier }
= render partial: 'dossiers/messagerie', locals: { dossier_facade: @facade }
= render partial: 'dossiers/motivation', locals: { dossier_facade: @facade }
- if @facade.procedure.individual_with_siret
.default-data-block
.row.show-block.infos
.header
.col-xs-8.title-no-expanse
.carret-right
INFORMATIONS DU DEMANDEUR
- if [Dossier.states.fetch(:brouillon), Dossier.states.fetch(:en_construction)].include?(@facade.dossier.state)
%a#add_siret.action{ href: users_dossier_add_siret_path(dossier_id: @facade.dossier.id) }
.col-lg-4.col-md-4.col-sm-4.col-xs-4.action
Renseigner un SIRET
- if @facade.etablissement.present?
.default-data-block
.row.show-block.infos#infos_entreprise
.header
.col-xs-12.title
.carret-right
.carret-down
INFORMATIONS DU DEMANDEUR
.body.display-block-on-print
= render partial: '/dossiers/infos_entreprise'
.default-data-block.default_visible
.row.show-block.infos#infos-dossiers
.header
.col-xs-10.title
.carret-right
.carret-down
CONSTRUCTION DU DOSSIER
= render partial: '/dossiers/edit_dossier'
.body.display-block-on-print
= render partial: '/dossiers/infos_dossier'
- if @facade.dossier.procedure.module_api_carto.use_api_carto
.default-data-block.default_visible.no-page-break-inside
.row.show-block#carto
.header
.col-xs-10.title
.carret-right
.carret-down
CARTOGRAPHIE
= render partial: '/dossiers/edit_carto'
.body.display-block-on-print
%input#json_latlngs{ type: 'hidden', value: "#{@facade.dossier.json_latlngs}", name: 'json_latlngs' }
%input#quartier_prioritaires{ type: 'hidden', value: "#{@facade.dossier.quartier_prioritaires.to_json}" }
%input#cadastres{ type: 'hidden', value: "#{@facade.dossier.cadastres.to_json}" }
= render partial: '/users/carte/map', locals: { dossier: @facade.dossier }
= render partial: 'users/carte/init_carto', locals: { dossier: @facade.dossier }

View file

@ -1,5 +0,0 @@
- if !@facade.dossier.read_only?
- if user_signed_in? && (current_user.owns_or_invite?(@facade.dossier))
%a#maj_carte.action{ href: "/users/dossiers/#{@facade.dossier.id}/carte" }
.col-lg-2.col-md-2.col-sm-2.col-xs-2.action
= 'MODIFIER'

View file

@ -1,5 +0,0 @@
- if !@facade.dossier.read_only?
- if user_signed_in? && (current_user.owns_or_invite?(@facade.dossier))
= link_to brouillon_dossier_path(@facade.dossier), class: 'action', id: 'maj_infos' do
#edit-dossier.col-lg-2.col-md-2.col-sm-2.col-xs-2.action
= "MODIFIER"

View file

@ -1,11 +0,0 @@
- if !@facade.dossier.read_only?
- if user_signed_in? && (current_user.owns_or_invite?(@facade.dossier))
- if @facade.dossier.types_de_piece_justificative.size > 0
.col-lg-4.col-md-4.col-sm-4.col-xs-4.action
%a#maj_pj.action{ "data-target" => "#upload-pj-modal",
"data-toggle" => "modal",
:type => "button",
style: 'margin-bottom: 15px; margin-top: -30px;' }
Modifier les documents
%br
= render partial: 'users/recapitulatif/modal_upload_pj'

View file

@ -1,146 +0,0 @@
.row
.col-xs-12
- if @facade.procedure.for_individual?
.row.title-row
.col-xs-4.split-hr
.col-xs-4.dossier-title= t('utils.depositaire')
.col-xs-4.split-hr
.row
.col-xs-6.depositaire-label Civilité
.col-xs-1.comments-off= "-"
.col-xs-5.depositaire-info= @facade.individual.gender
.row
.col-xs-6.depositaire-label Nom
.col-xs-1.comments-off= "-"
.col-xs-5.depositaire-info= @facade.individual.nom
.row
.col-xs-6.depositaire-label Prénom
.col-xs-1.comments-off= "-"
.col-xs-5.despositaire-info= @facade.individual.prenom
.row
.col-xs-6.depositaire-label Date de naissance
.col-xs-1.comments-off= "-"
.col-xs-4.depositaire-info= @facade.individual.birthdate&.strftime("%d/%m/%Y")
.row.margin-top-20
- if @facade.champs.present?
- @facade.champs.each do |champ|
- next if champ.type_champ == TypeDeChamp.type_champs.fetch(:explication)
- if champ.type_champ == TypeDeChamp.type_champs.fetch(:header_section)
.row.title-row.margin-top-40
.col-xs-3.split-hr
.col-xs-6.dossier-title= champ.libelle
.col-xs-3.split-hr
- else
.row
.col-xs-6.depositaire-label= champ.libelle
.col-xs-1.comments-off
= "-"
.col-xs-5.depositaire-info{ id: "champ-#{champ.id}-value" }
- if champ.decorate.value.present? || champ.piece_justificative_file.attached?
- if champ.type_champ == TypeDeChamp.type_champs.fetch(:dossier_link)
- dossier = Dossier.includes(:procedure).find_by(id: champ.decorate.value)
- if dossier
= link_to("Dossier #{dossier.id}", brouillon_dossier_path(dossier), target: '_blank')
%br
= sanitize(dossier.text_summary)
- else
Pas de dossier associé
- elsif champ.type_champ == TypeDeChamp.type_champs.fetch(:piece_justificative)
= render partial: "shared/champs/piece_justificative/pj_link", locals: { champ: champ, user_can_upload: true }
- elsif champ.type_champ == TypeDeChamp.type_champs.fetch(:textarea)
= simple_format(champ.decorate.value)
- elsif champ.type_champ == TypeDeChamp.type_champs.fetch(:linked_drop_down_list)
= champ.for_display
- else
= sanitize(champ.decorate.value)
.row
- if @facade.dossier.types_de_piece_justificative.count > 0
.col-xs-12
.row.title-row
.col-xs-4.split-hr
.col-xs-4.dossier-title= t('utils.pieces')
.col-xs-4.split-hr
.col-xs-12#pieces-justificatives.margin-bot-40
.row
.col-xs-12
- @facade.types_de_pieces_justificatives.each do |type_de_piece_justificative|
.row.piece-row
.col-xs-12{ id: "piece_justificative_#{type_de_piece_justificative.id}" }
.row
.col-xs-6.depositaire-label= type_de_piece_justificative.libelle
.col-xs-1.comments-off= "-"
.col-xs-5.despositaire-info
- if type_de_piece_justificative.api_entreprise
%span.text-success Nous l'avons récupéré pour vous.
- elsif (@pj = @facade.dossier.retrieve_last_piece_justificative_by_type(type_de_piece_justificative.id)).present?
%a{ href: "#{@pj.content_url}", target: '_blank' } Consulter
%span{ style: 'margin-left: 12px;' }
\-
- if @facade.dossier.pieces_justificatives.where(type_de_piece_justificative_id: type_de_piece_justificative.id).count > 1
= link_to "", class: "historique", "data-toggle" => "modal", "data-target" => "#pj-modal", :type => "button", "data-modal_title" => 'formulaires', "data-modal_index" => "type_de_pj_#{type_de_piece_justificative.id}" do
%span.fa.fa-clock-o
- else
Pièce non fournie
- if !@facade.dossier.read_only?
- if user_signed_in? && (current_user.owns_or_invite?(@facade.dossier))
- if @facade.dossier.types_de_piece_justificative.size > 0
.row
.col-xs-4
%a#maj_pj.action{ "data-target" => "#upload-pj-modal", "data-toggle" => "modal", :type => "button" }
.col-xs-4.action
Modifier les documents
%br
= render partial: 'users/recapitulatif/modal_upload_pj'
.col-xs-4
- if gestionnaire_signed_in?
#pj-modal.modal.fade{ "aria-labelledby" => "myModalLabel", :role => "dialog", :tabindex => "-1" }
.modal-dialog.modal-lg{ :role => "document" }
.modal-content
.modal-header
%button.close{ "aria-label" => "Close", "data-dismiss" => "modal", :type => "button" }
%span{ "aria-hidden" => "true" } ×
%h4#myModalLabel.modal-title
Historique des
%span#pj-modal-title
.modal-body
%table.table
%thead
%th
Usager
%th
Date d'envoi
%th
Lien
%thead.tr-content#cerfa
- @facade.dossier.types_de_piece_justificative.each do |type_de_piece_justificative|
%tbody.tr-content{ id: "type_de_pj_#{type_de_piece_justificative.id}" }
- @facade.dossier.retrieve_all_piece_justificative_by_type(type_de_piece_justificative.id).each do |piece_justificative|
%tr
%td.col-md-6.col-sm-6.col-xs-6.col-lg-4
= piece_justificative.user.email
%td.col-md-6.col-sm-6.col-xs-6.col-lg-4
= piece_justificative.created_at
%td.col-md-6.col-sm-6.col-xs-6.col-lg-4
= link_to 'Récupérer', piece_justificative.content_url, { target: :blank }
.modal-footer
#modalCommentairesDossierParChamp.modal.fade{ "tabindex" => -1, "role" => "dialog" }
.modal-dialog{ "role" => "document" }
.modal-content
.modal-header
%button.close{ "data-dismiss" => "modal", "aria-label" => "Fermer" }
%span{ "aria-hidden" => true }
&times;
.modal-title
Messages
.modal-body
%p
Chargement des messages en cours...
.modal-footer
%button.btn.btn-primary{ "data-dismiss" => "modal" }
Fermer

View file

@ -1,29 +0,0 @@
#pieces-justificatives
.row
.col-xs-12
- @facade.dossier.types_de_piece_justificative.order('order_place ASC').each do |type_de_piece_justificative|
.row.piece-row
.col-xs-12{ id: "piece_justificative_#{type_de_piece_justificative.id}" }
.row
.col-xs-6= type_de_piece_justificative.libelle
.col-xs-6
- if type_de_piece_justificative.api_entreprise
%span.text-success Nous l'avons récupéré pour vous.
- elsif (@pj = @facade.dossier.retrieve_last_piece_justificative_by_type(type_de_piece_justificative.id)).present?
-# - if user_signed_in?
-# = 'Pièce fournie'
-# - elsif gestionnaire_signed_in?
%a{ href: "#{@pj.content_url}", target: '_blank' } Consulter
%span{ style: 'margin-left: 12px;' }
\-
%a.btn.fa.fa-timer{ style: 'color: black; padding-top: 0;',
"data-target" => "#pj-modal",
"data-toggle" => "modal",
:type => "button",
"data-modal_title" => type_de_piece_justificative.libelle,
"data-modal_index" => "type_de_pj_#{type_de_piece_justificative.id}" }
- else
= 'Pièce non fournie'
-# - if gestionnaire_signed_in?
= render partial: '/dossiers/modal_historique'

View file

@ -1,17 +0,0 @@
%h3 Personnes invitées à voir ce dossier
%br
.row
.col-xs-4
- if @facade.invites.size > 0
%ul
- @facade.invites.each do |invite|
%li
= invite.email
- else
Aucune personne invitée
.col-xs-3
= form_tag invites_dossier_path(dossier_id: @facade.dossier.id), method: :post, class: 'form-inline' do
= text_field_tag :email, '', class: 'form-control', placeholder: 'Envoyer une invitation'
= submit_tag 'Ajouter', class: 'btn btn-success', id: 'send-invitation', data: { confirm: "Envoyer l'invitation ?" }

View file

@ -1,29 +0,0 @@
.default-data-block{ style: 'margin-top: 40px;' }
.row.show-block.clearfix#messages
.header
.col-xs-10.title
.carret-right
.carret-down
MESSAGERIE
.col-xs-2.count
= pluralize(@facade.commentaires.count, "message")
.alert.alert-info
Cette messagerie permet d'échanger entre le demandeur et le service instructeur.
.body.display-block-on-print
- if dossier_facade.commentaires.any?
.commentaires
= render partial: 'dossiers/commentaires/commentaire', collection: dossier_facade.commentaires.object.sort
.split-hr
#new-commentaire.hidden-print
= render partial: 'dossiers/commentaires/form', locals: { dossier_facade: @facade }
.last-commentaire.clearfix.hidden-print
- if last_comment = dossier_facade.commentaires.last
%div
DERNIER MESSAGE
= render partial: 'dossiers/commentaires/commentaire', object: last_comment
%button#open-message.new-action.btn.btn-danger
ENVOYER UN MESSAGE

View file

@ -1,11 +0,0 @@
- if Dossier::TERMINE.include?(@facade.dossier.state) && @facade.dossier.motivation.present?
.default-data-block.default_visible
.row.show-block.infos
.header
.col-xs-12.title
.carret-right
.carret-down
MOTIVATION
.body
.display-block-on-print
= @facade.dossier.motivation

View file

@ -1,18 +0,0 @@
.commentaire
.comment-header
= commentaire.header
.content
= sanitize(commentaire.body)
- if file = commentaire.piece_justificative
.file
= link_to file.content_url, class: 'link', target: '_blank' do
%span.fa.fa-file
%div
= file.original_filename
- elsif commentaire.file.present?
.file
= link_to commentaire.file_url, class: 'link', target: '_blank' do
%span.fa.fa-file
%div
= commentaire.file_identifier

View file

@ -1,10 +0,0 @@
= form_tag(url_for({ controller: 'commentaires', action: :create, dossier_id: dossier_facade.dossier.id, champ_id: dossier_facade.champ_id }), class: 'form-inline', method: 'POST', multipart: true) do
%textarea.form-control.wysihtml5#texte_commentaire{ name: 'texte_commentaire', style: 'width: 100%; margin-bottom: 2%;', rows: '5', placeholder: "Commentaire" }
.row
.col-md-6
%h4.text-primary{ style: 'margin-top: 0px;' } Ajouter un fichier
= file_field_tag "file", accept: Commentaire.new.file.accept_extension_list, style: 'float: left; margin-left: 20px;'
.col-md-6.text-right
= submit_tag 'Envoyer', id: 'save-message', class: 'form-control btn btn-danger', data: { disable: true }

View file

@ -1 +0,0 @@
= render partial: 'layouts/left_panels/left_panel_users_recapitulatifcontroller_show'

View file

@ -1,22 +0,0 @@
.link-to-dossiers
= link_to 'retour aux dossiers', dossiers_path
#first-block
.en-cours
%h2 Récapitulatif
.infos
%div= t('dynamics.dossiers.numéro') + @facade.dossier.id.to_s
#menu-block
#infos-block
.split-hr-left
.dossier-state= @facade.dossier.display_state
.split-hr-left
- if current_user.owns?(@facade.dossier) && !@facade.dossier.instruction_commencee?
.text-center.mt-1
= link_to ask_deletion_dossier_path(@facade.dossier), method: :post, class: "btn btn-danger", data: { confirm: "Vous vous apprêtez à supprimer votre dossier ainsi que les informations quil contient. Nous vous rappelons que toute suppression entraine lannulation de la démarche en cours.\n\n Confirmer la suppression ?" } do
Supprimer définitivement
%br
ce dossier

View file

@ -1,24 +0,0 @@
.col-xs-7.main-info
%span{ 'data-toggle' => :tooltip, "data-placement" => :bottom, title: @facade.dossier.procedure.libelle }
= @facade.dossier.procedure.libelle.truncate(60)
.col-lg-3.col-md-3.col-sm-3.col-xs-3.options
.row.centered-option
.col-lg-12.col-md-12.col-sm-12.col-xs-12
#invitations.dropdown-toggle{ 'data-toggle' => 'dropdown', 'aria-haspopup' => true, 'aria-expanded' => false }
%i.fa.fa-user
= t('utils.involved')
.badge.progress-bar-info
= @facade.dossier.invites.count
.dropdown-menu.dropdown-menu-right.dropdown-pannel
%h4= t('dynamics.dossiers.invites.title')
%ul
- if @facade.invites.present?
- @facade.invites.each do |invite|
%li= invite.email
- else
= t('dynamics.dossiers.invites.empty')
%li
= form_tag invites_dossier_path(dossier_id: @facade.dossier.id), method: :post, class: 'form-inline', id: 'send-invitation' do
= text_field_tag :invite_email, '', class: 'form-control', placeholder: 'Envoyer une invitation', id: 'invite_email'
= submit_tag 'Ajouter', class: 'btn btn-success', data: { confirm: "Envoyer l'invitation ?" }

View file

@ -1,27 +0,0 @@
%table.table
- dossier.types_de_piece_justificative.order('order_place ASC').each do |tpj|
%tr
%th.piece-libelle
= tpj.mandatory ? tpj.libelle + ' *' : tpj.libelle
%br
.piece-description= tpj.description
%td
- if tpj.lien_demarche.present?
%em
Récupérer le formulaire vierge pour mon dossier :
= link_to "Télécharger", tpj.lien_demarche, target: :blank
%td
- if tpj.api_entreprise
%span.text-success{ id: "piece_justificative_#{tpj.id}" } Nous l'avons récupéré pour vous.
- else
- if !dossier.was_piece_justificative_uploaded_for_type_id?(tpj.id)
= file_field_tag "piece_justificative_#{tpj.id}", accept: PieceJustificative.accept_format, :max_file_size => 6.megabytes
- else
- pj = dossier.retrieve_last_piece_justificative_by_type(tpj.id)
%a{ href: pj.content_url, target: '_blank' }
= pj.original_filename
%span.btn.btn-sm.btn-file.btn-success
Modifier
= file_field_tag "piece_justificative_#{tpj.id}", accept: PieceJustificative.accept_format, :max_file_size => 6.megabytes

View file

@ -1,17 +0,0 @@
#upload-pj-modal.modal.fade{ "aria-labelledby" => "myModalLabel", :role => "dialog", :tabindex => "-1" }
.modal-dialog{ :role => "document" }
.modal-content
- @dossier = @facade.dossier
= form_tag(url_for({ controller: '/users/description', action: :pieces_justificatives, dossier_id: @dossier.id }), class: 'form-inline', method: 'PATCH', multipart: true) do
.modal-header
%button.close{ "aria-label" => "Close", "data-dismiss" => "modal", :type => "button" }
%span{ "aria-hidden" => "true" } ×
%h4.modal-title
Modification des documents
.modal-body
= render partial: 'users/description/pieces_justificatives', locals: { dossier: @dossier }
.modal-footer
= submit_tag 'Modification terminée', class: %w(btn btn btn-info), id: 'modification_terminee', data: { disable: true, submit: true }

View file

@ -1,2 +0,0 @@
.col-lg-12.col-md-12.col-sm-12.col-xs-12#users-recapitulatif-dossier-show
= render partial: "dossiers/dossier_show"

View file

@ -134,20 +134,11 @@ Rails.application.routes.draw do
namespace :users do
namespace :dossiers do
resources :invites, only: [:index, :show]
post '/commentaire' => 'commentaires#create'
end
resources :dossiers do
get '/add_siret' => 'dossiers/add_siret#show'
patch 'pieces_justificatives' => 'description#pieces_justificatives'
# TODO: once these pages will be migrated to the new user design, replace these routes by a redirection
get '/recapitulatif' => 'recapitulatif#show'
post '/recapitulatif/initiate' => 'recapitulatif#initiate'
post '/commentaire' => 'commentaires#create'
get '/carte/position' => 'carte#get_position'
post '/carte/qp' => 'carte#get_qp'
post '/carte/cadastre' => 'carte#get_cadastre'
@ -165,6 +156,7 @@ Rails.application.routes.draw do
# Redirection of legacy "/users/dossiers" route to "/dossiers"
get 'dossiers', to: redirect('/dossiers')
get 'dossiers/:id/recapitulatif', to: redirect('/dossiers/%{id}')
end
namespace :gestionnaire do

View file

@ -1,81 +0,0 @@
require 'spec_helper'
describe Users::CommentairesController, type: :controller do
let(:dossier) { create(:dossier) }
let(:dossier_id) { dossier.id }
let(:email_commentaire) { 'test@test.com' }
let(:texte_commentaire) { 'Commentaire de test' }
before do
allow(ClamavService).to receive(:safe_file?).and_return(true)
end
describe '#POST create' do
context "when user has no access to dossier" do
before do
sign_in create(:user)
end
subject { post :create, params: { dossier_id: dossier_id, texte_commentaire: texte_commentaire } }
it { expect { subject }.to raise_error(ActiveRecord::RecordNotFound) }
it { expect { subject rescue nil }.to change(Commentaire, :count).by(0) }
end
context "when user is invited on dossier" do
let(:user) { create(:user) }
subject { post :create, params: { dossier_id: dossier_id, texte_commentaire: texte_commentaire } }
before do
sign_in user
InviteUser.create(dossier: dossier, user: user, email: user.email, email_sender: "test@test.com")
end
it { expect{ subject }.to change(Commentaire, :count).by(1) }
end
context 'création correct d\'un commentaire' do
subject do
sign_in dossier.user
post :create, params: { dossier_id: dossier_id, texte_commentaire: texte_commentaire }
end
it 'depuis la page récapitulatif' do
subject
expect(response).to redirect_to("/users/dossiers/#{dossier_id}/recapitulatif")
end
it 'Notification email is not send' do
expect(NotificationMailer).not_to receive(:new_answer)
subject
end
end
context 'when document is upload whith a commentaire', vcr: { cassette_name: 'controllers_sers_commentaires_controller_upload_doc' } do
let(:document_upload) { Rack::Test::UploadedFile.new("./spec/support/files/piece_justificative_0.pdf", 'application/pdf') }
subject do
sign_in dossier.user
post :create, params: { dossier_id: dossier_id, texte_commentaire: texte_commentaire, file: document_upload }
end
it 'clamav check the pj' do
expect(ClamavService).to receive(:safe_file?)
subject
end
describe 'commentaire created' do
let(:commentaire) { Commentaire.last }
before do
subject
end
it 'have a piece justificative reference' do
expect(commentaire.file.present?).to be true
expect(commentaire.file.class).to eq CommentaireFileUploader
end
end
end
end
end

View file

@ -1,44 +0,0 @@
require 'spec_helper'
describe Users::Dossiers::CommentairesController, type: :controller do
let(:dossier) { create(:dossier) }
let(:texte_commentaire) { 'Commentaire de test' }
describe '#POST create' do
subject {
post :create, params: { dossier_id: dossier.id, texte_commentaire: texte_commentaire }
dossier.reload
}
context 'when invite is connected' do
let!(:invite) { create(:invite, :with_user, dossier: dossier) }
before do
sign_in invite.user
end
it do
subject
is_expected.to redirect_to users_dossiers_invite_path(invite.id)
end
it 'should notify user' do
expect(NotificationMailer).to receive(:new_answer).and_return(NotificationMailer)
expect(NotificationMailer).to receive(:deliver_later)
subject
end
end
context 'when user is connected' do
before do
sign_in dossier.user
end
it 'do not send a mail to notify user' do
expect(NotificationMailer).to_not receive(:new_answer)
subject
end
end
end
end

View file

@ -1,54 +0,0 @@
require 'spec_helper'
describe Users::RecapitulatifController, type: :controller do
let(:dossier) { create(:dossier, state: Dossier.states.fetch(:en_construction)) }
let(:bad_dossier_id) { Dossier.count + 100000 }
before do
sign_in dossier.user
end
describe 'GET #show' do
it 'returns http success' do
get :show, params: { dossier_id: dossier.id }
expect(response).to redirect_to(dossier_path(dossier))
end
it 'redirection vers siret si mauvais dossier ID' do
get :show, params: { dossier_id: bad_dossier_id }
expect(response).to redirect_to('/')
end
it_behaves_like "not owner of dossier", :show
describe 'before_action authorized_routes?' do
context 'when dossier have brouillon state' do
before do
dossier.state = Dossier.states.fetch(:brouillon)
dossier.save
get :show, params: { dossier_id: dossier.id }
end
it { is_expected.to redirect_to root_path }
end
end
end
describe 'POST #initiate' do
context 'when an user initiate his dossier' do
before do
post :initiate, params: { dossier_id: dossier.id }
end
it 'dossier change his state for accepte' do
dossier.reload
expect(dossier.state).to eq(Dossier.states.fetch(:en_construction))
end
it 'a message informe user what his dossier is en_construction' do
expect(flash[:notice]).to include('Dossier soumis avec succès.')
end
end
end
end

View file

@ -1,15 +0,0 @@
require 'spec_helper'
describe CommentaireDecorator do
let(:time) { Time.utc(2008, 9, 1, 10, 5, 0) }
let(:commentaire) { Timecop.freeze(time) { create :commentaire } }
let(:decorator) { commentaire.decorate }
describe 'created_at_fr' do
subject { decorator.created_at_fr }
context 'when created_at have a value' do
it { is_expected.to eq time.localtime.strftime('%d/%m/%Y - %H:%M') }
end
end
end

View file

@ -38,6 +38,11 @@ describe 'Dossier details:' do
end
end
scenario 'the user is redirected from old URLs' do
visit "/users/dossiers/#{dossier.id}/recapitulatif"
expect(page).to have_current_path(dossier_path(dossier))
end
it_behaves_like 'the user can edit the submitted demande'
it_behaves_like 'the user can send messages to the instructeur'

File diff suppressed because it is too large Load diff

View file

@ -68,24 +68,5 @@ describe UserRoutesAuthorizationService do
end
end
end
describe 'recapitulatif' do
let(:controller) { Users::RecapitulatifController }
describe 'brouillon' do
let(:state) { Dossier.states.fetch(:brouillon) }
it { is_expected.to be_falsey }
end
describe 'en_construction' do
let(:state) { Dossier.states.fetch(:en_construction) }
it { is_expected.to be_truthy }
end
describe 'accepte' do
let(:state) { Dossier.states.fetch(:accepte) }
it { is_expected.to be_truthy }
end
end
end
end

View file

@ -1,71 +0,0 @@
require 'spec_helper'
describe 'dossiers/_infos_dossier.html.haml', type: :view do
describe "champs rendering" do
let(:dossier) { create(:dossier, :with_entreprise, procedure: create(:procedure, :with_api_carto, :with_type_de_champ)) }
before do
champs.each do |champ|
champ.value = ((0...8).map { (65 + rand(26)).chr }.join)
champ.save
end
assign(:facade, DossierFacades.new(dossier.id, dossier.user.email))
render
end
describe 'every champs are present on the page' do
let(:champs) { dossier.champs }
it { expect(rendered).to have_content(champs.first.libelle) }
it { expect(rendered).to have_content(champs.first.value) }
it { expect(rendered).to have_content(champs.last.libelle) }
it { expect(rendered).to have_content(champs.last.value) }
end
end
describe "oui_non champ rendering" do
let(:dossier_with_yes_no) { create(:dossier, procedure: create(:procedure, :with_yes_no)) }
context "with the true value" do
before do
oui_non_champ = dossier_with_yes_no.champs.first
oui_non_champ.value = 'true'
oui_non_champ.save
assign(:facade, DossierFacades.new(dossier_with_yes_no.id, dossier_with_yes_no.user.email))
render
end
it { expect(rendered).to have_content("Oui") }
end
context "with the false value" do
before do
oui_non_champ = dossier_with_yes_no.champs.first
oui_non_champ.value = 'false'
oui_non_champ.save
assign(:facade, DossierFacades.new(dossier_with_yes_no.id, dossier_with_yes_no.user.email))
render
end
it { expect(rendered).to have_content("Non") }
end
context "with no value" do
before do
oui_non_champ = dossier_with_yes_no.champs.first
oui_non_champ.value = nil
oui_non_champ.save
assign(:facade, DossierFacades.new(dossier_with_yes_no.id, dossier_with_yes_no.user.email))
render
end
it { expect(rendered).not_to have_content("Oui") }
it { expect(rendered).not_to have_content("Non") }
end
end
end

View file

@ -1,65 +0,0 @@
require 'spec_helper'
describe 'layouts/left_panels/_left_panel_users_recapitulatifcontroller_show.html.haml', type: :view do
let(:dossier) { create(:dossier, :with_entreprise, state: state, procedure: create(:procedure, :with_api_carto, :with_two_type_de_piece_justificative, for_individual: true, individual_with_siret: true)) }
let(:dossier_id) { dossier.id }
let(:state) { Dossier.states.fetch(:brouillon) }
before do
sign_in dossier.user
assign(:facade, DossierFacades.new(dossier.id, dossier.user.email))
end
context 'buttons to change dossier state' do
context 'when dossier state is en_construction' do
let(:state) { Dossier.states.fetch(:en_construction) }
before do
render
end
it { expect(rendered).to have_content('En construction') }
end
context 'when dossier state is accepte' do
let(:state) { Dossier.states.fetch(:accepte) }
before do
render
end
it { expect(rendered).to have_content('Accepté') }
it 'button Editer mon dossier n\'est plus present' do
expect(rendered).not_to have_css('#maj_infos')
expect(rendered).not_to have_content('Modifier mon dossier')
end
end
context 'when dossier state is refuse' do
let(:state) { Dossier.states.fetch(:refuse) }
before do
render
end
it { expect(rendered).to have_content('Refusé') }
it 'button Editer mon dossier n\'est plus present' do
expect(rendered).not_to have_css('#maj_infos')
expect(rendered).not_to have_content('Modifier mon dossier')
end
end
context 'when dossier state is sans_suite' do
let(:state) { Dossier.states.fetch(:sans_suite) }
before do
render
end
it { expect(rendered).to have_content('Sans suite') }
it 'button Editer mon dossier n\'est plus present' do
expect(rendered).not_to have_css('#maj_infos')
expect(rendered).not_to have_content('Modifier mon dossier')
end
end
end
end

View file

@ -1,103 +0,0 @@
require 'spec_helper'
describe 'users/recapitulatif/show.html.haml', type: :view do
let(:dossier) { create(:dossier, :with_entreprise, state: state, procedure: create(:procedure, :with_api_carto, :with_two_type_de_piece_justificative, for_individual: true, individual_with_siret: true)) }
let(:dossier_id) { dossier.id }
let(:state) { Dossier.states.fetch(:brouillon) }
before do
sign_in dossier.user
assign(:facade, DossierFacades.new(dossier.id, dossier.user.email))
end
context 'sur la rendered recapitulative' do
context 'test de composition de la page' do
before do
render
end
it 'la section infos dossier est présente' do
expect(rendered).to have_selector('#infos-dossiers')
end
it 'le flux de commentaire est présent' do
expect(rendered).to have_selector('#messages')
end
describe 'les liens de modifications' do
context 'lien description' do
it 'le lien vers description est présent' do
expect(rendered).to have_css('#maj_infos')
end
it 'le lien vers l édition est correct' do
expect(rendered).to have_selector("a[id=maj_infos][href='/dossiers/#{dossier_id}/brouillon']")
end
end
context 'lien carte' do
it 'le lien vers carte est présent' do
expect(rendered).to have_css('#maj_pj')
end
end
context 'lien carte' do
it 'le lien vers le renseignement un SIRET est présent' do
expect(rendered).to have_css('#add_siret')
end
end
context 'lien carte' do
it 'le lien vers carte est présent' do
expect(rendered).to have_css('#maj_carte')
end
it 'le lien vers description est correct' do
expect(rendered).to have_selector("a[id=maj_carte][href='/users/dossiers/#{dossier_id}/carte']")
end
end
end
end
context 'when dossier state is en_construction' do
let(:state) { Dossier.states.fetch(:en_construction) }
before do
render
end
it 'button Modifier les document est present' do
expect(rendered).to have_content('Modifier les documents')
expect(rendered).to have_css('#upload-pj-modal')
end
end
context 'when invite is logged' do
let!(:invite_user) { create(:user, email: 'invite@octo.com') }
before do
create(:invite) { create(:invite, email: invite_user.email, user: invite_user, dossier: dossier, type: 'InviteUser') }
sign_out dossier.user
sign_in invite_user
render
end
describe 'les liens de modifications' do
it 'describe link is not present' do
expect(rendered).to have_css('#maj_infos')
end
it 'map link is present' do
expect(rendered).to have_css('#maj_carte')
end
it 'PJ link is present' do
expect(rendered).to have_css('#maj_pj')
end
it 'archive link is present' do
expect(rendered).not_to have_content('Archiver')
end
end
end
end
end