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
355fcccc
Commit
355fcccc
authored
Jan 09, 2020
by
Florie Guibert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update widget on click dropdown item when creating epic from epic
parent
d1a3567e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
5 deletions
+17
-5
app/assets/javascripts/vue_shared/components/split_button.vue
...assets/javascripts/vue_shared/components/split_button.vue
+3
-5
spec/frontend/vue_shared/components/split_button_spec.js
spec/frontend/vue_shared/components/split_button_spec.js
+14
-0
No files found.
app/assets/javascripts/vue_shared/components/split_button.vue
View file @
355fcccc
...
...
@@ -49,7 +49,8 @@ export default {
triggerEvent
()
{
this
.
$emit
(
this
.
selectedItem
.
eventName
);
},
change
(
item
)
{
changeSelectedItem
(
item
)
{
this
.
selectedItem
=
item
;
this
.
$emit
(
'
change
'
,
item
);
},
},
...
...
@@ -70,10 +71,7 @@ export default {
:key=
"item.eventName"
:active=
"selectedItem === item"
active-class=
"is-active"
@
click=
"
selectedItem = item;
change(item);
"
@
click=
"changeSelectedItem(item)"
>
<strong>
{{
item
.
title
}}
</strong>
<div>
{{
item
.
description
}}
</div>
...
...
spec/frontend/vue_shared/components/split_button_spec.js
View file @
355fcccc
...
...
@@ -74,6 +74,7 @@ describe('SplitButton', () => {
describe
(
'
emitted event
'
,
()
=>
{
let
eventHandler
;
let
changeEventHandler
;
beforeEach
(()
=>
{
createComponent
({
actionItems
:
mockActionItems
});
...
...
@@ -84,6 +85,11 @@ describe('SplitButton', () => {
wrapper
.
vm
.
$once
(
eventName
,
()
=>
eventHandler
());
};
const
addChangeEventHandler
=
()
=>
{
changeEventHandler
=
jest
.
fn
();
wrapper
.
vm
.
$once
(
'
change
'
,
()
=>
changeEventHandler
());
};
it
(
'
defaults to first actionItems event
'
,
()
=>
{
addEventHandler
(
mockActionItems
[
0
]);
...
...
@@ -99,5 +105,13 @@ describe('SplitButton', () => {
.
then
(()
=>
{
expect
(
eventHandler
).
toHaveBeenCalled
();
}));
it
(
'
change to selected actionItem emits change event
'
,
()
=>
{
addChangeEventHandler
();
return
selectItem
(
1
).
then
(()
=>
{
expect
(
changeEventHandler
).
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