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
49d1b5c6
Commit
49d1b5c6
authored
Oct 08, 2020
by
Christie Lenneville
Committed by
Nicolò Maria Mezzopera
Oct 08, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Migrate "Start event label" dropdown
Fix failed pipelines
parent
e47b4c2d
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
40 additions
and
42 deletions
+40
-42
ee/app/assets/javascripts/analytics/cycle_analytics/components/labels_selector.vue
.../analytics/cycle_analytics/components/labels_selector.vue
+12
-19
ee/changelogs/unreleased/migrate-start-event-label.yml
ee/changelogs/unreleased/migrate-start-event-label.yml
+5
-0
ee/spec/frontend/analytics/cycle_analytics/components/__snapshots__/labels_selector_spec.js.snap
...ics/components/__snapshots__/labels_selector_spec.js.snap
+20
-20
ee/spec/frontend/analytics/cycle_analytics/components/labels_selector_spec.js
...lytics/cycle_analytics/components/labels_selector_spec.js
+1
-1
ee/spec/frontend/analytics/cycle_analytics/components/tasks_by_type/tasks_by_type_filters_spec.js
...cs/components/tasks_by_type/tasks_by_type_filters_spec.js
+2
-2
No files found.
ee/app/assets/javascripts/analytics/cycle_analytics/components/labels_selector.vue
View file @
49d1b5c6
<
script
>
import
Api
from
'
ee/api
'
;
import
{
debounce
}
from
'
lodash
'
;
import
{
GlDeprecatedDropdown
,
GlDeprecatedDropdownItem
,
GlIcon
,
GlLoadingIcon
,
GlSearchBoxByType
,
}
from
'
@gitlab/ui
'
;
import
{
GlDropdown
,
GlDropdownItem
,
GlIcon
,
GlLoadingIcon
,
GlSearchBoxByType
}
from
'
@gitlab/ui
'
;
import
{
mapGetters
}
from
'
vuex
'
;
import
{
deprecatedCreateFlash
as
createFlash
}
from
'
~/flash
'
;
import
{
__
}
from
'
~/locale
'
;
...
...
@@ -17,8 +11,8 @@ import { DATA_REFETCH_DELAY } from '../../shared/constants';
export
default
{
name
:
'
LabelsSelector
'
,
components
:
{
GlD
eprecatedD
ropdown
,
GlD
eprecatedD
ropdownItem
,
GlDropdown
,
GlDropdownItem
,
GlIcon
,
GlLoadingIcon
,
GlSearchBoxByType
,
...
...
@@ -126,10 +120,10 @@ export default {
};
</
script
>
<
template
>
<gl-d
eprecated-dropdown
class=
"w-100
"
toggle-class=
"overflow-hidden"
:right=
"right"
>
<gl-d
ropdown
class=
"gl-w-full
"
toggle-class=
"overflow-hidden"
:right=
"right"
>
<template
#button-content
>
<slot
name=
"label-dropdown-button"
>
<span
v-if=
"selectedLabel"
>
<span
v-if=
"selectedLabel"
class=
"gl-new-dropdown-button-text"
>
<span
:style=
"
{ backgroundColor: selectedLabel.color }"
class="d-inline-block dropdown-label-box"
...
...
@@ -137,22 +131,21 @@ export default {
</span>
{{
labelTitle
(
selectedLabel
)
}}
</span>
<span
v-else
>
{{
__
(
'
Select a label
'
)
}}
</span>
<span
v-else
class=
"gl-new-dropdown-button-text"
>
{{
__
(
'
Select a label
'
)
}}
</span>
<gl-icon
class=
"dropdown-chevron"
name=
"chevron-down"
/>
</slot>
</
template
>
<
template
>
<slot
name=
"label-dropdown-list-header"
>
<gl-deprecated-dropdown-item
:active=
"!selectedLabelId.length"
@
click.prevent=
"$emit('clearLabel')"
<gl-dropdown-item
:active=
"!selectedLabelId.length"
@
click.prevent=
"$emit('clearLabel')"
>
{{
__
(
'
Select a label
'
)
}}
</gl-d
eprecated-d
ropdown-item>
</gl-dropdown-item>
</slot>
<div
class=
"mb-3 px-3"
>
<gl-search-box-by-type
v-model.trim=
"searchTerm"
class=
"mb-2"
/>
</div>
<div
class=
"mb-3 px-3"
>
<gl-d
eprecated-d
ropdown-item
<gl-dropdown-item
v-for=
"label in labels"
:key=
"label.id"
:class=
"
{
...
...
@@ -170,7 +163,7 @@ export default {
<span
:style=
"
{ backgroundColor: label.color }" class="d-inline-block dropdown-label-box">
</span>
{{
labelTitle
(
label
)
}}
</gl-d
eprecated-d
ropdown-item>
</gl-dropdown-item>
<div
v-show=
"loading"
class=
"text-center"
>
<gl-loading-icon
:inline=
"true"
size=
"md"
/>
</div>
...
...
@@ -179,5 +172,5 @@ export default {
</div>
</div>
</
template
>
</gl-d
eprecated-d
ropdown>
</gl-dropdown>
</template>
ee/changelogs/unreleased/migrate-start-event-label.yml
0 → 100644
View file @
49d1b5c6
---
title
:
Migrate Start event label dropdown
merge_request
:
43050
author
:
type
:
other
ee/spec/frontend/analytics/cycle_analytics/components/__snapshots__/labels_selector_spec.js.snap
View file @
49d1b5c6
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Value Stream Analytics LabelsSelector with no item selected will render the label selector 1`] = `
"<gl-d
eprecated-dropdown-stub text=\\"\\" toggle-class=\\"overflow-hidden\\" class=\\"w-100
\\">
<gl-d
eprecated-dropdown-item-stub
active=\\"true\\">Select a label
</gl-d
eprecated-d
ropdown-item-stub>
"<gl-d
ropdown-stub headertext=\\"\\" text=\\"\\" category=\\"tertiary\\" variant=\\"default\\" size=\\"medium\\" toggleclass=\\"overflow-hidden\\" class=\\"gl-w-full
\\">
<gl-d
ropdown-item-stub avatarurl=\\"\\" iconcolor=\\"\\" iconname=\\"\\" iconrightname=\\"\\" secondarytext=\\"\\"
active=\\"true\\">Select a label
</gl-dropdown-item-stub>
<div class=\\"mb-3 px-3\\">
<gl-search-box-by-type-stub value=\\"\\" clearbuttontitle=\\"Clear\\" class=\\"mb-2\\"></gl-search-box-by-type-stub>
</div>
<div class=\\"mb-3 px-3\\">
<gl-d
eprecated-dropdown-item-stub
class=\\"\\">
<gl-d
ropdown-item-stub avatarurl=\\"\\" iconcolor=\\"\\" iconname=\\"\\" iconrightname=\\"\\" secondarytext=\\"\\"
class=\\"\\">
<!----> <span class=\\"d-inline-block dropdown-label-box\\" style=\\"background-color: rgb(255, 0, 0);\\"></span>
roses
</gl-d
eprecated-d
ropdown-item-stub>
<gl-d
eprecated-dropdown-item-stub
class=\\"\\">
</gl-dropdown-item-stub>
<gl-d
ropdown-item-stub avatarurl=\\"\\" iconcolor=\\"\\" iconname=\\"\\" iconrightname=\\"\\" secondarytext=\\"\\"
class=\\"\\">
<!----> <span class=\\"d-inline-block dropdown-label-box\\" style=\\"background-color: rgb(255, 255, 255);\\"></span>
some space
</gl-d
eprecated-d
ropdown-item-stub>
<gl-d
eprecated-dropdown-item-stub
class=\\"\\">
</gl-dropdown-item-stub>
<gl-d
ropdown-item-stub avatarurl=\\"\\" iconcolor=\\"\\" iconname=\\"\\" iconrightname=\\"\\" secondarytext=\\"\\"
class=\\"\\">
<!----> <span class=\\"d-inline-block dropdown-label-box\\" style=\\"background-color: rgb(0, 0, 255);\\"></span>
violets
</gl-d
eprecated-d
ropdown-item-stub>
</gl-dropdown-item-stub>
<div class=\\"text-center\\" style=\\"display: none;\\">
<gl-loading-icon-stub label=\\"Loading\\" size=\\"md\\" color=\\"orange\\" inline=\\"true\\"></gl-loading-icon-stub>
</div>
...
...
@@ -27,29 +27,29 @@ exports[`Value Stream Analytics LabelsSelector with no item selected will render
No matching labels
</div>
</div>
</gl-d
eprecated-d
ropdown-stub>"
</gl-dropdown-stub>"
`;
exports[`Value Stream Analytics LabelsSelector with selectedLabelId set will render the label selector 1`] = `
"<gl-d
eprecated-dropdown-stub text=\\"\\" toggle-class=\\"overflow-hidden\\" class=\\"w-100
\\">
<gl-d
eprecated-dropdown-item-stub
>Select a label
</gl-d
eprecated-d
ropdown-item-stub>
"<gl-d
ropdown-stub headertext=\\"\\" text=\\"\\" category=\\"tertiary\\" variant=\\"default\\" size=\\"medium\\" toggleclass=\\"overflow-hidden\\" class=\\"gl-w-full
\\">
<gl-d
ropdown-item-stub avatarurl=\\"\\" iconcolor=\\"\\" iconname=\\"\\" iconrightname=\\"\\" secondarytext=\\"\\"
>Select a label
</gl-dropdown-item-stub>
<div class=\\"mb-3 px-3\\">
<gl-search-box-by-type-stub value=\\"\\" clearbuttontitle=\\"Clear\\" class=\\"mb-2\\"></gl-search-box-by-type-stub>
</div>
<div class=\\"mb-3 px-3\\">
<gl-d
eprecated-dropdown-item-stub
class=\\"\\">
<gl-d
ropdown-item-stub avatarurl=\\"\\" iconcolor=\\"\\" iconname=\\"\\" iconrightname=\\"\\" secondarytext=\\"\\"
class=\\"\\">
<!----> <span class=\\"d-inline-block dropdown-label-box\\" style=\\"background-color: rgb(255, 0, 0);\\"></span>
roses
</gl-d
eprecated-d
ropdown-item-stub>
<gl-d
eprecated-dropdown-item-stub
class=\\"\\">
</gl-dropdown-item-stub>
<gl-d
ropdown-item-stub avatarurl=\\"\\" iconcolor=\\"\\" iconname=\\"\\" iconrightname=\\"\\" secondarytext=\\"\\"
class=\\"\\">
<!----> <span class=\\"d-inline-block dropdown-label-box\\" style=\\"background-color: rgb(255, 255, 255);\\"></span>
some space
</gl-d
eprecated-d
ropdown-item-stub>
<gl-d
eprecated-dropdown-item-stub
active=\\"true\\" class=\\"\\">
</gl-dropdown-item-stub>
<gl-d
ropdown-item-stub avatarurl=\\"\\" iconcolor=\\"\\" iconname=\\"\\" iconrightname=\\"\\" secondarytext=\\"\\"
active=\\"true\\" class=\\"\\">
<!----> <span class=\\"d-inline-block dropdown-label-box\\" style=\\"background-color: rgb(0, 0, 255);\\"></span>
violets
</gl-d
eprecated-d
ropdown-item-stub>
</gl-dropdown-item-stub>
<div class=\\"text-center\\" style=\\"display: none;\\">
<gl-loading-icon-stub label=\\"Loading\\" size=\\"md\\" color=\\"orange\\" inline=\\"true\\"></gl-loading-icon-stub>
</div>
...
...
@@ -57,5 +57,5 @@ exports[`Value Stream Analytics LabelsSelector with selectedLabelId set will ren
No matching labels
</div>
</div>
</gl-d
eprecated-d
ropdown-stub>"
</gl-dropdown-stub>"
`;
ee/spec/frontend/analytics/cycle_analytics/components/labels_selector_spec.js
View file @
49d1b5c6
...
...
@@ -11,7 +11,7 @@ import { groupLabels } from '../mock_data';
const
selectedLabel
=
groupLabels
[
groupLabels
.
length
-
1
];
const
findActiveItem
=
wrapper
=>
wrapper
.
findAll
(
'
gl-d
eprecated-d
ropdown-item-stub
'
)
.
findAll
(
'
gl-dropdown-item-stub
'
)
.
filter
(
d
=>
d
.
attributes
(
'
active
'
))
.
at
(
0
);
...
...
ee/spec/frontend/analytics/cycle_analytics/components/tasks_by_type/tasks_by_type_filters_spec.js
View file @
49d1b5c6
...
...
@@ -2,7 +2,7 @@ import Vuex from 'vuex';
import
axios
from
'
axios
'
;
import
MockAdapter
from
'
axios-mock-adapter
'
;
import
{
shallowMount
,
mount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
GlD
eprecatedD
ropdownItem
,
GlSegmentedControl
}
from
'
@gitlab/ui
'
;
import
{
GlDropdownItem
,
GlSegmentedControl
}
from
'
@gitlab/ui
'
;
import
TasksByTypeFilters
from
'
ee/analytics/cycle_analytics/components/tasks_by_type/tasks_by_type_filters.vue
'
;
import
LabelsSelector
from
'
ee/analytics/cycle_analytics/components/labels_selector.vue
'
;
import
{
...
...
@@ -20,7 +20,7 @@ const selectedLabelIds = [groupLabels[0].id];
const
findSubjectFilters
=
ctx
=>
ctx
.
find
(
GlSegmentedControl
);
const
findSelectedSubjectFilters
=
ctx
=>
findSubjectFilters
(
ctx
).
attributes
(
'
checked
'
);
const
findDropdownLabels
=
ctx
=>
ctx
.
find
(
LabelsSelector
).
findAll
(
GlD
eprecatedD
ropdownItem
);
const
findDropdownLabels
=
ctx
=>
ctx
.
find
(
LabelsSelector
).
findAll
(
GlDropdownItem
);
const
selectLabelAtIndex
=
(
ctx
,
index
)
=>
{
findDropdownLabels
(
ctx
)
...
...
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