Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
05236934
Commit
05236934
authored
Nov 05, 2020
by
Florie Guibert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Swimlanes - Fix grabbing cursor on drag
parent
7472a375
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
0 deletions
+55
-0
ee/app/assets/javascripts/boards/components/issues_lane_list.vue
...assets/javascripts/boards/components/issues_lane_list.vue
+6
-0
ee/spec/frontend/boards/components/issues_lane_list_spec.js
ee/spec/frontend/boards/components/issues_lane_list_spec.js
+49
-0
No files found.
ee/app/assets/javascripts/boards/components/issues_lane_list.vue
View file @
05236934
...
@@ -103,7 +103,11 @@ export default {
...
@@ -103,7 +103,11 @@ export default {
showIssue
(
issue
)
{
showIssue
(
issue
)
{
this
.
setActiveId
({
id
:
issue
.
id
,
sidebarType
:
ISSUABLE
});
this
.
setActiveId
({
id
:
issue
.
id
,
sidebarType
:
ISSUABLE
});
},
},
handleDragOnStart
()
{
document
.
body
.
classList
.
add
(
'
is-dragging
'
);
},
handleDragOnEnd
(
params
)
{
handleDragOnEnd
(
params
)
{
document
.
body
.
classList
.
remove
(
'
is-dragging
'
);
const
{
newIndex
,
oldIndex
,
from
,
to
,
item
}
=
params
;
const
{
newIndex
,
oldIndex
,
from
,
to
,
item
}
=
params
;
const
{
issueId
,
issueIid
,
issuePath
}
=
item
.
dataset
;
const
{
issueId
,
issueIid
,
issuePath
}
=
item
.
dataset
;
const
{
children
}
=
to
;
const
{
children
}
=
to
;
...
@@ -163,6 +167,8 @@ export default {
...
@@ -163,6 +167,8 @@ export default {
v-if=
"list.isExpanded"
v-if=
"list.isExpanded"
v-bind=
"treeRootOptions"
v-bind=
"treeRootOptions"
class=
"board-cell gl-p-2 gl-m-0 gl-h-full"
class=
"board-cell gl-p-2 gl-m-0 gl-h-full"
data-testid=
"tree-root-wrapper"
@
start=
"handleDragOnStart"
@
end=
"handleDragOnEnd"
@
end=
"handleDragOnEnd"
>
>
<board-card-layout
<board-card-layout
...
...
ee/spec/frontend/boards/components/issues_lane_list_spec.js
View file @
05236934
...
@@ -55,6 +55,7 @@ describe('IssuesLaneList', () => {
...
@@ -55,6 +55,7 @@ describe('IssuesLaneList', () => {
list
,
list
,
issues
:
mockIssues
,
issues
:
mockIssues
,
disabled
:
false
,
disabled
:
false
,
canAdminList
:
true
,
},
},
});
});
};
};
...
@@ -96,4 +97,52 @@ describe('IssuesLaneList', () => {
...
@@ -96,4 +97,52 @@ describe('IssuesLaneList', () => {
expect
(
wrapper
.
findAll
(
BoardCard
)).
toHaveLength
(
0
);
expect
(
wrapper
.
findAll
(
BoardCard
)).
toHaveLength
(
0
);
});
});
});
});
describe
(
'
drag & drop issue
'
,
()
=>
{
beforeEach
(()
=>
{
const
defaultStore
=
createStore
();
store
=
{
...
defaultStore
,
state
:
{
...
defaultStore
.
state
,
canAdminEpic
:
true
,
},
};
createComponent
();
});
describe
(
'
handleDragOnStart
'
,
()
=>
{
it
(
'
adds a class `is-dragging` to document body
'
,
()
=>
{
expect
(
document
.
body
.
classList
.
contains
(
'
is-dragging
'
)).
toBe
(
false
);
wrapper
.
find
(
`[data-testid="tree-root-wrapper"]`
).
vm
.
$emit
(
'
start
'
);
expect
(
document
.
body
.
classList
.
contains
(
'
is-dragging
'
)).
toBe
(
true
);
});
});
describe
(
'
handleDragOnEnd
'
,
()
=>
{
it
(
'
removes class `is-dragging` from document body
'
,
()
=>
{
jest
.
spyOn
(
wrapper
.
vm
,
'
moveIssue
'
).
mockImplementation
(()
=>
{});
document
.
body
.
classList
.
add
(
'
is-dragging
'
);
wrapper
.
find
(
`[data-testid="tree-root-wrapper"]`
).
vm
.
$emit
(
'
end
'
,
{
oldIndex
:
1
,
newIndex
:
0
,
item
:
{
dataset
:
{
issueId
:
mockIssues
[
0
].
id
,
issueIid
:
mockIssues
[
0
].
iid
,
issuePath
:
mockIssues
[
0
].
referencePath
,
},
},
to
:
{
children
:
[],
dataset
:
{
listId
:
'
gid://gitlab/List/1
'
}
},
from
:
{
dataset
:
{
listId
:
'
gid://gitlab/List/2
'
}
},
});
expect
(
document
.
body
.
classList
.
contains
(
'
is-dragging
'
)).
toBe
(
false
);
});
});
});
});
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment