feat(manager): display procedure state and unpublished date
This commit is contained in:
parent
623628212c
commit
ce466d072a
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_public: TypesDeChampCollectionField,
|
||||||
published_types_de_champ_private: TypesDeChampCollectionField,
|
published_types_de_champ_private: TypesDeChampCollectionField,
|
||||||
path: ProcedureLinkField,
|
path: ProcedureLinkField,
|
||||||
|
aasm_state: ProcedureStateField,
|
||||||
dossiers: Field::HasMany,
|
dossiers: Field::HasMany,
|
||||||
administrateurs: Field::HasMany,
|
administrateurs: Field::HasMany,
|
||||||
id: Field::Number.with_options(searchable: true),
|
id: Field::Number.with_options(searchable: true),
|
||||||
|
@ -56,7 +57,7 @@ class ProcedureDashboard < Administrate::BaseDashboard
|
||||||
:service,
|
:service,
|
||||||
:dossiers,
|
:dossiers,
|
||||||
:published_at,
|
:published_at,
|
||||||
:unpublished_at
|
:aasm_state
|
||||||
].freeze
|
].freeze
|
||||||
|
|
||||||
# SHOW_PAGE_ATTRIBUTES
|
# SHOW_PAGE_ATTRIBUTES
|
||||||
|
@ -64,6 +65,7 @@ class ProcedureDashboard < Administrate::BaseDashboard
|
||||||
SHOW_PAGE_ATTRIBUTES = [
|
SHOW_PAGE_ATTRIBUTES = [
|
||||||
:id,
|
:id,
|
||||||
:path,
|
:path,
|
||||||
|
:aasm_state,
|
||||||
:administrateurs,
|
:administrateurs,
|
||||||
:libelle,
|
:libelle,
|
||||||
:description,
|
:description,
|
||||||
|
@ -78,6 +80,7 @@ class ProcedureDashboard < Administrate::BaseDashboard
|
||||||
:whitelisted_at,
|
:whitelisted_at,
|
||||||
:hidden_at,
|
:hidden_at,
|
||||||
:closed_at,
|
:closed_at,
|
||||||
|
:unpublished_at,
|
||||||
:published_types_de_champ_public,
|
:published_types_de_champ_public,
|
||||||
:published_types_de_champ_private,
|
:published_types_de_champ_private,
|
||||||
:for_individual,
|
: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
|
close
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Depubliee
|
Dépubliée
|
||||||
"""
|
"""
|
||||||
depubliee
|
depubliee
|
||||||
|
|
||||||
|
|
|
@ -917,4 +917,13 @@ class Procedure < ApplicationRecord
|
||||||
def stable_ids_used_by_routing_rules
|
def stable_ids_used_by_routing_rules
|
||||||
@stable_ids_used_by_routing_rules ||= groupe_instructeurs.flat_map { _1.routing_rule&.sources }.compact
|
@stable_ids_used_by_routing_rules ||= groupe_instructeurs.flat_map { _1.routing_rule&.sources }.compact
|
||||||
end
|
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
|
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
|
publiee: Publiée
|
||||||
close: Close
|
close: Close
|
||||||
hidden: Supprimée
|
hidden: Supprimée
|
||||||
|
depubliee: Dépubliée
|
||||||
declarative_with_state/en_instruction: En instruction
|
declarative_with_state/en_instruction: En instruction
|
||||||
declarative_with_state/accepte: Accepté
|
declarative_with_state/accepte: Accepté
|
||||||
api_particulier_token: Jeton API Particulier
|
api_particulier_token: Jeton API Particulier
|
||||||
|
|
Loading…
Reference in a new issue