Storage location activity fixes [SCI-11145]

This commit is contained in:
Martin Artnik 2024-10-07 11:03:07 +02:00
parent 9c288c2021
commit ce287fa931
5 changed files with 12 additions and 4 deletions

View file

@ -131,7 +131,7 @@ class StorageLocationRepositoryRowsController < ApplicationController
.call(activity_type: type_of, .call(activity_type: type_of,
owner: current_user, owner: current_user,
team: @storage_location.team, team: @storage_location.team,
subject: @storage_location_repository_row.repository_row, subject: @storage_location_repository_row.storage_location,
message_items: { message_items: {
storage_location: @storage_location_repository_row.storage_location_id, storage_location: @storage_location_repository_row.storage_location_id,
repository_row: @storage_location_repository_row.repository_row_id, repository_row: @storage_location_repository_row.repository_row_id,

View file

@ -3,6 +3,7 @@
module GlobalActivitiesHelper module GlobalActivitiesHelper
include ActionView::Helpers::AssetTagHelper include ActionView::Helpers::AssetTagHelper
include ActionView::Helpers::UrlHelper include ActionView::Helpers::UrlHelper
include Canaid::Helpers::PermissionsHelper
include InputSanitizeHelper include InputSanitizeHelper
def generate_activity_content(activity, no_links: false, no_custom_links: false) def generate_activity_content(activity, no_links: false, no_custom_links: false)
@ -60,6 +61,9 @@ module GlobalActivitiesHelper
when Repository when Repository
path = repository_path(obj, team: obj.team.id) path = repository_path(obj, team: obj.team.id)
when RepositoryRow 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 return current_value unless obj.repository
path = repository_path(obj.repository, team: obj.repository.team.id) path = repository_path(obj.repository, team: obj.repository.team.id)
@ -127,6 +131,8 @@ module GlobalActivitiesHelper
message_item['type'].constantize.new message_item['type'].constantize.new
end 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('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? return I18n.t('storage_locations.index.breadcrumbs_root') if obj.is_a?(StorageLocation) && obj.new_record?

View file

@ -538,7 +538,7 @@ class Extends
team: [92, 94, 93, 97, 104, 244, 245], team: [92, 94, 93, 97, 104, 244, 245],
label_templates: [*216..219], label_templates: [*216..219],
storage_locations: [*309..315], storage_locations: [*309..315],
container_storage_location: [*316..322, 326], container_storage_locations: [*316..322, 326],
storage_location_repository_rows: [*323..325] storage_location_repository_rows: [*323..325]
} }

View file

@ -2180,6 +2180,7 @@ en:
errors: errors:
too_long: "Item name is too long (maximum is %{max_length} characters)" too_long: "Item name is too long (maximum is %{max_length} characters)"
is_empty: "Item name should be filled" 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 <a class=\"repository-save-changes-link\">save your changes</a> before you go to another page" pagination_edit_overlay_html: "Please <a class=\"repository-save-changes-link\">save your changes</a> before you go to another page"
toolbar_edit_overlay_html: "Please <a class=\"repository-save-changes-link\">save your changes</a> first to use filters" toolbar_edit_overlay_html: "Please <a class=\"repository-save-changes-link\">save your changes</a> first to use filters"
add_new_record: "New item" add_new_record: "New item"

View file

@ -650,8 +650,9 @@ en:
team: "Team" team: "Team"
exports: "Exports" exports: "Exports"
label_templates: "Label templates" label_templates: "Label templates"
storage_locations: "Locations" storage_locations: "Inventory locations"
container_storage_locations: "Boxes" container_storage_locations: "Inventory location boxes"
storage_location_repository_rows: "Item assignments to location"
subject_name: subject_name:
repository: "Inventory" repository: "Inventory"
project: "Project" project: "Project"