Follow up d5655908c629581d1817ae6133ac1602c42354b1 - Fixes #4035 - Fix naming collision between SearchableAjaxSelect and ObjectManagerAttribute attributes.

This commit is contained in:
Rolf Schmidt 2022-04-22 17:33:47 +02:00
parent 54227e82ac
commit 43aa552d8c
5 changed files with 7 additions and 7 deletions

View file

@ -15,7 +15,7 @@ class App.UiElement.autocompletion_ajax
id: params.organization_id || attribute.id id: params.organization_id || attribute.id
placeholder: App.i18n.translateInline('Search…') placeholder: App.i18n.translateInline('Search…')
limit: 40 limit: 40
object: attribute.relation relation: attribute.relation
ajax: true ajax: true
multiple: attribute.multiple multiple: attribute.multiple
) )

View file

@ -1502,7 +1502,7 @@ class InputsRef extends App.ControllerAppContent
id: 'user-123' id: 'user-123'
placeholder: __('Enter User') placeholder: __('Enter User')
limt: 10 limt: 10
object: 'User' relation: 'User'
@$('.searchableAjaxSelectPlaceholder').replaceWith( searchableAjaxSelectObject.element() ) @$('.searchableAjaxSelectPlaceholder').replaceWith( searchableAjaxSelectObject.element() )

View file

@ -52,7 +52,7 @@ class App.WidgetLinkKbAnswer extends App.WidgetLink
name: 'input' name: 'input'
placeholder: App.i18n.translateInline('Search…') placeholder: App.i18n.translateInline('Search…')
limit: 40 limit: 40
object: 'KnowledgeBaseAnswerTranslation' relation: 'KnowledgeBaseAnswerTranslation'
ajax: true ajax: true
).element()) ).element())

View file

@ -41,7 +41,7 @@ class App.SearchableSelect extends Spine.Controller
tokens = '' tokens = ''
if @attribute.multiple && @attribute.value if @attribute.multiple && @attribute.value
object = @attribute.object relation = @attribute.relation
# fallback for if the value is not an array # fallback for if the value is not an array
if typeof @attribute.value isnt 'object' if typeof @attribute.value isnt 'object'
@ -50,8 +50,8 @@ class App.SearchableSelect extends Spine.Controller
# create tokens and attribute values # create tokens and attribute values
values = [] values = []
for dataId in @attribute.value for dataId in @attribute.value
if App[object].exists dataId if App[relation].exists dataId
name = App[object].find(dataId).displayName() name = App[relation].find(dataId).displayName()
value = dataId value = dataId
values.push({name: name, value: value}) values.push({name: name, value: value})
tokens += App.view('generic/token')( tokens += App.view('generic/token')(

View file

@ -10,7 +10,7 @@ class App.SearchableAjaxSelect extends App.SearchableSelect
# convert requested object # convert requested object
# e.g. Ticket to ticket or AnotherObject to another_object # e.g. Ticket to ticket or AnotherObject to another_object
objectString = underscored(@options.attribute.object) objectString = underscored(@options.attribute.relation)
query = @input.val() query = @input.val()