This patch also adds checks for executable files in
pep8 job.
nose ignores executable files by default, so it is important
to ensure executable flag is not set for test files [1].
openstack_dashboard/test/test_plugins/panel_tests.py was not
tested actually and it was broken. This commit fixes it too.
[1] http://nose.readthedocs.io/en/latest/usage.html#cmdoption-exe
Co-Authored-By: Ivan Kolodyazhny <e0ne@e0ne.info>
Change-Id: I3a124fa2f9f0676b2b43a094e32e3d8b18fa6005
This change is to introduce a flexible mechanism for projects to
add content to horizon's navbar.
- Introduces a new plugin file variable called ADD_HEADER_SECTIONS,
which will take a list of views. These are template views that
will be used to render individual header sections.
- There is a new view in openstack_dashboard/views.py to cycle
through these added views and combine them into the complete
header to be added to the navbar.
- This view is queried by newly added javascript after page load.
On response it is inserted into the page's navbar.
If more than one header is present, the first will be shown in
the navbar, while the rest are added to a drop-down menu.
- The currently displayed header can be changed by clicking on a
new header in the drop-down; this is stored in a cookie to
persist the selection between pages.
- Unit tests were modified/added to verify the new plugin entry
can be parsed successfully and the main header view can parse
a plugin's view successfully
Change-Id: I177b69ec4e78c17f827e540a7e669af1c29e8b59
Implements: blueprint extensible-header
Signed-off-by: Tyler Smith <tyler.smith@windriver.com>
As per OpenStack licensing guide lines [1]:
[H102 H103] Newly contributed Source Code should be licensed under
the Apache 2.0 license.
[1] http://docs.openstack.org/developer/hacking/#openstack-licensing
Change-Id: If9ae2195d23ee8ed4bfe3da136e647f4e291a415
Django 1.8 altered and deprecated the existing pattern for defining
URLs. This will be removed in 1.10, meaning that many deprecation
warnings show up under Django 1.9. We should fix the URLs promptly to
avoid logspam, and to support Django 1.10 in Newton.
See
https://docs.djangoproject.com/en/1.9/releases/1.8/#django-conf-urls-patterns
Change-Id: I074d20850de59bfe678a3bc72e9f0f25bd743cbf
Partially-Implements: blueprint dj110
According to the Horizon documentation for Settings and Configuration,
for a plugin panel, 'If you want the panel to show up without a panel
group, use the panel group “default”'. In some cases, plugin panels were
getting put under the panel group "Other" instead. This is because
the default panel group wasn't getting created during plugin panel
processing when the panel's dashboard class already had some panel
groups defined. Fix this by making sure a default panel group is created
in each dashboard.
Change-Id: I98064c434326aabec16b5d1631e360643609ed40
Closes-Bug: 1403094
The root cause of 1479018 was the mixed method for loading content in
horizon. This patch moves horizon to load purely from enabled files.
There are a couple of things that were required to allow this change.
1) Adding a mechanism, can_register() to horizon/base.py to handle the
configuration based loading checks that had been accumulating in the
panel.py files. This is an optional static method in Panel to
encapsulate such configuration (read settings) based panel loading
logic. And added testing for and documentation for this addition.
2) Create a numbering scheme for plugins. Moved the base dashboards to
_1000_project.py _2000_admin.py _3000_identity.py _5000_settings.py.
then populated the required panel_group and panel enabled files sparsely
in those ranges. The sparseness is to allow for future additions.
Additionally, I moved the already added Angular based panels next to
their Django counterparts.
Once the configuration loading was normalized, the bug reported in
1479018 was resolved and tests work with plugins panels in all
dashboards.
Close-Bug: #1479018
Partially implements: blueprint plugin-sanity
Change-Id: I657e7ce37b2593a901a859cebf3d6ff8ada91941
Currently, we have tests for plugin but they are not comprehensive enough.
Considering that we are adding more logic to javascript, we need to ensure
that they are properly injected in these plugin.
Change-Id: Ie9186c445962e3142f2b33027b6556f9eb3b34a5
Closes-bug: #1468547
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
Patch https://review.openstack.org/#/c/142802 adds a method of
reducing duplication of page title logic, this patch applies that change
to the project settings and the test panel views.
Change-Id: I4af59bb3c051dcd24e46aacd91c49b8fcc6c10c7
Partial-Bug: 1413749
We have two imports with #noqa: django.conf.urls.patterns and
django.conf.urls.url however using them is a standard way of creating
any urls.py module. So there are over 150 imports in Horizon code
where #noqa could be replaced with two lines in list of import_exceptions.
Change-Id: I81c3290e0dc958b5037dd6a87e44df18adfbe751
Updated to bootstrap 3.2.0
back to v3.1.1
fix base-line-height variable
Revamped grid system
Replaced help-inline with help-block
Change .control-group to .form-group
Add column widths to horizontal form labels and .controls, remove .controls class
Datepicker form fix
Add btn-default to btn elements with no other color
Topbar switcher fix
Rename button sizes
Replace alert-error with alert-danger
Removed alert-block
Alerts fixing
Updated LinkAction and Action table actions to define icon, replaced btn-default icon with glyphicon
Replaced icons with glyphicons, removed btn-icon styling from horizon.scss
change Button Icons text in customizing docs
Fixed table header
Fix page_header h2 margin
Nav accordion fix
Tables fix
Modal fixes
added form-control class to input and selects
Forms fixes
Workflow modal fix
Fix quota bar
updated customizing docs
removed unused styling from horizon.scss
make datepicker form inline
fix table filter styling
added btn-danger to terminate instances button
fixed loading spinner
form fields and validations
Created bootstrap_form_field filter and template to render bootstrap forms properly
Style up the datepicker
Fixed failing test cases
Implements: blueprint bootstrap-update
Change-Id: Ic826849be1af7fc6bf06f97dd7a60fc54b862148
This change allows extension plugins to make use of AngularJS without
changing horizon template or javascript files.
Horizon bootstraps AngularJS once when a page loads with a list
of modules. An extension can register a list of modules and a list
of javascript files that contain these modules.
Implements blueprint: plugins-angular
Change-Id: I4a76363dd4a631cc0d2fc2c902c2f5cac0f073f2
Remove vim setting:
comment - # vim: tabstop=4 shiftwidth=4 softtabstop=4
at the top of source code files, except for files in
openstack/common.
Change-Id: I9a5c6b17c6ef7ecec601f4503dfc7b31fc72e90a
Close-bug: #1229324
This is an extension to the plugin-based dashboard configuration.
It adds support processing panel configuration configuration file
in the openstack_dashboard/enabled/ directory.
Panels can be added, removed to/from the panel group of a dashboard.
It also provide the ability to update the default panel of the
dashboard.
Change-Id: I2d7adfb8045c244ec063a6741e3b9fe21c188525
Implements: blueprint plugin-panel-config