Browse Source

Maintenance: Fix CI race condition in test and improve performance by dropping obsolete code which will be updated by ticket full as well.

Rolf Schmidt 3 years ago
parent
commit
c7ea22abf2

+ 0 - 19
app/assets/javascripts/app/controllers/widget/mention.coffee

@@ -8,27 +8,8 @@ class App.WidgetMention extends App.Controller
 
   constructor: ->
     super
-
-    @mentions = []
-    App.Event.bind('Mention:create Mention:destroy',
-      (data) =>
-        return if !data
-        return if data.mentionable_type isnt 'Ticket'
-        return if data.mentionable_id isnt @object.id
-        @fetch()
-    )
     @render()
 
-  fetch: =>
-    App.Mention.fetchMentionable(
-      'Ticket',
-      @object.id,
-      (data) =>
-        @mentions = data.record_ids
-        App.Collection.loadAssets(data.assets)
-        @render()
-    )
-
   reload: (mentions) =>
     @mentions = mentions
     @render()

+ 0 - 15
app/assets/javascripts/app/models/mention.coffee

@@ -6,21 +6,6 @@ class App.Mention extends App.Model
     { name: 'user_id', display: 'User', tag: 'select',   multiple: false, limit: 100, null: true, relation: 'User', width: '12%', edit: true },
   ]
 
-  @fetchMentionable: (mentionable_type, mentionable_id, callback) ->
-    App.Ajax.request(
-      type: 'GET'
-      url:  "#{@apiPath}/mentions"
-      data:
-        mentionable_type: mentionable_type
-        mentionable_id: mentionable_id
-        full: true
-      processData: true
-      success: (data, status, xhr) ->
-        if data.assets
-          App.Collection.loadAssets(data.assets, targetModel: @className)
-        callback(data)
-    )
-
   @searchUser: (query, group_id, callback) ->
     roles    = App.Role.withPermissions('ticket.agent')
     role_ids = roles.map (role) -> role.id