Bug 1591730 - [RFE] allow a ui-plugin to set an icon on its left nav
Summary: [RFE] allow a ui-plugin to set an icon on its left nav
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: Frontend.WebAdmin
Version: 4.2.2.6
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: ovirt-4.2.5
: 4.2.5
Assignee: Greg Sheremeta
QA Contact: Pavel Novotny
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-06-15 11:38 UTC by Pratik Narode
Modified: 2018-07-31 15:26 UTC (History)
4 users (show)

Fixed In Version: ovirt-engine-4.2.5
Clone Of:
Environment:
Last Closed: 2018-07-31 15:26:46 UTC
oVirt Team: UX
Embargoed:
rule-engine: ovirt-4.2?
rule-engine: planning_ack?
rule-engine: devel_ack+
lsvaty: testing_ack+


Attachments (Terms of Use)
The Backup tab in sidebar don't have a logo like other tabs (137.39 KB, image/png)
2018-06-15 11:38 UTC, Pratik Narode
no flags Details
icon in 4.2 (74.83 KB, image/png)
2018-06-18 23:42 UTC, Greg Sheremeta
no flags Details


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 92356 0 ovirt-engine-dashboard-1.2 MERGED Dasboard: Added setting icon. 2020-05-14 07:06:54 UTC
oVirt gerrit 92380 0 ovirt-engine-4.2 MERGED webadmin: backport ui plugin main menu icon 2020-05-14 07:06:54 UTC

Description Pratik Narode 2018-06-15 11:38:35 UTC
Created attachment 1451892 [details]
The Backup tab in sidebar don't have a logo like other tabs

Description of problem:
Working in Trilio as Lead Software Engineer. Trilio has a Backup Product for RHV Engine. We have developed a UI plugin for Trilio product in RHV. We support 4.2 and greater RHV version. The trilio plugin is then added into the RHV engine UI using the api, RHV provides for 4.2. We have added a MainTab into side navigation bar in the engine, but is failing to add an icon to it. I know that RHV 4.3 and greater version is adding an updated UI api's that will allow us to pass and set the icon for the MainTab added into the sidebar. But how can I do it in current 4.2 RHV. 

Version-Release number of selected component (if applicable):
Version 4.2.2.6-0.1.el7


I am attaching the screenshot showing not Logo to the BackUp tab.

Thanks for the Help in Advance.
Pratik

Comment 1 Vojtech Szocs 2018-06-18 16:29:51 UTC
Hello Pratik!

In oVirt/RHV 4.2, we did a big UI overhaul (moving away from main/sub tab concept, now using nav-menu and main/detail views), but we didn't reflect those visual changes into the UI plugin API of that version.

In upcoming oVirt/RHV 4.3 (current master), UI plugin API is adapted accordingly. Some of the existing API functions like "addMainTab" were deprecated, so please update your code when targetting 4.3 version. See details at:

  https://lists.ovirt.org/pipermail/users/2018-March/087694.html

If you want to see exactly what API functions are available for the given version, just clone ovirt-engine repo, switch to the corresponding branch and check PluginManager#exposePluginApi method in:

  frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/plugin/PluginManager.java

As for the reported issue - in 4.3, you can use either Font Awesome or PatternFly icon:

  api.addPrimaryMenuPlace(
    'Backup',
    'your-place-token',
    'plugin/your-plugin-name/your-content-page.html',
    {
      icon: 'fa-lock'
      // icon: 'pficon-security'
    }
  );


We'll add support for "icon" option in 4.2 as well. This should be a relatively small change.

Comment 2 Greg Sheremeta 2018-06-18 17:37:25 UTC
taking back so Vojtech can focus on react world :)

Comment 3 Pratik Narode 2018-06-18 18:37:19 UTC
Hello Vojtech, Greg,

Thanks for looking into the issue so quickly.
Vojtech I am aware of the changes made in the UI api for version 4.3 < and will be updating the trilio plugin accordingly.
The reason I filed this bug is because we are releasing a backup/restore product targeting RHV 4.2 and greater. So have developed the plugin as per 4.2 requirements. Have tried everything but was not able to add the icon for the sidebar option we added, Then I realised that this feature is not supported in 4.2.
So if the small change you mention that allows to add the icon in the sidebar can be made, it would be really great.

Thanks,
Pratik   (In reply to Greg Sheremeta from comment #2)
> taking back so Vojtech can focus on react world :)

Comment 4 Greg Sheremeta 2018-06-18 23:42:22 UTC
Created attachment 1452759 [details]
icon in 4.2

Comment 6 Greg Sheremeta 2018-07-30 12:31:48 UTC
ignore comment 5. 1597707 is VERIFIED, therefore this is also VERIFIED (same code)

Comment 7 Pratik Narode 2018-07-30 15:27:07 UTC
Thanks for fixing this guys and bringing out the changes so quickly.

Comment 8 Greg Sheremeta 2018-07-30 15:46:37 UTC
You're very welcome. It's out -- https://www.ovirt.org/release/4.2.5/

Let me know if you have any issues

Comment 9 Sandro Bonazzola 2018-07-31 15:26:46 UTC
This bugzilla is included in oVirt 4.2.5 release, published on July 30th 2018.

Since the problem described in this bug report should be
resolved in oVirt 4.2.5 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.