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
5dafb4a8
Commit
5dafb4a8
authored
5 years ago
by
piotr.kupczyk@id.ethz.ch
Browse files
Options
Downloads
Patches
Plain Diff
SSDM-7583 : ObjectTypeForm - automatically select an object that is being dragged
parent
8bb84447
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
openbis_ng_ui/src/js/components/types/objectType/ObjectTypePreview.jsx
+19
-2
19 additions, 2 deletions
.../src/js/components/types/objectType/ObjectTypePreview.jsx
with
19 additions
and
2 deletions
openbis_ng_ui/src/js/components/types/objectType/ObjectTypePreview.jsx
+
19
−
2
View file @
5dafb4a8
...
@@ -25,11 +25,23 @@ const styles = theme => ({
...
@@ -25,11 +25,23 @@ const styles = theme => ({
class
ObjectTypePreview
extends
React
.
PureComponent
{
class
ObjectTypePreview
extends
React
.
PureComponent
{
constructor
(
props
)
{
constructor
(
props
)
{
super
(
props
)
super
(
props
)
this
.
state
=
{}
this
.
handleDragStart
=
this
.
handleDragStart
.
bind
(
this
)
this
.
handleDragEnd
=
this
.
handleDragEnd
.
bind
(
this
)
this
.
handleDragEnd
=
this
.
handleDragEnd
.
bind
(
this
)
this
.
handleClick
=
this
.
handleClick
.
bind
(
this
)
this
.
handleClick
=
this
.
handleClick
.
bind
(
this
)
}
}
handleDragStart
(
start
)
{
this
.
setState
({
dragging
:
true
})
this
.
props
.
onSelectionChange
(
start
.
type
,
{
id
:
start
.
draggableId
})
}
handleDragEnd
(
result
)
{
handleDragEnd
(
result
)
{
this
.
setState
({
dragging
:
false
})
if
(
!
result
.
destination
)
{
if
(
!
result
.
destination
)
{
return
return
}
}
...
@@ -50,7 +62,9 @@ class ObjectTypePreview extends React.PureComponent {
...
@@ -50,7 +62,9 @@ class ObjectTypePreview extends React.PureComponent {
}
}
handleClick
()
{
handleClick
()
{
this
.
props
.
onSelectionChange
()
if
(
!
this
.
state
.
dragging
)
{
this
.
props
.
onSelectionChange
()
}
}
}
render
()
{
render
()
{
...
@@ -62,7 +76,10 @@ class ObjectTypePreview extends React.PureComponent {
...
@@ -62,7 +76,10 @@ class ObjectTypePreview extends React.PureComponent {
<
div
className
=
{
classes
.
container
}
onClick
=
{
this
.
handleClick
}
>
<
div
className
=
{
classes
.
container
}
onClick
=
{
this
.
handleClick
}
>
<
Typography
variant
=
'h6'
>
Form Preview
</
Typography
>
<
Typography
variant
=
'h6'
>
Form Preview
</
Typography
>
<
ObjectTypePreviewCode
type
=
{
type
}
/>
<
ObjectTypePreviewCode
type
=
{
type
}
/>
<
DragDropContext
onDragEnd
=
{
this
.
handleDragEnd
}
>
<
DragDropContext
onDragStart
=
{
this
.
handleDragStart
}
onDragEnd
=
{
this
.
handleDragEnd
}
>
<
Droppable
droppableId
=
'root'
type
=
'section'
>
<
Droppable
droppableId
=
'root'
type
=
'section'
>
{
provided
=>
(
{
provided
=>
(
<
div
<
div
...
...
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