Browse Source

Fixes #3462 - Mixed naming regarding mentioned and subscribed in UI

Martin Edenhofer 4 years ago
parent
commit
602c8137b4

+ 1 - 1
app/assets/javascripts/app/controllers/_profile/notification.coffee

@@ -123,7 +123,7 @@ class ProfileNotification extends App.ControllerSubContent
             if !params.notification_config[area[0]][area[1]][area[2]]
               params.notification_config[area[0]][area[1]][area[2]] = {}
 
-            for recipientKey in ['owned_by_me', 'owned_by_nobody', 'mentioned', 'no']
+            for recipientKey in ['owned_by_me', 'owned_by_nobody', 'subscribed', 'no']
               if params.notification_config[area[0]][area[1]][area[2]][recipientKey] == undefined
                 params.notification_config[area[0]][area[1]][area[2]][recipientKey] = false
 

+ 1 - 1
app/assets/javascripts/app/controllers/_ui_element/ticket_selector.coffee

@@ -120,7 +120,7 @@ class App.UiElement.ticket_selector
 
     elements['ticket.mention_user_ids'] =
       name: 'mention_user_ids'
-      display: 'Mention'
+      display: 'Subscribe'
       tag: 'autocompletion_ajax'
       relation: 'User'
       null: false

+ 4 - 4
app/assets/javascripts/app/controllers/ticket_zoom/sidebar_ticket.coffee

@@ -131,18 +131,18 @@ class SidebarTicket extends App.Controller
 
     if @ticket.currentView() is 'agent'
       @mentionWidget = new App.WidgetMention(
-        el:       localEl.filter('.mentions')
+        el:       localEl.filter('.js-subscriptions')
         object:   @ticket
         mentions: @mentions
       )
       @tagWidget = new App.WidgetTag(
-        el:          localEl.filter('.tags')
+        el:          localEl.filter('.js-tags')
         object_type: 'Ticket'
         object:      @ticket
         tags:        @tags
       )
       @linkWidget = new App.WidgetLink.Ticket(
-        el:          localEl.filter('.links')
+        el:          localEl.filter('.js-links')
         object_type: 'Ticket'
         object:      @ticket
         links:       @links
@@ -150,7 +150,7 @@ class SidebarTicket extends App.Controller
 
       if @permissionCheck('knowledge_base.*') and App.Config.get('kb_active')
         @linkKbAnswerWidget = new App.WidgetLinkKbAnswer(
-          el:          localEl.filter('.link_kb_answers')
+          el:          localEl.filter('.js-linkKbAnswers')
           object_type: 'Ticket'
           object:      @ticket
           links:       @links

+ 2 - 2
app/assets/javascripts/app/views/profile/notification.jst.eco

@@ -11,7 +11,7 @@
           <th>
           <th width="16%" style="text-align: center;"><%- @T('My Tickets') %>
           <th width="16%" style="text-align: center;"><%- @T('Not Assigned') %>*
-          <th width="16%" style="text-align: center;"><%- @T('Mentioned Tickets') %>
+          <th width="16%" style="text-align: center;"><%- @T('Subscribed Tickets') %>
           <th width="16%" style="text-align: center;"><%- @T('All Tickets') %>*
           <th width="120px" class="settings-list-separator" style="text-align: center;"><%- @T('Also notify via email') %>
       </thead>
@@ -37,7 +37,7 @@
             </label>
           <td class="u-positionOrigin">
             <label class="checkbox-replacement checkbox-replacement--fullscreen">
-              <input type="checkbox" name="matrix.<%= key %>.criteria.mentioned" value="true"<% if criteria && criteria.mentioned: %> checked<% end %> />
+              <input type="checkbox" name="matrix.<%= key %>.criteria.subscribed" value="true"<% if criteria && criteria.subscribed: %> checked<% end %> />
               <%- @Icon('checkbox', 'icon-unchecked') %>
               <%- @Icon('checkbox-checked', 'icon-checked') %>
             </label>

+ 4 - 4
app/assets/javascripts/app/views/ticket_zoom/sidebar_ticket.jst.eco

@@ -1,8 +1,8 @@
 <form>
   <fieldset class="edit"></fieldset>
 </form>
-<div class="tags"></div>
-<div class="links"></div>
-<div class="link_kb_answers"></div>
+<div class="js-tags tags"></div>
+<div class="js-links links"></div>
+<div class="js-linkKbAnswers link_kb_answers"></div>
 <div class="js-timeUnit"></div>
-<div class="mentions"></div>
+<div class="js-subscriptions"></div>

+ 1 - 1
app/assets/javascripts/app/views/widget/mention.jst.eco

@@ -1,4 +1,4 @@
-<label><%- @T('Mentions') %></label>
+<label><%- @T('Notifications') %></label>
 <form class="ui-front mentionWidget">
   <div class="js-subscribe<% if @subscribed: %> hidden<% end %>">
     <input type="button" class="btn btn--fullWidth" name="subscribe" value="<%- @T('Subscribe') %>">

+ 1 - 1
app/models/transaction/notification.rb

@@ -62,7 +62,7 @@ class Transaction::Notification
         next if !mention_user.group_access?(ticket.group_id, 'read')
 
         possible_recipients.push mention_user
-        recipients_reason[mention_user.id] = 'are mentioned'
+        recipients_reason[mention_user.id] = 'are subscribed'
       end
     end
 

+ 4 - 4
config/application.rb

@@ -49,7 +49,7 @@ module Zammad
               criteria: {
                 owned_by_me:     true,
                 owned_by_nobody: true,
-                mentioned:       true,
+                subscribed:      true,
                 no:              false,
               },
               channel:  {
@@ -61,7 +61,7 @@ module Zammad
               criteria: {
                 owned_by_me:     true,
                 owned_by_nobody: true,
-                mentioned:       true,
+                subscribed:      true,
                 no:              false,
               },
               channel:  {
@@ -73,7 +73,7 @@ module Zammad
               criteria: {
                 owned_by_me:     true,
                 owned_by_nobody: false,
-                mentioned:       false,
+                subscribed:      false,
                 no:              false,
               },
               channel:  {
@@ -85,7 +85,7 @@ module Zammad
               criteria: {
                 owned_by_me:     true,
                 owned_by_nobody: false,
-                mentioned:       false,
+                subscribed:      false,
                 no:              false,
               },
               channel:  {

+ 4 - 4
db/migrate/20201110000001_mention_init.rb

@@ -23,8 +23,8 @@ class MentionInit < ActiveRecord::Migration[5.2]
 
   def create_overview
     Overview.create_if_not_exists(
-      name:          'My mentioned Tickets',
-      link:          'my_mentioned_tickets',
+      name:          'My subscribed Tickets',
+      link:          'my_subscribed_tickets',
       prio:          1025,
       role_ids:      Role.with_permissions('ticket.agent').pluck(:id),
       condition:     { 'ticket.mention_user_ids'=>{ 'operator' => 'is', 'pre_condition' => 'current_user.id', 'value' => '', 'value_completion' => '' } },
@@ -55,11 +55,11 @@ class MentionInit < ActiveRecord::Migration[5.2]
 
   def update_user_matrix_by_user(user)
     %w[create update].each do |type|
-      user.preferences['notification_config']['matrix'][type]['criteria']['mentioned'] = true
+      user.preferences['notification_config']['matrix'][type]['criteria']['subscribed'] = true
     end
 
     %w[reminder_reached escalation].each do |type|
-      user.preferences['notification_config']['matrix'][type]['criteria']['mentioned'] = false
+      user.preferences['notification_config']['matrix'][type]['criteria']['subscribed'] = false
     end
     user.save!
   end

+ 2 - 2
db/seeds/overviews.rb

@@ -86,8 +86,8 @@ Overview.create_if_not_exists(
 )
 
 Overview.create_if_not_exists(
-  name:      'My mentioned Tickets',
-  link:      'my_mentioned_tickets',
+  name:      'My subscribed Tickets',
+  link:      'my_subscribed_tickets',
   prio:      1025,
   role_ids:  [overview_role.id],
   condition: { 'ticket.mention_user_ids'=>{ 'operator' => 'is', 'pre_condition' => 'current_user.id', 'value' => '', 'value_completion' => '' } },

Some files were not shown because too many files changed in this diff