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
31bb6342
Commit
31bb6342
authored
Aug 28, 2020
by
Evan Read
Committed by
Simon Knox
Aug 28, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Migrate analytics stage button away from deprecated button
parent
f9087286
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
13 deletions
+54
-13
ee/app/assets/javascripts/analytics/cycle_analytics/components/stage_nav_item.vue
...s/analytics/cycle_analytics/components/stage_nav_item.vue
+28
-13
ee/changelogs/unreleased/eread-migrate-vsa-stage-nav-button.yml
...ngelogs/unreleased/eread-migrate-vsa-stage-nav-button.yml
+5
-0
ee/spec/frontend/analytics/cycle_analytics/components/stage_nav_item_spec.js
...alytics/cycle_analytics/components/stage_nav_item_spec.js
+21
-0
No files found.
ee/app/assets/javascripts/analytics/cycle_analytics/components/stage_nav_item.vue
View file @
31bb6342
<
script
>
import
{
Gl
DeprecatedButton
,
GlIcon
,
GlTooltip
}
from
'
@gitlab/ui
'
;
import
{
Gl
Button
,
GlTooltip
,
GlTooltipDirective
}
from
'
@gitlab/ui
'
;
import
{
approximateDuration
}
from
'
~/lib/utils/datetime_utility
'
;
import
StageCardListItem
from
'
./stage_card_list_item.vue
'
;
...
...
@@ -7,10 +7,12 @@ export default {
name
:
'
StageNavItem
'
,
components
:
{
StageCardListItem
,
GlIcon
,
GlDeprecatedButton
,
GlButton
,
GlTooltip
,
},
directives
:
{
GlTooltip
:
GlTooltipDirective
,
},
props
:
{
isDefaultStage
:
{
type
:
Boolean
,
...
...
@@ -106,31 +108,44 @@ export default {
<span
v-else
class=
"stage-empty"
>
{{
__
(
'
Not enough data
'
)
}}
</span>
</div>
<div
v-show=
"isHover"
ref=
"dropdown"
:class=
"[openMenuClasses]"
class=
"dropdown w-25"
>
<gl-deprecated-button
<gl-button
v-gl-tooltip
category=
"tertiary"
icon=
"ellipsis_v"
:title=
"__('More actions')"
class=
"more-actions-toggle btn btn-transparent p-0"
data-toggle=
"dropdown"
>
<gl-icon
class=
"icon"
name=
"ellipsis_v"
/>
</gl-deprecated-button>
/>
<ul
class=
"more-actions-dropdown dropdown-menu dropdown-open-left"
>
<template
v-if=
"isDefaultStage"
>
<li>
<gl-deprecated-button
@
click=
"handleDropdownAction('hide', $event)"
>
<gl-button
category=
"tertiary"
data-testid=
"hide-btn"
@
click=
"handleDropdownAction('hide', $event)"
>
{{
__
(
'
Hide stage
'
)
}}
</gl-
deprecated-
button>
</gl-button>
</li>
</
template
>
<
template
v-else
>
<li>
<gl-deprecated-button
@
click=
"handleDropdownAction('edit', $event)"
>
<gl-button
category=
"tertiary"
data-testid=
"edit-btn"
@
click=
"handleDropdownAction('edit', $event)"
>
{{
__
(
'
Edit stage
'
)
}}
</gl-
deprecated-
button>
</gl-button>
</li>
<li>
<gl-deprecated-button
@
click=
"handleDropdownAction('remove', $event)"
>
<gl-button
category=
"tertiary"
data-testid=
"remove-btn"
@
click=
"handleDropdownAction('remove', $event)"
>
{{
__
(
'
Remove stage
'
)
}}
</gl-
deprecated-
button>
</gl-button>
</li>
</
template
>
</ul>
...
...
ee/changelogs/unreleased/eread-migrate-vsa-stage-nav-button.yml
0 → 100644
View file @
31bb6342
---
title
:
Migrate analytics stage button away from deprecated button
merge_request
:
39560
author
:
type
:
other
ee/spec/frontend/analytics/cycle_analytics/components/stage_nav_item_spec.js
View file @
31bb6342
...
...
@@ -24,6 +24,7 @@ describe('StageNavItem', () => {
let
wrapper
=
null
;
const
findStageTitle
=
()
=>
wrapper
.
find
({
ref
:
'
title
'
});
const
findStageMedian
=
()
=>
wrapper
.
find
({
ref
:
'
median
'
});
const
findDropdown
=
()
=>
wrapper
.
find
({
ref
:
'
dropdown
'
});
afterEach
(()
=>
{
wrapper
.
destroy
();
...
...
@@ -46,6 +47,26 @@ describe('StageNavItem', () => {
it
(
'
renders the stage title
'
,
()
=>
{
expect
(
findStageTitle
().
text
()).
toEqual
(
title
);
});
it
(
'
renders the dropdown with edit and remove options
'
,
()
=>
{
expect
(
findDropdown
().
exists
()).
toBe
(
true
);
expect
(
wrapper
.
find
(
'
[data-testid="edit-btn"]
'
).
exists
()).
toBe
(
true
);
expect
(
wrapper
.
find
(
'
[data-testid="remove-btn"]
'
).
exists
()).
toBe
(
true
);
expect
(
wrapper
.
find
(
'
[data-testid="hide-btn"]
'
).
exists
()).
toBe
(
false
);
});
});
describe
(
'
with data an a non-default state
'
,
()
=>
{
beforeEach
(()
=>
{
wrapper
=
createComponent
({
props
:
{
isDefaultStage
:
true
}
});
});
it
(
'
renders the dropdown with a hide option
'
,
()
=>
{
expect
(
findDropdown
().
exists
()).
toBe
(
true
);
expect
(
wrapper
.
find
(
'
[data-testid="hide-btn"]
'
).
exists
()).
toBe
(
true
);
expect
(
wrapper
.
find
(
'
[data-testid="edit-btn"]
'
).
exists
()).
toBe
(
false
);
expect
(
wrapper
.
find
(
'
[data-testid="remove-btn"]
'
).
exists
()).
toBe
(
false
);
});
});
describe
(
'
with a really long name
'
,
()
=>
{
...
...
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