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 {
this
.
updateGroups
(
res
,
Boolean
(
filterGroupsBy
));
});
},
fetchPage
(
page
,
filterGroupsBy
,
sortBy
,
archived
)
{
fetchPage
(
{
page
,
filterGroupsBy
,
sortBy
,
archived
}
)
{
this
.
isLoading
=
true
;
return
this
.
fetchGroups
({
...
...
app/assets/javascripts/groups/components/groups.vue
View file @
a3ffe24d
...
...
@@ -32,10 +32,10 @@ export default {
},
methods
:
{
change
(
page
)
{
const
filterGroups
Param
=
getParameterByName
(
'
filter
'
);
const
sort
Param
=
getParameterByName
(
'
sort
'
);
const
archived
Param
=
getParameterByName
(
'
archived
'
);
eventHub
.
$emit
(
`
${
this
.
action
}
fetchPage`
,
page
,
filterGroupsParam
,
sortParam
,
archivedParam
);
const
filterGroups
By
=
getParameterByName
(
'
filter
'
);
const
sort
By
=
getParameterByName
(
'
sort
'
);
const
archived
=
getParameterByName
(
'
archived
'
);
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', () => {
jest
.
spyOn
(
window
.
history
,
'
replaceState
'
).
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
.
fetchGroups
).
toHaveBeenCalledWith
({
...
...
spec/frontend/groups/components/groups_spec.js
View file @
a3ffe24d
...
...
@@ -41,13 +41,12 @@ describe('GroupsComponent', () => {
vm
.
change
(
2
);
expect
(
eventHub
.
$emit
).
toHaveBeenCalledWith
(
'
fetchPage
'
,
2
,
expect
.
any
(
Object
),
expect
.
any
(
Object
),
expect
.
any
(
Object
),
);
expect
(
eventHub
.
$emit
).
toHaveBeenCalledWith
(
'
fetchPage
'
,
{
page
:
2
,
archived
:
null
,
filterGroupsBy
:
null
,
sortBy
:
null
,
});
});
});
});
...
...
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