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
797612bc
Commit
797612bc
authored
Jun 21, 2021
by
Vitaly Slobodin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace $emit call with a single arg in sidebar
See
https://gitlab.com/groups/gitlab-org/-/epics/3334
parent
c1e45452
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
10 deletions
+12
-10
ee/app/assets/javascripts/epic/components/epic_sidebar.vue
ee/app/assets/javascripts/epic/components/epic_sidebar.vue
+2
-2
ee/app/assets/javascripts/epic/components/sidebar_items/sidebar_date_picker.vue
...pts/epic/components/sidebar_items/sidebar_date_picker.vue
+2
-2
ee/spec/frontend/epic/components/epic_sidebar_spec.js
ee/spec/frontend/epic/components/epic_sidebar_spec.js
+4
-4
ee/spec/frontend/epic/components/sidebar_items/sidebar_date_picker_spec.js
...epic/components/sidebar_items/sidebar_date_picker_spec.js
+4
-2
No files found.
ee/app/assets/javascripts/epic/components/epic_sidebar.vue
View file @
797612bc
...
...
@@ -103,7 +103,7 @@ export default {
dueDateTimeFromMilestones
:
this
.
dueDateTimeFromMilestones
,
});
},
changeStartDateType
(
dateTypeIsFixed
,
typeChangeOnEdit
)
{
changeStartDateType
(
{
dateTypeIsFixed
,
typeChangeOnEdit
}
)
{
this
.
toggleStartDateType
({
dateTypeIsFixed
});
if
(
!
typeChangeOnEdit
)
{
this
.
saveDate
({
...
...
@@ -120,7 +120,7 @@ export default {
dateTypeIsFixed
:
true
,
});
},
changeDueDateType
(
dateTypeIsFixed
,
typeChangeOnEdit
)
{
changeDueDateType
(
{
dateTypeIsFixed
,
typeChangeOnEdit
}
)
{
this
.
toggleDueDateType
({
dateTypeIsFixed
});
if
(
!
typeChangeOnEdit
)
{
this
.
saveDate
({
...
...
ee/app/assets/javascripts/epic/components/sidebar_items/sidebar_date_picker.vue
View file @
797612bc
...
...
@@ -133,7 +133,7 @@ export default {
methods
:
{
stopEditing
()
{
this
.
editing
=
false
;
this
.
$emit
(
'
toggleDateType
'
,
true
,
true
);
this
.
$emit
(
'
toggleDateType
'
,
{
dateTypeIsFixed
:
true
,
typeChangeOnEdit
:
true
}
);
},
startEditing
(
e
)
{
this
.
editing
=
true
;
...
...
@@ -144,7 +144,7 @@ export default {
this
.
$emit
(
'
saveDate
'
,
date
);
},
toggleDateType
(
dateTypeFixed
)
{
this
.
$emit
(
'
toggleDateType
'
,
dateTypeFixed
);
this
.
$emit
(
'
toggleDateType
'
,
{
dateTypeIsFixed
:
dateTypeFixed
}
);
},
toggleSidebar
()
{
this
.
$emit
(
'
toggleCollapse
'
);
...
...
ee/spec/frontend/epic/components/epic_sidebar_spec.js
View file @
797612bc
...
...
@@ -68,7 +68,7 @@ describe('EpicSidebarComponent', () => {
it
(
'
calls `toggleStartDateType` on component with `dateTypeIsFixed` param
'
,
()
=>
{
jest
.
spyOn
(
wrapper
.
vm
,
'
toggleStartDateType
'
);
wrapper
.
vm
.
changeStartDateType
(
true
,
true
);
wrapper
.
vm
.
changeStartDateType
(
{
dateTypeIsFixed
:
true
,
typeChangeOnEdit
:
true
}
);
expect
(
wrapper
.
vm
.
toggleStartDateType
).
toHaveBeenCalledWith
(
expect
.
objectContaining
({
...
...
@@ -80,7 +80,7 @@ describe('EpicSidebarComponent', () => {
it
(
'
calls `saveDate` on component when `typeChangeOnEdit` param false
'
,
()
=>
{
jest
.
spyOn
(
wrapper
.
vm
,
'
saveDate
'
);
wrapper
.
vm
.
changeStartDateType
(
true
,
false
);
wrapper
.
vm
.
changeStartDateType
(
{
dateTypeIsFixed
:
true
,
typeChangeOnEdit
:
false
}
);
expect
(
wrapper
.
vm
.
saveDate
).
toHaveBeenCalledWith
(
expect
.
objectContaining
({
...
...
@@ -112,7 +112,7 @@ describe('EpicSidebarComponent', () => {
it
(
'
calls `toggleDueDateType` on component with `dateTypeIsFixed` param
'
,
()
=>
{
jest
.
spyOn
(
wrapper
.
vm
,
'
toggleDueDateType
'
);
wrapper
.
vm
.
changeDueDateType
(
true
,
true
);
wrapper
.
vm
.
changeDueDateType
(
{
dateTypeIsFixed
:
true
,
typeChangeOnEdit
:
true
}
);
expect
(
wrapper
.
vm
.
toggleDueDateType
).
toHaveBeenCalledWith
(
expect
.
objectContaining
({
...
...
@@ -124,7 +124,7 @@ describe('EpicSidebarComponent', () => {
it
(
'
calls `saveDate` on component when `typeChangeOnEdit` param false
'
,
()
=>
{
jest
.
spyOn
(
wrapper
.
vm
,
'
saveDate
'
);
wrapper
.
vm
.
changeDueDateType
(
true
,
false
);
wrapper
.
vm
.
changeDueDateType
(
{
dateTypeIsFixed
:
true
,
typeChangeOnEdit
:
false
}
);
expect
(
wrapper
.
vm
.
saveDate
).
toHaveBeenCalledWith
(
expect
.
objectContaining
({
...
...
ee/spec/frontend/epic/components/sidebar_items/sidebar_date_picker_spec.js
View file @
797612bc
...
...
@@ -146,7 +146,9 @@ describe('SidebarDatePicker', () => {
.
$nextTick
()
.
then
(()
=>
{
wrapper
.
find
(
DatePicker
).
vm
.
$emit
(
'
hidePicker
'
);
expect
(
wrapper
.
emitted
().
toggleDateType
[
0
]).
toStrictEqual
([
true
,
true
]);
expect
(
wrapper
.
emitted
().
toggleDateType
[
0
]).
toStrictEqual
([
{
dateTypeIsFixed
:
true
,
typeChangeOnEdit
:
true
},
]);
})
.
then
(()
=>
wrapper
.
vm
.
$nextTick
())
.
then
(()
=>
{
...
...
@@ -184,7 +186,7 @@ describe('SidebarDatePicker', () => {
wrapper
.
find
(
'
input
'
).
trigger
(
'
click
'
);
return
wrapper
.
vm
.
$nextTick
(()
=>
{
expect
(
wrapper
.
emitted
().
toggleDateType
).
toStrictEqual
([[
true
]]);
expect
(
wrapper
.
emitted
().
toggleDateType
).
toStrictEqual
([[
{
dateTypeIsFixed
:
true
}
]]);
});
});
...
...
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