Bug 1361255
Summary: | UI plugin API: allow executing certain actions while the plugin is loading | ||||||
---|---|---|---|---|---|---|---|
Product: | [oVirt] ovirt-engine | Reporter: | Vojtech Szocs <vszocs> | ||||
Component: | Frontend.WebAdmin | Assignee: | Vojtech Szocs <vszocs> | ||||
Status: | CLOSED CURRENTRELEASE | QA Contact: | Pavel Novotny <pnovotny> | ||||
Severity: | high | Docs Contact: | |||||
Priority: | unspecified | ||||||
Version: | 4.0.2 | CC: | bugs, gklein, oourfali, pstehlik, sbonazzo | ||||
Target Milestone: | ovirt-4.0.2 | Flags: | rule-engine:
ovirt-4.0.z+
rule-engine: exception+ rule-engine: planning_ack+ oourfali: devel_ack+ pstehlik: testing_ack+ |
||||
Target Release: | 4.0.2.4 | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Whiteboard: | |||||||
Fixed In Version: | Doc Type: | Enhancement | |||||
Doc Text: |
Background:
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.
Feature:
Allow following API functions to be executed also while the plugin is loading:
- loginUserName
- loginUserId
- ssoToken
- engineBaseUrl
- currentLocale
Above functions are considered "safe to call while loading" as they have no visual or other side effects on WebAdmin UI.
Reason:
Let UI plugins call above functions within their init code, e.g. before the plugin calls ready() to signal that it's ready for use.
Result:
Plugins able to call above functions within their init code.
|
Story Points: | --- | ||||
Clone Of: | Environment: | ||||||
Last Closed: | 2016-08-17 14:44:56 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: | |||||||
Bug Depends On: | |||||||
Bug Blocks: | 1351585 | ||||||
Attachments: |
|
Description
Vojtech Szocs
2016-07-28 15:39:28 UTC
This change is low risk and has no impact on existing UI plugins. The practical effect is relaxing the condition when UI plugin API interaction is allowed, but only for specific ("harmless") API functions. Created attachment 1185592 [details]
UI plugin used to verify the new API behavior
Attached test UI plugin to ease the verification. After loading WebAdmin page, browser console should say: ---Before ready call null null <actual-sso-token> <base-engine-path> <webadmin-locale> ---After ready call null null <actual-sso-token> <base-engine-path> <webadmin-locale> The first two nulls are for loginUserName + loginUserId. This is expected behavior due to adopting SSO. I'll post another patch to address that. (In reply to vszocs from comment #3) > The first two nulls are for loginUserName + loginUserId. This is expected > behavior due to adopting SSO. It's actually a bug, I've got the fix ready, will open a separate BZ on that. Pavel - can you qe-ack? Verified in rhevm-4.0.2.6-0.1.el7ev.noarch ovirt-engine-webadmin-portal-4.0.2.6-0.1.el7ev.noarch Verification: I verified with Vojta's test UI plugin from attachment 1185592 [details]. After reloading the Webadmin page, the browser console says: -~- Tue Aug 16 19:22:23 GMT+200 2016 org.ovirt.engine.ui.webadmin.plugin.PluginManager INFO: Plugin [loading-test] has registered the event handler object plugin.html:11 ---Before ready call plugin.html:12 null plugin.html:13 null plugin.html:14 YC6XzGIlksd_GMYqM5PbtcqsD12ff7Goz7EF6u869Egd52lu9aWkWgSQ8dZJeJTbBhBk0Bn_43tSEBaQchnGvw plugin.html:15 https://rhvm.example.com/ovirt-engine/ plugin.html:16 en-US webadmin-0.js:15466 Tue Aug 16 19:22:23 GMT+200 2016 org.ovirt.engine.ui.webadmin.plugin.PluginManager INFO: Plugin [loading-test] reports in as ready webadmin-0.js:15466 Tue Aug 16 19:22:24 GMT+200 2016 org.ovirt.engine.ui.webadmin.plugin.PluginManager INFO: Plugin [dashboard] has registered the event handler object webadmin-0.js:15466 Tue Aug 16 19:22:24 GMT+200 2016 org.ovirt.engine.ui.webadmin.plugin.PluginManager INFO: Plugin [dashboard] reports in as ready ... ... Tue Aug 16 19:22:26 GMT+200 2016 org.ovirt.engine.ui.webadmin.plugin.PluginManager INFO: Invoking event handler function [UiInit] for plugin [loading-test] plugin.html:11 ---After ready call plugin.html:12 admin@internal-authz plugin.html:13 0000002c-002c-002c-002c-000000000411 plugin.html:14 YC6XzGIlksd_GMYqM5PbtcqsD12ff7Goz7EF6u869Egd52lu9aWkWgSQ8dZJeJTbBhBk0Bn_43tSEBaQchnGvw plugin.html:15 https://rhvm.example.com/ovirt-engine/ plugin.html:16 en-US webadmin-0.js:15466 Tue Aug 16 19:22:26 GMT+200 2016 org.ovirt.engine.ui.webadmin.plugin.PluginManager INFO: Plugin [loading-test] is initialized and in use now webadmin-0.js:15466 Tue Aug 16 19:22:26 GMT+200 2016 org.ovirt.engine.ui.webadmin.plugin.PluginManager INFO: Invoking event handler function [UserLogin] for plugin [loading-test] -~- |