Merge pull request #7876 from aignatov-bio/ai-sci-11077-container-move-not-working

Storage locations box fixes [SCI-11077][SCI-11078][SCI-11080]
This commit is contained in:
aignatov-bio 2024-09-23 17:57:24 +02:00 committed by GitHub
commit 01b585ebda
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 45 additions and 30 deletions

View file

@ -46,6 +46,8 @@ class RepositoriesController < ApplicationController
def list
results = @repositories
results = results.name_like(params[:query]) if params[:query].present?
results = results.joins(:repository_rows).distinct if params[:non_empty].present?
render json: { data: results.map { |r| [r.id, r.name] } }
end

View file

@ -125,34 +125,43 @@ export default {
},
columnDefs() {
const columns = [{
field: 'position_formatted',
headerName: this.i18n.t('storage_locations.show.table.position'),
sortable: true,
cellClass: 'text-sn-blue cursor-pointer'
},
{
field: 'reminders',
headerName: this.i18n.t('storage_locations.show.table.reminders'),
sortable: false,
cellRenderer: RemindersRender
},
{
field: 'row_id',
headerName: this.i18n.t('storage_locations.show.table.row_id'),
sortable: true
},
{
field: 'row_name',
headerName: this.i18n.t('storage_locations.show.table.row_name'),
sortable: true,
cellRenderer: ItemNameRenderer
},
{
field: 'stock',
headerName: this.i18n.t('storage_locations.show.table.stock'),
sortable: false
}];
let columns = [];
if (this.withGrid) {
columns.push({
field: 'position_formatted',
headerName: this.i18n.t('storage_locations.show.table.position'),
sortable: true,
cellClass: 'text-sn-blue cursor-pointer'
});
}
columns = columns.concat(
[
{
field: 'reminders',
headerName: this.i18n.t('storage_locations.show.table.reminders'),
sortable: false,
cellRenderer: RemindersRender
},
{
field: 'row_code',
headerName: this.i18n.t('storage_locations.show.table.row_id'),
sortable: true
},
{
field: 'row_name',
headerName: this.i18n.t('storage_locations.show.table.row_name'),
sortable: true,
cellRenderer: ItemNameRenderer
},
{
field: 'stock',
headerName: this.i18n.t('storage_locations.show.table.stock'),
sortable: false
}
]
);
return columns;
},

View file

@ -48,7 +48,7 @@ export default {
},
computed: {
repositoriesUrl() {
return list_team_repositories_path(this.teamId);
return list_team_repositories_path(this.teamId, { non_empty: true });
},
rowsUrl() {
if (!this.selectedRepository) {

View file

@ -6,9 +6,13 @@ module Lists
include Rails.application.routes.url_helpers
attributes :created_by, :created_on, :position, :row_id, :row_name, :hidden, :position_formatted, :stock,
:have_reminders, :reminders_url, :row_url
:have_reminders, :reminders_url, :row_url, :row_code
def row_id
object.repository_row.id
end
def row_code
object.repository_row.code
end