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
cacc8f40
Commit
cacc8f40
authored
Apr 12, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixes the sort to correctly order the array
parent
e51fde9a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
10 deletions
+9
-10
app/assets/javascripts/ide/components/file_finder/index.vue
app/assets/javascripts/ide/components/file_finder/index.vue
+2
-1
app/assets/javascripts/ide/stores/getters.js
app/assets/javascripts/ide/stores/getters.js
+7
-9
No files found.
app/assets/javascripts/ide/components/file_finder/index.vue
View file @
cacc8f40
...
...
@@ -24,7 +24,8 @@ export default {
filteredBlobs
()
{
const
searchText
=
this
.
searchText
.
trim
();
if
(
searchText
===
''
)
return
this
.
allBlobs
.
slice
(
0
,
MAX_RESULTS
);
if
(
searchText
===
''
)
return
this
.
allBlobs
.
sort
((
a
,
b
)
=>
b
.
lastOpenedAt
-
a
.
lastOpenedAt
).
slice
(
0
,
MAX_RESULTS
);
return
fuzzaldrinPlus
.
filter
(
this
.
allBlobs
,
searchText
,
{
key
:
'
path
'
,
...
...
app/assets/javascripts/ide/stores/getters.js
View file @
cacc8f40
...
...
@@ -37,8 +37,7 @@ export const hasChanges = state => !!state.changedFiles.length;
export
const
hasMergeRequest
=
state
=>
!!
state
.
currentMergeRequestId
;
export
const
allBlobs
=
state
=>
Object
.
keys
(
state
.
entries
)
.
reduce
((
acc
,
key
)
=>
{
Object
.
keys
(
state
.
entries
).
reduce
((
acc
,
key
)
=>
{
const
entry
=
state
.
entries
[
key
];
if
(
entry
.
type
===
'
blob
'
)
{
...
...
@@ -46,5 +45,4 @@ export const allBlobs = state =>
}
return
acc
;
},
[])
.
sort
((
a
,
b
)
=>
b
.
lastOpenedAt
>
a
.
lastOpenedAt
);
},
[]);
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