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

vszocs at redhat.com vszocs at redhat.com
Mon Aug 1 14:42:23 UTC 2016


Vojtech Szocs 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(+), 16 deletions(-)

Approvals:
  Jenkins CI: Passed CI tests
  Martin Betak: Looks good to me, but someone else must approve
  Greg Sheremeta: Looks good to me, approved
  Vojtech Szocs: Verified



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

Gerrit-MessageType: merged
Gerrit-Change-Id: I8996f4e7bb69696fb13a99068cf1a0c267b1481a
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
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: Martin Betak <mbetak at redhat.com>
Gerrit-Reviewer: Oved Ourfali <oourfali 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