create a new layout without procedure for login and use same layout full_screen without description for identite step
This commit is contained in:
parent
1c409f0145
commit
31969b290b
15 changed files with 49 additions and 71 deletions
|
@ -1,6 +1,6 @@
|
|||
module Users
|
||||
class CommencerController < ApplicationController
|
||||
layout 'procedure_context_full_screen'
|
||||
layout 'procedure_context'
|
||||
|
||||
def commencer
|
||||
@procedure = retrieve_procedure
|
||||
|
|
|
@ -92,10 +92,12 @@ module Users
|
|||
def identite
|
||||
@dossier = dossier
|
||||
@user = current_user
|
||||
@no_description = true
|
||||
end
|
||||
|
||||
def update_identite
|
||||
@dossier = dossier
|
||||
@no_description = true
|
||||
|
||||
if @dossier.individual.update(individual_params)
|
||||
@dossier.update!(autorisation_donnees: true, identity_updated_at: Time.zone.now)
|
||||
|
@ -110,10 +112,12 @@ module Users
|
|||
|
||||
def siret
|
||||
@dossier = dossier
|
||||
@no_description = true
|
||||
end
|
||||
|
||||
def update_siret
|
||||
@dossier = dossier
|
||||
@no_description = true
|
||||
|
||||
# We use the user as the holder model object for the siret value
|
||||
# (so that we can restore it on the form in case of error).
|
||||
|
|
|
@ -5,7 +5,7 @@ class Users::RegistrationsController < Devise::RegistrationsController
|
|||
# before_action :configure_account_update_params, only: [:update]
|
||||
before_action :restore_procedure_context, only: [:new, :create]
|
||||
|
||||
layout 'procedure_context', only: [:new, :create]
|
||||
layout 'login', only: [:new, :create]
|
||||
|
||||
# GET /resource/sign_up
|
||||
def new
|
||||
|
|
|
@ -3,7 +3,7 @@ class Users::SessionsController < Devise::SessionsController
|
|||
include TrustedDeviceConcern
|
||||
include ActionView::Helpers::DateHelper
|
||||
|
||||
layout 'procedure_context', only: [:new, :create]
|
||||
layout 'login', only: [:new, :create]
|
||||
|
||||
before_action :restore_procedure_context, only: [:new, :create]
|
||||
|
||||
|
|
|
@ -25,4 +25,4 @@
|
|||
.procedure-form__preview.sticky--top
|
||||
%h3.procedure-form__preview-title Aperçu
|
||||
.procedure-preview
|
||||
= render partial: 'shared/procedure_description', locals: { procedure: @procedure, full_screen_display: false }
|
||||
= render partial: 'shared/procedure_description', locals: { procedure: @procedure }
|
||||
|
|
|
@ -25,4 +25,4 @@
|
|||
.procedure-form__preview.sticky--top
|
||||
%h3.procedure-form__preview-title Aperçu
|
||||
.procedure-preview
|
||||
= render partial: 'shared/procedure_description', locals: { procedure: @procedure, full_screen_display: false }
|
||||
= render partial: 'shared/procedure_description', locals: { procedure: @procedure }
|
||||
|
|
17
app/views/layouts/login.html.haml
Normal file
17
app/views/layouts/login.html.haml
Normal file
|
@ -0,0 +1,17 @@
|
|||
- procedure = @procedure || @dossier&.procedure || nil
|
||||
|
||||
- content_for :content do
|
||||
.two-columns.procedure-context
|
||||
.columns-container
|
||||
.column.procedure-preview
|
||||
= yield
|
||||
.column.procedure-context-content
|
||||
= render partial: 'layouts/commencer/no_procedure'
|
||||
|
||||
- content_for :footer do
|
||||
- if procedure
|
||||
= render partial: 'users/procedure_footer', locals: { procedure: procedure, dossier: @dossier }
|
||||
- else
|
||||
= render partial: 'users/dossiers/index_footer'
|
||||
|
||||
= render template: 'layouts/application'
|
|
@ -1,17 +1,11 @@
|
|||
- procedure = @procedure || @dossier&.procedure || nil
|
||||
|
||||
- content_for :content do
|
||||
.two-columns.procedure-context
|
||||
.columns-container
|
||||
|
||||
.column.procedure-preview
|
||||
- if procedure
|
||||
= render partial: 'shared/procedure_description', locals: { procedure: procedure, full_screen_display: false }
|
||||
- else
|
||||
= render partial: 'layouts/commencer/no_procedure'
|
||||
|
||||
.column.procedure-context-content
|
||||
= yield
|
||||
.fr-container.fr-mt-5w
|
||||
.fr-grid-row
|
||||
.fr-col-12.fr-col-md-8.fr-col-offset-md-2
|
||||
.procedure-preview.fr-mb-5w
|
||||
= render partial: 'shared/procedure_description', locals: { procedure: procedure }
|
||||
|
||||
- content_for :footer do
|
||||
- if procedure
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
- procedure = @procedure || @dossier&.procedure || nil
|
||||
|
||||
- content_for :content do
|
||||
.fr-container.fr-mt-5w
|
||||
.fr-grid-row
|
||||
.fr-col-12.fr-col-md-8.fr-col-offset-md-2
|
||||
.procedure-preview.fr-mb-5w
|
||||
- if procedure
|
||||
= render partial: 'shared/procedure_description', locals: { procedure: procedure, full_screen_display: true }
|
||||
- else
|
||||
= render partial: 'layouts/commencer/no_procedure'
|
||||
= yield
|
||||
|
||||
- content_for :footer do
|
||||
- if procedure
|
||||
= render partial: 'users/procedure_footer', locals: { procedure: procedure, dossier: @dossier }
|
||||
- else
|
||||
= render partial: 'users/dossiers/index_footer'
|
||||
|
||||
= render template: 'layouts/application'
|
|
@ -7,7 +7,7 @@
|
|||
.two-columns.procedure-context
|
||||
.columns-container
|
||||
.column.procedure-preview
|
||||
= render partial: 'shared/procedure_description', locals: { procedure: @prefill_description, full_screen_display: false }
|
||||
= render partial: 'shared/procedure_description', locals: { procedure: @prefill_description }
|
||||
.column.procedure-context-content
|
||||
%p
|
||||
= t("views.prefill_descriptions.edit.intro_html", libelle: @prefill_description.libelle)
|
||||
|
|
|
@ -14,8 +14,8 @@
|
|||
%span.fr-icon-timer-line
|
||||
= t('shared.procedure_description.estimated_fill_duration', estimated_minutes: estimated_fill_duration_minutes(procedure))
|
||||
|
||||
- if full_screen_display
|
||||
= yield
|
||||
|
||||
= yield
|
||||
|
||||
- if procedure.auto_archive_on
|
||||
%details.procedure-configuration--auto-archive
|
||||
|
@ -25,8 +25,8 @@
|
|||
%span.procedure-auto-archive-title Date limite : #{procedure_auto_archive_date(procedure)}
|
||||
%p Vous pouvez déposer vos dossiers jusqu’au #{procedure_auto_archive_datetime(procedure)}.
|
||||
|
||||
|
||||
.fr-accordions-group
|
||||
- unless @no_description
|
||||
.fr-accordions-group
|
||||
%section.fr-accordion
|
||||
%h2.fr-accordion__title
|
||||
%button.fr-accordion__btn{ "aria-controls" => "accordion-114", "aria-expanded" => "true" } Quel est l’objet de cette démarche ?
|
||||
|
|
|
@ -35,7 +35,6 @@ describe 'Signin in:' do
|
|||
scenario 'an existing user can sign-in and fill the procedure' do
|
||||
click_on 'J’ai déjà un compte'
|
||||
expect(page).to have_current_path new_user_session_path
|
||||
expect(page).to have_procedure_description(procedure)
|
||||
|
||||
sign_in_with user.email, password
|
||||
|
||||
|
@ -43,7 +42,7 @@ describe 'Signin in:' do
|
|||
click_on 'Commencer la démarche'
|
||||
|
||||
expect(page).to have_current_path identite_dossier_path(user.reload.dossiers.last)
|
||||
expect(page).to have_procedure_description(procedure)
|
||||
expect(page).to have_content(procedure.libelle)
|
||||
expect(page).to have_content "Données d’identité"
|
||||
end
|
||||
end
|
||||
|
|
|
@ -70,7 +70,6 @@ describe 'Signing up:' do
|
|||
|
||||
click_on 'Créer un compte'
|
||||
expect(page).to have_current_path new_user_registration_path
|
||||
expect(page).to have_procedure_description(procedure)
|
||||
|
||||
sign_up_with user_email, user_password
|
||||
expect(page).to have_content "nous avons besoin de vérifier votre adresse #{user_email}"
|
||||
|
@ -84,7 +83,7 @@ describe 'Signing up:' do
|
|||
click_on 'Commencer la démarche'
|
||||
|
||||
expect(page).to have_current_path identite_dossier_path(procedure.reload.dossiers.last)
|
||||
expect(page).to have_procedure_description(procedure)
|
||||
expect(page).to have_content(procedure.libelle)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -141,7 +140,6 @@ describe 'Signing up:' do
|
|||
click_procedure_sign_in_link_for user_email
|
||||
|
||||
expect(page).to have_current_path new_user_session_path
|
||||
expect(page).to have_procedure_description(procedure)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -51,18 +51,4 @@ describe 'layouts/procedure_context', type: :view do
|
|||
expect(subject).to have_text(dossier.procedure.service.email)
|
||||
end
|
||||
end
|
||||
|
||||
context 'when neither procedure or dossier are assigned' do
|
||||
it 'renders a placeholder for the procedure' do
|
||||
expect(subject).to have_selector('.no-procedure')
|
||||
end
|
||||
|
||||
it 'renders the inner content' do
|
||||
expect(subject).to have_text('Column content')
|
||||
end
|
||||
|
||||
it 'renders a generic footer' do
|
||||
expect(subject).to have_text('Mentions légales')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -2,7 +2,7 @@ describe 'shared/_procedure_description', type: :view do
|
|||
let(:estimated_duration_visible) { true }
|
||||
let(:procedure) { create(:procedure, :published, :with_service, estimated_duration_visible:) }
|
||||
|
||||
subject { render partial: 'shared/procedure_description', locals: { procedure: procedure, full_screen_display: false } }
|
||||
subject { render partial: 'shared/procedure_description', locals: { procedure: procedure } }
|
||||
|
||||
it 'renders the view' do
|
||||
subject
|
||||
|
|
Loading…
Reference in a new issue