diff --git a/app/controllers/storage_locations_controller.rb b/app/controllers/storage_locations_controller.rb index 3bae95dd8..7a21c38c1 100644 --- a/app/controllers/storage_locations_controller.rb +++ b/app/controllers/storage_locations_controller.rb @@ -9,6 +9,7 @@ class StorageLocationsController < ApplicationController 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 :set_inline_name_editing, only: %i(show) before_action :check_read_permissions, except: %i(index create tree actions_toolbar import_container unassign_rows) before_action :check_manage_repository_rows_permissions, only: %i(import_container unassign_rows) before_action :check_create_permissions, only: :create @@ -20,6 +21,8 @@ class StorageLocationsController < ApplicationController render_403 if @parent_location && !can_read_storage_location?(@parent_location) + set_inline_name_editing + respond_to do |format| format.html format.json do @@ -311,6 +314,20 @@ class StorageLocationsController < ApplicationController ) end + def set_inline_name_editing + location = @storage_location || @parent_location + + if location + @inline_editable_title_config = { + name: 'title', + params_group: nil, + item_id: location.id, + field_to_udpate: 'name', + path_to_update: storage_location_path(location) + } + end + end + def log_unassign_activities @storage_location_repository_rows.each do |storage_location_repository_row| Activities::CreateActivityService diff --git a/app/views/storage_locations/index.html.erb b/app/views/storage_locations/index.html.erb index 110898cbf..54d9156a6 100644 --- a/app/views/storage_locations/index.html.erb +++ b/app/views/storage_locations/index.html.erb @@ -5,7 +5,19 @@