From b0288b42ac52b95c3b38aadef82b445b1c7954f7 Mon Sep 17 00:00:00 2001 From: ChrisBAshton Date: Tue, 5 Nov 2024 17:36:58 +0000 Subject: [PATCH] Point developer to the schema that needs updating The Zendesk integration currently just outputs the schema contents that need copying and pasting. But the developer still needs to track down the file in specialist-publisher, which is an unnecessarily manual step - let's give them the link directly to the file edit screen, ready to copy and paste the schema. Trello: https://trello.com/c/YdGWsy0I/3035-integrate-the-specialist-finder-edit-forms-with-support-api --- app/controllers/admin_controller.rb | 5 ++++- spec/controllers/admin_controller_spec.rb | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index 109dcbeb1..4ca4ee5ea 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -58,7 +58,10 @@ def support_payload subject: "Specialist Finder Edit Request: #{current_format.title.pluralize}", tags: %w[specialist_finder_edit_request], priority: "normal", - description: "```\r\n#{params[:proposed_schema]}\r\n```", + description: "Developer - raise a PR replacing this schema with the schema below: " \ + "https://github.com/alphagov/specialist-publisher/edit/main/lib/documents/schemas/#{current_format.document_type.pluralize}.json" \ + "\r\n---\r\n" \ + "```\r\n#{params[:proposed_schema]}\r\n```", requester: { name: current_user.name, email: current_user.email, diff --git a/spec/controllers/admin_controller_spec.rb b/spec/controllers/admin_controller_spec.rb index 389e89aa2..d29f44b3c 100644 --- a/spec/controllers/admin_controller_spec.rb +++ b/spec/controllers/admin_controller_spec.rb @@ -43,6 +43,7 @@ tags: %w[specialist_finder_edit_request], priority: "normal", requester: { name: user.name, email: user.email }, + description: /^Developer - raise a PR replacing this schema with the schema below: https:\/\/github\.com\/alphagov\/specialist-publisher\/edit\/main\/lib\/documents\/schemas\/cma_cases\.json\r\n---\r\n```\r\n{/, })) post :zendesk, params: { document_type_slug: "cma-cases", proposed_schema: CmaCase.finder_schema.schema }