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
29549124
Commit
29549124
authored
Jan 17, 2022
by
Natalia Tepluhina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Merge branch '350312-labels-widget-auto-select-first-label-when-searching' into 'master'"
This reverts merge request !78246
parent
aed836d7
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
25 deletions
+1
-25
app/assets/javascripts/vue_shared/components/sidebar/labels_select_widget/dropdown_contents_labels_view.vue
...ar/labels_select_widget/dropdown_contents_labels_view.vue
+1
-12
spec/frontend/vue_shared/components/sidebar/labels_select_widget/dropdown_contents_labels_view_spec.js
...abels_select_widget/dropdown_contents_labels_view_spec.js
+0
-13
No files found.
app/assets/javascripts/vue_shared/components/sidebar/labels_select_widget/dropdown_contents_labels_view.vue
View file @
29549124
...
@@ -84,14 +84,6 @@ export default {
...
@@ -84,14 +84,6 @@ export default {
showNoMatchingResultsMessage
()
{
showNoMatchingResultsMessage
()
{
return
Boolean
(
this
.
searchKey
)
&&
this
.
visibleLabels
.
length
===
0
;
return
Boolean
(
this
.
searchKey
)
&&
this
.
visibleLabels
.
length
===
0
;
},
},
shouldHighlighFirstItem
()
{
return
this
.
searchKey
!==
''
&&
this
.
visibleLabels
.
length
>
0
;
},
},
updated
()
{
if
(
this
.
shouldHighlighFirstItem
)
{
this
.
$refs
.
labelItem
[
0
]?.
$el
?.
firstChild
?.
focus
();
}
},
},
methods
:
{
methods
:
{
isLabelSelected
(
label
)
{
isLabelSelected
(
label
)
{
...
@@ -151,14 +143,11 @@ export default {
...
@@ -151,14 +143,11 @@ export default {
/>
/>
<template
v-else
>
<template
v-else
>
<gl-dropdown-item
<gl-dropdown-item
v-for=
"(label, index) in visibleLabels"
v-for=
"label in visibleLabels"
ref=
"labelItem"
:key=
"label.id"
:key=
"label.id"
:is-checked=
"isLabelSelected(label)"
:is-checked=
"isLabelSelected(label)"
:is-check-centered=
"true"
:is-check-centered=
"true"
:is-check-item=
"true"
:is-check-item=
"true"
:active=
"shouldHighlighFirstItem && index === 0"
active-class=
"is-focused"
data-testid=
"labels-list"
data-testid=
"labels-list"
@
click.native.capture.stop=
"handleLabelClick(label)"
@
click.native.capture.stop=
"handleLabelClick(label)"
>
>
...
...
spec/frontend/vue_shared/components/sidebar/labels_select_widget/dropdown_contents_labels_view_spec.js
View file @
29549124
...
@@ -110,19 +110,6 @@ describe('DropdownContentsLabelsView', () => {
...
@@ -110,19 +110,6 @@ describe('DropdownContentsLabelsView', () => {
});
});
});
});
it
(
'
first item is active when search is not empty
'
,
async
()
=>
{
createComponent
({
queryHandler
:
jest
.
fn
().
mockResolvedValue
(
workspaceLabelsQueryResponse
),
searchKey
:
'
Label
'
,
});
await
makeObserverAppear
();
await
waitForPromises
();
await
nextTick
();
expect
(
findLabelsList
().
exists
()).
toBe
(
true
);
expect
(
findFirstLabel
().
attributes
(
'
active
'
)).
toBe
(
'
true
'
);
});
it
(
'
when search returns 0 results
'
,
async
()
=>
{
it
(
'
when search returns 0 results
'
,
async
()
=>
{
createComponent
({
createComponent
({
queryHandler
:
jest
.
fn
().
mockResolvedValue
({
queryHandler
:
jest
.
fn
().
mockResolvedValue
({
...
...
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