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
8a645d43
Commit
8a645d43
authored
Dec 10, 2021
by
Florie Guibert
Committed by
Natalia Tepluhina
Dec 10, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Labels widget follow up
parent
14ab76f9
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
33 additions
and
22 deletions
+33
-22
app/assets/javascripts/vue_shared/components/sidebar/labels_select_widget/dropdown_contents.vue
...onents/sidebar/labels_select_widget/dropdown_contents.vue
+2
-2
app/assets/javascripts/vue_shared/components/sidebar/labels_select_widget/dropdown_header.vue
...mponents/sidebar/labels_select_widget/dropdown_header.vue
+10
-4
app/assets/javascripts/vue_shared/components/sidebar/labels_select_widget/labels_select_root.vue
...nents/sidebar/labels_select_widget/labels_select_root.vue
+1
-1
spec/frontend/vue_shared/components/sidebar/labels_select_widget/dropdown_contents_spec.js
...ts/sidebar/labels_select_widget/dropdown_contents_spec.js
+1
-13
spec/frontend/vue_shared/components/sidebar/labels_select_widget/dropdown_header_spec.js
...ents/sidebar/labels_select_widget/dropdown_header_spec.js
+17
-0
spec/frontend/vue_shared/components/sidebar/labels_select_widget/labels_select_root_spec.js
...s/sidebar/labels_select_widget/labels_select_root_spec.js
+2
-2
No files found.
app/assets/javascripts/vue_shared/components/sidebar/labels_select_widget/dropdown_contents.vue
View file @
8a645d43
...
...
@@ -195,12 +195,12 @@ export default {
>
<template
#header
>
<dropdown-header
v-if=
"!isStandalone"
ref=
"header"
v-model
=
"searchKey"
:search-key
=
"searchKey"
:labels-create-title=
"labelsCreateTitle"
:labels-list-title=
"labelsListTitle"
:show-dropdown-contents-create-view=
"showDropdownContentsCreateView"
:is-standalone=
"isStandalone"
@
toggleDropdownContentsCreateView=
"toggleDropdownContent"
@
closeDropdown=
"$emit('closeDropdown')"
@
input=
"debouncedSearchKeyUpdate"
...
...
app/assets/javascripts/vue_shared/components/sidebar/labels_select_widget/dropdown_header.vue
View file @
8a645d43
...
...
@@ -6,9 +6,6 @@ export default {
GlButton
,
GlSearchBoxByType
,
},
model
:
{
prop
:
'
searchKey
'
,
},
props
:
{
labelsCreateTitle
:
{
type
:
String
,
...
...
@@ -31,6 +28,11 @@ export default {
type
:
String
,
required
:
true
,
},
isStandalone
:
{
type
:
Boolean
,
required
:
false
,
default
:
false
,
},
},
computed
:
{
dropdownTitle
()
{
...
...
@@ -47,7 +49,11 @@ export default {
<
template
>
<div
data-testid=
"dropdown-header"
>
<div
class=
"dropdown-title gl-display-flex gl-align-items-center gl-pt-0 gl-pb-3!"
>
<div
v-if=
"!isStandalone"
class=
"dropdown-title gl-display-flex gl-align-items-center gl-pt-0 gl-pb-3!"
data-testid=
"dropdown-header-title"
>
<gl-button
v-if=
"showDropdownContentsCreateView"
:aria-label=
"__('Go back')"
...
...
app/assets/javascripts/vue_shared/components/sidebar/labels_select_widget/labels_select_root.vue
View file @
8a645d43
...
...
@@ -286,7 +286,7 @@ export default {
<
template
>
<div
class=
"labels-select-wrapper
position
-relative"
class=
"labels-select-wrapper
gl
-relative"
:class=
"
{
'is-standalone': isDropdownVariantStandalone(variant),
'is-embedded': isDropdownVariantEmbedded(variant),
...
...
spec/frontend/vue_shared/components/sidebar/labels_select_widget/dropdown_contents_spec.js
View file @
8a645d43
...
...
@@ -124,19 +124,7 @@ describe('DropdownContent', () => {
expect
(
wrapper
.
emitted
(
'
setLabels
'
)).
toEqual
([[[
updatedLabel
]]]);
});
it
(
'
does not render header on standalone variant
'
,
()
=>
{
createComponent
({
props
:
{
variant
:
DropdownVariant
.
Standalone
}
});
expect
(
findDropdownHeader
().
exists
()).
toBe
(
false
);
});
it
(
'
renders header on embedded variant
'
,
()
=>
{
createComponent
({
props
:
{
variant
:
DropdownVariant
.
Embedded
}
});
expect
(
findDropdownHeader
().
exists
()).
toBe
(
true
);
});
it
(
'
renders header on sidebar variant
'
,
()
=>
{
it
(
'
renders header
'
,
()
=>
{
createComponent
();
expect
(
findDropdownHeader
().
exists
()).
toBe
(
true
);
...
...
spec/frontend/vue_shared/components/sidebar/labels_select_widget/dropdown_header_spec.js
View file @
8a645d43
...
...
@@ -9,6 +9,7 @@ describe('DropdownHeader', () => {
const
createComponent
=
({
showDropdownContentsCreateView
=
false
,
labelsFetchInProgress
=
false
,
isStandalone
=
false
,
}
=
{})
=>
{
wrapper
=
extendedWrapper
(
shallowMount
(
DropdownHeader
,
{
...
...
@@ -18,6 +19,7 @@ describe('DropdownHeader', () => {
labelsCreateTitle
:
'
Create label
'
,
labelsListTitle
:
'
Select label
'
,
searchKey
:
''
,
isStandalone
,
},
stubs
:
{
GlSearchBoxByType
,
...
...
@@ -32,6 +34,7 @@ describe('DropdownHeader', () => {
const
findSearchInput
=
()
=>
wrapper
.
findComponent
(
GlSearchBoxByType
);
const
findGoBackButton
=
()
=>
wrapper
.
findByTestId
(
'
go-back-button
'
);
const
findDropdownTitle
=
()
=>
wrapper
.
findByTestId
(
'
dropdown-header-title
'
);
beforeEach
(()
=>
{
createComponent
();
...
...
@@ -72,4 +75,18 @@ describe('DropdownHeader', () => {
},
);
});
describe
(
'
Standalone variant
'
,
()
=>
{
beforeEach
(()
=>
{
createComponent
({
isStandalone
:
true
});
});
it
(
'
renders search input
'
,
()
=>
{
expect
(
findSearchInput
().
exists
()).
toBe
(
true
);
});
it
(
'
does not render title
'
,
async
()
=>
{
expect
(
findDropdownTitle
().
exists
()).
toBe
(
false
);
});
});
});
spec/frontend/vue_shared/components/sidebar/labels_select_widget/labels_select_root_spec.js
View file @
8a645d43
...
...
@@ -75,9 +75,9 @@ describe('LabelsSelectRoot', () => {
wrapper
.
destroy
();
});
it
(
'
renders component with classes `labels-select-wrapper
position
-relative`
'
,
()
=>
{
it
(
'
renders component with classes `labels-select-wrapper
gl
-relative`
'
,
()
=>
{
createComponent
();
expect
(
wrapper
.
classes
()).
toEqual
([
'
labels-select-wrapper
'
,
'
position
-relative
'
]);
expect
(
wrapper
.
classes
()).
toEqual
([
'
labels-select-wrapper
'
,
'
gl
-relative
'
]);
});
it
.
each
`
...
...
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