Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1168334

Summary: [RFE] Provide UI plugin API to reveal given main tab
Product: [oVirt] ovirt-engine Reporter: Ramesh N <rnachimu>
Component: RFEsAssignee: Vojtech Szocs <vszocs>
Status: CLOSED CURRENTRELEASE QA Contact: Petr Matyáš <pmatyas>
Severity: medium Docs Contact:
Priority: unspecified    
Version: ---CC: bugs, gklein, iheim, lsurette, mgoldboi, oourfali, pmatyas, rbalakri, vszocs, yeylon, ykaul
Target Milestone: ovirt-3.6.0-rcKeywords: FutureFeature
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.revealPlace(historyToken); [1] http://www.ovirt.org/Features/UIPlugins#API_function_reference This function allows UI plugins to reveal (navigate to) given application place, e.g. standard or plugin-contributed main tab. The `historyToken` denotes a logical place of the web application, represented as #historyToken in application's URL. For example, to reveal "Virtual Machines" main tab represented by `WebAdmin.html#vms` URL: api.revealPlace('vms'); When called from `UiInit` event handler [2], this function can be used to override the default tab shown after loading WebAdmin UI. [2] http://www.ovirt.org/Features/UIPlugins#Core_functions
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-02-10 12:58:30 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 Ramesh N 2014-11-26 17:09:38 UTC
Description of problem:

 Currently Ovirt UI Plugin Infra supports contributing main tabs through plugin API. Similarly we should have an API to make one of the contributed tab as a default in Webadmin portal. 

   Also currently we are not able to navigate to the plugin contributed tabs by typing the location URL in browser, because of which simple page refresh on a UI Plugin tab takes the user to default main tab. We need to have the support to address the plugin tabs also in address bar.

Comment 1 Vojtech Szocs 2014-11-28 16:34:45 UTC
This BZ can be split into two separate issues:

1, override default place (URL token, mapping to main tab) after login

2, recognize URL tokens for dynamically-added main tabs

Fixing 2, is not trivial due to async nature of dynamically-added main tabs, see BZ comment: https://bugzilla.redhat.com/show_bug.cgi?id=1145227#c9

Anyway, this RFE is valid and we should at least attempt to address both issues mentioned above.

Comment 2 Einav Cohen 2015-04-14 16:10:45 UTC
Just for reference: Quoting e-mail thread: 

[Vojtech]
"""
Implementing this RFE is not trivial due to asynchronous nature of dynamically added (custom) tabs, since UI plugin code can add these at *any* point in time (in "UiInit" callback or anytime later). 
(So right upon WebAdmin login, #gluster-dashboard might not be added yet, but we want to set it as the default landing tab --> problem.)

However, what we can do is trigger UI plugin bootstrap sequence (PluginManager#enablePluginInvocation) *before* showing main GUI, which would give UI plugins chance to add custom tabs in advance, which would solve the "asynchronous custom tab" issue (but only if these custom tabs are added inside "UiInit" and not later).
"""

[Ramesh/Dusmant]
"""
That should be enough. We are not doing any dynamic loading stuff here also we don't require the second case in comment #1. 
"""

Comment 3 Vojtech Szocs 2015-04-22 13:58:45 UTC
Based on info in comment #2 narrowing the scope of this RFE to:

- override default place (URL token, mapping to main tab) after login

Proposed API example:

  UiInit: function() {
    api.addMainTab('My Tab', 'my-tab', 'plugin/ExamplePlugin/my.html');
    api.revealPlace('my-tab'); // navigate to #my-tab
  }

`api.revealPlace` can be called at any point, assuming that given place (e.g. main tab) is either core (built-in) -or- is dynamic (plugin-contributed) and is already added. Otherwise, WebAdmin will redirect to the default (VMs main tab) place.

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

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

Indeed, setting to POST.

Comment 6 Vojtech Szocs 2015-04-30 15:17:07 UTC
Updated BZ summary to reflect the fact that new UI plugin API (revealPlace) should work for both standard (built-in) and custom (UI-plugin-contributed) main tabs.

Comment 7 Vojtech Szocs 2015-04-30 15:18:24 UTC
Created attachment 1020637 [details]
Test UI plugin

Comment 8 Vojtech Szocs 2015-04-30 15:19:54 UTC
Attached test UI plugin (ui-plugins_1168334.tar.gz) to demonstrate the use of new "revealPlace" API.

Comment 9 Vojtech Szocs 2015-04-30 18:29:48 UTC
Associated upstream patch http://gerrit.ovirt.org/40404 is verified and ready for merge.

Comment 10 Einav Cohen 2015-05-07 17:43:55 UTC
Vojtech - MODIFIED (patches merged)?

Comment 11 Vojtech Szocs 2015-05-11 15:19:55 UTC
(In reply to Einav Cohen from comment #10)
> Vojtech - MODIFIED (patches merged)?

Yes. Moving to MODIFIED.

Comment 12 Petr Matyáš 2016-02-04 12:52:57 UTC
Verified on 3.6.3-1