Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
jupyter-openbis-gui-widget
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
openbis
openbis-public
jupyter
jupyter-openbis-gui-widget
Commits
ea7b9c66
Commit
ea7b9c66
authored
6 years ago
by
anttil
Browse files
Options
Downloads
Patches
Plain Diff
Remember checkbox states in upload dialog
parent
7c35f077
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
jupyter-openbis-extension/static/state.js
+4
-2
4 additions, 2 deletions
jupyter-openbis-extension/static/state.js
jupyter-openbis-extension/static/uploadDIalog.js
+9
-6
9 additions, 6 deletions
jupyter-openbis-extension/static/uploadDIalog.js
with
13 additions
and
8 deletions
jupyter-openbis-extension/static/state.js
+
4
−
2
View file @
ea7b9c66
...
@@ -8,8 +8,10 @@ define([],
...
@@ -8,8 +8,10 @@ define([],
uploadDataSetType
:
null
,
uploadDataSetType
:
null
,
uploadDataSetTypes
:
{},
uploadDataSetTypes
:
{},
uploadEntityIdentifier
:
''
,
uploadEntityIdentifier
:
''
,
getSelectedDataSets
:
()
=>
[],
datasetCheckboxes
:
[],
getSelectedFiles
:
()
=>
[]
fileCheckboxes
:
[],
selectedFiles
:
[],
unselectedDatasets
:
[]
}
}
}
}
)
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
jupyter-openbis-extension/static/uploadDIalog.js
+
9
−
6
View file @
ea7b9c66
...
@@ -40,7 +40,7 @@ define([
...
@@ -40,7 +40,7 @@ define([
.
then
(
function
(
data
){
.
then
(
function
(
data
){
var
values
=
Object
.
keys
(
data
.
files
)
var
values
=
Object
.
keys
(
data
.
files
)
values
.
sort
()
values
.
sort
()
state
.
getSelectedFil
es
=
createSelectTable
(
values
,
container
,
false
)
state
.
fileCheckbox
es
=
createSelectTable
(
values
,
container
,
false
,
state
.
selectedFiles
)
})
})
}
}
else
{
else
{
...
@@ -55,7 +55,7 @@ define([
...
@@ -55,7 +55,7 @@ define([
if
(
datasets
!=
null
)
{
if
(
datasets
!=
null
)
{
var
values
=
Object
.
keys
(
datasets
)
var
values
=
Object
.
keys
(
datasets
)
values
.
sort
()
values
.
sort
()
state
.
getSelectedD
ata
S
ets
=
createSelectTable
(
values
,
container
,
true
)
state
.
d
ata
s
et
Checkboxe
s
=
createSelectTable
(
values
,
container
,
true
,
state
.
unselectedDatasets
)
}
}
}
}
...
@@ -156,7 +156,7 @@ define([
...
@@ -156,7 +156,7 @@ define([
})
})
}
}
function
createSelectTable
(
values
,
container
,
checked
)
{
function
createSelectTable
(
values
,
container
,
checked
,
overrides
)
{
var
table
=
document
.
createElement
(
"
TABLE
"
)
var
table
=
document
.
createElement
(
"
TABLE
"
)
table
.
className
=
'
table-bordered table-striped table-condensed
'
table
.
className
=
'
table-bordered table-striped table-condensed
'
...
@@ -170,7 +170,7 @@ define([
...
@@ -170,7 +170,7 @@ define([
var
checkbox
=
document
.
createElement
(
"
INPUT
"
)
var
checkbox
=
document
.
createElement
(
"
INPUT
"
)
checkbox
.
type
=
"
checkbox
"
checkbox
.
type
=
"
checkbox
"
checkbox
.
value
=
value
checkbox
.
value
=
value
checkbox
.
checked
=
checked
checkbox
.
checked
=
overrides
.
includes
(
value
)
?
!
checked
:
checked
checkboxes
.
push
(
checkbox
)
checkboxes
.
push
(
checkbox
)
row
.
insertCell
().
appendChild
(
checkbox
)
row
.
insertCell
().
appendChild
(
checkbox
)
var
valueCell
=
row
.
insertCell
()
var
valueCell
=
row
.
insertCell
()
...
@@ -179,7 +179,7 @@ define([
...
@@ -179,7 +179,7 @@ define([
})
})
container
.
appendChild
(
table
)
container
.
appendChild
(
table
)
return
()
=>
checkboxes
.
filter
(
cb
=>
cb
.
checked
).
map
(
cb
=>
cb
.
value
)
return
checkboxes
}
}
return
{
return
{
...
@@ -255,6 +255,8 @@ define([
...
@@ -255,6 +255,8 @@ define([
}
}
}
}
state
.
uploadEntityIdentifier
=
sampleIdentifier
.
value
state
.
uploadEntityIdentifier
=
sampleIdentifier
.
value
state
.
unselectedDatasets
=
state
.
datasetCheckboxes
.
filter
(
cb
=>
!
cb
.
checked
).
map
(
cb
=>
cb
.
value
)
state
.
selectedFiles
=
state
.
fileCheckboxes
.
filter
(
cb
=>
cb
.
checked
).
map
(
cb
=>
cb
.
value
)
}
}
function
onOk
()
{
function
onOk
()
{
...
@@ -268,7 +270,7 @@ define([
...
@@ -268,7 +270,7 @@ define([
var
uploadUrl
=
env
.
notebook
.
base_url
+
'
openbis/dataset/
'
+
connection_name
var
uploadUrl
=
env
.
notebook
.
base_url
+
'
openbis/dataset/
'
+
connection_name
var
notebook
=
IPython
.
notebook
var
notebook
=
IPython
.
notebook
var
files
=
state
.
getSel
ec
t
ed
Files
(
)
var
files
=
state
.
fileCheckboxes
.
filter
(
cb
=>
cb
.
ch
ec
k
ed
).
map
(
cb
=>
cb
.
value
)
var
re
=
/
\/
notebooks
\/(
.*
?)
$/
var
re
=
/
\/
notebooks
\/(
.*
?)
$/
var
filepath
=
window
.
location
.
pathname
.
match
(
re
)[
1
]
var
filepath
=
window
.
location
.
pathname
.
match
(
re
)[
1
]
files
.
push
(
filepath
)
files
.
push
(
filepath
)
...
@@ -281,6 +283,7 @@ define([
...
@@ -281,6 +283,7 @@ define([
var
dataSetInfo
=
{
var
dataSetInfo
=
{
"
type
"
:
dataset_types
.
value
,
"
type
"
:
dataset_types
.
value
,
"
files
"
:
files
,
"
files
"
:
files
,
"
parents
"
:
state
.
datasetCheckboxes
.
filter
(
cb
=>
cb
.
checked
).
map
(
cb
=>
cb
.
value
),
"
sampleIdentifier
"
:
sampleIdentifier
.
value
,
"
sampleIdentifier
"
:
sampleIdentifier
.
value
,
"
props
"
:
props
"
props
"
:
props
}
}
...
...
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