Browse Source

Follow-up e5b4a1767c3118374061924a42e1addad57d76d8 - Fixes #4329: Typing the text attribute in the ticket changes the displayed name of the ticket in the activity stream.

Dusan Vuckovic 2 years ago
parent
commit
0aa27f9cc9

+ 1 - 1
app/assets/javascripts/app/controllers/_application_controller/_base.coffee

@@ -345,7 +345,7 @@ class App.Controller extends Spine.Controller
 
   prepareForObjectListItem: (item) ->
     item.link  = ''
-    item.title = '???'
+    item.title = '-'
 
     # convert backend name space to local name space
     item.object = item.object.replace('::', '')

+ 1 - 1
app/assets/javascripts/app/models/_application_model.coffee

@@ -14,7 +14,7 @@ class App.Model extends Spine.Model
     @constructor.className
 
   displayName: ->
-    return @name || '???'
+    return @name || '-'
 
   # shows the icon representing the object itself (e. g. the organization icon in organization profile or ticket sidebar)
   icon: (user) ->

+ 1 - 1
app/assets/javascripts/app/models/channel.coffee

@@ -17,5 +17,5 @@ class App.Channel extends App.Model
           else
             name += " (#{@options.outbound.adapter})"
     if name == ''
-      name = '???'
+      name = '-'
     name

+ 2 - 0
app/assets/javascripts/app/models/email_address.coffee

@@ -5,6 +5,8 @@ class App.EmailAddress extends App.Model
 
   displayName: ->
     if @realname
+      # Do not use App.Utils.buildEmailAddress here because we don't build an email address and the
+      #   quoting would confuse sorting in the GUI.
       return "#{@realname} <#{@email}>"
     @email
 

+ 1 - 1
app/assets/javascripts/app/models/ticket.coffee

@@ -389,4 +389,4 @@ class App.Ticket extends App.Model
     attrs
 
   displayName: ->
-    return @title || '???'
+    return @title || '-'

+ 1 - 1
app/assets/javascripts/app/models/ticket_article.coffee

@@ -32,7 +32,7 @@ class App.TicketArticle extends App.Model
       ticket = App.Ticket.findNative(@ticket_id)
     if ticket
       return ticket.title
-    '???'
+    '-'
 
   iconActivity: (user) ->
     return if !user

+ 2 - 6
app/assets/javascripts/app/models/user.coffee

@@ -416,10 +416,6 @@ class App.User extends App.Model
   @current: App.Session.get
 
   displayName: ->
-    if @realname
-      # Do not use App.Utils.buildEmailAddress here because we don't build an email address and the
-      #   quoting would confuse sorting in the GUI.
-      return "#{@realname} <#{@email}>"
     if !_.isEmpty(@firstname)
       name = @firstname
     if !_.isEmpty(@lastname)
@@ -435,7 +431,7 @@ class App.User extends App.Model
       return @phone
     if @login
       return @login
-    return '???'
+    return '-'
 
   displayNameLong: ->
     if !_.isEmpty(@firstname)
@@ -461,4 +457,4 @@ class App.User extends App.Model
       return @phone
     if @login
       return @login
-    return '???'
+    return '-'

+ 1 - 1
app/frontend/shared/entities/user/utils/getUserDisplayName.ts

@@ -8,6 +8,6 @@ export const userDisplayName = (user: Partial<User>): string => {
 
   return (
     [fullname, email, phone, login].find((elem) => elem && !isEmpty(elem)) ||
-    '???'
+    '-'
   )
 }

+ 1 - 1
app/services/service/ticket/article/create.rb

@@ -83,7 +83,7 @@ class Service::Ticket::Article::Create < Service::BaseWithCurrentUser
     return user.phone if user.phone.present?
     return user.login if user.login.present?
 
-    '???'
+    '-'
   end
 
   def attachments(article, attachments_raw)