Merge pull request #8929 from tchak/feat-display-procedure-state-in-manager
ETQ opérateur, je voudrais pouvoir consulter plus facilement l’état d’une démarche
This commit is contained in:
commit
38b806a1e0
7 changed files with 26 additions and 2 deletions
|
@ -11,6 +11,7 @@ class ProcedureDashboard < Administrate::BaseDashboard
|
|||
published_types_de_champ_public: TypesDeChampCollectionField,
|
||||
published_types_de_champ_private: TypesDeChampCollectionField,
|
||||
path: ProcedureLinkField,
|
||||
aasm_state: ProcedureStateField,
|
||||
dossiers: Field::HasMany,
|
||||
administrateurs: Field::HasMany,
|
||||
id: Field::Number.with_options(searchable: true),
|
||||
|
@ -56,7 +57,7 @@ class ProcedureDashboard < Administrate::BaseDashboard
|
|||
:service,
|
||||
:dossiers,
|
||||
:published_at,
|
||||
:unpublished_at
|
||||
:aasm_state
|
||||
].freeze
|
||||
|
||||
# SHOW_PAGE_ATTRIBUTES
|
||||
|
@ -64,6 +65,7 @@ class ProcedureDashboard < Administrate::BaseDashboard
|
|||
SHOW_PAGE_ATTRIBUTES = [
|
||||
:id,
|
||||
:path,
|
||||
:aasm_state,
|
||||
:administrateurs,
|
||||
:libelle,
|
||||
:description,
|
||||
|
@ -78,6 +80,7 @@ class ProcedureDashboard < Administrate::BaseDashboard
|
|||
:whitelisted_at,
|
||||
:hidden_at,
|
||||
:closed_at,
|
||||
:unpublished_at,
|
||||
:published_types_de_champ_public,
|
||||
:published_types_de_champ_private,
|
||||
:for_individual,
|
||||
|
|
7
app/fields/procedure_state_field.rb
Normal file
7
app/fields/procedure_state_field.rb
Normal file
|
@ -0,0 +1,7 @@
|
|||
require "administrate/field/base"
|
||||
|
||||
class ProcedureStateField < Administrate::Field::String
|
||||
def name
|
||||
"Statut"
|
||||
end
|
||||
end
|
|
@ -1070,7 +1070,7 @@ enum DemarcheState {
|
|||
close
|
||||
|
||||
"""
|
||||
Depubliee
|
||||
Dépubliée
|
||||
"""
|
||||
depubliee
|
||||
|
||||
|
|
|
@ -917,4 +917,13 @@ class Procedure < ApplicationRecord
|
|||
def stable_ids_used_by_routing_rules
|
||||
@stable_ids_used_by_routing_rules ||= groupe_instructeurs.flat_map { _1.routing_rule&.sources }.compact
|
||||
end
|
||||
|
||||
# We need this to unfuck administrate + aasm
|
||||
def self.human_attribute_name(attribute, options = {})
|
||||
if attribute == :aasm_state
|
||||
'Statut'
|
||||
else
|
||||
super
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
2
app/views/fields/procedure_state_field/_index.html.haml
Normal file
2
app/views/fields/procedure_state_field/_index.html.haml
Normal file
|
@ -0,0 +1,2 @@
|
|||
- if field.data.present?
|
||||
= t field.data, scope: 'activerecord.attributes.procedure.aasm_state'
|
2
app/views/fields/procedure_state_field/_show.html.haml
Normal file
2
app/views/fields/procedure_state_field/_show.html.haml
Normal file
|
@ -0,0 +1,2 @@
|
|||
- if field.data.present?
|
||||
= t field.data, scope: 'activerecord.attributes.procedure.aasm_state'
|
|
@ -20,6 +20,7 @@ fr:
|
|||
publiee: Publiée
|
||||
close: Close
|
||||
hidden: Supprimée
|
||||
depubliee: Dépubliée
|
||||
declarative_with_state/en_instruction: En instruction
|
||||
declarative_with_state/accepte: Accepté
|
||||
api_particulier_token: Jeton API Particulier
|
||||
|
|
Loading…
Reference in a new issue