Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openbis
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sispub
openbis
Commits
7ef7ceb4
Commit
7ef7ceb4
authored
3 years ago
by
Juan Fuentes
Browse files
Options
Downloads
Patches
Plain Diff
SSDM-11855 : Only move to storages from the same group (same space)
parent
7c5f9844
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/widgets/StorageListView.js
+18
-4
18 additions, 4 deletions
...-lims/html/js/views/SampleForm/widgets/StorageListView.js
with
18 additions
and
4 deletions
openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/widgets/StorageListView.js
+
18
−
4
View file @
7ef7ceb4
...
...
@@ -232,15 +232,29 @@ function StorageListView(storageListController, storageListModel) {
var
storageContainer
=
$
(
"
#storage-pop-up-container
"
);
storageController
.
getView
().
repaint
(
storageContainer
,
function
()
{
storageContainer
.
append
(
containerButtons
);
if
(
!
sampleChild
.
newSampleJustCreated
)
{
//Restrict storages to the ones the created group
var
storageToDropdown
=
storageController
.
getView
().
getStoragesDropdown
();
var
selectedSpace
=
IdentifierUtil
.
getSpaceCodeFromIdentifier
(
sampleChild
.
identifier
);
// Show/hide storages from Storage To based on the one from the sample
for
(
var
sIdx
=
0
;
sIdx
<
storageToDropdown
[
0
].
childNodes
.
length
;
sIdx
++
)
{
var
spaceCode
=
storageToDropdown
[
0
].
childNodes
[
sIdx
].
attributes
.
spaceCode
;
var
show
=
spaceCode
&&
spaceCode
.
value
===
selectedSpace
;
storageToDropdown
[
0
].
childNodes
[
sIdx
].
disabled
=
!
show
;
}
}
$
(
"
#storage-accept
"
).
on
(
"
click
"
,
function
(
event
)
{
storageController
.
isValid
(
function
(
isValid
)
{
if
(
isValid
)
{
// 1. Find the Space of the selected storage
var
spaceCode
=
storageController
.
getModel
().
storageConfig
.
spaceCode
;
// 2. Update the Space the sample belongs to and with that the storage
sampleChild
.
identifier
=
IdentifierUtil
.
getSampleIdentifier
(
spaceCode
,
null
,
sampleChild
.
code
);
delete
sampleChild
.
newSampleJustCreated
;
// 2. Set the Space the sample belongs to and with that the storage
if
(
sampleChild
.
newSampleJustCreated
)
{
sampleChild
.
identifier
=
IdentifierUtil
.
getSampleIdentifier
(
spaceCode
,
null
,
sampleChild
.
code
);
delete
sampleChild
.
newSampleJustCreated
;
}
else
{
// On update the identifier should be set, fail if not
}
Util
.
unblockUI
();
_this
.
_dataGrid
.
refresh
();
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment