mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-15 05:34:53 +08:00
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:
commit
01b585ebda
4 changed files with 45 additions and 30 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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;
|
||||
},
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue