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
2113d961
Commit
2113d961
authored
Sep 08, 2021
by
Terri Chu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use similarity sort in search project dropdown
Changelog: changed
parent
d3d80a33
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-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
+7
-1
No files found.
app/assets/javascripts/search/store/actions.js
View file @
2113d961
...
...
@@ -40,7 +40,7 @@ export const fetchProjects = ({ commit, state }, search) => {
);
}
else
{
// The .catch() is due to the API method not handling a rejection properly
Api
.
projects
(
search
,
{
order_by
:
'
id
'
},
callback
).
catch
(()
=>
{
Api
.
projects
(
search
,
{
order_by
:
'
similarity
'
},
callback
).
catch
(()
=>
{
callback
();
});
}
...
...
spec/frontend/search/store/actions_spec.js
View file @
2113d961
...
...
@@ -142,7 +142,13 @@ describe('Global Search Store Actions', () => {
actions
.
fetchProjects
({
commit
:
mockCommit
,
state
});
expect
(
Api
.
groupProjects
).
not
.
toHaveBeenCalled
();
expect
(
Api
.
projects
).
toHaveBeenCalled
();
expect
(
Api
.
projects
).
toHaveBeenCalledWith
(
state
.
query
.
search
,
{
order_by
:
'
similarity
'
,
},
expect
.
any
(
Function
),
);
});
});
});
...
...
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