diff --git a/app/controllers/storage_location_repository_rows_controller.rb b/app/controllers/storage_location_repository_rows_controller.rb index 8aa723387..31d7642b9 100644 --- a/app/controllers/storage_location_repository_rows_controller.rb +++ b/app/controllers/storage_location_repository_rows_controller.rb @@ -131,7 +131,7 @@ class StorageLocationRepositoryRowsController < ApplicationController .call(activity_type: type_of, owner: current_user, team: @storage_location.team, - subject: @storage_location_repository_row.repository_row, + subject: @storage_location_repository_row.storage_location, message_items: { storage_location: @storage_location_repository_row.storage_location_id, repository_row: @storage_location_repository_row.repository_row_id, diff --git a/app/helpers/global_activities_helper.rb b/app/helpers/global_activities_helper.rb index 17aecb5a2..af945712a 100644 --- a/app/helpers/global_activities_helper.rb +++ b/app/helpers/global_activities_helper.rb @@ -3,6 +3,7 @@ module GlobalActivitiesHelper include ActionView::Helpers::AssetTagHelper include ActionView::Helpers::UrlHelper + include Canaid::Helpers::PermissionsHelper include InputSanitizeHelper def generate_activity_content(activity, no_links: false, no_custom_links: false) @@ -60,6 +61,9 @@ module GlobalActivitiesHelper when Repository path = repository_path(obj, team: obj.team.id) when RepositoryRow + # Handle private repository rows + return I18n.t('storage_locations.show.hidden') unless can_read_repository?(obj.repository) + return current_value unless obj.repository path = repository_path(obj.repository, team: obj.repository.team.id) @@ -127,6 +131,8 @@ module GlobalActivitiesHelper message_item['type'].constantize.new end + return I18n.t('storage_locations.show.hidden') if obj.is_a?(RepositoryRow) && !can_read_repository?(obj.repository) + return I18n.t('projects.index.breadcrumbs_root') if obj.is_a?(ProjectFolder) && obj.new_record? return I18n.t('storage_locations.index.breadcrumbs_root') if obj.is_a?(StorageLocation) && obj.new_record? diff --git a/config/initializers/extends.rb b/config/initializers/extends.rb index feee64791..8a4a4b76c 100644 --- a/config/initializers/extends.rb +++ b/config/initializers/extends.rb @@ -538,7 +538,7 @@ class Extends team: [92, 94, 93, 97, 104, 244, 245], label_templates: [*216..219], storage_locations: [*309..315], - container_storage_location: [*316..322, 326], + container_storage_locations: [*316..322, 326], storage_location_repository_rows: [*323..325] } diff --git a/config/locales/en.yml b/config/locales/en.yml index 2b3bdd0aa..9b0de4dad 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -2180,6 +2180,7 @@ en: errors: too_long: "Item name is too long (maximum is %{max_length} characters)" is_empty: "Item name should be filled" + row_locked: The item is locked, snapshot creation is in progress. Please try later. pagination_edit_overlay_html: "Please save your changes before you go to another page" toolbar_edit_overlay_html: "Please save your changes first to use filters" add_new_record: "New item" diff --git a/config/locales/global_activities/en.yml b/config/locales/global_activities/en.yml index a34665149..6d1a470a1 100644 --- a/config/locales/global_activities/en.yml +++ b/config/locales/global_activities/en.yml @@ -650,8 +650,9 @@ en: team: "Team" exports: "Exports" label_templates: "Label templates" - storage_locations: "Locations" - container_storage_locations: "Boxes" + storage_locations: "Inventory locations" + container_storage_locations: "Inventory location boxes" + storage_location_repository_rows: "Item assignments to location" subject_name: repository: "Inventory" project: "Project"