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
88a46833
Commit
88a46833
authored
Feb 13, 2020
by
Kushal Pandya
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'psi-remove-header-getters' into 'master'
Remove some dead code See merge request gitlab-org/gitlab!24957
parents
d3650d67
24e847af
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
49 deletions
+0
-49
ee/app/assets/javascripts/related_items_tree/store/getters.js
...pp/assets/javascripts/related_items_tree/store/getters.js
+0
-16
ee/spec/frontend/related_items_tree/store/getters_spec.js
ee/spec/frontend/related_items_tree/store/getters_spec.js
+0
-33
No files found.
ee/app/assets/javascripts/related_items_tree/store/getters.js
View file @
88a46833
import
{
issuableTypesMap
,
PathIdSeparator
}
from
'
ee/related_issues/constants
'
;
import
{
ChildType
}
from
'
../constants
'
;
export
const
autoCompleteSources
=
()
=>
gl
.
GfmAutoComplete
&&
gl
.
GfmAutoComplete
.
dataSources
;
...
...
@@ -8,21 +7,6 @@ export const directChildren = state => state.children[state.parentItem.reference
export
const
anyParentHasChildren
=
(
state
,
getters
)
=>
getters
.
directChildren
.
some
(
item
=>
item
.
hasChildren
||
item
.
hasIssues
);
export
const
headerItems
=
state
=>
[
{
iconName
:
'
epic
'
,
count
:
state
.
epicsCount
,
qaClass
:
'
qa-add-epics-button
'
,
type
:
ChildType
.
Epic
,
},
{
iconName
:
'
issues
'
,
count
:
state
.
issuesCount
,
qaClass
:
'
qa-add-issues-button
'
,
type
:
ChildType
.
Issue
,
},
];
export
const
itemAutoCompleteSources
=
(
state
,
getters
)
=>
{
if
(
getters
.
isEpic
)
{
return
state
.
autoCompleteEpics
?
getters
.
autoCompleteSources
:
{};
...
...
ee/spec/frontend/related_items_tree/store/getters_spec.js
View file @
88a46833
import
*
as
getters
from
'
ee/related_items_tree/store/getters
'
;
import
createDefaultState
from
'
ee/related_items_tree/store/state
'
;
import
{
issuableTypesMap
}
from
'
ee/related_issues/constants
'
;
import
{
ChildType
}
from
'
ee/related_items_tree/constants
'
;
import
{
mockEpic1
,
mockEpic2
}
from
'
../../../javascripts/related_items_tree/mock_data
'
;
...
...
@@ -60,36 +57,6 @@ describe('RelatedItemsTree', () => {
});
});
describe
(
'
headerItems
'
,
()
=>
{
it
(
'
returns an item within array containing Epic iconName, count, qaClass & type props
'
,
()
=>
{
state
.
epicsCount
=
2
;
const
epicHeaderItem
=
getters
.
headerItems
(
state
)[
0
];
expect
(
epicHeaderItem
).
toEqual
(
expect
.
objectContaining
({
iconName
:
'
epic
'
,
count
:
2
,
qaClass
:
'
qa-add-epics-button
'
,
type
:
ChildType
.
Epic
,
}),
);
});
it
(
'
returns an item within array containing Issue iconName, count, qaClass & type props
'
,
()
=>
{
state
.
issuesCount
=
2
;
const
epicHeaderItem
=
getters
.
headerItems
(
state
)[
1
];
expect
(
epicHeaderItem
).
toEqual
(
expect
.
objectContaining
({
iconName
:
'
issues
'
,
count
:
2
,
qaClass
:
'
qa-add-issues-button
'
,
type
:
ChildType
.
Issue
,
}),
);
});
});
describe
(
'
itemAutoCompleteSources
'
,
()
=>
{
it
(
'
returns autoCompleteSources value when `issuableType` is set to `Epic` and `autoCompleteEpics` is true
'
,
()
=>
{
const
mockGetter
=
{
...
...
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