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
36f84ce7
Commit
36f84ce7
authored
Jun 15, 2017
by
Fatih Acet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IssueNotesRefactor: Always show
👍
👎
emojis first.
parent
d110f38d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
3 deletions
+19
-3
app/assets/javascripts/notes/components/issue_note_awards_list.vue
...s/javascripts/notes/components/issue_note_awards_list.vue
+19
-3
No files found.
app/assets/javascripts/notes/components/issue_note_awards_list.vue
View file @
36f84ce7
...
...
@@ -22,21 +22,37 @@ export default {
computed
:
{
// `this.awards` is an array with emojis but they are not grouped by emoji name. See below.
// [ { name: foo, user: user1 }, { name: bar, user: user1 }, { name: foo, user: user2 } ]
// This method will group emojis by
name
their name as an Object. See below.
// This method will group emojis by their name as an Object. See below.
// {
// foo: [ { name: foo, user: user1 }, { name: foo, user: user2 } ],
// bar: [ { name: bar, user: user1 } ]
// }
// We need to do this otherwise w
ill
will render the same emoji over and over again.
// We need to do this otherwise w
e
will render the same emoji over and over again.
groupedAwards
()
{
const
awards
=
{};
const
orderedAwards
=
{};
this
.
awards
.
forEach
((
award
)
=>
{
awards
[
award
.
name
]
=
awards
[
award
.
name
]
||
[];
awards
[
award
.
name
].
push
(
award
);
});
return
awards
;
// Always show thumbsup and thumbsdown first
const
{
thumbsup
,
thumbsdown
}
=
awards
;
if
(
thumbsup
)
{
orderedAwards
.
thumbsup
=
thumbsup
;
delete
awards
.
thumbsup
;
}
if
(
thumbsdown
)
{
orderedAwards
.
thumbsdown
=
thumbsdown
;
delete
awards
.
thumbsdown
;
}
for
(
let
key
in
awards
)
{
orderedAwards
[
key
]
=
awards
[
key
];
};
return
orderedAwards
;
},
},
methods
:
{
...
...
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