Skip to content

Commit

Permalink
Rename Hyrax.collection.browse_view to edit_view & update value
Browse files Browse the repository at this point in the history
This view is more properly called the 'Edit View' and that should be reflected
in the breadcrumbs. The i18n key was previously also `browse_view` and changing
it to `edit_view` helps ensure translations get updated.

Fixes #2164.
  • Loading branch information
Tom Johnson committed Sep 24, 2019
1 parent 607f13a commit 493967a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def add_breadcrumb_for_controller
def add_breadcrumb_for_action
case action_name
when 'edit'.freeze
add_breadcrumb I18n.t("hyrax.collection.browse_view"), collection_path(params["id"]), mark_active_action
add_breadcrumb I18n.t("hyrax.collection.edit_view"), collection_path(params["id"]), mark_active_action
when 'show'.freeze
add_breadcrumb presenter.to_s, polymorphic_path(presenter), mark_active_action
end
Expand Down
1 change: 1 addition & 0 deletions config/locales/hyrax.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,7 @@ en:
no_visible_works: The collection is either empty or does not contain items to which you have access.
edit:
manage_items: Manage Items in this Collection
edit_view: Edit View
form:
additional_fields: Additional fields
description: Descriptions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@
expect(controller).to receive(:add_breadcrumb).with('Home', Hyrax::Engine.routes.url_helpers.root_path(locale: 'en'))
expect(controller).to receive(:add_breadcrumb).with('Dashboard', Hyrax::Engine.routes.url_helpers.dashboard_path(locale: 'en'))
expect(controller).to receive(:add_breadcrumb).with('Collections', Hyrax::Engine.routes.url_helpers.my_collections_path(locale: 'en'))
expect(controller).to receive(:add_breadcrumb).with(I18n.t("hyrax.collection.browse_view"), collection_path(collection.id, locale: 'en'), "aria-current" => "page")
expect(controller).to receive(:add_breadcrumb).with(I18n.t("hyrax.collection.edit_view"), collection_path(collection.id, locale: 'en'), "aria-current" => "page")
get :edit, params: { id: collection }
expect(response).to be_successful
end
Expand All @@ -506,7 +506,7 @@
expect(controller).to receive(:add_breadcrumb).with('Home', Hyrax::Engine.routes.url_helpers.root_path(locale: 'en'))
expect(controller).to receive(:add_breadcrumb).with('Dashboard', Hyrax::Engine.routes.url_helpers.dashboard_path(locale: 'en'))
expect(controller).to receive(:add_breadcrumb).with('Collections', Hyrax::Engine.routes.url_helpers.my_collections_path(locale: 'en'))
expect(controller).to receive(:add_breadcrumb).with(I18n.t("hyrax.collection.browse_view"), collection_path(collection.id, locale: 'en'), "aria-current" => "page")
expect(controller).to receive(:add_breadcrumb).with(I18n.t("hyrax.collection.edit_view"), collection_path(collection.id, locale: 'en'), "aria-current" => "page")
get :edit, params: { id: collection }
expect(response).to be_successful
end
Expand Down

0 comments on commit 493967a

Please sign in to comment.