Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions app/components/admin/edition_images/image_component.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,6 @@
<div class="app-view-edition-resource__actions govuk-grid-column-full govuk-button-group govuk-!-margin-top-4">
<%= link_to("Edit details", edit_admin_edition_image_path(edition, image), class: "govuk-link govuk-!-margin-top-2 app-view-edition-resource__actions__link") %>
<%= link_to("Delete image", confirm_destroy_admin_edition_image_path(edition, image), class: "govuk-link gem-link--destructive govuk-!-margin-top-2 app-view-edition-resource__actions__link") %>

<% if can_be_used_as_case_study_lead_image? %>
<%= form_with url: admin_edition_lead_image_path(edition, image), method: :patch do |form| %>
<%= render "govuk_publishing_components/components/button", {
text: "Select as lead image",
secondary_solid: true,
margin_bottom: 4,
} %>
<% end %>
<% end %>
</div>
<% end %>
</li>
4 changes: 0 additions & 4 deletions app/components/admin/edition_images/image_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,4 @@ def image_markdown
def find_image_index
edition.images.find_index(image)
end

def can_be_used_as_case_study_lead_image?
edition.is_a?(CaseStudy) && image_usage.embeddable? && !image.svg? && !image.image_data.requires_crop?
end
end
64 changes: 0 additions & 64 deletions app/components/admin/edition_images/lead_image_component.html.erb

This file was deleted.

70 changes: 0 additions & 70 deletions app/components/admin/edition_images/lead_image_component.rb

This file was deleted.

26 changes: 0 additions & 26 deletions app/controllers/admin/case_studies_controller.rb

This file was deleted.

2 changes: 0 additions & 2 deletions app/controllers/admin/edition_images_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ def toggle_default_lead_image_behaviour
def destroy
filename = image.image_data.carrierwave_image
image.destroy!
@edition.update_lead_image if @edition.is_a?(CaseStudy) # Legacy: remove when CaseStudy migrated to StandardEdition
PublishingApiDocumentRepublishingJob.perform_async(@edition.document_id, false)

redirect_to admin_edition_images_path(@edition), notice: "#{filename} has been deleted"
Expand Down Expand Up @@ -98,7 +97,6 @@ def create

if @images.any? && @images.map(&:valid?).all?
@images.each(&:save)
@edition.update_lead_image if @edition.is_a?(CaseStudy) # Legacy: remove when CaseStudy migrated to StandardEdition
@edition.update!(image_display_option: nil) if @image_usage.key == "lead"
PublishingApiDocumentRepublishingJob.perform_async(@edition.document_id, false)
flash.notice = "Images successfully uploaded"
Expand Down
41 changes: 0 additions & 41 deletions app/controllers/admin/edition_lead_images_controller.rb

This file was deleted.

4 changes: 2 additions & 2 deletions app/controllers/admin/editions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class Admin::EditionsController < Admin::BaseController
before_action :clean_edition_parameters, only: %i[create update]
before_action :clear_scheduled_publication_if_not_activated, only: %i[create update]
before_action :clear_response_form_file_cache, only: %i[create update]
before_action :find_edition, only: %i[show edit update revise diff confirm_destroy destroy update_bypass_id update_image_display_option features]
before_action :find_edition, only: %i[show edit update revise diff confirm_destroy destroy update_bypass_id features]
before_action :prevent_modification_of_unmodifiable_edition, only: %i[update]
before_action :delete_absent_edition_organisations, only: %i[create update]
before_action :build_national_exclusion_params, only: %i[create update]
Expand All @@ -33,7 +33,7 @@ def enforce_permissions!
enforce_permission!(:create, edition_class || Edition)
when "create"
enforce_permission!(:create, @edition)
when "edit", "update", "revise", "diff", "update_bypass_id", "update_image_display_option", "features"
when "edit", "update", "revise", "diff", "update_bypass_id", "features"
enforce_permission!(:update, @edition)
when "destroy", "confirm_destroy"
enforce_permission!(:delete, @edition)
Expand Down
4 changes: 2 additions & 2 deletions app/helpers/admin/base_path_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module Admin::BasePathHelper
MAPPINGS = [
{ "CallForEvidence" => "/government/calls-for-evidence" },
{ "CaseStudy" => "/government/case-studies" },
{ "StandardEdition" => "/government/case-studies" },
{ "Consultation" => "/government/consultations" },
{ "DetailedGuide" => "/guidance" },
{ "DocumentCollection" => "/government/collections" },
Expand All @@ -20,7 +20,7 @@ module Admin::BasePathHelper
HTML_ATTACHMENT_PATH_REGEX = %r{
\A/government/
(?!statistics/announcements/) # exclude /government/statistics/announcements/...
[^/]+ # section (e.g. calls-for-evidence, publications, case-studies, etc.)
[^/]+ # section (e.g. calls-for-evidence, publications etc.)
/[^/]+ # document slug
/[^/]+ # attachment slug
\z
Expand Down
1 change: 0 additions & 1 deletion app/helpers/admin/edition_actions_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ def legacy_types_options(user)
legacy_classes.map { |edition_type|
next if edition_type == FatalityNotice && !user.can_handle_fatalities?
next if edition_type == PlanForChangeLandingPage && !user.gds_admin?
next if edition_type == CaseStudy

[edition_type.format_name.humanize.pluralize, edition_type.model_name.singular]
}.compact
Expand Down
1 change: 0 additions & 1 deletion app/helpers/admin/republishing_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ def bulk_content_type_metadata
def republishable_content_types
legacy_editionable_content_types = %w[
CallForEvidence
CaseStudy
Consultation
CorporateInformationPage
DetailedGuide
Expand Down
Loading