Bugzilla (bugzilla.redhat.com) will be under maintenance for infrastructure upgrades and will not be available on July 31st between 12:30 AM - 05:30 AM UTC. We appreciate your understanding and patience. You can follow status.redhat.com for details.
Bug 1570077 - [RFE] Add UI plugin API function to allow tab/place resource cleanup
Summary: [RFE] Add UI plugin API function to allow tab/place resource cleanup
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: Frontend.WebAdmin
Version: future
Hardware: Unspecified
OS: Unspecified
Target Milestone: ovirt-4.3.0
: 4.3.0
Assignee: Vojtech Szocs
QA Contact: Pavel Novotny
Depends On:
TreeView+ depends on / blocked
Reported: 2018-04-20 15:16 UTC by Vojtech Szocs
Modified: 2019-03-26 07:17 UTC (History)
5 users (show)

Fixed In Version: ovirt-engine-4.3.0_alpha
Doc Type: Enhancement
Doc Text:
The current release of the User Interface Plugin API provides an "unload" handler that can be attached to a primary/secondary menu item or a details tab to perform clean-up when the user navigates away from these interface elements.
Clone Of:
Last Closed: 2019-03-26 07:17:48 UTC
oVirt Team: UX
rule-engine: ovirt-4.3?
rule-engine: planning_ack?
rule-engine: devel_ack+
lsvaty: testing_ack+

Attachments (Terms of Use)
Test UI plugin (753 bytes, application/x-gzip)
2018-05-16 16:37 UTC, Vojtech Szocs
no flags Details

System ID Private Priority Status Summary Last Updated
oVirt gerrit 90498 0 master MERGED webadmin: Add setPlaceUnloadHandler UI plugin API function 2020-05-27 10:17:43 UTC
oVirt gerrit 91298 0 master MERGED webadmin: Fix setPlaceUnloadHandler API impl. for unattached iframes 2020-05-27 10:17:43 UTC

Description Vojtech Szocs 2018-04-20 15:16:07 UTC
UI plugins should be able to register tab/place unload handler in order to cleanup associated resources when the user navigates away from the given tab/place.

For example:


  UiInit () {
    api.addPrimaryMenuPlace('Test', 'test-tab', 'plugin/test-plugin/tab.html');

api.setPlaceUnloadHandler('test-tab', function () {
  // plugin specific cleanup code



To verify above example:

1, navigate to given plugin-contributed place, e.g. 'Test'
2, navigate to any other place, e.g. 'Events'
3, unload handler code should execute

Comment 1 Vojtech Szocs 2018-05-16 15:34:36 UTC
Verification with test UI plugin didn't pass for all API functions, moving to POST and going to fix the problem.

Comment 2 Vojtech Szocs 2018-05-16 16:37:00 UTC
Created attachment 1437475 [details]
Test UI plugin

Comment 3 Vojtech Szocs 2018-05-16 16:46:21 UTC
Attached test UI plugin to ease BZ verification.

Please check plugin code in test-resources/start.html and adapt if necessary.

To verify, for all application places contributed by the test UI plugin:

1, nav menu -> Test Primary Place (#test1)
2, nav menu -> Test Container -> Test Secondary Place (#test2)
3, nav menu -> Compute -> Virtual Machines (#vms) -> [click on VM name] -> Test Detail Tab (#test3)

check that going away from that place to somewhere else (e.g. Events) will emit following console logs:

  Calling unload handler for place test1
  Calling unload handler for place test2
  Calling unload handler for place test3

Comment 4 Pavel Novotny 2019-03-25 16:07:19 UTC
Verified in

Verified with provided test plugin in attachment 1437475 [details]

Followed steps in comment 3, the browser console showed:

Calling unload handler for place test1
Calling unload handler for place test2
Calling unload handler for place test3

Comment 5 Sandro Bonazzola 2019-03-26 07:17:48 UTC
This bugzilla is included in oVirt 4.3.0 release, published on February 4th 2019.

Since the problem described in this bug report should be
resolved in oVirt 4.3.0 release, it has been closed with a resolution of CURRENT RELEASE.

If the solution does not work for you, please open a new bug report.

Note You need to log in before you can comment on or make changes to this bug.