Hide archived rows and repositories in storage locations assignment modal [SCI-11131]

This commit is contained in:
Anton 2024-10-02 11:48:25 +02:00
parent 5ab1fbbab9
commit f03f22fd8a
2 changed files with 8 additions and 5 deletions

View file

@ -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

View file

@ -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() {