search: style search detail, add detail link

This commit is contained in:
Felix Niklas 2016-07-05 17:06:00 +02:00
parent d002da8a64
commit 613cc7ef20
10 changed files with 229 additions and 145 deletions

View file

@ -3,24 +3,26 @@ class App.Navigation extends App.ControllerWidgetPermanent
elements: elements:
'#global-search': 'searchInput' '#global-search': 'searchInput'
'#global-search-result': 'searchResult' '.js-global-search-result': 'searchResult'
'.search': 'searchContainer' '.search': 'searchContainer'
events: events:
'click .js-toggleNotifications': 'toggleNotifications' 'click .js-toggleNotifications': 'toggleNotifications'
'click .js-emptySearch': 'emptyAndClose' 'click .js-emptySearch': 'emptyAndClose'
'dblclick .search-holder .icon-magnifier': 'openExtendedSearch'
'submit form.search-holder': 'preventDefault' 'submit form.search-holder': 'preventDefault'
'focus #global-search': 'searchFocus' 'focus #global-search': 'searchFocus'
'blur #global-search': 'searchBlur' 'blur #global-search': 'searchBlur'
'keydown #global-search': 'listNavigate' 'keydown #global-search': 'listNavigate'
'click #global-search-result': 'andClose' 'click .js-global-search-result': 'andClose'
'change .js-menu .js-switch input': 'switch' 'change .js-menu .js-switch input': 'switch'
'click .js-details-link': 'openExtendedSearch'
constructor: -> constructor: ->
super super
@render() @render()
@throttledSearch = _.throttle @search, 200
# rerender view, e. g. on langauge change # rerender view, e. g. on langauge change
@bind 'ui:rerender', => @bind 'ui:rerender', =>
@renderMenu() @renderMenu()
@ -195,7 +197,7 @@ class App.Navigation extends App.ControllerWidgetPermanent
@query = '' # reset query cache @query = '' # reset query cache
@searchContainer.addClass('focused') @searchContainer.addClass('focused')
@anyPopoversDestroy() @anyPopoversDestroy()
@searchFunction(0) @search()
searchBlur: (e) => searchBlur: (e) =>
@ -220,7 +222,7 @@ class App.Navigation extends App.ControllerWidgetPermanent
@nudge(e, 1) @nudge(e, 1)
return return
else if e.keyCode is 13 # enter else if e.keyCode is 13 # enter
href = @$('#global-search-result .nav-tab.is-hover').attr('href') href = @$('.global-search-result .nav-tab.is-hover').attr('href')
return if !href return if !href
@locationExecute(href) @locationExecute(href)
@emptyAndClose() @emptyAndClose()
@ -228,7 +230,7 @@ class App.Navigation extends App.ControllerWidgetPermanent
return return
# on other keys, show result # on other keys, show result
@searchFunction(200) @throttledSearch()
nudge: (e, position) => nudge: (e, position) =>
@ -266,60 +268,57 @@ class App.Navigation extends App.ControllerWidgetPermanent
@searchContainer.removeClass('open') @searchContainer.removeClass('open')
@delay(@anyPopoversDestroy, 100, 'removePopovers') @delay(@anyPopoversDestroy, 100, 'removePopovers')
searchFunction: (delay) => search: =>
query = @searchInput.val().trim()
return if !query
return if query is @query
@query = query
@searchContainer.toggleClass('filled', !!@query)
search = => # use cache for search result
query = @searchInput.val().trim() if @searchResultCache[@query]
return if !query @renderResult(@searchResultCache[@query].result)
return if query is @query currentTime = new Date
@query = query return if @searchResultCache[@query].time > currentTime.setSeconds(currentTime.getSeconds() - 20)
@searchContainer.toggleClass('filled', !!@query)
# use cache for search result App.Ajax.request(
if @searchResultCache[@query] id: 'search'
@renderResult(@searchResultCache[@query].result) type: 'GET'
currentTime = new Date url: "#{@apiPath}/search"
return if @searchResultCache[@query].time > currentTime.setSeconds(currentTime.getSeconds() - 20) data:
query: @query
App.Ajax.request( processData: true,
id: 'search' success: (data, status, xhr) =>
type: 'GET' App.Collection.loadAssets(data.assets)
url: "#{@apiPath}/search" result = {}
data: for item in data.result
query: @query if App[item.type] && App[item.type].find
processData: true, if !result[item.type]
success: (data, status, xhr) => result[item.type] = []
App.Collection.loadAssets(data.assets) item_object = App[item.type].find(item.id)
result = {} if item_object.searchResultAttributes
for item in data.result item_object_search_attributes = item_object.searchResultAttributes()
if App[item.type] && App[item.type].find result[item.type].push item_object_search_attributes
if !result[item.type]
result[item.type] = []
item_object = App[item.type].find(item.id)
if item_object.searchResultAttributes
item_object_search_attributes = item_object.searchResultAttributes()
result[item.type].push item_object_search_attributes
else
@log 'error', "No such model #{item.type.toLocaleLowerCase()}.searchResultAttributes()"
else else
@log 'error', "No such model App.#{item.type}" @log 'error', "No such model #{item.type.toLocaleLowerCase()}.searchResultAttributes()"
else
@log 'error', "No such model App.#{item.type}"
diff = false diff = false
if @searchResultCache[@query] if @searchResultCache[@query]
diff = difference(@searchResultCache[@query].resultRaw, data.result) diff = difference(@searchResultCache[@query].resultRaw, data.result)
# cache search result # cache search result
@searchResultCache[@query] = @searchResultCache[@query] =
result: result result: result
resultRaw: data.result resultRaw: data.result
time: new Date time: new Date
# if result hasn't changed, do not rerender # if result hasn't changed, do not rerender
return if diff isnt false && _.isEmpty(diff) return if diff isnt false && _.isEmpty(diff)
@renderResult(result) @renderResult(result)
) )
@delay(search, delay, 'search')
getItems: (data) -> getItems: (data) ->
navbar = _.values(data.navbar) navbar = _.values(data.navbar)
@ -479,7 +478,8 @@ class App.Navigation extends App.ControllerWidgetPermanent
e.stopPropagation() e.stopPropagation()
@notificationWidget.toggle() @notificationWidget.toggle()
openExtendedSearch: => openExtendedSearch: (event) ->
event.preventDefault()
query = @searchInput.val() query = @searchInput.val()
@searchInput.val('').blur() @searchInput.val('').blur()
if query if query
@ -487,4 +487,6 @@ class App.Navigation extends App.ControllerWidgetPermanent
return return
@navigate('#search') @navigate('#search')
App.Config.set('navigation', App.Navigation, 'Navigations') App.Config.set('navigation', App.Navigation, 'Navigations')

View file

@ -4,9 +4,11 @@ class App.Search extends App.Controller
'.js-search': 'searchInput' '.js-search': 'searchInput'
events: events:
'click .js-emptySearch': 'empty'
'submit form.search-holder': 'preventDefault' 'submit form.search-holder': 'preventDefault'
'keydown .js-search': 'listNavigate' 'keydown .js-search': 'listNavigate'
'click .js-tab': 'showTab' 'click .js-tab': 'showTab'
'input .js-search': 'updateFilledClass'
constructor: -> constructor: ->
super super
@ -19,18 +21,21 @@ class App.Search extends App.Controller
# update taskbar with new meta data # update taskbar with new meta data
App.TaskManager.touch(@task_key) App.TaskManager.touch(@task_key)
@throttledSearch = _.throttle @search, 200
@render() @render()
meta: => meta: =>
title = App.i18n.translateInline('Extended Search')
if @query if @query
title += ": #{App.Utils.htmlEscape(@query)}" title = App.Utils.htmlEscape(@query)
else
title = App.i18n.translateInline('Extended Search')
meta = meta =
url: @url() url: @url()
id: '' id: ''
head: title head: title
title: title title: title
iconClass: 'magnifier' iconClass: 'searchdetail'
meta meta
url: -> url: ->
@ -38,10 +43,9 @@ class App.Search extends App.Controller
show: (params) => show: (params) =>
@navupdate(url: '#search', type: 'menu') @navupdate(url: '#search', type: 'menu')
console.log('par', params)
return if !params.query return if !params.query
@$('.js-search').val(decodeURIComponent(params.query)).trigger('change') @$('.js-search').val(decodeURIComponent(params.query)).trigger('change')
@searchFunction(200, true) @throttledSearch(true)
hide: -> hide: ->
# nothing # nothing
@ -79,7 +83,7 @@ class App.Search extends App.Controller
) )
if @query if @query
@searchFunction(200, true) @throttledSearch(true)
listNavigate: (e) => listNavigate: (e) =>
if e.keyCode is 27 # close on esc if e.keyCode is 27 # close on esc
@ -87,71 +91,69 @@ class App.Search extends App.Controller
return return
# on other keys, show result # on other keys, show result
@searchFunction(200) @throttledSearch(200)
empty: => empty: =>
@searchInput.val('') @searchInput.val('')
@updateFilledClass()
# remove not needed popovers # remove not needed popovers
@delay(@anyPopoversDestroy, 100, 'removePopovers') @delay(@anyPopoversDestroy, 100, 'removePopovers')
searchFunction: (delay, force = false) => search: (force = false) =>
query = @searchInput.val().trim()
if !force
return if !query
return if query is @query
@query = query
search = => # use cache for search result
query = @searchInput.val().trim() if @searchResultCache[@query]
if !force @renderResult(@searchResultCache[@query].result)
return if !query currentTime = new Date
return if query is @query return if @searchResultCache[@query].time > currentTime.setSeconds(currentTime.getSeconds() - 20)
@query = query
# use cache for search result @updateTask()
if @searchResultCache[@query]
@renderResult(@searchResultCache[@query].result)
currentTime = new Date
return if @searchResultCache[@query].time > currentTime.setSeconds(currentTime.getSeconds() - 20)
@updateTask() App.Ajax.request(
id: 'search'
App.Ajax.request( type: 'GET'
id: 'search' url: "#{@apiPath}/search"
type: 'GET' data:
url: "#{@apiPath}/search" query: @query
data: limit: 200
query: @query processData: true,
limit: 200 success: (data, status, xhr) =>
processData: true, App.Collection.loadAssets(data.assets)
success: (data, status, xhr) => result = {}
App.Collection.loadAssets(data.assets) for item in data.result
result = {} if App[item.type] && App[item.type].find
for item in data.result if !result[item.type]
if App[item.type] && App[item.type].find result[item.type] = []
if !result[item.type] item_object = App[item.type].find(item.id)
result[item.type] = [] if item_object.searchResultAttributes
item_object = App[item.type].find(item.id) item_object_search_attributes = item_object.searchResultAttributes()
if item_object.searchResultAttributes result[item.type].push item_object_search_attributes
item_object_search_attributes = item_object.searchResultAttributes()
result[item.type].push item_object_search_attributes
else
@log 'error', "No such model #{item.type.toLocaleLowerCase()}.searchResultAttributes()"
else else
@log 'error', "No such model App.#{item.type}" @log 'error', "No such model #{item.type.toLocaleLowerCase()}.searchResultAttributes()"
else
@log 'error', "No such model App.#{item.type}"
diff = false diff = false
if @searchResultCache[@query] if @searchResultCache[@query]
diff = difference(@searchResultCache[@query].resultRaw, data.result) diff = difference(@searchResultCache[@query].resultRaw, data.result)
# cache search result # cache search result
@searchResultCache[@query] = @searchResultCache[@query] =
result: result result: result
resultRaw: data.result resultRaw: data.result
time: new Date time: new Date
# if result hasn't changed, do not rerender # if result hasn't changed, do not rerender
return if diff isnt false && _.isEmpty(diff) return if diff isnt false && _.isEmpty(diff)
@renderResult(result) @renderResult(result)
) )
@delay(search, delay, 'search')
renderResult: (result = []) => renderResult: (result = []) =>
@result = result @result = result
@ -161,7 +163,7 @@ class App.Search extends App.Controller
count = result[tab.model].length count = result[tab.model].length
if @model is tab.model if @model is tab.model
@renderTab(tab.model, result[tab.model] || []) @renderTab(tab.model, result[tab.model] || [])
@$(".js-tab#{tab.model} .js-counter").text("(#{count})") @$(".js-tab#{tab.model} .js-counter").text(count)
showTab: (e) => showTab: (e) =>
tabs = $(e.currentTarget).closest('.tabs') tabs = $(e.currentTarget).closest('.tabs')
@ -213,6 +215,9 @@ class App.Search extends App.Controller
App.TaskManager.update(@task_key, { state: current }) App.TaskManager.update(@task_key, { state: current })
App.TaskManager.touch(@task_key) App.TaskManager.touch(@task_key)
updateFilledClass: ->
@searchInput.toggleClass 'is-empty', !@searchInput.val()
class Router extends App.ControllerPermanent class Router extends App.ControllerPermanent
constructor: (params) -> constructor: (params) ->
super super

View file

@ -10,7 +10,18 @@
<%- @Icon('logo') %> <%- @Icon('logo') %>
<div class="activity-counter js-notificationsCounter"></div> <div class="activity-counter js-notificationsCounter"></div>
</div> </div>
<ul id="global-search-result" class="custom-dropdown-menu" role="menu"></ul> <div class="global-search-menu">
<a href="#search" class="global-search-detail-link nav-tab nav-tab--search js-details-link">
<div class="nav-tab-icon">
<%- @Icon('searchdetail') %>
</div>
<div class="nav-tab-name flex u-textTruncate">
<%= @T('Show Search Details') %>
<%- @Icon('long-arrow-right') %>
</div>
</a>
<ul class="global-search-result js-global-search-result" role="menu"></ul>
</div>
</div> </div>
<div class="menu js-menu"></div> <div class="menu js-menu"></div>
<div class="tasks tasks-navigation"></div> <div class="tasks tasks-navigation"></div>

View file

@ -1,19 +1,26 @@
<div class="flex vertical"> <div class="flex main vertical">
<div class="searchfield"> <div class="detail-search">
<%- @Icon('magnifier') %> <div class="detail-search-header">
<input class="js-search form-control" name="query" placeholder="<%- @Ti('Find what you search. E. g. "search phrase"') %>" value="<%= @query %>" type="search" autocomplete="off"> <div class="searchfield">
<div class="empty-search js-emptySearch"> <%- @Icon('magnifier') %>
<%- @Icon('diagonal-cross') %> <input class="js-search form-control<%= if !@query then ' is-empty' %>" name="query" placeholder="<%- @Ti('Find what you search. E. g. "search phrase"') %>" value="<%= @query %>" type="search" autocomplete="off">
<div class="empty-search js-emptySearch">
<%- @Icon('diagonal-cross') %>
</div>
</div>
<div class="tabs tabs-wide">
<% for tab in @tabs: %>
<div data-tab-content="<%- tab.model %>" class="tab js-tab js-tab<%- tab.model %><% if tab.active: %> active<% end %>">
<span class="tab-name"><%- @T(tab.name) %></span>
<span class="tab-badge js-counter"><%- tab.count %></span>
</div>
<% end %>
</div>
</div> </div>
</div>
<div class="tabs tabs-wide"> <div class="js-content"></div>
<% for tab in @tabs: %>
<div data-tab-content="<%- tab.model %>" class="tab js-tab js-tab<%- tab.model %><% if tab.active: %> active<% end %>"><%- @T(tab.name) %> <span class="js-counter"><%- tab.count %></span></div>
<% end %>
</div> </div>
<div class="js-content"></div>
</div> </div>

View file

@ -70,6 +70,7 @@
.icon-reply-all { width: 16px; height: 16px; } .icon-reply-all { width: 16px; height: 16px; }
.icon-reply { width: 16px; height: 16px; } .icon-reply { width: 16px; height: 16px; }
.icon-report { width: 20px; height: 20px; } .icon-report { width: 20px; height: 20px; }
.icon-searchdetail { width: 18px; height: 14px; }
.icon-signout { width: 15px; height: 19px; } .icon-signout { width: 15px; height: 19px; }
.icon-small-dot { width: 16px; height: 16px; } .icon-small-dot { width: 16px; height: 16px; }
.icon-split { width: 16px; height: 16px; } .icon-split { width: 16px; height: 16px; }

View file

@ -1800,12 +1800,27 @@ input.has-error {
appearance: textfield; appearance: textfield;
border-radius: 19px; border-radius: 19px;
padding: 0 17px 0 42px; padding: 0 17px 0 42px;
&.is-empty + .empty-search {
visibility: hidden;
}
} }
input[type="search"]::-webkit-search-cancel-button, input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration { input[type="search"]::-webkit-search-decoration {
-webkit-appearance: none; -webkit-appearance: none;
} }
.empty-search {
height: 41px;
width: 50px;
visibility: visible;
.icon {
position: static;
opacity: 0.5;
}
}
} }
.content { .content {
@ -3038,19 +3053,17 @@ footer {
} }
.nav-tab-icon { .nav-tab-icon {
margin-right: 7px;
margin-left: 7px;
margin-top: -3px; margin-top: -3px;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
position: relative; position: relative;
width: 16px; width: 30px;
} }
.nav-tab-icon .icon { .nav-tab-icon .icon {
width: 16px; max-width: 18px;
height: 16px; max-height: 18px;
fill: #808080; fill: #808080;
} }
@ -3193,7 +3206,7 @@ footer {
cursor: pointer; cursor: pointer;
} }
.empty-search .icon-diagonal-cross { .search .empty-search .icon-diagonal-cross {
fill: white; fill: white;
opacity: 0.5; opacity: 0.5;
} }
@ -3272,10 +3285,7 @@ footer {
display: none; display: none;
} }
.search .custom-dropdown-menu { .global-search-menu {
margin: 0;
padding: 0;
list-style: none;
background: #26272e; background: #26272e;
position: absolute; position: absolute;
left: 0; left: 0;
@ -3285,16 +3295,47 @@ footer {
z-index: 900; z-index: 900;
display: none; display: none;
overflow: auto; overflow: auto;
.divider {
height: 1px;
background: #2f3238;
margin: 14px 0 17px;
}
} }
.search.open .custom-dropdown-menu { .search.open .global-search-menu {
display: block; display: block;
} }
.search .custom-dropdown-menu .divider { .global-search-detail-link {
height: 1px; padding: 9px 15px 8px 0;
background: #2f3238; margin-bottom: 7px;
margin: 14px 0 17px; height: auto !important;
.nav-tab-icon {
width: 18px;
margin-left: 10px;
margin-right: 10px;
.icon {
width: 18px;
height: 14px;
}
}
.nav-tab-name {
.icon {
fill: currentColor;
margin: -2px 0 0 3px;
vertical-align: middle;
}
}
}
.global-search-result {
margin: 0;
padding: 0;
list-style: none;
} }
.user-menu { .user-menu {
@ -8218,6 +8259,10 @@ output {
} }
} }
.detail-search-header {
margin: 20px 0 32px;
}
/* /*
---------------- ----------------

Binary file not shown.

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 59 KiB

View file

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="18px" height="14px" viewBox="0 0 18 14" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 3.8.3 (29802) - http://www.bohemiancoding.com/sketch -->
<title>searchdetail</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="searchdetail" fill="#50E3C2">
<path d="M13.2097264,8.62000012 C12.3275246,8.61422004 11.614616,7.89207056 11.6200305,7.00952369 C11.6265279,6.13347943 12.3426852,5.42000008 13.2194725,5.42000008 L13.2299405,5.42000008 C13.6566027,5.42252886 14.0569144,5.59195763 14.3565165,5.89613465 C14.6564796,6.19958916 14.8203583,6.60311141 14.8178315,7.03047651 C14.8142219,7.45531282 14.6474554,7.85558377 14.3456875,8.15506447 C14.0446416,8.45490642 13.6439689,8.62000012 13.2201944,8.62000012 L13.2097264,8.62000012 M10.0000488,6.95269288 C9.99044948,8.7054343 11.3988803,10.1347405 13.1502196,10.1459486 C13.7533757,10.1459486 14.2994693,9.98903452 14.7677019,9.71363422 L16.694495,11.6430375 L16.7435581,11.690005 C16.8166194,11.7631248 16.9115459,11.7994179 17.0070056,11.7994179 C17.1024653,11.7994179 17.197925,11.7631248 17.2704531,11.690005 L17.8912079,11.0703543 C18.036264,10.9241146 18.036264,10.687676 17.8912079,10.5425037 L17.8426781,10.4928676 L15.9132185,8.56293066 C16.1825323,8.10072784 16.3371877,7.56593889 16.3409207,6.99325571 C16.3537198,5.24051429 14.9420892,3.81174183 13.1907499,3.79999995 C11.4298114,3.79999995 10.0117813,5.20688984 10.0000488,6.95269288 Z" id="search" opacity="0.5"></path>
<path d="M0,1 C0,0.44771525 0.448920205,0 1.00748397,0 L13.992516,0 C14.5489341,0 15,0.443864822 15,1 C15,1.55228475 14.5510798,2 13.992516,2 L1.00748397,2 C0.45106594,2 0,1.55613518 0,1 Z M0,5 C0,4.44771525 0.446311399,4 0.997544646,4 L8.00245535,4 C8.55338405,4 9,4.44386482 9,5 C9,5.55228475 8.5536886,6 8.00245535,6 L0.997544646,6 C0.446615951,6 0,5.55613518 0,5 Z M0,9 C0,8.44771525 0.446311399,8 0.997544646,8 L8.00245535,8 C8.55338405,8 9,8.44386482 9,9 C9,9.55228475 8.5536886,10 8.00245535,10 L0.997544646,10 C0.446615951,10 0,9.55613518 0,9 Z M0,13 C0,12.4477153 0.448920205,12 1.00748397,12 L13.992516,12 C14.5489341,12 15,12.4438648 15,13 C15,13.5522847 14.5510798,14 13.992516,14 L1.00748397,14 C0.45106594,14 0,13.5561352 0,13 Z" id="Combined-Shape"></path>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.4 KiB

View file

@ -2297,7 +2297,7 @@ wait untill text in selector disabppears
# open ticket # open ticket
#instance.find_element(partial_link_text: params[:number] } ).click #instance.find_element(partial_link_text: params[:number] } ).click
instance.execute_script("$(\"#global-search-result a:contains('#{params[:value]}') .nav-tab-icon\").click()") instance.execute_script("$(\".js-global-search-result a:contains('#{params[:value]}') .nav-tab-icon\").click()")
sleep 1 sleep 1
number = instance.find_elements(css: '.active .ticketZoom-header .ticket-number')[0].text number = instance.find_elements(css: '.active .ticketZoom-header .ticket-number')[0].text
if number !~ /#{params[:number]}/ if number !~ /#{params[:number]}/
@ -2332,7 +2332,7 @@ wait untill text in selector disabppears
# open ticket # open ticket
#instance.find_element(partial_link_text: params[:title] } ).click #instance.find_element(partial_link_text: params[:title] } ).click
instance.execute_script("$(\"#global-search-result a:contains('#{params[:title]}') .nav-tab-icon\").click()") instance.execute_script("$(\".js-global-search-result a:contains('#{params[:title]}') .nav-tab-icon\").click()")
sleep 1 sleep 1
title = instance.find_elements(css: '.active .ticketZoom-header .js-objectTitle')[0].text title = instance.find_elements(css: '.active .ticketZoom-header .js-objectTitle')[0].text
if title !~ /#{params[:title]}/ if title !~ /#{params[:title]}/
@ -2420,7 +2420,7 @@ wait untill text in selector disabppears
element.send_keys(params[:value]) element.send_keys(params[:value])
sleep 2 sleep 2
#instance.find_element(partial_link_text: params[:value] } ).click #instance.find_element(partial_link_text: params[:value] } ).click
instance.execute_script("$(\"#global-search-result a:contains('#{params[:value]}') .nav-tab-icon\").click()") instance.execute_script("$(\".js-global-search-result a:contains('#{params[:value]}') .nav-tab-icon\").click()")
sleep 1 sleep 1
name = instance.find_elements(css: '.active h1')[0].text name = instance.find_elements(css: '.active h1')[0].text
if name !~ /#{params[:value]}/ if name !~ /#{params[:value]}/
@ -2453,7 +2453,7 @@ wait untill text in selector disabppears
element.send_keys(params[:value]) element.send_keys(params[:value])
sleep 3 sleep 3
#instance.find_element(partial_link_text: params[:value]).click #instance.find_element(partial_link_text: params[:value]).click
instance.execute_script("$(\"#global-search-result a:contains('#{params[:value]}') .nav-tab-icon\").click()") instance.execute_script("$(\".js-global-search-result a:contains('#{params[:value]}') .nav-tab-icon\").click()")
sleep 1 sleep 1
name = instance.find_elements(css: '.active h1')[0].text name = instance.find_elements(css: '.active h1')[0].text
if name !~ /#{params[:value]}/ if name !~ /#{params[:value]}/