diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 65a831092..5f41d3a0a 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -44,11 +44,12 @@ class RepositoriesController < ApplicationController end def list - results = @repositories + results = @repositories.select(:id, :name, 'LOWER(repositories.name)') results = results.name_like(params[:query]) if params[:query].present? results = results.joins(:repository_rows).distinct if params[:non_empty].present? + results = results.active if params[:active].present? - render json: { data: results.map { |r| [r.id, r.name] } } + render json: { data: results.order('LOWER(repositories.name) asc').map { |r| [r.id, r.name] } } end def rows_list @@ -59,7 +60,9 @@ class RepositoriesController < ApplicationController params[:query] ) end - render json: { data: results.map { |r| [r.id, r.name] } } + results = results.active if params[:active].present? + + render json: { data: results.order('LOWER(repository_rows.name) asc').map { |r| [r.id, r.name] } } end def sidebar diff --git a/app/javascript/vue/storage_locations/modals/assign/row_selector.vue b/app/javascript/vue/storage_locations/modals/assign/row_selector.vue index ac26f07ea..2ae417099 100644 --- a/app/javascript/vue/storage_locations/modals/assign/row_selector.vue +++ b/app/javascript/vue/storage_locations/modals/assign/row_selector.vue @@ -48,14 +48,14 @@ export default { }, computed: { repositoriesUrl() { - return list_team_repositories_path(this.teamId, { non_empty: true }); + return list_team_repositories_path(this.teamId, { non_empty: true, active: true }); }, rowsUrl() { if (!this.selectedRepository) { return null; } - return rows_list_team_repositories_path(this.teamId); + return rows_list_team_repositories_path(this.teamId, { active: true }); } }, data() {