From c760b215deeaa447ea00a55fedfed136eb07b61d Mon Sep 17 00:00:00 2001 From: Anton Date: Wed, 2 Oct 2024 12:14:18 +0200 Subject: [PATCH] Storage locations fix name ordering and move modal ordering [SCI-11133] --- app/controllers/storage_locations_controller.rb | 2 +- app/services/lists/storage_locations_service.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/storage_locations_controller.rb b/app/controllers/storage_locations_controller.rb index 965d766a0..d9f81cba5 100644 --- a/app/controllers/storage_locations_controller.rb +++ b/app/controllers/storage_locations_controller.rb @@ -253,7 +253,7 @@ class StorageLocationsController < ApplicationController end def storage_locations_recursive_builder(storage_locations) - storage_locations.map do |storage_location| + storage_locations.order('LOWER(storage_locations.name) ASC').map do |storage_location| { storage_location: storage_location, can_manage: (can_manage_storage_location?(storage_location) unless storage_location.parent_id), diff --git a/app/services/lists/storage_locations_service.rb b/app/services/lists/storage_locations_service.rb index ca1c6b77b..a1300ee09 100644 --- a/app/services/lists/storage_locations_service.rb +++ b/app/services/lists/storage_locations_service.rb @@ -60,9 +60,9 @@ module Lists @records = @records.order(id: :asc) when 'code_DESC' @records = @records.order(id: :desc) - when 'name_ASC' + when 'name_hash_ASC' @records = @records.order(name: :asc) - when 'name_DESC' + when 'name_hash_DESC' @records = @records.order(name: :desc) when 'sub_location_count_ASC' @records = @records.order(sub_location_count: :asc)