-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
create component to display deleted dossiers
- Loading branch information
1 parent
dcb5d0f
commit 2902a2f
Showing
6 changed files
with
74 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
class Dossiers::DeletedDossiersComponent < ApplicationComponent | ||
include DossierHelper | ||
|
||
def initialize(deleted_dossiers:) | ||
@deleted_dossiers = deleted_dossiers | ||
end | ||
|
||
def role | ||
controller.try(:nav_bar_profile) | ||
end | ||
end | ||
7 changes: 7 additions & 0 deletions
7
app/components/dossiers/deleted_dossiers_component/deleted_dossiers_component.en.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
en: | ||
deleted_explanation: "The folders have been deleted. You can no longer recover them for the following reasons:" | ||
deleted_explanation_first_instructor: The user intentionally deleted their folder. | ||
deleted_explanation_second_instructor: The maximum retention period has expired. In accordance with GDPR regulations, the application cannot continue to host them. | ||
deleted_explanation_first_user: You have deleted your folder. | ||
deleted_explanation_second_user: The maximum retention period has expired. In accordance with GDPR regulations, the application cannot continue to host them. | ||
no_deleted_folders: You have no permanently deleted folders. |
7 changes: 7 additions & 0 deletions
7
app/components/dossiers/deleted_dossiers_component/deleted_dossiers_component.fr.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
fr: | ||
deleted_explanation: "Les dossiers ont été supprimés. Vous ne pouvez plus les récupérer pour les raisons suivantes :" | ||
deleted_explanation_first_instructeur: L’utilisateur a intentionnellement supprimé son dossier. | ||
deleted_explanation_second_instructeur: Le délai de conservation maximal a expiré. Conformément au règlement RGPD, l'application ne peut continuer à les héberger. | ||
deleted_explanation_first_user: Vous avez supprimé votre dossier. | ||
deleted_explanation_second_user: Le délai de conservation maximal a expiré. Conformément au règlement RGPD, l'application ne peut continuer à les héberger. | ||
no_deleted_dossiers: Vous n'avez pas de dossiers supprimés définitivement. |
47 changes: 47 additions & 0 deletions
47
app/components/dossiers/deleted_dossiers_component/deleted_dossiers_component.html.haml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
|
||
.fr-container | ||
%h1.fr-h2 | ||
Historique des dossiers supprimés | ||
|
||
.fr-container | ||
- if @deleted_dossiers.present? | ||
= render Dsfr::CalloutComponent.new(title: nil) do |c| | ||
- c.with_body do | ||
%p | ||
= t('.deleted_explanation') | ||
|
||
%ul | ||
%li | ||
= t(".deleted_explanation_first_#{role}") | ||
%li | ||
= t(".deleted_explanation_second_#{role}") | ||
|
||
.fr-table.fr-table--layout-fixed.fr-mt-3w | ||
%table | ||
%thead | ||
%tr | ||
%th.number-col N° dossier | ||
%th Libellé de la démarche | ||
%th Raison de suppression | ||
%th Date de suppression | ||
%tbody | ||
- @deleted_dossiers.each do |deleted_dossier| | ||
%tr | ||
%td.number-col | ||
= deleted_dossier.dossier_id | ||
|
||
%td.number-col | ||
= deleted_dossier.procedure.libelle.truncate_words(10) | ||
|
||
%td | ||
= deletion_reason_badge(deleted_dossier.reason) | ||
-# .fr-badge | ||
-# = t("activerecord.attributes.deleted_dossier.reason.#{deleted_dossier.reason}") | ||
%td.deleted-cell | ||
= l(deleted_dossier.deleted_at, format: '%d/%m/%y') | ||
|
||
= paginate @deleted_dossiers, views_prefix: 'shared' | ||
|
||
- else | ||
%p | ||
= t('.no_deleted_dossiers') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters