Merge branch 'develop' into staging

This commit is contained in:
Xavier J 2017-01-02 09:54:22 +01:00
commit 9c86ef420a
12 changed files with 70 additions and 59 deletions

View file

@ -180,6 +180,9 @@
.margin-top-40 { .margin-top-40 {
margin-top: 40px; margin-top: 40px;
} }
.margin-top-20 {
margin-top: 20px;
}
.margin-bot-40 { .margin-bot-40 {
margin-bottom: 40px; margin-bottom: 40px;
} }

View file

@ -34,7 +34,7 @@
} }
} }
#action-block { #action-block {
margin-right: 10px; margin: 10px;
.action { .action {
background-color: #E45B51; background-color: #E45B51;
text-align: center; text-align: center;
@ -115,6 +115,9 @@
margin-right: auto; margin-right: auto;
} }
#notifications_list { #notifications_list {
.no-notification {
margin: 0 30px 0 30px;
}
.notification { .notification {
padding: 10px 10px 10px 20px; padding: 10px 10px 10px 20px;
.dossier, .updated-at { .dossier, .updated-at {

View file

@ -14,7 +14,7 @@ class Users::RecapitulatifController < UsersController
@facade.dossier.next_step! 'user', 'initiate' @facade.dossier.next_step! 'user', 'initiate'
flash.notice = 'Dossier soumis avec succès.' flash.notice = 'Dossier soumis avec succès.'
render 'show' redirect_to users_dossier_recapitulatif_path
end end
def submit def submit
@ -23,7 +23,7 @@ class Users::RecapitulatifController < UsersController
@facade.dossier.submit! @facade.dossier.submit!
flash.notice = 'Dossier déposé avec succès.' flash.notice = 'Dossier déposé avec succès.'
render 'show' redirect_to users_dossier_recapitulatif_path
end end
def self.route_authorization def self.route_authorization

View file

@ -37,6 +37,7 @@ class Users::SessionsController < Sessions::SessionsController
elsif administrateur_signed_in? elsif administrateur_signed_in?
redirect_to admin_path redirect_to admin_path
else else
flash.alert = 'Mauvais couple login / mot de passe'
new new
render :new, status: 401 render :new, status: 401
end end

View file

@ -56,9 +56,10 @@
%div.col-lg-8.col-md-8.col-sm-8.col-xs-8.title-no-expanse %div.col-lg-8.col-md-8.col-sm-8.col-xs-8.title-no-expanse
%div.carret-right %div.carret-right
INFORMATIONS ENTREPRISE / ASSOCIATION INFORMATIONS ENTREPRISE / ASSOCIATION
%a#add_siret.action{href: users_dossier_add_siret_path(dossier_id: @facade.dossier.id)} - if !@current_gestionnaire && ["draft", "updated", "replied", "initiated"].include?(@facade.dossier.state)
%div.col-lg-4.col-md-4.col-sm-4.col-xs-4.action %a#add_siret.action{href: users_dossier_add_siret_path(dossier_id: @facade.dossier.id)}
= "Renseigner un SIRET" %div.col-lg-4.col-md-4.col-sm-4.col-xs-4.action
= "Renseigner un SIRET"
- unless @facade.entreprise.nil? - unless @facade.entreprise.nil?
.default_data_block .default_data_block

View file

@ -22,6 +22,7 @@
%div.col-md-6.col-sm-6.col-xs-6.col-lg-6.depositaire-label Date de naissance %div.col-md-6.col-sm-6.col-xs-6.col-lg-6.depositaire-label Date de naissance
%div.col-md-1.col-lg-1.col-sm-1.col-xs-1.comments-off= "-" %div.col-md-1.col-lg-1.col-sm-1.col-xs-1.comments-off= "-"
%div.col-md-5.col-sm-5.col-xs-5.col-lg-5.depositaire-info= @facade.individual.birthdate %div.col-md-5.col-sm-5.col-xs-5.col-lg-5.depositaire-info= @facade.individual.birthdate
.row.margin-top-20
- unless @facade.champs.nil? - unless @facade.champs.nil?
- @facade.champs.each do |champ| - @facade.champs.each do |champ|

View file

@ -29,9 +29,12 @@
.badge.progress-bar-warning{title: 'Notifications'} .badge.progress-bar-warning{title: 'Notifications'}
= procedure[:unread_notifications] = procedure[:unread_notifications]
#notifications_list.hidden #notifications_list.hidden
- @facade_data_view.unread_notifications.each do |notification| - if @facade_data_view.unread_notifications.empty?
= link_to backoffice_dossier_path(notification.dossier.id) do .no-notification= "Aucune notification pour le moment."
.notification - else
.dossier= notification.decorate.index_display[:dossier] - @facade_data_view.unread_notifications.each do |notification|
.updated-at= notification.decorate.index_display[:date] = link_to backoffice_dossier_path(notification.dossier.id) do
.type= notification.decorate.index_display[:type] .notification
.dossier= notification.decorate.index_display[:dossier]
.updated-at= notification.decorate.index_display[:date]
.type= notification.decorate.index_display[:type]

View file

@ -12,17 +12,17 @@ feature 'As an administrateur I wanna create a new procedure', js: true do
context 'Right after sign_in I shall see all procedure states links' do context 'Right after sign_in I shall see all procedure states links' do
scenario 'Finding draft procedures' do scenario 'Finding draft procedures' do
page.find_by_id('draft-procedures').click page.find_by_id('draft-procedures').trigger('click')
expect(page).to have_current_path(admin_procedures_draft_path, only_path: true) expect(page).to have_current_path(admin_procedures_draft_path, only_path: true)
end end
scenario 'Finding active procedures' do scenario 'Finding active procedures' do
page.find_by_id('active-procedures').click page.find_by_id('active-procedures').trigger('click')
expect(page).to have_current_path(admin_procedures_path, only_path: true) expect(page).to have_current_path(admin_procedures_path, only_path: true)
end end
scenario 'Finding archived procedures' do scenario 'Finding archived procedures' do
page.find_by_id('archived-procedures').click page.find_by_id('archived-procedures').trigger('click')
expect(page).to have_current_path(admin_procedures_archived_path, only_path: true) expect(page).to have_current_path(admin_procedures_archived_path, only_path: true)
end end
end end
@ -60,13 +60,13 @@ feature 'As an administrateur I wanna create a new procedure', js: true do
page.find_by_id('procedure_types_de_champ_attributes_1_libelle') page.find_by_id('procedure_types_de_champ_attributes_1_libelle')
expect(Procedure.first.types_de_champ.first.libelle).to eq('libelle de champ') expect(Procedure.first.types_de_champ.first.libelle).to eq('libelle de champ')
page.find_by_id('onglet-pieces').click page.find_by_id('onglet-pieces').trigger('click')
expect(page).to have_current_path(admin_procedure_pieces_justificatives_path(Procedure.first.id.to_s)) expect(page).to have_current_path(admin_procedure_pieces_justificatives_path(Procedure.first.id.to_s))
page.find_by_id('procedure_types_de_piece_justificative_attributes_0_libelle').set 'libelle de piece' page.find_by_id('procedure_types_de_piece_justificative_attributes_0_libelle').set 'libelle de piece'
page.find_by_id('add_piece_justificative').click page.find_by_id('add_piece_justificative').click
page.find_by_id('procedure_types_de_piece_justificative_attributes_1_libelle') page.find_by_id('procedure_types_de_piece_justificative_attributes_1_libelle')
page.find_by_id('onglet-preview').click page.find_by_id('onglet-preview').trigger('click')
expect(page).to have_current_path(admin_procedure_previsualisation_path(Procedure.first.id.to_s)) expect(page).to have_current_path(admin_procedure_previsualisation_path(Procedure.first.id.to_s))
expect(page.find_by_id('champs_1')['placeholder']).to eq('libelle de champ') expect(page.find_by_id('champs_1')['placeholder']).to eq('libelle de champ')
expect(page.first('.piece-libelle').text).to eq('libelle de piece') expect(page.first('.piece-libelle').text).to eq('libelle de piece')
@ -75,11 +75,11 @@ feature 'As an administrateur I wanna create a new procedure', js: true do
scenario 'After adding champ and file, check impossibility to publish procedure, add accompagnateur and make publication' do scenario 'After adding champ and file, check impossibility to publish procedure, add accompagnateur and make publication' do
page.find_by_id('procedure_types_de_champ_attributes_0_libelle').set 'libelle de champ' page.find_by_id('procedure_types_de_champ_attributes_0_libelle').set 'libelle de champ'
page.find_by_id('add_type_de_champ').click page.find_by_id('add_type_de_champ').click
page.find_by_id('onglet-pieces').click page.find_by_id('onglet-pieces').trigger('click')
page.find_by_id('procedure_types_de_piece_justificative_attributes_0_libelle').set 'libelle de piece' page.find_by_id('procedure_types_de_piece_justificative_attributes_0_libelle').set 'libelle de piece'
page.find_by_id('add_piece_justificative').click page.find_by_id('add_piece_justificative').click
page.find_by_id('onglet-infos').click page.find_by_id('onglet-infos').trigger('click')
expect(page).to have_current_path(admin_procedure_path(Procedure.first.id.to_s)) expect(page).to have_current_path(admin_procedure_path(Procedure.first.id.to_s))
expect(page.find_by_id('publish-procedure')['disabled']).to eq('disabled') expect(page.find_by_id('publish-procedure')['disabled']).to eq('disabled')

View file

@ -23,29 +23,28 @@ feature 'As an Accompagnateur I can navigate and use each functionnality around
context 'On index' do context 'On index' do
scenario 'Switching between procedures' do scenario 'Switching between procedures' do
page.all('#procedure_list a').first.click page.all('#procedure_list a').first.trigger('click')
expect(page).to have_current_path(backoffice_dossiers_procedure_path(id: procedure_1.id.to_s), only_path: true) expect(page).to have_current_path(backoffice_dossiers_procedure_path(id: procedure_1.id.to_s), only_path: true)
expect(page.find('#all_dossiers .count').text).to eq('20 dossiers') expect(page.find('#all_dossiers .count').text).to eq('20 dossiers')
page.all('#procedure_list a').last.click page.all('#procedure_list a').last.trigger('click')
expect(page).to have_current_path(backoffice_dossiers_procedure_path(id: procedure_2.id.to_s), only_path: true) expect(page).to have_current_path(backoffice_dossiers_procedure_path(id: procedure_2.id.to_s), only_path: true)
expect(page.find('#all_dossiers .count').text).to eq('15 dossiers') expect(page.find('#all_dossiers .count').text).to eq('15 dossiers')
#save_and_open_page
end end
scenario 'Searching with search bar' do scenario 'Searching with search bar' do
page.find_by_id('search_area').trigger('click') page.find_by_id('search_area').trigger('click')
fill_in 'q', with: '15' fill_in 'q', with: '15'
page.find_by_id('search_button').click page.find_by_id('search_button').trigger('click')
page.find_by_id('tr_dossier_15').click page.find_by_id('tr_dossier_15').trigger('click')
expect(page).to have_current_path("/backoffice/dossiers/15") expect(page).to have_current_path("/backoffice/dossiers/15")
end end
scenario 'Following dossier' do scenario 'Following dossier' do
page.all('#procedure_list a').first.click page.all('#procedure_list a').first.trigger('click')
expect(page.all('#follow_dossiers .smart-listing')[0]['data-item-count']).to eq ("0") expect(page.all('#follow_dossiers .smart-listing')[0]['data-item-count']).to eq ("0")
page.find_by_id('all_dossiers').click page.find_by_id('all_dossiers').trigger('click')
expect(page.all('#dossiers_list a').first.text).to eq('Suivre') expect(page.all('#dossiers_list a').first.text).to eq('Suivre')
page.all('#dossiers_list a').first.click page.all('#dossiers_list a').first.trigger('click')
expect(page.all('#follow_dossiers .smart-listing')[0]['data-item-count']).to eq ("1") expect(page.all('#follow_dossiers .smart-listing')[0]['data-item-count']).to eq ("1")
end end
@ -91,9 +90,9 @@ feature 'As an Accompagnateur I can navigate and use each functionnality around
scenario 'Adding message' do scenario 'Adding message' do
page.find_by_id('tr_dossier_4').trigger('click') page.find_by_id('tr_dossier_4').trigger('click')
expect(page).to have_current_path(backoffice_dossier_path(4), only_path: true) expect(page).to have_current_path(backoffice_dossier_path(4), only_path: true)
page.find_by_id('open-message').click page.find_by_id('open-message').trigger('click')
page.execute_script("$('#texte_commentaire').data('wysihtml5').editor.setValue('Contenu du nouveau message')") page.execute_script("$('#texte_commentaire').data('wysihtml5').editor.setValue('Contenu du nouveau message')")
page.find_by_id('save-message').click page.find_by_id('save-message').trigger('click')
expect(page.find('.last-commentaire .content').text).to eq('Contenu du nouveau message') expect(page.find('.last-commentaire .content').text).to eq('Contenu du nouveau message')
end end
end end

View file

@ -17,11 +17,11 @@ feature 'As a User I wanna create a dossier', js: true do
fill_in 'dossier_individual_attributes_prenom', with: 'Prenom' fill_in 'dossier_individual_attributes_prenom', with: 'Prenom'
fill_in 'dossier_individual_attributes_birthdate', with: '14/10/1987' fill_in 'dossier_individual_attributes_birthdate', with: '14/10/1987'
find(:css, "#dossier_autorisation_donnees[value='1']").set(true) find(:css, "#dossier_autorisation_donnees[value='1']").set(true)
page.find_by_id('etape_suivante').click page.find_by_id('etape_suivante').trigger('click')
expect(page).to have_current_path(users_dossier_carte_path(Dossier.first.id.to_s), only_path: true) expect(page).to have_current_path(users_dossier_carte_path(Dossier.first.id.to_s), only_path: true)
page.find_by_id('etape_suivante').click page.find_by_id('etape_suivante').trigger('click')
fill_in 'champs_1', with: 'contenu du champ 1' fill_in 'champs_1', with: 'contenu du champ 1'
page.find_by_id('suivant').click page.find_by_id('suivant').trigger('click')
expect(page).to have_current_path(users_dossier_recapitulatif_path(Dossier.first.id.to_s), only_path: true) expect(page).to have_current_path(users_dossier_recapitulatif_path(Dossier.first.id.to_s), only_path: true)
end end
@ -39,14 +39,14 @@ feature 'As a User I wanna create a dossier', js: true do
stub_request(:get, "https://api-dev.apientreprise.fr/v1/associations/#{siret}?token=#{SIADETOKEN}") stub_request(:get, "https://api-dev.apientreprise.fr/v1/associations/#{siret}?token=#{SIADETOKEN}")
.to_return(status: 404, body: '') .to_return(status: 404, body: '')
page.find_by_id('dossier_siret').set siret page.find_by_id('dossier_siret').set siret
page.find_by_id('submit-siret').click page.find_by_id('submit-siret').trigger('click')
expect(page).to have_css('#recap_info_entreprise') expect(page).to have_css('#recap_info_entreprise')
find(:css, "#dossier_autorisation_donnees[value='1']").set(true) find(:css, "#dossier_autorisation_donnees[value='1']").set(true)
page.find_by_id('etape_suivante').click page.find_by_id('etape_suivante').trigger('click')
expect(page).to have_current_path(users_dossier_carte_path(Dossier.first.id.to_s), only_path: true) expect(page).to have_current_path(users_dossier_carte_path(Dossier.first.id.to_s), only_path: true)
page.find_by_id('etape_suivante').click page.find_by_id('etape_suivante').trigger('click')
fill_in 'champs_1', with: 'contenu du champ 1' fill_in 'champs_1', with: 'contenu du champ 1'
page.find_by_id('suivant').click page.find_by_id('suivant').trigger('click')
expect(page).to have_current_path(users_dossier_recapitulatif_path(Dossier.first.id.to_s), only_path: true) expect(page).to have_current_path(users_dossier_recapitulatif_path(Dossier.first.id.to_s), only_path: true)
end end
end end

View file

@ -12,9 +12,9 @@ feature 'As a User I want to edit a dossier I own', js: true do
fill_in 'dossier_individual_attributes_prenom', with: 'Prenom' fill_in 'dossier_individual_attributes_prenom', with: 'Prenom'
fill_in 'dossier_individual_attributes_birthdate', with: '14/10/1987' fill_in 'dossier_individual_attributes_birthdate', with: '14/10/1987'
find(:css, "#dossier_autorisation_donnees[value='1']").set(true) find(:css, "#dossier_autorisation_donnees[value='1']").set(true)
page.find_by_id('etape_suivante').click page.find_by_id('etape_suivante').trigger('click')
page.find_by_id('etape_suivante').click page.find_by_id('etape_suivante').trigger('click')
page.find_by_id('suivant').click page.find_by_id('suivant').trigger('click')
visit root_path visit root_path
end end
@ -22,29 +22,29 @@ feature 'As a User I want to edit a dossier I own', js: true do
scenario 'After sign_in, I can see dossiers "à traiter" (default), and other indexes' do scenario 'After sign_in, I can see dossiers "à traiter" (default), and other indexes' do
expect(page.find('#a_traiter')['class'] ).to eq('active procedure_list_element') expect(page.find('#a_traiter')['class'] ).to eq('active procedure_list_element')
page.find_by_id('brouillon').click page.find_by_id('brouillon').trigger('click')
page.find_by_id('a_traiter').click page.find_by_id('a_traiter').trigger('click')
page.find_by_id('valides').click page.find_by_id('valides').trigger('click')
page.find_by_id('en_instruction').click page.find_by_id('en_instruction').trigger('click')
page.find_by_id('termine').click page.find_by_id('termine').trigger('click')
page.find_by_id('invite').click page.find_by_id('invite').trigger('click')
end end
scenario 'Getting a dossier, I want to create a new message on' do scenario 'Getting a dossier, I want to create a new message on' do
page.find_by_id('tr_dossier_' + Dossier.last.id.to_s).click page.find_by_id('tr_dossier_' + Dossier.last.id.to_s).trigger('click')
expect(page).to have_current_path(users_dossier_recapitulatif_path(Dossier.first.id.to_s), only_path: true) expect(page).to have_current_path(users_dossier_recapitulatif_path(Dossier.first.id.to_s), only_path: true)
page.find_by_id('open-message').click page.find_by_id('open-message').trigger('click')
page.execute_script("$('#texte_commentaire').data('wysihtml5').editor.setValue('Contenu du nouveau message')") page.execute_script("$('#texte_commentaire').data('wysihtml5').editor.setValue('Contenu du nouveau message')")
page.find_by_id('save-message').click page.find_by_id('save-message').trigger('click')
expect(page.find('.last-commentaire .content').text).to eq('Contenu du nouveau message') expect(page.find('.last-commentaire .content').text).to eq('Contenu du nouveau message')
end end
scenario 'On the same dossier, I want to edit informations' do scenario 'On the same dossier, I want to edit informations' do
page.find_by_id('tr_dossier_' + Dossier.last.id.to_s).click page.find_by_id('tr_dossier_' + Dossier.last.id.to_s).trigger('click')
page.find_by_id('edit-dossier').click page.find_by_id('edit-dossier').trigger('click')
expect(page).to have_current_path(users_dossier_description_path(Dossier.first.id.to_s), only_path: true) expect(page).to have_current_path(users_dossier_description_path(Dossier.first.id.to_s), only_path: true)
fill_in 'champs_1', with: 'Contenu du champ 1' fill_in 'champs_1', with: 'Contenu du champ 1'
page.find_by_id('modification_terminee').click page.find_by_id('modification_terminee').trigger('click')
expect(page).to have_current_path(users_dossier_recapitulatif_path(Dossier.first.id.to_s), only_path: true) expect(page).to have_current_path(users_dossier_recapitulatif_path(Dossier.first.id.to_s), only_path: true)
expect(page.find('#champ-1-value').text).to eq('Contenu du champ 1') expect(page.find('#champ-1-value').text).to eq('Contenu du champ 1')
end end

View file

@ -12,8 +12,8 @@ feature 'As a User I want to sort and paginate dossiers', js: true do
fill_in 'dossier_individual_attributes_prenom', with: 'Prenom' fill_in 'dossier_individual_attributes_prenom', with: 'Prenom'
fill_in 'dossier_individual_attributes_birthdate', with: '14/10/1987' fill_in 'dossier_individual_attributes_birthdate', with: '14/10/1987'
find(:css, "#dossier_autorisation_donnees[value='1']").set(true) find(:css, "#dossier_autorisation_donnees[value='1']").set(true)
page.find_by_id('etape_suivante').click page.find_by_id('etape_suivante').trigger('click')
page.find_by_id('suivant').click page.find_by_id('suivant').trigger('click')
50.times do 50.times do
Dossier.create(procedure_id: 1, user_id: 1, state: "initiated") Dossier.create(procedure_id: 1, user_id: 1, state: "initiated")
end end
@ -23,7 +23,7 @@ feature 'As a User I want to sort and paginate dossiers', js: true do
context 'After sign_in, I can see my 51 dossiers on the index' do context 'After sign_in, I can see my 51 dossiers on the index' do
scenario 'Using sort' do scenario 'Using sort' do
expect(page.all(:css, '#dossiers_list tr')[1].text.split(" ").first).to eq('1') expect(page.all(:css, '#dossiers_list tr')[0].text.split(" ").first).to eq('1')
expect(page.all(:css, '#dossiers_list tr')[2].text.split(" ").first).to eq('2') expect(page.all(:css, '#dossiers_list tr')[2].text.split(" ").first).to eq('2')
visit "/users/dossiers?dossiers_smart_listing[sort][id]=desc" visit "/users/dossiers?dossiers_smart_listing[sort][id]=desc"
expect(page.all(:css, '#dossiers_list tr')[1].text.split(" ").first).to eq('51') expect(page.all(:css, '#dossiers_list tr')[1].text.split(" ").first).to eq('51')
@ -34,16 +34,16 @@ feature 'As a User I want to sort and paginate dossiers', js: true do
end end
scenario 'Using pagination' do scenario 'Using pagination' do
expect(page.all(:css, '#dossiers_list tr')[1].text.split(" ").first).to eq('1') expect(page.all(:css, '#dossiers_list tr')[0].text.split(" ").first).to eq('1')
page.find('.next_page a').click page.find('.next_page a').trigger('click')
wait_for_ajax wait_for_ajax
expect(page.all(:css, '#dossiers_list tr')[1].text.split(" ").first).to eq('8') expect(page.all(:css, '#dossiers_list tr')[1].text.split(" ").first).to eq('8')
page.find('.next_page a').click page.find('.next_page a').trigger('click')
wait_for_ajax wait_for_ajax
expect(page.all(:css, '#dossiers_list tr')[1].text.split(" ").first).to eq('15') expect(page.all(:css, '#dossiers_list tr')[1].text.split(" ").first).to eq('15')
page.find('.prev a').click page.find('.prev a').trigger('click')
wait_for_ajax wait_for_ajax
page.find('.prev a').click page.find('.prev a').trigger('click')
wait_for_ajax wait_for_ajax
expect(page.all(:css, '#dossiers_list tr')[1].text.split(" ").first).to eq('1') expect(page.all(:css, '#dossiers_list tr')[1].text.split(" ").first).to eq('1')
end end