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
a3ffe24d
Commit
a3ffe24d
authored
Aug 25, 2021
by
Vitaly Slobodin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace Vue.$emit with single arg in groups
parent
9c38b4c0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
13 deletions
+17
-13
app/assets/javascripts/groups/components/app.vue
app/assets/javascripts/groups/components/app.vue
+1
-1
app/assets/javascripts/groups/components/groups.vue
app/assets/javascripts/groups/components/groups.vue
+4
-4
spec/frontend/groups/components/app_spec.js
spec/frontend/groups/components/app_spec.js
+6
-1
spec/frontend/groups/components/groups_spec.js
spec/frontend/groups/components/groups_spec.js
+6
-7
No files found.
app/assets/javascripts/groups/components/app.vue
View file @
a3ffe24d
...
@@ -136,7 +136,7 @@ export default {
...
@@ -136,7 +136,7 @@ export default {
this
.
updateGroups
(
res
,
Boolean
(
filterGroupsBy
));
this
.
updateGroups
(
res
,
Boolean
(
filterGroupsBy
));
});
});
},
},
fetchPage
(
page
,
filterGroupsBy
,
sortBy
,
archived
)
{
fetchPage
(
{
page
,
filterGroupsBy
,
sortBy
,
archived
}
)
{
this
.
isLoading
=
true
;
this
.
isLoading
=
true
;
return
this
.
fetchGroups
({
return
this
.
fetchGroups
({
...
...
app/assets/javascripts/groups/components/groups.vue
View file @
a3ffe24d
...
@@ -32,10 +32,10 @@ export default {
...
@@ -32,10 +32,10 @@ export default {
},
},
methods
:
{
methods
:
{
change
(
page
)
{
change
(
page
)
{
const
filterGroups
Param
=
getParameterByName
(
'
filter
'
);
const
filterGroups
By
=
getParameterByName
(
'
filter
'
);
const
sort
Param
=
getParameterByName
(
'
sort
'
);
const
sort
By
=
getParameterByName
(
'
sort
'
);
const
archived
Param
=
getParameterByName
(
'
archived
'
);
const
archived
=
getParameterByName
(
'
archived
'
);
eventHub
.
$emit
(
`
${
this
.
action
}
fetchPage`
,
page
,
filterGroupsParam
,
sortParam
,
archivedParam
);
eventHub
.
$emit
(
`
${
this
.
action
}
fetchPage`
,
{
page
,
filterGroupsBy
,
sortBy
,
archived
}
);
},
},
},
},
};
};
...
...
spec/frontend/groups/components/app_spec.js
View file @
a3ffe24d
...
@@ -182,7 +182,12 @@ describe('AppComponent', () => {
...
@@ -182,7 +182,12 @@ describe('AppComponent', () => {
jest
.
spyOn
(
window
.
history
,
'
replaceState
'
).
mockImplementation
(()
=>
{});
jest
.
spyOn
(
window
.
history
,
'
replaceState
'
).
mockImplementation
(()
=>
{});
jest
.
spyOn
(
window
,
'
scrollTo
'
).
mockImplementation
(()
=>
{});
jest
.
spyOn
(
window
,
'
scrollTo
'
).
mockImplementation
(()
=>
{});
const
fetchPagePromise
=
vm
.
fetchPage
(
2
,
null
,
null
,
true
);
const
fetchPagePromise
=
vm
.
fetchPage
({
page
:
2
,
filterGroupsBy
:
null
,
sortBy
:
null
,
archived
:
true
,
});
expect
(
vm
.
isLoading
).
toBe
(
true
);
expect
(
vm
.
isLoading
).
toBe
(
true
);
expect
(
vm
.
fetchGroups
).
toHaveBeenCalledWith
({
expect
(
vm
.
fetchGroups
).
toHaveBeenCalledWith
({
...
...
spec/frontend/groups/components/groups_spec.js
View file @
a3ffe24d
...
@@ -41,13 +41,12 @@ describe('GroupsComponent', () => {
...
@@ -41,13 +41,12 @@ describe('GroupsComponent', () => {
vm
.
change
(
2
);
vm
.
change
(
2
);
expect
(
eventHub
.
$emit
).
toHaveBeenCalledWith
(
expect
(
eventHub
.
$emit
).
toHaveBeenCalledWith
(
'
fetchPage
'
,
{
'
fetchPage
'
,
page
:
2
,
2
,
archived
:
null
,
expect
.
any
(
Object
),
filterGroupsBy
:
null
,
expect
.
any
(
Object
),
sortBy
:
null
,
expect
.
any
(
Object
),
});
);
});
});
});
});
});
});
...
...
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