Change in ovirt-engine[ovirt-engine-4.0]: webadmin: Allow UI plugins to run certain actions while loading

oourfali at redhat.com oourfali at redhat.com
Mon Aug 1 17:18:24 UTC 2016


Oved Ourfali has submitted this change and it was merged.

Change subject: webadmin: Allow UI plugins to run certain actions while loading
......................................................................


webadmin: Allow UI plugins to run certain actions while loading

UI plugin API performs requested actions only if the given plugin is
either initializing (within UiInit callback) or in use (within other
callbacks).

This means all API actions are no-op while the plugin is loading, e.g.
before the plugin calls the ready() function that triggers the UiInit
callback.

This limits the usability of plugin API, for example:

  var api = window.top.pluginApi('my-plugin');
  api.register(objectWithCallbacks);

  // problem: cannot use e.g. `api.currentLocale` yet!
  api.ready(); // triggers UiInit callback execution

This patch fixes the above issue by letting following API functions
to be executed also while the plugin is loading (before api.ready):

- loginUserName
- loginUserId
- ssoToken
- engineBaseUrl
- currentLocale

Change-Id: I8996f4e7bb69696fb13a99068cf1a0c267b1481a
Bug-Url: https://bugzilla.redhat.com/1361255
Signed-off-by: Vojtech Szocs <vszocs at redhat.com>
---
M frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/plugin/PluginManager.java
M frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/plugin/PluginState.java
2 files changed, 26 insertions(+), 18 deletions(-)

Approvals:
  Alexander Wels: Looks good to me, approved
  Jenkins CI: Passed CI tests
  Vojtech Szocs: Verified



-- 
To view, visit https://gerrit.ovirt.org/61778
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I8996f4e7bb69696fb13a99068cf1a0c267b1481a
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-4.0
Gerrit-Owner: Vojtech Szocs <vszocs at redhat.com>
Gerrit-Reviewer: Alexander Wels <awels at redhat.com>
Gerrit-Reviewer: Greg Sheremeta <gshereme at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Oved Ourfali <oourfali at redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski at gmail.com>
Gerrit-Reviewer: Tal Nisan <tnisan at redhat.com>
Gerrit-Reviewer: Vojtech Szocs <vszocs at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>



More information about the Engine-commits mailing list