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
6febc3ba
Commit
6febc3ba
authored
Feb 25, 2020
by
Axel García
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Filter out epic tree item chevron button from Draggable component
parent
1a7ca4b0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
2 deletions
+16
-2
ee/app/assets/javascripts/related_items_tree/constants.js
ee/app/assets/javascripts/related_items_tree/constants.js
+2
-0
ee/app/assets/javascripts/related_items_tree/mixins/tree_dd_mixin.js
...ts/javascripts/related_items_tree/mixins/tree_dd_mixin.js
+5
-1
ee/spec/frontend/related_items_tree/components/tree_item_spec.js
.../frontend/related_items_tree/components/tree_item_spec.js
+7
-1
ee/spec/javascripts/related_items_tree/components/tree_root_spec.js
...vascripts/related_items_tree/components/tree_root_spec.js
+2
-0
No files found.
ee/app/assets/javascripts/related_items_tree/constants.js
View file @
6febc3ba
...
...
@@ -40,3 +40,5 @@ export const RemoveItemModalProps = {
export
const
OVERFLOW_AFTER
=
5
;
export
const
itemRemoveModalId
=
'
item-remove-confirmation
'
;
export
const
treeItemChevronBtnClassName
=
'
btn-tree-item-chevron
'
;
ee/app/assets/javascripts/related_items_tree/mixins/tree_dd_mixin.js
View file @
6febc3ba
import
Draggable
from
'
vuedraggable
'
;
import
defaultSortableConfig
from
'
~/sortable/sortable_config
'
;
import
{
idProp
,
relativePositions
}
from
'
../constants
'
;
import
{
idProp
,
relativePositions
,
treeItemChevronBtnClassName
}
from
'
../constants
'
;
export
default
{
computed
:
{
...
...
@@ -17,6 +17,10 @@ export default {
'
ghost-class
'
:
'
tree-item-drag-active
'
,
'
data-parent-reference
'
:
this
.
parentItem
.
reference
,
value
:
this
.
children
,
// This filters out/ignores all the chevron buttons (used for
// expanding and collapsing epic tree items) so the drag action
// can only be performed on the actual item card.
filter
:
`.
${
treeItemChevronBtnClassName
}
`
,
};
return
this
.
userSignedIn
?
options
:
{};
...
...
ee/spec/frontend/related_items_tree/components/tree_item_spec.js
View file @
6febc3ba
...
...
@@ -7,7 +7,7 @@ import TreeRoot from 'ee/related_items_tree/components/tree_root.vue';
import
createDefaultStore
from
'
ee/related_items_tree/store
'
;
import
*
as
epicUtils
from
'
ee/related_items_tree/utils/epic_utils
'
;
import
{
ChildType
}
from
'
ee/related_items_tree/constants
'
;
import
{
ChildType
,
treeItemChevronBtnClassName
}
from
'
ee/related_items_tree/constants
'
;
import
{
PathIdSeparator
}
from
'
ee/related_issues/constants
'
;
import
Icon
from
'
~/vue_shared/components/icon.vue
'
;
...
...
@@ -142,6 +142,12 @@ describe('RelatedItemsTree', () => {
expect
(
chevronButton
.
attributes
(
'
title
'
)).
toBe
(
'
Collapse
'
);
});
it
(
'
has the proper class on the expand/collapse button to avoid dragging
'
,
()
=>
{
const
chevronButton
=
wrapper
.
find
(
GlButton
);
expect
(
chevronButton
.
attributes
(
'
class
'
)).
toContain
(
treeItemChevronBtnClassName
);
});
it
(
'
renders expand/collapse icon
'
,
()
=>
{
const
expandedIcon
=
wrapperExpanded
.
find
(
Icon
);
const
collapsedIcon
=
wrapperCollapsed
.
find
(
Icon
);
...
...
ee/spec/javascripts/related_items_tree/components/tree_root_spec.js
View file @
6febc3ba
...
...
@@ -7,6 +7,7 @@ import TreeRoot from 'ee/related_items_tree/components/tree_root.vue';
import
createDefaultStore
from
'
ee/related_items_tree/store
'
;
import
*
as
epicUtils
from
'
ee/related_items_tree/utils/epic_utils
'
;
import
{
treeItemChevronBtnClassName
}
from
'
ee/related_items_tree/constants
'
;
import
{
mockQueryResponse
,
...
...
@@ -116,6 +117,7 @@ describe('RelatedItemsTree', () => {
'
ghost-class
'
:
'
tree-item-drag-active
'
,
'
data-parent-reference
'
:
mockParentItem
.
reference
,
value
:
wrapper
.
vm
.
children
,
filter
:
`.
${
treeItemChevronBtnClassName
}
`
,
}),
);
});
...
...
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