From 759fd30747e98bafbb3ce3f635235bee7568c154 Mon Sep 17 00:00:00 2001 From: Anton Date: Thu, 26 Sep 2024 13:55:31 +0200 Subject: [PATCH] Add team switch to storage locations [SCI-11097] --- app/controllers/storage_locations_controller.rb | 2 ++ app/serializers/concerns/breadcrumbs_helper.rb | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/controllers/storage_locations_controller.rb b/app/controllers/storage_locations_controller.rb index dd1c1630f..57029543e 100644 --- a/app/controllers/storage_locations_controller.rb +++ b/app/controllers/storage_locations_controller.rb @@ -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) diff --git a/app/serializers/concerns/breadcrumbs_helper.rb b/app/serializers/concerns/breadcrumbs_helper.rb index 96112bc2f..c28da89f3 100644 --- a/app/serializers/concerns/breadcrumbs_helper.rb +++ b/app/serializers/concerns/breadcrumbs_helper.rb @@ -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