Просмотр исходного кода

Maintenance: Adjust WhatsApp reaction history entry text in case emoji is missing.

Dusan Vuckovic 5 месяцев назад
Родитель
Сommit
7779585199

+ 10 - 2
app/assets/javascripts/app/controllers/_application_controller/_modal_generic_history.coffee

@@ -130,9 +130,17 @@ class App.GenericHistory extends App.ControllerModal
         article_body = App.TicketArticle.find(item.o_id)?.body
         truncated_article_body = App.Utils.truncate(article_body) or '-'
         content = if item.type is 'created' or item.type is 'updated'
-          App.i18n.translatePlain("reacted with a %s to %s message '%s'",  item.value_to, item.value_from, truncated_article_body)
+          if item.value_to
+            item.id + '/' + App.i18n.translatePlain("reacted with a %s to %s message '%s'", item.value_to, item.value_from, truncated_article_body)
+
+          # NB: On MySQL backends, the reaction emoji may get stripped due to column type UTF-8 limitation (`string`).
+          #   Rather than migrating this column on very heavy tables, we are opting to simply change the message here.
+          #   With Zammad 7.0, MySQL support will be dropped anyway.
+          else
+            App.i18n.translatePlain("reacted to %s message '%s'", item.value_from, truncated_article_body)
+
         else if item.type is 'removed'
-          App.i18n.translatePlain("removed reaction to %s message '%s'",  item.value_from, truncated_article_body)
+          App.i18n.translatePlain("removed reaction to %s message '%s'", item.value_from, truncated_article_body)
       else
         content = "#{ @T( item.type ) } #{ @T(item.object) } "
         if item.attribute