Renamed term to query for searches.

This commit is contained in:
Martin Edenhofer 2016-09-07 10:39:06 +02:00
parent 02e39e092d
commit 325e0b4ddd
6 changed files with 26 additions and 26 deletions

View file

@ -27,8 +27,8 @@ class Index extends App.ControllerContent
(e) =>
e.preventDefault()
$(e.target).toggleClass('active')
term = @searchInput.val().trim()
if term
query = @searchInput.val().trim()
if query
@delay( @search, 220, 'search' )
return
@recent()
@ -36,10 +36,10 @@ class Index extends App.ControllerContent
# start search
@searchInput.bind( 'keyup', (e) =>
term = @searchInput.val().trim()
return if !term
return if term is @term
@term = term
query = @searchInput.val().trim()
return if !query
return if query is @query
@query = query
@delay( @search, 220, 'search' )
)
@ -144,7 +144,7 @@ class Index extends App.ControllerContent
type: 'GET'
url: @apiPath + '/users/search'
data:
term: @term
query: @query
limit: 140
role_ids: role_ids
full: 1

View file

@ -4,7 +4,7 @@
type: 'GET'
url: url
data:
term: term
qeury: query
processData: true,
success: (data, status, xhr) =>
console.log(data, status)

View file

@ -290,30 +290,30 @@ class App.UserOrganizationAutocompletion extends App.Controller
@userSelect.on 'keyup', @onKeyUp
onKeyUp: (e) =>
term = $(e.target).val().trim()
return if @searchTerm is term
@searchTerm = term
query = $(e.target).val().trim()
return if @searchTerm is query
@searchTerm = query
@hideOrganizationMembers()
# hide dropdown
if !term
if !query
@emptyResultList()
if !@attribute.disableCreateUser
@recipientList.append(@buildUserNew())
# show dropdown
if term && ( !@attribute.minLengt || @attribute.minLengt <= term.length )
@lazySearch(term)
if query && ( !@attribute.minLengt || @attribute.minLengt <= query.length )
@lazySearch(query)
searchUser: (term) =>
searchUser: (query) =>
@ajax(
id: "searchUser#{@key}"
type: 'GET'
url: @attribute.source
data:
query: term
query: query
processData: true
success: (data, status, xhr) =>
@emptyResultList()

View file

@ -228,7 +228,7 @@ curl http://localhost/api/v1/organization/{id} -v -u #{login}:#{password} -H "Co
end
query_params = {
query: params[:term],
query: params[:query],
limit: params[:limit],
current_user: current_user,
}

View file

@ -396,7 +396,7 @@ class TicketsController < ApplicationController
# build result list
tickets = Ticket.search(
limit: params[:limit],
query: params[:term],
query: params[:query],
condition: params[:condition],
current_user: current_user,
)

View file

@ -310,7 +310,7 @@ class UsersController < ApplicationController
# The requester has to be in the role 'Admin' or 'Agent' to
# be able to search for User records.
#
# @parameter term [String] The search term.
# @parameter query [String] The search query.
# @parameter limit [Integer] The limit of search results.
# @parameter role_ids(multi) [Array<String>] A list of Role identifiers to which the Users have to be allocated to.
# @parameter full [Boolean] Defines if the result should be
@ -332,7 +332,7 @@ class UsersController < ApplicationController
end
query_params = {
query: params[:term],
query: params[:query],
limit: params[:limit],
current_user: current_user,
}