Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search bar component in Cloud Tenant module #9229

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1031,14 +1031,14 @@ def get_view_process_search_text(view)
# {Processes,Users,...} in that case, search shoult NOT be applied.
# If loading a form such as provisioning, don't filter records
# FIXME: This needs to be changed to apply search in some explicit way.
return nil if @display || @in_a_form
return nil if @in_a_form

# If we came in through Chart pop-up menu click we don't filter records.
return nil if session[:menu_click]

# Build sub_filter where clause from search text
# This part is for the Hosts screen. In explorer screens we have search (that includes vm_infra and Control/Explorer/Policies)
if (!@parent && @lastaction == "show_list") || @explorer
if (!@parent && @lastaction == "show_list") || @explorer || @display
stxt = @search_text.gsub("_", "`_") # Escape underscores
stxt.gsub!("%", "`%") # and percents

Expand Down
7 changes: 7 additions & 0 deletions app/stylesheet/search-bar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,10 @@
margin-right: 2px;
}
}

.display-search-bar {
width: 300px;
position:absolute;
right: 20px;
top: -40px
}
3 changes: 3 additions & 0 deletions app/views/cloud_tenant/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
- arr = %w[floating_ips network_ports cloud_tenants cloud_networks cloud_subnets network_routers network_services instances images]
- arr.concat(%w[security_groups security_policies cloud_object_store_containers cloud_volumes cloud_volume_snapshots custom_button_events])
- if arr.include?(@display) && @showtype != "compare"
.display-search-bar
= react('SearchBar', :searchText => @search_text, :action => 'show',
:advancedSearch => false)
= render :partial => "layouts/gtl", :locals => {:action_url => "show/#{@record.id}"}
- elsif @showtype == "compare"
= raise 'compare partial called through "show"'
Expand Down