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
5f12034b
Commit
5f12034b
authored
Mar 09, 2022
by
Rajat Jain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Migrate Epic Tabs to use Button Group
Changelog: changed EE: true
parent
53e4024e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
22 deletions
+35
-22
ee/app/assets/javascripts/epic/components/epic_tabs.vue
ee/app/assets/javascripts/epic/components/epic_tabs.vue
+33
-22
ee/spec/frontend/epic/components/epic_tabs_spec.js
ee/spec/frontend/epic/components/epic_tabs_spec.js
+2
-0
No files found.
ee/app/assets/javascripts/epic/components/epic_tabs.vue
View file @
5f12034b
<
script
>
import
{
Gl
Tabs
,
GlTab
}
from
'
@gitlab/ui
'
;
import
{
Gl
ButtonGroup
,
GlButton
}
from
'
@gitlab/ui
'
;
import
initRelatedItemsTree
from
'
ee/related_items_tree/related_items_tree_bundle
'
;
const
displayNoneClass
=
'
gl-display-none
'
;
...
...
@@ -7,8 +7,8 @@ const containerClass = 'container-limited';
export
default
{
components
:
{
Gl
Tabs
,
Gl
Tab
,
Gl
Button
,
Gl
ButtonGroup
,
},
inject
:
{
allowSubEpics
:
{
...
...
@@ -27,6 +27,7 @@ export default {
data
()
{
return
{
roadmapLoaded
:
false
,
activeButton
:
this
.
$options
.
TABS
.
TREE
,
};
},
computed
:
{
...
...
@@ -51,11 +52,13 @@ export default {
.
catch
(()
=>
{});
},
onTreeTabClick
()
{
this
.
activeButton
=
this
.
$options
.
TABS
.
TREE
;
this
.
roadmapElement
.
classList
.
add
(
displayNoneClass
);
this
.
treeElement
.
classList
.
remove
(
displayNoneClass
);
this
.
containerElement
.
classList
.
add
(
containerClass
);
},
showRoadmapTabContent
()
{
this
.
activeButton
=
this
.
$options
.
TABS
.
ROADMAP
;
this
.
roadmapElement
.
classList
.
remove
(
displayNoneClass
);
this
.
treeElement
.
classList
.
add
(
displayNoneClass
);
this
.
containerElement
.
classList
.
remove
(
containerClass
);
...
...
@@ -73,26 +76,34 @@ export default {
}
},
},
TABS
:
{
TREE
:
'
related_items_tree
'
,
ROADMAP
:
'
roadmap
'
,
},
};
</
script
>
<
template
>
<gl-tabs
content-class=
"gl-display-none"
nav-wrapper-class=
"epic-tabs-container"
nav-class=
"gl-border-bottom-0"
class=
"epic-tabs-holder"
data-testid=
"tabs"
<div
class=
"epic-tabs-holder gl-pl-0 gl-pr-0 gl-ml-0 gl-mr-0"
>
<div
class=
"epic-tabs-container gl-pt-3 gl-pb-3"
>
<gl-button-group
data-testid=
"tabs"
>
<gl-button
class=
"js-epic-tree-tab"
data-testid=
"epic-tree-tab"
:selected=
"activeButton === $options.TABS.TREE"
@
click=
"onTreeTabClick"
>
<gl-tab
title-link-class=
"js-epic-tree-tab"
data-testid=
"epic-tree-tab"
@
click=
"onTreeTabClick"
>
<template
#title
>
{{
allowSubEpics
?
__
(
'
Epics and Issues
'
)
:
__
(
'
Issues
'
)
}}
</
template
>
</gl-tab>
<gl-tab
{{
allowSubEpics
?
__
(
'
Epics and Issues
'
)
:
__
(
'
Issues
'
)
}}
</gl-button>
<gl-button
v-if=
"allowSubEpics"
title-link-
class=
"js-epic-roadmap-tab"
class=
"js-epic-roadmap-tab"
data-testid=
"epic-roadmap-tab"
:selected=
"activeButton === $options.TABS.ROADMAP"
@
click=
"onRoadmapTabClick"
>
<
template
#title
>
{{
__
(
'
Roadmap
'
)
}}
</
template
>
</gl-tab>
</gl-tabs>
{{
__
(
'
Roadmap
'
)
}}
</gl-button>
</gl-button-group>
</div>
</div>
</
template
>
ee/spec/frontend/epic/components/epic_tabs_spec.js
View file @
5f12034b
...
...
@@ -60,6 +60,7 @@ describe('EpicTabs', () => {
const
treeTab
=
findEpicTreeTab
();
expect
(
treeTab
.
exists
()).
toBe
(
true
);
expect
(
treeTab
.
text
()).
toBe
(
'
Epics and Issues
'
);
expect
(
treeTab
.
props
().
selected
).
toBe
(
true
);
});
it
(
'
displays the roadmap tab
'
,
()
=>
{
...
...
@@ -68,6 +69,7 @@ describe('EpicTabs', () => {
const
treeTab
=
findEpicRoadmapTab
();
expect
(
treeTab
.
exists
()).
toBe
(
true
);
expect
(
treeTab
.
text
()).
toBe
(
'
Roadmap
'
);
expect
(
treeTab
.
props
().
selected
).
toBe
(
false
);
});
const
treeTabFixture
=
`
...
...
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