Skip to content

Commit

Permalink
Revert custom visual editor exit tracking
Browse files Browse the repository at this point in the history
Now that we are tracking all buttons we can remove the custom tracking for the visual editor exit button, maintaining only the custom event and tool names.
  • Loading branch information
dnkrj committed Jun 14, 2024
1 parent 8304c61 commit c2ae68b
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 22 deletions.
1 change: 0 additions & 1 deletion app/views/admin/attachments/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
attachment_ids: [], # HTML attachments cannot embed Attachments from their parent Edition
},
hidden_field_name: "attachment[visual_editor]",
ga4_tracking_section: "#{@edition.new_record? ? "New" : "Editing"} #{@edition.format_name.titleize}",
} %>
<% else %>
<%= render "components/govspeak_editor", {
Expand Down
1 change: 0 additions & 1 deletion app/views/admin/editions/_standard_fields.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@
alternative_format_provider_id: (edition.alternative_format_provider_id || current_user.organisation.try(:id)),
},
hidden_field_name: "edition[visual_editor]",
ga4_tracking_section: "#{edition.new_record? ? "New" : "Editing"} #{edition.format_name.titleize}",
} %>
<% else %>
<%= render "components/govspeak_editor", {
Expand Down
12 changes: 4 additions & 8 deletions app/views/components/_visual_editor.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
id ||= "#{name}-#{SecureRandom.hex(4)}"
label_id = "#{id}-label"
value ||= nil
ga4_tracking_section ||= nil
error_items ||= nil

error_class = "govuk-form-group--error" if error_items
Expand Down Expand Up @@ -30,20 +29,17 @@
<div class="js-app-c-visual-editor__inset-text">
<%= render "govuk_publishing_components/components/inset_text", {
} do %>
<p class="govuk-body"><%= I18n.t("admin.visual_editor.exit.description").html_safe %></p>
<p class="govuk-body">Continue to edit in markdown if you have to add or format content that is not available.</p>
<p class="govuk-body">Visual Editor can only be used once per document and subsequent editing needs to be done in markdown.</p>
<p class="govuk-body">All changes made in Visual Editor will be saved when you press save and exit to markdown.</p>
<%= render "govuk_publishing_components/components/button", {
text: I18n.t("admin.visual_editor.exit.button"),
text: "Continue editing in markdown",
secondary_solid: true,
type: "button",
classes: "js-app-c-visual-editor__exit-button",
destructive: true,
data_attributes: {
"ga4-event": {
event_name: "visual_editor_exit",
type: "tabs",
text: I18n.t("admin.visual_editor.exit.button"),
section: ga4_tracking_section,
action: I18n.t("admin.visual_editor.exit.button"),
tool_name: "Visual Editor",
}.to_json,
},
Expand Down
11 changes: 0 additions & 11 deletions config/locales/en/admin/visual_editor.yml

This file was deleted.

2 changes: 1 addition & 1 deletion features/step_definitions/visual_editor_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
end

And(/^I exit the visual editor experience$/) do
click_on I18n.t("admin.visual_editor.exit.button")
click_on "Continue editing in markdown"
end

When(/^I edit a pre-existing publication$/) do
Expand Down

0 comments on commit c2ae68b

Please sign in to comment.