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
>
<
script
>
import
Api
from
'
ee/api
'
;
import
Api
from
'
ee/api
'
;
import
{
debounce
}
from
'
lodash
'
;
import
{
debounce
}
from
'
lodash
'
;
import
{
import
{
GlDropdown
,
GlDropdownItem
,
GlIcon
,
GlLoadingIcon
,
GlSearchBoxByType
}
from
'
@gitlab/ui
'
;
GlDeprecatedDropdown
,
GlDeprecatedDropdownItem
,
GlIcon
,
GlLoadingIcon
,
GlSearchBoxByType
,
}
from
'
@gitlab/ui
'
;
import
{
mapGetters
}
from
'
vuex
'
;
import
{
mapGetters
}
from
'
vuex
'
;
import
{
deprecatedCreateFlash
as
createFlash
}
from
'
~/flash
'
;
import
{
deprecatedCreateFlash
as
createFlash
}
from
'
~/flash
'
;
import
{
__
}
from
'
~/locale
'
;
import
{
__
}
from
'
~/locale
'
;
...
@@ -17,8 +11,8 @@ import { DATA_REFETCH_DELAY } from '../../shared/constants';
...
@@ -17,8 +11,8 @@ import { DATA_REFETCH_DELAY } from '../../shared/constants';
export
default
{
export
default
{
name
:
'
LabelsSelector
'
,
name
:
'
LabelsSelector
'
,
components
:
{
components
:
{
GlD
eprecatedD
ropdown
,
GlDropdown
,
GlD
eprecatedD
ropdownItem
,
GlDropdownItem
,
GlIcon
,
GlIcon
,
GlLoadingIcon
,
GlLoadingIcon
,
GlSearchBoxByType
,
GlSearchBoxByType
,
...
@@ -126,10 +120,10 @@ export default {
...
@@ -126,10 +120,10 @@ export default {
};
};
</
script
>
</
script
>
<
template
>
<
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
>
<template
#button-content
>
<slot
name=
"label-dropdown-button"
>
<slot
name=
"label-dropdown-button"
>
<span
v-if=
"selectedLabel"
>
<span
v-if=
"selectedLabel"
class=
"gl-new-dropdown-button-text"
>
<span
<span
:style=
"
{ backgroundColor: selectedLabel.color }"
:style=
"
{ backgroundColor: selectedLabel.color }"
class="d-inline-block dropdown-label-box"
class="d-inline-block dropdown-label-box"
...
@@ -137,22 +131,21 @@ export default {
...
@@ -137,22 +131,21 @@ export default {
</span>
</span>
{{
labelTitle
(
selectedLabel
)
}}
{{
labelTitle
(
selectedLabel
)
}}
</span>
</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>
</slot>
</
template
>
</
template
>
<
template
>
<
template
>
<slot
name=
"label-dropdown-list-header"
>
<slot
name=
"label-dropdown-list-header"
>
<gl-deprecated-dropdown-item
<gl-dropdown-item
:active=
"!selectedLabelId.length"
@
click.prevent=
"$emit('clearLabel')"
:active=
"!selectedLabelId.length"
@
click.prevent=
"$emit('clearLabel')"
>
{{
__
(
'
Select a label
'
)
}}
>
{{
__
(
'
Select a label
'
)
}}
</gl-d
eprecated-d
ropdown-item>
</gl-dropdown-item>
</slot>
</slot>
<div
class=
"mb-3 px-3"
>
<div
class=
"mb-3 px-3"
>
<gl-search-box-by-type
v-model.trim=
"searchTerm"
class=
"mb-2"
/>
<gl-search-box-by-type
v-model.trim=
"searchTerm"
class=
"mb-2"
/>
</div>
</div>
<div
class=
"mb-3 px-3"
>
<div
class=
"mb-3 px-3"
>
<gl-d
eprecated-d
ropdown-item
<gl-dropdown-item
v-for=
"label in labels"
v-for=
"label in labels"
:key=
"label.id"
:key=
"label.id"
:class=
"
{
:class=
"
{
...
@@ -170,7 +163,7 @@ export default {
...
@@ -170,7 +163,7 @@ export default {
<span
:style=
"
{ backgroundColor: label.color }" class="d-inline-block dropdown-label-box">
<span
:style=
"
{ backgroundColor: label.color }" class="d-inline-block dropdown-label-box">
</span>
</span>
{{
labelTitle
(
label
)
}}
{{
labelTitle
(
label
)
}}
</gl-d
eprecated-d
ropdown-item>
</gl-dropdown-item>
<div
v-show=
"loading"
class=
"text-center"
>
<div
v-show=
"loading"
class=
"text-center"
>
<gl-loading-icon
:inline=
"true"
size=
"md"
/>
<gl-loading-icon
:inline=
"true"
size=
"md"
/>
</div>
</div>
...
@@ -179,5 +172,5 @@ export default {
...
@@ -179,5 +172,5 @@ export default {
</div>
</div>
</div>
</div>
</
template
>
</
template
>
</gl-d
eprecated-d
ropdown>
</gl-dropdown>
</template>
</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
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Value Stream Analytics LabelsSelector with no item selected will render the label selector 1`] = `
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
ropdown-stub headertext=\\"\\" text=\\"\\" category=\\"tertiary\\" variant=\\"default\\" size=\\"medium\\" toggleclass=\\"overflow-hidden\\" class=\\"gl-w-full
\\">
<gl-d
eprecated-dropdown-item-stub
active=\\"true\\">Select a label
<gl-d
ropdown-item-stub avatarurl=\\"\\" iconcolor=\\"\\" iconname=\\"\\" iconrightname=\\"\\" secondarytext=\\"\\"
active=\\"true\\">Select a label
</gl-d
eprecated-d
ropdown-item-stub>
</gl-dropdown-item-stub>
<div class=\\"mb-3 px-3\\">
<div class=\\"mb-3 px-3\\">
<gl-search-box-by-type-stub value=\\"\\" clearbuttontitle=\\"Clear\\" class=\\"mb-2\\"></gl-search-box-by-type-stub>
<gl-search-box-by-type-stub value=\\"\\" clearbuttontitle=\\"Clear\\" class=\\"mb-2\\"></gl-search-box-by-type-stub>
</div>
</div>
<div class=\\"mb-3 px-3\\">
<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>
<!----> <span class=\\"d-inline-block dropdown-label-box\\" style=\\"background-color: rgb(255, 0, 0);\\"></span>
roses
roses
</gl-d
eprecated-d
ropdown-item-stub>
</gl-dropdown-item-stub>
<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, 255, 255);\\"></span>
<!----> <span class=\\"d-inline-block dropdown-label-box\\" style=\\"background-color: rgb(255, 255, 255);\\"></span>
some space
some space
</gl-d
eprecated-d
ropdown-item-stub>
</gl-dropdown-item-stub>
<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(0, 0, 255);\\"></span>
<!----> <span class=\\"d-inline-block dropdown-label-box\\" style=\\"background-color: rgb(0, 0, 255);\\"></span>
violets
violets
</gl-d
eprecated-d
ropdown-item-stub>
</gl-dropdown-item-stub>
<div class=\\"text-center\\" style=\\"display: none;\\">
<div class=\\"text-center\\" style=\\"display: none;\\">
<gl-loading-icon-stub label=\\"Loading\\" size=\\"md\\" color=\\"orange\\" inline=\\"true\\"></gl-loading-icon-stub>
<gl-loading-icon-stub label=\\"Loading\\" size=\\"md\\" color=\\"orange\\" inline=\\"true\\"></gl-loading-icon-stub>
</div>
</div>
...
@@ -27,29 +27,29 @@ exports[`Value Stream Analytics LabelsSelector with no item selected will render
...
@@ -27,29 +27,29 @@ exports[`Value Stream Analytics LabelsSelector with no item selected will render
No matching labels
No matching labels
</div>
</div>
</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`] = `
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
ropdown-stub headertext=\\"\\" text=\\"\\" category=\\"tertiary\\" variant=\\"default\\" size=\\"medium\\" toggleclass=\\"overflow-hidden\\" class=\\"gl-w-full
\\">
<gl-d
eprecated-dropdown-item-stub
>Select a label
<gl-d
ropdown-item-stub avatarurl=\\"\\" iconcolor=\\"\\" iconname=\\"\\" iconrightname=\\"\\" secondarytext=\\"\\"
>Select a label
</gl-d
eprecated-d
ropdown-item-stub>
</gl-dropdown-item-stub>
<div class=\\"mb-3 px-3\\">
<div class=\\"mb-3 px-3\\">
<gl-search-box-by-type-stub value=\\"\\" clearbuttontitle=\\"Clear\\" class=\\"mb-2\\"></gl-search-box-by-type-stub>
<gl-search-box-by-type-stub value=\\"\\" clearbuttontitle=\\"Clear\\" class=\\"mb-2\\"></gl-search-box-by-type-stub>
</div>
</div>
<div class=\\"mb-3 px-3\\">
<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>
<!----> <span class=\\"d-inline-block dropdown-label-box\\" style=\\"background-color: rgb(255, 0, 0);\\"></span>
roses
roses
</gl-d
eprecated-d
ropdown-item-stub>
</gl-dropdown-item-stub>
<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, 255, 255);\\"></span>
<!----> <span class=\\"d-inline-block dropdown-label-box\\" style=\\"background-color: rgb(255, 255, 255);\\"></span>
some space
some space
</gl-d
eprecated-d
ropdown-item-stub>
</gl-dropdown-item-stub>
<gl-d
eprecated-dropdown-item-stub
active=\\"true\\" class=\\"\\">
<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>
<!----> <span class=\\"d-inline-block dropdown-label-box\\" style=\\"background-color: rgb(0, 0, 255);\\"></span>
violets
violets
</gl-d
eprecated-d
ropdown-item-stub>
</gl-dropdown-item-stub>
<div class=\\"text-center\\" style=\\"display: none;\\">
<div class=\\"text-center\\" style=\\"display: none;\\">
<gl-loading-icon-stub label=\\"Loading\\" size=\\"md\\" color=\\"orange\\" inline=\\"true\\"></gl-loading-icon-stub>
<gl-loading-icon-stub label=\\"Loading\\" size=\\"md\\" color=\\"orange\\" inline=\\"true\\"></gl-loading-icon-stub>
</div>
</div>
...
@@ -57,5 +57,5 @@ exports[`Value Stream Analytics LabelsSelector with selectedLabelId set will ren
...
@@ -57,5 +57,5 @@ exports[`Value Stream Analytics LabelsSelector with selectedLabelId set will ren
No matching labels
No matching labels
</div>
</div>
</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';
...
@@ -11,7 +11,7 @@ import { groupLabels } from '../mock_data';
const
selectedLabel
=
groupLabels
[
groupLabels
.
length
-
1
];
const
selectedLabel
=
groupLabels
[
groupLabels
.
length
-
1
];
const
findActiveItem
=
wrapper
=>
const
findActiveItem
=
wrapper
=>
wrapper
wrapper
.
findAll
(
'
gl-d
eprecated-d
ropdown-item-stub
'
)
.
findAll
(
'
gl-dropdown-item-stub
'
)
.
filter
(
d
=>
d
.
attributes
(
'
active
'
))
.
filter
(
d
=>
d
.
attributes
(
'
active
'
))
.
at
(
0
);
.
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';
...
@@ -2,7 +2,7 @@ import Vuex from 'vuex';
import
axios
from
'
axios
'
;
import
axios
from
'
axios
'
;
import
MockAdapter
from
'
axios-mock-adapter
'
;
import
MockAdapter
from
'
axios-mock-adapter
'
;
import
{
shallowMount
,
mount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
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
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
LabelsSelector
from
'
ee/analytics/cycle_analytics/components/labels_selector.vue
'
;
import
{
import
{
...
@@ -20,7 +20,7 @@ const selectedLabelIds = [groupLabels[0].id];
...
@@ -20,7 +20,7 @@ const selectedLabelIds = [groupLabels[0].id];
const
findSubjectFilters
=
ctx
=>
ctx
.
find
(
GlSegmentedControl
);
const
findSubjectFilters
=
ctx
=>
ctx
.
find
(
GlSegmentedControl
);
const
findSelectedSubjectFilters
=
ctx
=>
findSubjectFilters
(
ctx
).
attributes
(
'
checked
'
);
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
)
=>
{
const
selectLabelAtIndex
=
(
ctx
,
index
)
=>
{
findDropdownLabels
(
ctx
)
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