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
0
Merge Requests
0
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
Kazuhiko Shiozaki
gitlab-ce
Commits
efe98067
Commit
efe98067
authored
Dec 23, 2015
by
Valery Sizov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
emoji picker search
parent
2803b6e8
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
47 additions
and
1 deletion
+47
-1
CHANGELOG
CHANGELOG
+1
-0
app/assets/javascripts/awards_handler.coffee
app/assets/javascripts/awards_handler.coffee
+22
-0
app/assets/stylesheets/pages/awards.scss
app/assets/stylesheets/pages/awards.scss
+4
-0
app/views/votes/_votes_block.html.haml
app/views/votes/_votes_block.html.haml
+2
-1
features/project/issues/award_emoji.feature
features/project/issues/award_emoji.feature
+6
-0
features/steps/project/issues/award_emoji.rb
features/steps/project/issues/award_emoji.rb
+12
-0
No files found.
CHANGELOG
View file @
efe98067
...
@@ -2,6 +2,7 @@ Please view this file on the master branch, on stable branches it's out of date.
...
@@ -2,6 +2,7 @@ Please view this file on the master branch, on stable branches it's out of date.
v 8.4.0 (unreleased)
v 8.4.0 (unreleased)
- Implement new UI for group page
- Implement new UI for group page
- Implement search inside emoji picker
v 8.3.0
v 8.3.0
- Add CAS support (tduehr)
- Add CAS support (tduehr)
...
...
app/assets/javascripts/awards_handler.coffee
View file @
efe98067
...
@@ -10,6 +10,8 @@ class @AwardsHandler
...
@@ -10,6 +10,8 @@ class @AwardsHandler
if
$
(
".emoji-menu"
).
is
(
":visible"
)
if
$
(
".emoji-menu"
).
is
(
":visible"
)
$
(
".emoji-menu"
).
hide
()
$
(
".emoji-menu"
).
hide
()
@
setupSearch
()
addAward
:
(
emoji
)
->
addAward
:
(
emoji
)
->
emoji
=
@
normilizeEmojiName
(
emoji
)
emoji
=
@
normilizeEmojiName
(
emoji
)
@
postEmoji
emoji
,
=>
@
postEmoji
emoji
,
=>
...
@@ -108,3 +110,23 @@ class @AwardsHandler
...
@@ -108,3 +110,23 @@ class @AwardsHandler
normilizeEmojiName
:
(
emoji
)
->
normilizeEmojiName
:
(
emoji
)
->
@
aliases
[
emoji
]
||
emoji
@
aliases
[
emoji
]
||
emoji
setupSearch
:
->
$
(
"input.emoji-search"
).
keyup
(
ev
)
=>
term
=
$
(
ev
.
target
).
val
()
# Clean previous search results
$
(
"ul.emoji-search,h5.emoji-search"
).
remove
()
if
term
# Generate search result block
h5
=
$
(
"<h5>"
).
text
(
"Search results"
).
addClass
(
"emoji-search"
)
found_emojis
=
@
searchEmojis
(
term
).
show
()
ul
=
$
(
"<ul>"
).
addClass
(
"emoji-search"
).
append
(
found_emojis
)
$
(
".emoji-menu-content ul, .emoji-menu-content h5"
).
hide
()
$
(
".emoji-menu-content"
).
append
(
h5
).
append
(
ul
)
else
$
(
".emoji-menu-content"
).
children
().
show
()
searchEmojis
:
(
term
)
->
$
(
".emoji-menu-content [data-emoji*='"
+
term
+
"']"
).
closest
(
"li"
).
clone
()
app/assets/stylesheets/pages/awards.scss
View file @
efe98067
...
@@ -101,6 +101,10 @@
...
@@ -101,6 +101,10 @@
overflow
:
auto
;
overflow
:
auto
;
}
}
input
.emoji-search
{
background
:
url(/assets/icon-search.png)
240px
no-repeat
;
}
li
{
li
{
cursor
:
pointer
;
cursor
:
pointer
;
width
:
30px
;
width
:
30px
;
...
...
app/views/votes/_votes_block.html.haml
View file @
efe98067
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
=
icon
(
'smile-o'
)
=
icon
(
'smile-o'
)
.emoji-menu
.emoji-menu
.emoji-menu-content
.emoji-menu-content
=
text_field_tag
:emoji_search
,
""
,
class:
"emoji-search search-input form-control"
-
AwardEmoji
.
emoji_by_category
.
each
do
|
category
,
emojis
|
-
AwardEmoji
.
emoji_by_category
.
each
do
|
category
,
emojis
|
%h5
=
AwardEmoji
::
CATEGORIES
[
category
]
%h5
=
AwardEmoji
::
CATEGORIES
[
category
]
%ul
%ul
...
@@ -32,7 +33,7 @@
...
@@ -32,7 +33,7 @@
aliases
aliases
)
)
$(".
emoji-menu-content li").click
(e)->
$(".
awards").on "click", ".emoji-menu-content li",
(e)->
emoji = $(this).find(".emoji-icon").data("emoji")
emoji = $(this).find(".emoji-icon").data("emoji")
awards_handler.addAward(emoji)
awards_handler.addAward(emoji)
...
...
features/project/issues/award_emoji.feature
View file @
efe98067
...
@@ -18,6 +18,12 @@ Feature: Award Emoji
...
@@ -18,6 +18,12 @@ Feature: Award Emoji
Given
I click to emoji-picker
Given
I click to emoji-picker
Then
I can see the activity and food categories
Then
I can see the activity and food categories
@javascript
Scenario
:
I
can search emoji
Given
I click to emoji-picker
And
I search
"hand"
Then
I see search result for
"hand"
@javascript
@javascript
Scenario
:
I
add award emoji using regular comment
Scenario
:
I
add award emoji using regular comment
Given
I leave comment with a single emoji
Given
I leave comment with a single emoji
...
...
features/steps/project/issues/award_emoji.rb
View file @
efe98067
...
@@ -52,4 +52,16 @@ class Spinach::Features::AwardEmoji < Spinach::FeatureSteps
...
@@ -52,4 +52,16 @@ class Spinach::Features::AwardEmoji < Spinach::FeatureSteps
click_button
'Add Comment'
click_button
'Add Comment'
end
end
end
end
step
'I search "hand"'
do
page
.
within
(
'.emoji-menu-content'
)
do
fill_in
'emoji_search'
,
with:
'hand'
end
end
step
'I see search result for "hand"'
do
page
.
within
'.emoji-menu-content'
do
expect
(
page
).
to
have_selector
'[data-emoji="raised_hand"]'
end
end
end
end
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