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
dd4b1a1b
Commit
dd4b1a1b
authored
Jun 18, 2021
by
Terri Chu
Committed by
Vitaly Slobodin
Jun 18, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Sort by similarity in Search Group's Project dropdown
Changelog: changed
parent
d2580206
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
2 deletions
+9
-2
app/assets/javascripts/search/store/actions.js
app/assets/javascripts/search/store/actions.js
+1
-1
spec/frontend/search/store/actions_spec.js
spec/frontend/search/store/actions_spec.js
+8
-1
No files found.
app/assets/javascripts/search/store/actions.js
View file @
dd4b1a1b
...
...
@@ -30,7 +30,7 @@ export const fetchProjects = ({ commit, state }, search) => {
if
(
groupId
)
{
// TODO (https://gitlab.com/gitlab-org/gitlab/-/issues/323331): For errors `createFlash` is called twice; in `callback` and in `Api.groupProjects`
Api
.
groupProjects
(
groupId
,
search
,
{},
callback
);
Api
.
groupProjects
(
groupId
,
search
,
{
order_by
:
'
similarity
'
},
callback
);
}
else
{
// The .catch() is due to the API method not handling a rejection properly
Api
.
projects
(
search
,
{
order_by
:
'
id
'
},
callback
).
catch
(()
=>
{
...
...
spec/frontend/search/store/actions_spec.js
View file @
dd4b1a1b
...
...
@@ -67,7 +67,14 @@ describe('Global Search Store Actions', () => {
it
(
'
calls Api.groupProjects
'
,
()
=>
{
actions
.
fetchProjects
({
commit
:
mockCommit
,
state
});
expect
(
Api
.
groupProjects
).
toHaveBeenCalled
();
expect
(
Api
.
groupProjects
).
toHaveBeenCalledWith
(
state
.
query
.
group_id
,
state
.
query
.
search
,
{
order_by
:
'
similarity
'
,
},
expect
.
any
(
Function
),
);
expect
(
Api
.
projects
).
not
.
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