Add opensimplif feature flip to hide user/gestionnaire tabs

This commit is contained in:
Julien Portalier 2016-10-18 15:51:32 +02:00
parent 86e6dd0233
commit 101bd68252
7 changed files with 40 additions and 10 deletions

View file

@ -1,6 +1,3 @@
=link_to 'Tous mes dossiers en CSV', backoffice_download_dossiers_tps_path, {class: 'btn btn-success btn-sm', style: 'float: right; margin-right: 4%; margin-top: 7px'}
%h1 Gestion des dossiers
#filter_by_procedure{style:'margin-left: 5%'} #filter_by_procedure{style:'margin-left: 5%'}
%select{onchange: 'location = this.value', style:'margin-top: 10px; margin-bottom: 10px', id: 'filter_by_procedure_select'} %select{onchange: 'location = this.value', style:'margin-top: 10px; margin-bottom: 10px', id: 'filter_by_procedure_select'}
%option{value: backoffice_dossiers_path} %option{value: backoffice_dossiers_path}
@ -67,4 +64,4 @@
%a.btn#pref_list_dossier_open_action{href: '#'} %a.btn#pref_list_dossier_open_action{href: '#'}
%i.fa.fa-columns %i.fa.fa-columns
%br %br

View file

@ -1,7 +1,12 @@
#backoffice_index #backoffice_index
#pref_list_menu #pref_list_menu
= render partial: 'backoffice/dossiers/pref_list' = render partial: 'backoffice/dossiers/pref_list'
= render partial: 'backoffice/dossiers/onglets'
=link_to 'Tous mes dossiers en CSV', backoffice_download_dossiers_tps_path, {class: 'btn btn-success btn-sm', style: 'float: right; margin-right: 4%; margin-top: 7px'}
%h1 Gestion des dossiers
-unless Features.opensimplif
= render partial: 'backoffice/dossiers/onglets'
= smart_listing_render :dossiers = smart_listing_render :dossiers

View file

@ -1,5 +1,3 @@
%h1 Mes dossiers
%br %br
#onglets #onglets
%ul.nav.nav-tabs %ul.nav.nav-tabs

View file

@ -1,5 +1,8 @@
#users_index #users_index
= render partial: 'onglets' %h1 Mes dossiers
-unless Features.opensimplif
= render partial: 'onglets'
= smart_listing_render :dossiers = smart_listing_render :dossiers

View file

@ -89,4 +89,16 @@ feature 'on click on tabs button' do
end end
end end
end end
end
context "OpenSimplif" do
before do
allow(Features).to receive(:opensimplif).and_return(true)
visit backoffice_dossiers_url
end
scenario "it hides the tabs" do
expect(page).to_not have_css('#filter_by_procedure')
expect(page).to_not have_css('#onglets')
end
end
end

View file

@ -99,4 +99,15 @@ feature 'on click on tabs button' do
end end
end end
end end
end
context "OpenSimplif" do
before do
allow(Features).to receive(:opensimplif).and_return(true)
visit users_dossiers_url
end
scenario "it hides the tabs" do
expect(page).to_not have_css('#onglets')
end
end
end

View file

@ -83,6 +83,10 @@ class Features
def self.unified_login def self.unified_login
false false
end end
def self.opensimplif
false
end
end end
WebMock.disable_net_connect!(allow_localhost: true) WebMock.disable_net_connect!(allow_localhost: true)