Merge pull request #6280 from tchak/add-delete-dossier-to-list
Add delete dossier action to dossiers list
This commit is contained in:
commit
4866934171
2 changed files with 35 additions and 11 deletions
|
@ -1,4 +1,29 @@
|
|||
- if Dossier::EN_CONSTRUCTION_OU_INSTRUCTION.include?(state)
|
||||
- if Dossier::TERMINE.include?(state)
|
||||
.dropdown.user-dossier-actions
|
||||
%button.button.dropdown-button{ 'aria-expanded' => 'false', 'aria-controls' => 'actions-menu' }
|
||||
Actions
|
||||
#actions-menu.dropdown-content.fade-in-down
|
||||
%ul.dropdown-items
|
||||
- if archived
|
||||
%li
|
||||
= link_to unarchive_instructeur_dossier_path(procedure_id, dossier_id), method: :patch do
|
||||
%span.icon.unarchive
|
||||
.dropdown-description
|
||||
Désarchiver le dossier
|
||||
- else
|
||||
%li
|
||||
= link_to archive_instructeur_dossier_path(procedure_id, dossier_id), method: :patch do
|
||||
%span.icon.archive
|
||||
.dropdown-description
|
||||
Archiver le dossier
|
||||
|
||||
%li.danger
|
||||
= link_to supprimer_dossier_instructeur_dossier_path(procedure_id, dossier_id), method: :patch, data: { confirm: "Voulez vous vraiment supprimer le dossier #{dossier_id} ? Cette action est irréversible. \nNous vous suggérons de télécharger le dossier au format PDF au préalable." } do
|
||||
%span.icon.delete
|
||||
.dropdown-description
|
||||
Supprimer le dossier
|
||||
|
||||
- elsif Dossier::EN_CONSTRUCTION_OU_INSTRUCTION.include?(state)
|
||||
- if dossier_is_followed
|
||||
= link_to unfollow_instructeur_dossier_path(procedure_id, dossier_id), method: :patch, class: 'button' do
|
||||
%span.icon.unfollow>
|
||||
|
@ -7,13 +32,3 @@
|
|||
= link_to follow_instructeur_dossier_path(procedure_id, dossier_id), method: :patch, class: 'button' do
|
||||
%span.icon.follow>
|
||||
Suivre le dossier
|
||||
|
||||
- elsif Dossier::TERMINE.include?(state)
|
||||
- if archived
|
||||
= link_to unarchive_instructeur_dossier_path(procedure_id, dossier_id), method: :patch, class: 'button' do
|
||||
%span.icon.unarchive>
|
||||
Désarchiver le dossier
|
||||
- else
|
||||
= link_to archive_instructeur_dossier_path(procedure_id, dossier_id), method: :patch, class: 'button' do
|
||||
%span.icon.archive>
|
||||
Archiver le dossier
|
||||
|
|
|
@ -66,6 +66,15 @@ feature 'Instructing a dossier:', js: true do
|
|||
dossier.reload
|
||||
expect(dossier.state).to eq(Dossier.states.fetch(:accepte))
|
||||
expect(dossier.motivation).to eq('a good reason')
|
||||
|
||||
click_on procedure.libelle
|
||||
click_on 'traité'
|
||||
click_on 'Actions'
|
||||
accept_confirm do
|
||||
click_on 'Supprimer le dossier'
|
||||
end
|
||||
click_on 'traité'
|
||||
expect(page).not_to have_button('Actions')
|
||||
end
|
||||
|
||||
scenario 'A instructeur can follow/unfollow a dossier' do
|
||||
|
|
Loading…
Reference in a new issue