diff --git a/app/assets/javascripts/modules/smart_answer_flowchart.js b/app/assets/javascripts/modules/smart_answer_flowchart.js deleted file mode 100644 index 0520d09fc..000000000 --- a/app/assets/javascripts/modules/smart_answer_flowchart.js +++ /dev/null @@ -1,25 +0,0 @@ -//= require mermaid/dist/mermaid - -(function (Modules) { - 'use strict' - - Modules.SmartAnswerFlowchart = function () { - this.start = function (element) { - var diagram = element.find('.flowchart') - var flowchartLoading = element.find('.flowchart__loading') - - // eslint-disable-next-line - mermaid.initialize( - { - startOnLoad: true, - flowchart: { - useMaxWidth: false - } - } - ) - - diagram.removeClass('flowchart--hidden') - flowchartLoading.addClass('flowchart__loading--hidden') - } - } -})(window.GOVUKAdmin.Modules) diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index 80439a259..6fb828a23 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -19,7 +19,6 @@ // Pages @import "downtime"; @import "smart_answer_builder"; -@import "smart_answer_flowchart"; // GOVUK Design System @import "govuk_publishing_components/all_components"; diff --git a/app/assets/stylesheets/smart_answer_flowchart.scss b/app/assets/stylesheets/smart_answer_flowchart.scss deleted file mode 100644 index a8ada8453..000000000 --- a/app/assets/stylesheets/smart_answer_flowchart.scss +++ /dev/null @@ -1,14 +0,0 @@ -.smart-answer-flowchart { - .mermaid { - background-color: #ffffff; - } - - .flowchart--hidden, - .flowchart__loading--hidden { - display: none; - } - - pre { - word-break: normal; - } -} diff --git a/app/controllers/editions_controller.rb b/app/controllers/editions_controller.rb index f2a9fa7e2..f9faf9c63 100644 --- a/app/controllers/editions_controller.rb +++ b/app/controllers/editions_controller.rb @@ -235,13 +235,6 @@ def process_unpublish end end - def diagram - # [MT] TODO: What's the best way to handle requests for a diagram for a non-simple smart answer? - if @resource.format != "SimpleSmartAnswer" - render plain: "404 Not Found", status: :not_found - end - end - protected def permitted_params(subtype: nil) diff --git a/app/views/editions/diagram.html.erb b/app/views/editions/diagram.html.erb deleted file mode 100644 index bd0388500..000000000 --- a/app/views/editions/diagram.html.erb +++ /dev/null @@ -1,15 +0,0 @@ -<%= render 'shared/edition_header' %> - -

- <%= link_to "Back to current edition", edition_path(@resource.history.first), :class => "btn btn-default" %> -

- -
-
-    <%= @resource.generate_mermaid %>
-  
- -

Generating diagram ...

-
- -<% content_for :page_title, "Diagram for #{@resource.title}" %> diff --git a/app/views/editions/show.html.erb b/app/views/editions/show.html.erb index 7b4906793..41d868f67 100644 --- a/app/views/editions/show.html.erb +++ b/app/views/editions/show.html.erb @@ -27,12 +27,6 @@