Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1616327

Summary: UI plugin contributed buttons in main view aren't reflected into detail view
Product: [oVirt] ovirt-engine Reporter: Vojtech Szocs <vszocs>
Component: Frontend.WebAdminAssignee: biakymet
Status: CLOSED CURRENTRELEASE QA Contact: Petr Matyáš <pmatyas>
Severity: medium Docs Contact:
Priority: medium    
Version: futureCC: biakymet, bugs, gshereme, lleistne, sgratch, vszocs
Target Milestone: ovirt-4.3.5Flags: rule-engine: ovirt-4.3+
lleistne: testing_ack+
Target Release: 4.3.5.2   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ovirt-engine-4.3.5.2 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-07-30 14:08:04 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:
Attachments:
Description Flags
main view - custom button is present
none
detail view - custom button is missing
none
Test UI plugin none

Description Vojtech Szocs 2018-08-15 15:25:40 UTC
Description of problem:

Normally, all action-panel-related buttons between main views vs. detail views are in sync (except for e.g. "New" button removed from detail views on purpose), see the screenshot for reference.

When adding a button to the main view, UI plugins should have the ability to specify whether this button will be available in detail view. (Current behavior is to show the custom button in main view's action panel only.)


How reproducible:

Taking Greg's Cluster Upgrade dialog UI plugin [1] as an example.

[1] https://gerrit.ovirt.org/#/c/93639/

Going to Cluster main view (#clusters), the "Upgrade" button is part of the action panel, as expected.

Going to Cluster detail view (like #clusters-general), the "Upgrade" button is missing.

Comment 1 Vojtech Szocs 2018-08-15 15:33:05 UTC
Created attachment 1476184 [details]
main view - custom button is present

Comment 2 Vojtech Szocs 2018-08-15 15:33:27 UTC
Created attachment 1476186 [details]
detail view - custom button is missing

Comment 3 Greg Sheremeta 2018-08-15 18:26:55 UTC
Vojtech, can you roughly estimate how difficult this would be to fix?

Comment 4 Vojtech Szocs 2018-08-15 19:05:57 UTC
(In reply to Greg Sheremeta from comment #3)
> Vojtech, can you roughly estimate how difficult this would be to fix?

ETA ~1 day to fix, details follow.

Looking at the code, there are two separate

  <Entity>ActionPanelPresenterWidget

instances, one used in main view and another one used in detail view.

Taking Cluster as an example, the main view renders all buttons as-is (first ActionPanel instance unchanged), while the detail view removes the "New" button (second ActionPanel instance modified):

  // in ClusterSubTabPanelView constructor
  actionPanel.removeButton(actionPanel.getNewButtonDefinition());

When a UI plugin adds new button to the given main view, only the first ActionPanel instance is updated.

To fix this, we should either ensure that given button is added to both ActionPanel instances, or bind ActionPanel for given <Entity> as singleton and have it return two logical button representations, one for main and one for detail.

Comment 5 Vojtech Szocs 2019-01-18 18:57:42 UTC
Created attachment 1521664 [details]
Test UI plugin

Comment 6 Vojtech Szocs 2019-01-18 19:03:32 UTC
I've attached a test UI plugin that can be used to verify this bug.

To apply this plugin, extract the files to /usr/share/ovirt-engine/ui-plugins directory and reload WebAdmin UI. (There's no need to restart Engine.)

Navigate to Compute/DataCenters and notice two test buttons (first one represented as a regular button, second one represented as a kebab menu item). Then, click some DC name to navigate to its details and notice that those two test buttons are still accessible in the top-right panel.

Comment 7 Sandro Bonazzola 2019-01-28 09:39:44 UTC
This bug has not been marked as blocker for oVirt 4.3.0.
Since we are releasing it tomorrow, January 29th, this bug has been re-targeted to 4.3.1.

Comment 8 Petr Matyáš 2019-06-24 08:46:51 UTC
I have ovirt-engine-4.3.5.1-0.1.el7.noarch and I can see the buttons from given ui plugin in DC overview however I can't find them anywhere in detail view of any DC detail view.

Comment 9 Sandro Bonazzola 2019-06-25 14:45:07 UTC
Is the fix included in 4.3.5.2?

Comment 10 Petr Matyáš 2019-06-28 12:18:09 UTC
Verified on ovirt-engine-4.3.5.2-0.1.el7.noarch

Comment 11 Sandro Bonazzola 2019-07-30 14:08:04 UTC
This bugzilla is included in oVirt 4.3.5 release, published on July 30th 2019.

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