mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-10-08 21:06:24 +08:00
Merge pull request #7912 from aignatov-bio/ai-sci-11131-hide-archived-rows-from-storage-location-assignment
Hide archived rows and repositories in storage locations assignment modal [SCI-11131]
This commit is contained in:
commit
56c23a8e8f
2 changed files with 8 additions and 5 deletions
|
@ -44,11 +44,12 @@ class RepositoriesController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def list
|
def list
|
||||||
results = @repositories
|
results = @repositories.select(:id, :name, 'LOWER(repositories.name)')
|
||||||
results = results.name_like(params[:query]) if params[:query].present?
|
results = results.name_like(params[:query]) if params[:query].present?
|
||||||
results = results.joins(:repository_rows).distinct if params[:non_empty].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
|
end
|
||||||
|
|
||||||
def rows_list
|
def rows_list
|
||||||
|
@ -59,7 +60,9 @@ class RepositoriesController < ApplicationController
|
||||||
params[:query]
|
params[:query]
|
||||||
)
|
)
|
||||||
end
|
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
|
end
|
||||||
|
|
||||||
def sidebar
|
def sidebar
|
||||||
|
|
|
@ -48,14 +48,14 @@ export default {
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
repositoriesUrl() {
|
repositoriesUrl() {
|
||||||
return list_team_repositories_path(this.teamId, { non_empty: true });
|
return list_team_repositories_path(this.teamId, { non_empty: true, active: true });
|
||||||
},
|
},
|
||||||
rowsUrl() {
|
rowsUrl() {
|
||||||
if (!this.selectedRepository) {
|
if (!this.selectedRepository) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return rows_list_team_repositories_path(this.teamId);
|
return rows_list_team_repositories_path(this.teamId, { active: true });
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue