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
ee37a4eb
Commit
ee37a4eb
authored
Jul 14, 2021
by
Vitaly Slobodin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace $emit call with a single argument
See
https://gitlab.com/groups/gitlab-org/-/epics/3334
parent
c24915f8
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
7 deletions
+10
-7
ee/app/assets/javascripts/boards/stores/boards_store_ee.js
ee/app/assets/javascripts/boards/stores/boards_store_ee.js
+1
-1
ee/app/assets/javascripts/sidebar/components/weight/sidebar_weight.vue
.../javascripts/sidebar/components/weight/sidebar_weight.vue
+1
-1
ee/app/assets/javascripts/sidebar/components/weight/weight.vue
...p/assets/javascripts/sidebar/components/weight/weight.vue
+2
-2
ee/spec/frontend/sidebar/sidebar_weight_spec.js
ee/spec/frontend/sidebar/sidebar_weight_spec.js
+1
-1
ee/spec/frontend/sidebar/weight_spec.js
ee/spec/frontend/sidebar/weight_spec.js
+5
-2
No files found.
ee/app/assets/javascripts/boards/stores/boards_store_ee.js
View file @
ee37a4eb
...
...
@@ -170,7 +170,7 @@ class BoardsStoreEE {
issue
.
epic
=
newEpic
;
}
updateWeight
(
newWeight
,
id
)
{
updateWeight
(
{
id
,
value
:
newWeight
}
)
{
const
{
issue
}
=
this
.
store
.
detail
;
if
(
issue
.
id
===
id
&&
issue
.
sidebarInfoEndpoint
)
{
issue
.
setLoadingState
(
'
weight
'
,
true
);
...
...
ee/app/assets/javascripts/sidebar/components/weight/sidebar_weight.vue
View file @
ee37a4eb
...
...
@@ -26,7 +26,7 @@ export default {
},
methods
:
{
onUpdateWeight
(
newWeight
)
{
onUpdateWeight
(
{
value
:
newWeight
}
)
{
this
.
mediator
.
updateWeight
(
newWeight
).
catch
(()
=>
{
createFlash
({
message
:
__
(
'
Error occurred while updating the issue weight
'
),
...
...
ee/app/assets/javascripts/sidebar/components/weight/weight.vue
View file @
ee37a4eb
...
...
@@ -123,14 +123,14 @@ export default {
$
(
this
.
$el
).
trigger
(
'
hidden.gl.dropdown
'
);
if
(
isNewValue
)
{
eventHub
.
$emit
(
'
updateWeight
'
,
value
,
this
.
id
);
eventHub
.
$emit
(
'
updateWeight
'
,
{
id
:
this
.
id
,
value
}
);
}
this
.
showEditField
(
false
);
}
},
removeWeight
()
{
eventHub
.
$emit
(
'
updateWeight
'
,
''
,
this
.
id
);
eventHub
.
$emit
(
'
updateWeight
'
,
{
id
:
this
.
id
,
value
:
''
}
);
},
},
maxDisplayWeight
:
MAX_DISPLAY_WEIGHT
,
...
...
ee/spec/frontend/sidebar/sidebar_weight_spec.js
View file @
ee37a4eb
...
...
@@ -36,7 +36,7 @@ describe('Sidebar Weight', () => {
mediator
:
sidebarMediator
,
});
eventHub
.
$emit
(
'
updateWeight
'
);
eventHub
.
$emit
(
'
updateWeight
'
,
{
value
:
''
}
);
expect
(
SidebarMediator
.
prototype
.
updateWeight
).
toHaveBeenCalled
();
});
...
...
ee/spec/frontend/sidebar/weight_spec.js
View file @
ee37a4eb
...
...
@@ -130,7 +130,10 @@ describe('Weight', () => {
await
wrapper
.
vm
.
$nextTick
;
expect
(
containsInputError
()).
toBe
(
false
);
expect
(
eventHub
.
$emit
).
toHaveBeenCalledWith
(
'
updateWeight
'
,
expectedWeightValue
,
mockId
);
expect
(
eventHub
.
$emit
).
toHaveBeenCalledWith
(
'
updateWeight
'
,
{
id
:
mockId
,
value
:
expectedWeightValue
,
});
});
it
(
'
emits event on remove weight link click
'
,
async
()
=>
{
...
...
@@ -149,7 +152,7 @@ describe('Weight', () => {
await
wrapper
.
vm
.
$nextTick
;
expect
(
containsInputError
()).
toBe
(
false
);
expect
(
eventHub
.
$emit
).
toHaveBeenCalledWith
(
'
updateWeight
'
,
''
,
mockId
);
expect
(
eventHub
.
$emit
).
toHaveBeenCalledWith
(
'
updateWeight
'
,
{
id
:
mockId
,
value
:
''
}
);
});
it
(
'
triggers error on invalid negative integer value
'
,
async
()
=>
{
...
...
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