mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-10-06 20:05:55 +08:00
Merge pull request #8312 from aignatov-bio/ai-sci-11700-fix-override-position-of-private-items
Small fixes for storage locations [SCI-11700][SCI-11699][SCI-11702]
This commit is contained in:
commit
cceb43ed6e
4 changed files with 13 additions and 13 deletions
|
@ -24,14 +24,13 @@
|
||||||
:class="{ '!border-t-sn-grey': cell.row === 0, '!border-l-sn-grey': cell.column === 0 }"
|
:class="{ '!border-t-sn-grey': cell.row === 0, '!border-l-sn-grey': cell.column === 0 }"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="h-full w-full rounded-full items-center flex justify-center"
|
class="h-full w-full rounded-full items-center flex justify-center cursor-pointer"
|
||||||
@click="selectPosition(cell)"
|
@click="selectPosition(cell)"
|
||||||
:class="{
|
:class="{
|
||||||
'bg-sn-background-green': cellIsOccupied(cell),
|
'bg-sn-background-green': cellIsOccupied(cell),
|
||||||
'bg-sn-grey-100': cellIsHidden(cell),
|
'bg-sn-grey-100': cellIsHidden(cell),
|
||||||
'bg-white': cellIsAvailable(cell),
|
'bg-white': cellIsAvailable(cell),
|
||||||
'bg-white border-sn-science-blue border-solid border-[1px]': cellIsSelected(cell),
|
'bg-white border-sn-science-blue border-solid border-[1px]': cellIsSelected(cell),
|
||||||
'cursor-pointer': !cellIsHidden(cell)
|
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<template v-if="cellIsHidden(cell)">
|
<template v-if="cellIsHidden(cell)">
|
||||||
|
@ -119,21 +118,17 @@ export default {
|
||||||
return !this.cellIsOccupied(cell) && !this.cellIsHidden(cell);
|
return !this.cellIsOccupied(cell) && !this.cellIsHidden(cell);
|
||||||
},
|
},
|
||||||
selectPosition(cell) {
|
selectPosition(cell) {
|
||||||
if (this.cellIsOccupied(cell)) {
|
if (this.cellIsOccupied(cell) || this.cellIsHidden(cell)) {
|
||||||
this.$emit('select', this.cellObject(cell));
|
this.$emit('select', this.cellObject(cell));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.cellIsHidden(cell)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.$emit('selectEmptyCell', cell);
|
this.$emit('selectEmptyCell', cell);
|
||||||
},
|
},
|
||||||
selectRow(row) {
|
selectRow(row) {
|
||||||
this.columnsList.forEach((column) => {
|
this.columnsList.forEach((column) => {
|
||||||
const cell = { row: this.rowsList.indexOf(row), column: column - 1 };
|
const cell = { row: this.rowsList.indexOf(row), column: column - 1 };
|
||||||
if (!this.cellIsSelected(cell) && !this.cellIsOccupied(cell)) {
|
if (!this.cellIsSelected(cell) && !this.cellIsOccupied(cell) && !this.cellIsHidden(cell)) {
|
||||||
this.$emit('selectEmptyCell', cell);
|
this.$emit('selectEmptyCell', cell);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -141,7 +136,7 @@ export default {
|
||||||
selectColumn(column) {
|
selectColumn(column) {
|
||||||
this.rowsList.forEach((row) => {
|
this.rowsList.forEach((row) => {
|
||||||
const cell = { row: this.rowsList.indexOf(row), column: column - 1 };
|
const cell = { row: this.rowsList.indexOf(row), column: column - 1 };
|
||||||
if (!this.cellIsSelected(cell) && !this.cellIsOccupied(cell)) {
|
if (!this.cellIsSelected(cell) && !this.cellIsOccupied(cell) && !this.cellIsHidden(cell)) {
|
||||||
this.$emit('selectEmptyCell', cell);
|
this.$emit('selectEmptyCell', cell);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -52,7 +52,7 @@
|
||||||
{{ i18n.t(`storage_locations.show.assign_modal.move_description`, { name: selectedRowName }) }}
|
{{ i18n.t(`storage_locations.show.assign_modal.move_description`, { name: selectedRowName }) }}
|
||||||
</h4>
|
</h4>
|
||||||
<p v-else class="mb-4">
|
<p v-else class="mb-4">
|
||||||
{{ i18n.t(`storage_locations.show.assign_modal.assign_description`) }}
|
{{ i18n.t(`storage_locations.show.assign_modal.assign_description`, { number: selectedPositions.length } )}}
|
||||||
</p>
|
</p>
|
||||||
<RowSelector v-if="!selectedRow" @change="this.rowId = $event" class="mb-4"></RowSelector>
|
<RowSelector v-if="!selectedRow" @change="this.rowId = $event" class="mb-4"></RowSelector>
|
||||||
<ContainerSelector v-if="!selectedContainer" @change="this.containerId = $event"></ContainerSelector>
|
<ContainerSelector v-if="!selectedContainer" @change="this.containerId = $event"></ContainerSelector>
|
||||||
|
@ -117,7 +117,12 @@ export default {
|
||||||
formattedPosition() {
|
formattedPosition() {
|
||||||
if (this.selectedPositions.length > 0) {
|
if (this.selectedPositions.length > 0) {
|
||||||
const pos = [];
|
const pos = [];
|
||||||
this.selectedPositions.forEach((p) => {
|
this.selectedPositions.sort((a, b) => {
|
||||||
|
if (a[0] === b[0]) {
|
||||||
|
return a[1] - b[1];
|
||||||
|
}
|
||||||
|
return a[0] - b[0];
|
||||||
|
}).forEach((p) => {
|
||||||
pos.push(String.fromCharCode(96 + parseInt(p[0], 10)).toUpperCase() + p[1]);
|
pos.push(String.fromCharCode(96 + parseInt(p[0], 10)).toUpperCase() + p[1]);
|
||||||
});
|
});
|
||||||
return pos.join(', ');
|
return pos.join(', ');
|
||||||
|
|
|
@ -81,7 +81,7 @@ class StorageLocation < ApplicationRecord
|
||||||
url = if container
|
url = if container
|
||||||
storage_location_path(id)
|
storage_location_path(id)
|
||||||
else
|
else
|
||||||
storage_locations_path(parent_id: root? ? nil : parent_id)
|
storage_locations_path(parent_id: id)
|
||||||
end
|
end
|
||||||
|
|
||||||
return [{ name: (readable ? name : code), url: url }] if root?
|
return [{ name: (readable ? name : code), url: url }] if root?
|
||||||
|
|
|
@ -2840,7 +2840,7 @@ en:
|
||||||
selected_row_title: 'Assign new location'
|
selected_row_title: 'Assign new location'
|
||||||
assign_title: 'Assign position'
|
assign_title: 'Assign position'
|
||||||
move_title: 'Move %{name}'
|
move_title: 'Move %{name}'
|
||||||
assign_description: 'Select an item to assign it to a location.'
|
assign_description: 'Select an item to assign it to a %{number} location(s).'
|
||||||
move_description: 'Select where you want to move %{name}.'
|
move_description: 'Select where you want to move %{name}.'
|
||||||
selected_row_description: "Select a location for the item %{name}."
|
selected_row_description: "Select a location for the item %{name}."
|
||||||
assign_action: 'Assign'
|
assign_action: 'Assign'
|
||||||
|
|
Loading…
Add table
Reference in a new issue