it displays an alert if using test service before publishing a procedure
This commit is contained in:
parent
0ffb7cd886
commit
b5051a25d9
6 changed files with 15 additions and 3 deletions
|
@ -30,7 +30,7 @@ module InitiationProcedureConcern
|
|||
telephone: '1234',
|
||||
horaires: 'de 9 h à 18 h',
|
||||
adresse: 'adresse',
|
||||
siret: '35600082800018',
|
||||
siret: Service::SIRET_TEST,
|
||||
etablissement_infos: { adresse: "75 rue du Louvre\n75002\nPARIS\nFRANCE" },
|
||||
etablissement_lat: 48.87,
|
||||
etablissement_lng: 2.34,
|
||||
|
|
|
@ -706,6 +706,10 @@ class Procedure < ApplicationRecord
|
|||
result << :service
|
||||
end
|
||||
|
||||
if service_test?
|
||||
result << :service
|
||||
end
|
||||
|
||||
if missing_instructeurs?
|
||||
result << :instructeurs
|
||||
end
|
||||
|
@ -737,6 +741,10 @@ class Procedure < ApplicationRecord
|
|||
end
|
||||
end
|
||||
|
||||
def service_test?
|
||||
service&.siret == Service::SIRET_TEST
|
||||
end
|
||||
|
||||
def revised?
|
||||
revisions.size > 2
|
||||
end
|
||||
|
|
|
@ -6,6 +6,8 @@ class Service < ApplicationRecord
|
|||
|
||||
scope :ordered, -> { order(nom: :asc) }
|
||||
|
||||
SIRET_TEST = '35600082800018'
|
||||
|
||||
enum type_organisme: {
|
||||
administration_centrale: 'administration_centrale',
|
||||
association: 'association',
|
||||
|
|
|
@ -46,6 +46,8 @@
|
|||
%li= link_to("des instructeurs", admin_procedure_groupe_instructeur_path(@procedure, @procedure.defaut_groupe_instructeur))
|
||||
- if @procedure.service.nil?
|
||||
%li= link_to("un service", admin_services_path(procedure_id: @procedure))
|
||||
- if @procedure.service_test?
|
||||
%li= link_to("un service valide", admin_services_path(procedure_id: @procedure))
|
||||
= link_to t('.back_to_procedure'), admin_procedure_path(id: @procedure), class: 'fr-btn fr-btn--secondary fr-btn--icon-left fr-icon-arrow-go-back-line fr-mt-2w'
|
||||
|
||||
- else
|
||||
|
|
|
@ -47,7 +47,7 @@ en:
|
|||
published_procedure_html: "This procedure is <strong>published</strong>, some elements can no longer be modified. To access it you can use the link:"
|
||||
public_link_procedure_html: "Be careful, always post the <strong>full link</strong> displayed above, and not a generic link to %{link}"
|
||||
missing_information_title: missing information
|
||||
missing_information_content: "To be able to test this procedure, you must first assign it:"
|
||||
missing_information_content: "To be able to publish this procedure, you must first assign it:"
|
||||
missing_information_service: You must provide the contact details of your Administrative Department before you can publish your procedure.
|
||||
missing_information_instructeurs: You must assign instructors before you can publish your procedure.
|
||||
missing_link: This procedure does not yet have a link, and is not accessible to the public.
|
||||
|
|
|
@ -47,7 +47,7 @@ fr:
|
|||
published_procedure_html: "Cette démarche est <strong>publiée</strong>, certains éléments ne peuvent plus être modifiés. Pour y accéder vous pouvez utiliser le lien :"
|
||||
public_link_procedure_html: "Attention, diffusez toujours le <strong>lien complet</strong> affiché ci-dessus, et non pas un lien générique vers %{link}"
|
||||
missing_information_title: informations manquantes
|
||||
missing_information_content: "Pour pouvoir tester cette démarche, vous devez d’abord lui affecter :"
|
||||
missing_information_content: "Pour pouvoir publier cette démarche, vous devez d’abord lui affecter :"
|
||||
missing_information_service: Vous devez renseigner les coordonnées de votre Service administratif avant de pouvoir publier votre démarche.
|
||||
missing_information_instructeurs: Vous devez affecter des instructeurs avant de pouvoir publier votre démarche.
|
||||
missing_link: Cette démarche n’a pas encore de lien, et n’est pas accessible par le public.
|
||||
|
|
Loading…
Reference in a new issue