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
fda7a608
Commit
fda7a608
authored
Apr 08, 2021
by
Rajat Jain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use topFrequentItems in projects dropdown
parent
d749256a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
15 deletions
+17
-15
ee/app/assets/javascripts/related_items_tree/components/create_issue_form.vue
...ripts/related_items_tree/components/create_issue_form.vue
+8
-11
ee/changelogs/unreleased/frequent-items.yml
ee/changelogs/unreleased/frequent-items.yml
+5
-0
ee/spec/frontend/related_items_tree/mock_data.js
ee/spec/frontend/related_items_tree/mock_data.js
+4
-4
No files found.
ee/app/assets/javascripts/related_items_tree/components/create_issue_form.vue
View file @
fda7a608
...
...
@@ -15,7 +15,8 @@ import { mapState, mapActions } from 'vuex';
import
Api
from
'
~/api
'
;
import
createFlash
,
{
FLASH_TYPES
}
from
'
~/flash
'
;
import
{
STORAGE_KEY
,
FREQUENT_ITEMS
}
from
'
~/frequent_items/constants
'
;
import
{
STORAGE_KEY
}
from
'
~/frequent_items/constants
'
;
import
{
getTopFrequentItems
}
from
'
~/frequent_items/utils
'
;
import
AccessorUtilities
from
'
~/lib/utils/accessor
'
;
import
{
__
}
from
'
~/locale
'
;
import
ProjectAvatar
from
'
~/vue_shared/components/project_avatar/default.vue
'
;
...
...
@@ -137,11 +138,9 @@ export default {
let
storedFrequentItems
=
storedRawItems
?
JSON
.
parse
(
storedRawItems
)
:
[];
/* Filter for the current group */
storedFrequentItems
=
storedFrequentItems
.
filter
((
item
)
=>
{
return
Boolean
(
item
.
webUrl
?.
slice
(
1
)?.
startsWith
(
this
.
parentItem
.
fullPath
));
})
.
sort
((
a
,
b
)
=>
a
.
frequency
>
b
.
frequency
);
storedFrequentItems
=
storedFrequentItems
.
filter
((
item
)
=>
{
return
Boolean
(
item
.
webUrl
?.
slice
(
1
)?.
startsWith
(
this
.
parentItem
.
fullPath
));
});
if
(
searchTerm
)
{
storedFrequentItems
=
fuzzaldrinPlus
.
filter
(
storedFrequentItems
,
searchTerm
,
{
...
...
@@ -149,11 +148,9 @@ export default {
});
}
this
.
recentItems
=
storedFrequentItems
.
map
((
item
)
=>
{
return
{
...
item
,
avatar_url
:
item
.
avatarUrl
,
web_url
:
item
.
webUrl
};
})
.
slice
(
0
,
FREQUENT_ITEMS
.
LIST_COUNT_DESKTOP
);
// Only keep top 5 results
this
.
recentItems
=
getTopFrequentItems
(
storedFrequentItems
).
map
((
item
)
=>
{
return
{
...
item
,
avatar_url
:
item
.
avatarUrl
,
web_url
:
item
.
webUrl
};
});
return
this
.
recentItems
;
},
...
...
ee/changelogs/unreleased/frequent-items.yml
0 → 100644
View file @
fda7a608
---
title
:
Use `getTopFrequentItems` in projects dropdown to show recently used
merge_request
:
58851
author
:
type
:
fixed
ee/spec/frontend/related_items_tree/mock_data.js
View file @
fda7a608
...
...
@@ -368,7 +368,7 @@ export const mockFrequentlyUsedProjects = [
webUrl
:
'
/gitlab-org/project1
'
,
avatarUrl
:
null
,
lastAccessedOn
:
123
,
frequency
:
1
,
frequency
:
4
,
},
{
id
:
2
,
...
...
@@ -377,7 +377,7 @@ export const mockFrequentlyUsedProjects = [
webUrl
:
'
/gitlab-org/project2
'
,
avatarUrl
:
null
,
lastAccessedOn
:
124
,
frequency
:
1
,
frequency
:
3
,
},
];
...
...
@@ -389,7 +389,7 @@ export const mockMixedFrequentlyUsedProjects = [
webUrl
:
'
/gitlab-org/project1
'
,
avatarUrl
:
null
,
lastAccessedOn
:
123
,
frequency
:
1
,
frequency
:
4
,
},
{
id
:
2
,
...
...
@@ -398,6 +398,6 @@ export const mockMixedFrequentlyUsedProjects = [
webUrl
:
'
/gitlab-com/project2
'
,
avatarUrl
:
null
,
lastAccessedOn
:
124
,
frequency
:
1
,
frequency
:
3
,
},
];
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