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

This commit is contained in:
Rolf Schmidt 2021-06-16 15:33:35 +01:00
parent 88c5e0e10b
commit c7ea22abf2
2 changed files with 0 additions and 34 deletions

View file

@ -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()

View file

@ -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