Merge pull request #3514 from betagouv/dev

2019-02-26-02
This commit is contained in:
Frederic Merizen 2019-02-26 18:17:06 +01:00 committed by GitHub
commit 0ab464b7cf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 31 additions and 28 deletions

View file

@ -1,16 +1,6 @@
#switch-menu {
position: fixed;
left: 10px;
bottom: 10px;
color: #FFFFFF;
list-style: none;
text-decoration: none;
padding-left: 20px;
}
#switch-menu a,
#switch-menu a:link,
#switch-menu a:visited,
#switch-menu a:hover {
text-decoration: none;
color: #FFFFFF;
z-index: 300;
}

View file

@ -67,7 +67,7 @@ class Admin::ProceduresController < AdminController
end
def create
@procedure = current_administrateur.admin_procedures.build(procedure_params)
@procedure = Procedure.new(procedure_params.merge(administrateurs: [current_administrateur]))
@path = @procedure.path
@availability = Procedure.path_availability(current_administrateur, @procedure.path)

View file

@ -1,14 +1,25 @@
- if SwitchDeviseProfileService.new(warden).multiple_devise_profile_connect?
%ul#switch-menu
%li
Changer de rôle
#switch-menu.dropdown.dropup
%button.btn.btn-default.dropdown-toggle{ type: :button, 'data-toggle' => 'dropdown', 'aria-haspopup' => true, 'aria-expanded' => false }
%i.fa.fa-toggle-on
%span.caret
%ul.dropdown-menu.dropdown-menu-left
- if user_signed_in?
%li
= link_to(dossiers_path, id: :menu_item_procedure, title: 'Aller dans votre espace usager. Vous pourrez revenir ici ensuite') do
%i.fa.fa-users
&nbsp; Usager
= link_to(dossiers_path, id: :menu_item_procedure) do
%i.fa.fa-user
&nbsp;
Usager
- if gestionnaire_signed_in?
%li
= link_to(gestionnaire_procedures_path, title: 'Aller dans votre espace instructeur. Vous pourrez revenir ici ensuite.') do
= link_to(gestionnaire_procedures_path) do
%i.fa.fa-user
&nbsp; Instructeur
&nbsp;
Instructeur
- if administrateur_signed_in?
%li
= link_to(admin_procedures_path) do
%i.fa.fa-user
&nbsp;
Administrateur

View file

@ -48,4 +48,6 @@
%h1
%i.fa.fa-times{ style: 'position: fixed; top: 10; right: 30; color: white;' }
= render partial: 'layouts/switch_devise_profile_module'
= render partial: 'layouts/footer', locals: { main_container_size: main_container_size }

View file

@ -31,7 +31,6 @@
= current_administrateur.procedures.archivees.count
.split-hr-left
= render partial: 'layouts/switch_devise_profile_module'
#infos-block

View file

@ -13,6 +13,6 @@ namespace :after_party do
end
progress.finish
AfterParty::TaskRecord.create version: '20190214101524'
AfterParty::TaskRecord.create version: '20190226101524'
end
end

View file

@ -197,6 +197,7 @@ describe Admin::ProceduresController, type: :controller do
it { expect(subject.organisation).to eq(organisation) }
it { expect(subject.direction).to eq(direction) }
it { expect(subject.administrateur_id).to eq(admin.id) }
it { expect(subject.administrateurs).to eq([admin]) }
it { expect(subject.duree_conservation_dossiers_dans_ds).to eq(duree_conservation_dossiers_dans_ds) }
it { expect(subject.duree_conservation_dossiers_hors_ds).to eq(duree_conservation_dossiers_hors_ds) }
end