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
39b6ddf2
Commit
39b6ddf2
authored
Oct 07, 2021
by
Florie Guibert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix labels widget update on close on Ubuntu
parent
b20d0415
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
7 deletions
+20
-7
app/assets/javascripts/vue_shared/components/sidebar/labels_select_widget/dropdown_contents.vue
...onents/sidebar/labels_select_widget/dropdown_contents.vue
+3
-3
app/assets/javascripts/vue_shared/components/sidebar/labels_select_widget/labels_select_root.vue
...nents/sidebar/labels_select_widget/labels_select_root.vue
+6
-2
spec/frontend/vue_shared/components/sidebar/labels_select_widget/dropdown_contents_spec.js
...ts/sidebar/labels_select_widget/dropdown_contents_spec.js
+3
-2
spec/frontend/vue_shared/components/sidebar/labels_select_widget/labels_select_root_spec.js
...s/sidebar/labels_select_widget/labels_select_root_spec.js
+8
-0
No files found.
app/assets/javascripts/vue_shared/components/sidebar/labels_select_widget/dropdown_contents.vue
View file @
39b6ddf2
...
@@ -87,9 +87,6 @@ export default {
...
@@ -87,9 +87,6 @@ export default {
return
isDropdownVariantStandalone
(
this
.
variant
);
return
isDropdownVariantStandalone
(
this
.
variant
);
},
},
},
},
mounted
()
{
this
.
$refs
.
dropdown
.
show
();
},
methods
:
{
methods
:
{
toggleDropdownContentsCreateView
()
{
toggleDropdownContentsCreateView
()
{
this
.
showDropdownContentsCreateView
=
!
this
.
showDropdownContentsCreateView
;
this
.
showDropdownContentsCreateView
=
!
this
.
showDropdownContentsCreateView
;
...
@@ -101,6 +98,9 @@ export default {
...
@@ -101,6 +98,9 @@ export default {
this
.
$refs
.
dropdown
.
$refs
.
dropdown
.
$_popper
.
scheduleUpdate
();
this
.
$refs
.
dropdown
.
$refs
.
dropdown
.
$_popper
.
scheduleUpdate
();
}
}
},
},
showDropdown
()
{
this
.
$refs
.
dropdown
.
show
();
},
closeDropdown
()
{
closeDropdown
()
{
this
.
$emit
(
'
setLabels
'
,
this
.
localSelectedLabels
);
this
.
$emit
(
'
setLabels
'
,
this
.
localSelectedLabels
);
this
.
$refs
.
dropdown
.
hide
();
this
.
$refs
.
dropdown
.
hide
();
...
...
app/assets/javascripts/vue_shared/components/sidebar/labels_select_widget/labels_select_root.vue
View file @
39b6ddf2
...
@@ -141,6 +141,9 @@ export default {
...
@@ -141,6 +141,9 @@ export default {
handleCollapsedValueClick
()
{
handleCollapsedValueClick
()
{
this
.
$emit
(
'
toggleCollapse
'
);
this
.
$emit
(
'
toggleCollapse
'
);
},
},
showDropdownContents
()
{
this
.
$refs
.
dropdownContents
.
showDropdown
();
},
isDropdownVariantSidebar
,
isDropdownVariantSidebar
,
isDropdownVariantStandalone
,
isDropdownVariantStandalone
,
isDropdownVariantEmbedded
,
isDropdownVariantEmbedded
,
...
@@ -167,6 +170,7 @@ export default {
...
@@ -167,6 +170,7 @@ export default {
:title=
"__('Labels')"
:title=
"__('Labels')"
:loading=
"isLoading"
:loading=
"isLoading"
:can-edit=
"allowLabelEdit"
:can-edit=
"allowLabelEdit"
@
open=
"showDropdownContents"
>
>
<template
#collapsed
>
<template
#collapsed
>
<dropdown-value
<dropdown-value
...
@@ -180,7 +184,7 @@ export default {
...
@@ -180,7 +184,7 @@ export default {
<slot></slot>
<slot></slot>
</dropdown-value>
</dropdown-value>
</
template
>
</
template
>
<
template
#default
=
"{ edit }"
>
<
template
#default
>
<dropdown-value
<dropdown-value
:disable-labels=
"labelsSelectInProgress"
:disable-labels=
"labelsSelectInProgress"
:selected-labels=
"issuableLabels"
:selected-labels=
"issuableLabels"
...
@@ -193,7 +197,7 @@ export default {
...
@@ -193,7 +197,7 @@ export default {
<slot></slot>
<slot></slot>
</dropdown-value>
</dropdown-value>
<dropdown-contents
<dropdown-contents
v-if=
"edit
"
ref=
"dropdownContents
"
:dropdown-button-text=
"dropdownButtonText"
:dropdown-button-text=
"dropdownButtonText"
:allow-multiselect=
"allowMultiselect"
:allow-multiselect=
"allowMultiselect"
:labels-list-title=
"labelsListTitle"
:labels-list-title=
"labelsListTitle"
...
...
spec/frontend/vue_shared/components/sidebar/labels_select_widget/dropdown_contents_spec.js
View file @
39b6ddf2
...
@@ -68,10 +68,11 @@ describe('DropdownContent', () => {
...
@@ -68,10 +68,11 @@ describe('DropdownContent', () => {
const
findCreateLabelButton
=
()
=>
wrapper
.
find
(
'
[data-testid="create-label-button"]
'
);
const
findCreateLabelButton
=
()
=>
wrapper
.
find
(
'
[data-testid="create-label-button"]
'
);
const
findGoBackButton
=
()
=>
wrapper
.
find
(
'
[data-testid="go-back-button"]
'
);
const
findGoBackButton
=
()
=>
wrapper
.
find
(
'
[data-testid="go-back-button"]
'
);
it
(
'
calls dropdown `show` method on component mount
'
,
()
=>
{
it
(
'
emits `show` for dropdown on call showDropdown
'
,
()
=>
{
createComponent
();
createComponent
();
wrapper
.
vm
.
showDropdown
();
expect
(
showDropdown
).
toHaveBeenCall
ed
();
expect
(
findDropdown
().
emitted
(
'
show
'
)).
toBeUndefin
ed
();
});
});
it
(
'
emits `setLabels` event on dropdown hide
'
,
()
=>
{
it
(
'
emits `setLabels` event on dropdown hide
'
,
()
=>
{
...
...
spec/frontend/vue_shared/components/sidebar/labels_select_widget/labels_select_root_spec.js
View file @
39b6ddf2
...
@@ -128,6 +128,13 @@ describe('LabelsSelectRoot', () => {
...
@@ -128,6 +128,13 @@ describe('LabelsSelectRoot', () => {
it
(
'
emits `updateSelectedLabels` event on dropdown contents `setLabels` event if there are labels to update
'
,
async
()
=>
{
it
(
'
emits `updateSelectedLabels` event on dropdown contents `setLabels` event if there are labels to update
'
,
async
()
=>
{
const
label
=
{
id
:
'
gid://gitlab/ProjectLabel/1
'
};
const
label
=
{
id
:
'
gid://gitlab/ProjectLabel/1
'
};
createComponent
();
createComponent
();
wrapper
.
vm
.
$refs
.
dropdownContents
=
{
showDropdown
:
jest
.
fn
(),
};
const
showSpy
=
jest
.
spyOn
(
wrapper
.
vm
.
$refs
.
dropdownContents
,
'
showDropdown
'
);
findDropdownContents
().
vm
.
$refs
.
dropdown
=
{
show
:
jest
.
fn
(),
};
await
waitForPromises
();
await
waitForPromises
();
expandDropdown
();
expandDropdown
();
...
@@ -135,5 +142,6 @@ describe('LabelsSelectRoot', () => {
...
@@ -135,5 +142,6 @@ describe('LabelsSelectRoot', () => {
findDropdownContents
().
vm
.
$emit
(
'
setLabels
'
,
[
label
]);
findDropdownContents
().
vm
.
$emit
(
'
setLabels
'
,
[
label
]);
expect
(
wrapper
.
emitted
(
'
updateSelectedLabels
'
)).
toEqual
([[[
label
]]]);
expect
(
wrapper
.
emitted
(
'
updateSelectedLabels
'
)).
toEqual
([[[
label
]]]);
expect
(
showSpy
).
toHaveBeenCalled
();
});
});
});
});
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