<% announcements =
 @coronavirus_page.announcements.order(:position).map do |announcement|
   {
     id: announcement.id,
     field: announcement.title,
     edit: { href: coronavirus_page_path(@coronavirus_page.slug) },
     delete: {
       href: coronavirus_page_path(@coronavirus_page.slug),
       data_attributes: {
         confirm: "Are you sure?",
         method: "delete"
       }
     }
   }
 end %>

<div class="covid-manage-page__announcements-summary-list">
  <%= render "govuk_publishing_components/components/summary_list", {
    title: "Announcements",
    items: announcements,
    edit: {
      link_text: "Reorder",
      href: reorder_coronavirus_page_announcements_path(@coronavirus_page.slug)
    }
  } %>

  <%= render "govuk_publishing_components/components/button", {
    text: "Add announcement",
    href: coronavirus_page_path(@coronavirus_page.slug)
  } %>
</div>

<% announcements =
 @coronavirus_page.announcements.order(:position).map do |announcement|
   {
     id: announcement.id,
     field: announcement.title,
     edit: { href: coronavirus_page_path(@coronavirus_page.slug) },
     delete: {
       href: coronavirus_page_path(@coronavirus_page.slug),
       data_attributes: {
         confirm: "Are you sure?",
         method: "delete"
       }
     }
   }
 end %>

<div class="covid-manage-page__announcements-summary-list">
  <%= render "govuk_publishing_components/components/summary_list", {
    title: "Announcements",
    items: announcements,
    edit: {
      link_text: "Reorder",
      href: reorder_coronavirus_page_announcements_path(@coronavirus_page.slug)
    }
  } %>
  <%= render "govuk_publishing_components/components/button", {
    text: "Add announcement",
    href: new_coronavirus_page_announcement_path(@coronavirus_page.slug)
  } %>
</div>

Change path on add announcement button
Change path on add announcement button

Button redirects to the new announcement path instead of refreshing landing page

Co-authored-by: Rosa Fox <7730dfe70100dfd32d4a03b4b554258d5d0f44a0@digital.cabinet-office.gov.uk>
