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

View file

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

View file

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

View file

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

View file

@ -396,7 +396,7 @@ class TicketsController < ApplicationController
# build result list # build result list
tickets = Ticket.search( tickets = Ticket.search(
limit: params[:limit], limit: params[:limit],
query: params[:term], query: params[:query],
condition: params[:condition], condition: params[:condition],
current_user: current_user, 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 # The requester has to be in the role 'Admin' or 'Agent' to
# be able to search for User records. # 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 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 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 # @parameter full [Boolean] Defines if the result should be
@ -332,7 +332,7 @@ class UsersController < ApplicationController
end end
query_params = { query_params = {
query: params[:term], query: params[:query],
limit: params[:limit], limit: params[:limit],
current_user: current_user, current_user: current_user,
} }