Bug 1081028

Summary: [RFE] Provide UI plugin API to control the search string
Product: [oVirt] ovirt-engine Reporter: Vojtech Szocs <vszocs>
Component: RFEsAssignee: Vojtech Szocs <vszocs>
Status: CLOSED CURRENTRELEASE QA Contact: Petr Matyáš <pmatyas>
Severity: medium Docs Contact:
Priority: unspecified    
Version: ---CC: bugs, gklein, iheim, mgoldboi, pmatyas, rbalakri, s.kieske, vszocs, yeylon, ykaul
Target Milestone: ovirt-3.6.0-rcKeywords: FutureFeature, Reopened
Target Release: 3.6.0Flags: rule-engine: ovirt-3.6.0+
ylavi: planning_ack+
rule-engine: devel_ack+
rule-engine: testing_ack+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ovirt-3.6.0-alpha1.2 Doc Type: Enhancement
Doc Text:
Added new oVirt/RHEV UI plugin API function [1]: api.setSearchString(searchString); [1] http://www.ovirt.org/Features/UIPlugins#API_function_reference This function allows UI plugins to apply given search string into WebAdmin's search panel, which in turn reveals (navigates to) the corresponding main tab. For example: api.setSearchString('Vms: name = abc'); Calling this function is behaviorally identical to entering the UI search string by hand and applying it via Enter key or Search icon.
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-02-10 12:52:45 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: UX RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Test UI plugin none

Description Vojtech Szocs 2014-03-26 14:04:06 UTC
WebAdmin's search panel can be used to query different kinds of objects, with UI adapting its view to objects being queried.

This RFE is about controlling the search string via URL parameter, for example:

  WebAdmin.html#search;q={uri-encoded-search-string}

GWT(P) UI infra could handle this URL simply by applying the search string into the search panel, which in turn redirects the URL to appropriate place (based on object type being searched) like #vms or #hosts.

This kind of URL would also work with auto-login, i.e. if Engine user session exists, WebAdmin UI takes user into the main section and applies the search string.

The advantage would be that users could simply bookmark popular search strings via URL in their browser.

Comment 1 Sven Kieske 2014-03-26 14:54:31 UTC
(In reply to vszocs from comment #0)
> GWT(P) UI infra could handle this URL simply by applying the search string
> into the search panel

well you should parse it for allowed searches.
so it's not that simple, at least if you want a secure search ;)

Comment 2 Vojtech Szocs 2014-03-26 15:08:36 UTC
> well you should parse it for allowed searches.
> so it's not that simple, at least if you want a secure search ;)

Good point, however the search is just a string (text) that's meant to be placed in WebAdmin's search panel text-box (input element), i.e. same as if you entered such text into the search panel by hand. This text will not evaluate as JS, so XSS shouldn't be involved.

I agree that we could do some validation here, i.e. check search string sytax (among other things).

Comment 3 Itamar Heim 2015-03-29 09:06:06 UTC
Closing old bugs. If this issue is still relevant/important in current version, please re-open the bug.

Comment 4 Pavel Stehlik 2015-04-02 17:29:14 UTC
User experience improvement, reopening.

Comment 5 Einav Cohen 2015-04-30 12:13:36 UTC
Vojtech - status should be POST?

Comment 6 Einav Cohen 2015-04-30 12:15:09 UTC
(In reply to Einav Cohen from comment #5)
> Vojtech - status should be POST?

Also: subject should change to something like "provide a UI Plugins API method for setting the search string"?

Comment 7 Vojtech Szocs 2015-04-30 18:30:57 UTC
(In reply to Einav Cohen from comment #5)
> Vojtech - status should be POST?

Indeed, setting to POST.(In reply to Einav Cohen from comment #6)

> Also: subject should change to something like "provide a UI Plugins API
> method for setting the search string"?

Will change the BZ summary accordingly.

Comment 8 Vojtech Szocs 2015-04-30 18:34:38 UTC
Created attachment 1020709 [details]
Test UI plugin

Comment 9 Vojtech Szocs 2015-04-30 18:36:08 UTC
Attached test UI plugin (ui-plugins_1081028.tar.gz) to demonstrate the use of new "setSearchString" API.

Comment 10 Vojtech Szocs 2015-04-30 18:42:37 UTC
Associated upstream patch http://gerrit.ovirt.org/#/c/40405 is verified and ready for merge.

Comment 11 Vojtech Szocs 2015-04-30 18:50:23 UTC
Forgot to mention: scope of this RFE has been narrowed down from "search string controlled via WebAdmin URL" to "search string controlled via UI plugin API".

Main reason for this is GWTP's URL token handling (ParameterTokenFormatter) that implies special treatment for characters such as '=' that are perfectly valid in search syntax. If we ever need to control search via WebAdmin URL, we can open a separate RFE.

Comment 12 Einav Cohen 2015-05-07 17:40:31 UTC
Vojtech - MODIFIED (patch merged)?

Comment 13 Vojtech Szocs 2015-05-11 15:20:43 UTC
(In reply to Einav Cohen from comment #12)
> Vojtech - MODIFIED (patch merged)?

Yes. Moving to MODIFIED.

Comment 14 Petr Matyáš 2016-02-04 13:00:22 UTC
Verified on 3.6.3-1