Merge pull request #7888 from aignatov-bio/ai-sci-11097-fix-team-switch-in-storage-locations

Add team switch to storage locations [SCI-11097]
This commit is contained in:
aignatov-bio 2024-09-26 14:23:40 +02:00 committed by GitHub
commit 6b42ea9cb1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View file

@ -3,8 +3,10 @@
class StorageLocationsController < ApplicationController
include ActionView::Helpers::TextHelper
include ApplicationHelper
include TeamsHelper
include Rails.application.routes.url_helpers
before_action :switch_team_with_param, only: %i(index show)
before_action :check_storage_locations_enabled, except: :unassign_rows
before_action :load_storage_location, only: %i(update destroy duplicate move show available_positions unassign_rows export_container import_container)
before_action :check_read_permissions, except: %i(index create tree actions_toolbar)

View file

@ -62,9 +62,9 @@ module BreadcrumbsHelper
when StorageLocation
parent = subject.team
url = if subject.container
storage_location_path(subject)
storage_location_path(subject, team: subject.team_id)
else
storage_locations_path(parent_id: subject.id)
storage_locations_path(parent_id: subject.id, team: subject.team_id)
end
when Team
parent = nil