horizon/openstack_dashboard/test/test_panels/plugin_panel
Janet Yu e2ef492311 Fix addition of plugin panel to panel group
Revert fix from bug #1329050, which adds a plugin panel to its dashboard's
class. Adding a plugin panel to a dashboard whose class has its panels defined
in a tuple will fail because the new plugin cannot be appended to the tuple.
The code errors out before the panel gets added to the dashboard's panel list.
However, at this point, the panel has already been registered with the
dashboard. This causes Dashboard.get_panels() to see the panel in its registry
but not in its panel groups. Consequently, the panel gets put in the "Other"
panel group instead of its configured one, as described in bug #1378558.

By not adding the the plugin panel to its dashboard's class, the panel gets
added to its dashboard's panel list. Now the original issue from bug #1329050
resurfaces. The root cause of that is that every time Dashboard._autodiscover()
is called, it instantiates all its panel group classes, wiping out any panels
previously added to any of the panel groups. Avoid this by always processing
all the plugin panel groups before any of the plugin panels, which also ensures
that the panel groups exist before their panels.

Making this change exposed an issue where the Horizon URLs were being loaded
twice during the plugin infrastructure's unit tests, causing plugin panels to
be added multiple times to their dashboards. Fix that by removing the second,
unnecessary call. Also create a second test plugin panel group and panel to
test the scenarios described in the two bugs addressed here, adding two panel
groups at a time.

Change-Id: Id6a99c3ff18102c8f47431638d4dda98f14ec641
Closes-Bug: 1378558
2015-04-22 23:02:43 -07:00
..
static/plugin_panel Allow extensions to add Angular modules 2014-05-28 15:58:39 -06:00
templates/plugin_panel Reduce page title duplication in settings and test 2015-02-12 13:07:27 +00:00
__init__.py Plugin-based panel configuration 2014-03-03 12:21:42 -08:00
panel.py Remove extraneous vim configuration comments 2014-05-06 15:30:10 +08:00
urls.py Fix E128 errors in remaining openstack_dashboard/ 2014-10-16 16:53:52 +09:00
views.py Fix addition of plugin panel to panel group 2015-04-22 23:02:43 -07:00