From c7ea22abf2f4bfcf5b6f41e161f2685ef4042c7c Mon Sep 17 00:00:00 2001 From: Rolf Schmidt Date: Wed, 16 Jun 2021 15:33:35 +0100 Subject: [PATCH] Maintenance: Fix CI race condition in test and improve performance by dropping obsolete code which will be updated by ticket full as well. --- .../app/controllers/widget/mention.coffee | 19 ------------------- .../javascripts/app/models/mention.coffee | 15 --------------- 2 files changed, 34 deletions(-) diff --git a/app/assets/javascripts/app/controllers/widget/mention.coffee b/app/assets/javascripts/app/controllers/widget/mention.coffee index 6e5d34b3b..ed8af80ae 100644 --- a/app/assets/javascripts/app/controllers/widget/mention.coffee +++ b/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() diff --git a/app/assets/javascripts/app/models/mention.coffee b/app/assets/javascripts/app/models/mention.coffee index 4aae73793..bf36b1a90 100644 --- a/app/assets/javascripts/app/models/mention.coffee +++ b/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