allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [09/10] allura git commit: [#8253] Remove unwanted emoji unicode response
Date Thu, 08 Nov 2018 21:53:50 GMT
[#8253] Remove unwanted emoji unicode response


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/461792d7
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/461792d7
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/461792d7

Branch: refs/heads/master
Commit: 461792d781714e087ebcc2a5fbee81443772f54d
Parents: 2593a22
Author: Shalitha Suranga <shalithasuranga@gmail.com>
Authored: Thu Nov 8 11:35:20 2018 +0530
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Thu Nov 8 21:53:25 2018 +0000

----------------------------------------------------------------------
 Allura/allura/controllers/discuss.py                | 6 +-----
 Allura/allura/lib/widgets/resources/js/reactions.js | 2 +-
 Allura/allura/tests/functional/test_discuss.py      | 7 -------
 3 files changed, 2 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/461792d7/Allura/allura/controllers/discuss.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/discuss.py b/Allura/allura/controllers/discuss.py
index 1e5e30a..c7f21ed 100644
--- a/Allura/allura/controllers/discuss.py
+++ b/Allura/allura/controllers/discuss.py
@@ -383,11 +383,7 @@ class PostController(BaseController):
             self.post.post_reaction(r, c.user)
         else:
             status = 'error' 
-        emoji_unicode = {}
-        # Need send back unicode emojis too for rendering :+1: .. etc
-        for em_code in self.post.react_counts:
-            emoji_unicode[em_code] = g.emojize(em_code)
-        return dict(status=status, counts=self.post.react_counts, emoji_unicode=emoji_unicode)
+        return dict(status=status, counts=self.post.react_counts)
 
     def error_handler(self, *args, **kwargs):
         redirect(request.referer)

http://git-wip-us.apache.org/repos/asf/allura/blob/461792d7/Allura/allura/lib/widgets/resources/js/reactions.js
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/widgets/resources/js/reactions.js b/Allura/allura/lib/widgets/resources/js/reactions.js
index f8df816..50fb674 100644
--- a/Allura/allura/lib/widgets/resources/js/reactions.js
+++ b/Allura/allura/lib/widgets/resources/js/reactions.js
@@ -70,7 +70,7 @@ $.ajax({
         var react_html = '';
 
         for (var i in res.counts) {
-            react_html += '<span>' + res.emoji_unicode[i] + '</span> ' + res.counts[i];
+            react_html += '<span>' + global_reactions[i] + '</span> ' + res.counts[i];
         }
         
         reacts_list.html(react_html);

http://git-wip-us.apache.org/repos/asf/allura/blob/461792d7/Allura/allura/tests/functional/test_discuss.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/functional/test_discuss.py b/Allura/allura/tests/functional/test_discuss.py
index fbe631b..9910e5c 100644
--- a/Allura/allura/tests/functional/test_discuss.py
+++ b/Allura/allura/tests/functional/test_discuss.py
@@ -227,14 +227,12 @@ class TestDiscuss(TestDiscussBase):
                 'r': ':+1:'})
         assert response.json['status'] == 'ok'
         assert response.json['counts'][':+1:'] == 1
-        assert response.json['emoji_unicode'][':+1:'] == u'\U0001F44D'
         response = self.app.post(
             react_link,
             params={
                 'r': 'invalid'})
         assert response.json['status'] == 'error' 
         assert response.json['counts'][':+1:'] == 1
-        assert response.json['emoji_unicode'][':+1:'] == u'\U0001F44D'
         # anon users can't react comments
         response = self.app.post(
             react_link,
@@ -261,7 +259,6 @@ class TestDiscuss(TestDiscussBase):
                 'r': ':-1:'})
         assert response.json['status'] == 'ok'
         assert response.json['counts'][':-1:'] == 1
-        assert response.json['emoji_unicode'][':-1:'] == u'\U0001F44E'
         response = self.app.post(
             react_link,
             params={
@@ -269,8 +266,6 @@ class TestDiscuss(TestDiscussBase):
         assert response.json['status'] == 'ok'
         assert response.json['counts'][':+1:'] == 1
         assert ':-1:' not in response.json['counts']
-        assert ':-1:' not in response.json['emoji_unicode']
-        assert response.json['emoji_unicode'][':+1:'] == u'\U0001F44D'
 
     def test_comment_post_reaction_undo(self):
         r = self._make_post('This is a post')
@@ -283,14 +278,12 @@ class TestDiscuss(TestDiscussBase):
                 'r': ':tada:'})
         assert response.json['status'] == 'ok'
         assert response.json['counts'][':tada:'] == 1
-        assert response.json['emoji_unicode'][':tada:'] == u'\U0001F389'
         response = self.app.post(
             react_link,
             params={
                 'r': ':tada:'})
         assert response.json['status'] == 'ok'
         assert ':tada:' not in response.json['counts']
-        assert ':tada:' not in response.json['emoji_unicode']
 
     def test_user_filter(self):
         r = self._make_post('Test post')


Mime
View raw message