In Train cycle, we moved the definition of default values
to openstack_dashboard/defaults.py. The current code accesses
a dict member using []. It requires operators to define a dict
setting with a full member.
This commit allows to use dict-type settings with partial members.
A new function is introduced to retrieve a dict-type setting
considering default values defined in
{openstack_dashboard,horizon,openstack_auth}/defaults.py
Change-Id: I7ff0ad4bca698aef9c0eba370b0570200a14367a
Closes-Bug: #1843104
Cookie-based settings related to openstack_dashboard are located
under horizon directory,, but they are not related to "horizon".
This commit moves them to "openstack_dashboard" directory.
Part of blueprint ini-based-configuration
Change-Id: Id48ececdbe819a95485e9a91dc5a1a163a5568c3
This commit enhances django workflow implementation to allow horizon
plugins to add workflow steps to a workflow in other repository like
the main horizon repo. New setting "EXTRA_STEPS" is introduced to
the horizon plugin 'enabled' file.
To this aim, the workflow class looks up HORIZON_CONFIG['extra_steps']
with its class full name and loads them as extra steps if any.
HORIZON_CONFIG['extra_steps'] are populated via horizon plugin settings.
This commit completes the blueprint.
blueprint horizon-plugin-tab-for-info-and-quotas
Change-Id: I347d113f47587932e4f583d3152e781ad1a4849f
W503 line break before binary operator
Looking at the code base, it sounds okay to follow this check.
Change-Id: Id511e0104dc6de5b204021661d4a8776ca6d3658
This patch allows Horizon to accept additional xstatic modules
in plugin dashboards. Related static files would be collected
and included in every page.
Change-Id: Ie49a522b28aaf6e028c5b218968d68189dd7eef1
Closes-Bug: #1755339
This commit enhances django tab implementation to allow horizon plugins
to add tabs to a tab group in other repository like the main horizon repo.
New setting "EXTRA_TABS" is introduced to the horizon plugin 'enabled' file.
To this aim, the tab group class looks up HORIZON_CONFIG['extra_tabs']
with its class full name and loads them as extra tabs if any.
HORIZON_CONFIG['extra_tabs'] are populated via horizon plugin settings.
This commit moves update_settings in openstack_dashboard.test.helpers
to horizon as I would like to use it in a new horizon unit test.
blueprint horizon-plugin-tab-for-info-and-quotas
Closes-Bug: #1746754
Change-Id: Ice2469a90553754929826d14d20b4719bd1f62d3
When doing theme customization with templates
collectstatic failes with a traceback
Change-Id: I0fdb80ddde1f73b657d445c75b55636d6f2e8d88
Closes-bug: #1744239
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 allows to throw a detailed exception
in case if 'files' list has 'None' value:
"""
Exception occurred:
File "/<<PKGBUILDDIR>>/openstack_dashboard/utils/\
settings.py", line 263, in get_xstatic_dirs
for file in files:
TypeError: 'NoneType' object is not iterable
"""
Closes-Bug: #1732567
Change-Id: Iaf6282819c26c12ca24d19ef7dee00a5c8586418
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>
At now, the horizon plugin framework does not allow to override default panel
settings by same filename. The embeded enabled files are always processed,
so this leads to make operators difficult to change the order of panels
from the default. In the original design of the plugin mechanism,
we allow to override embeded enabled files by local/enabled files.
For more detail, see bug 1700325.
This commit changes import_dashboard_config to override an embeded enabled
file by specifying a enabled file in local/enabled with the same filename.
Closes-Bug: #1700325
Change-Id: Id6b15848206a684eca850a8f510a8ba1608bb7bf
The Horizon spinner was using a spinner generated and animated
entirely out of JavaScript. Since CSS3 provides animates and we have
access to icon fonts, doing everything with JavaScript is not
necessary and actually taxing on the browser. Plus, all of the
spinner options were being passed in and around with JavaScript,
including the colors. This makes it supremely difficult to use the
theme to style the spinner.
The new spinner is just defined by a handful of templates now. There
are two clientside templates to support Legacy Horizon, and one
template in the Angular to support spinners going forward. Legacy
Horizon had two forms of spinners, so it was broken up. Angular as
not yet made use of the inline spinner, but should follow the same
markup when it is made.
There are two types of spinners, inline spinners (those shown when a
dynamic tab content is loading) and modal spinners (various other
places). These are consistent with each other for the 'default'
experience, but their experience can be entirely customized separate
from each other. 'material' has been augmented with loaders defined
within their design spec to show the power of this new feature.
horizon.templates.js was augmented with this refactor to support only
having to compile one tempalte at a time (instead of all of them) and
caching that template so that all of them can be recompiled later.
Also, horizon.loader.js was added to house template compilation code
that was repeated in several locations.
To test overwriting page modal spinner and inline-modal spinner
examples, please follow the instructions in _loading_inline_exmaple.html,
_loading_modal_example.html under
openstack_dashboard/themes/material/templates/horizon/client_side
Change-Id: I92bc786160e070d30691eeabd4f2a50d6e2bb395
Partially-implements: blueprint horizon-theme-css-reorg
Partially-Implements: blueprint bootstrap-html-standards
Closes-bug: #1570485
As mentioned in [1], we should avoid using six.iteritems(iter) to
achieve iterators. We can use iter.items() instead, as it will
return iterators in PY3 as well.
[1] http://lists.openstack.org/pipermail/openstack-dev/2015-June/066391.html
Change-Id: Ieadd5fa69b3f6058c0641a5b96ef3e8e1e3f6cc2
This patch reduces duplication arbitrary directory choices for
xstatic package locations in the static directory.
It moves the xstatic configuration from the library into the
settings file, and the supporting functions move to
the openstack_dashboard.utils.settings module. Having the xstatic
module list in settings allows deployers to add new modules.
It standardises the paths the files are served from, reducing
potential conflicts.
It simplifies the interaction with the xstatic modules, and also uses
the new MAIN variable if present to determine the entry points used.
Since some of the xstatic packages were installed into special
snowflakes directories (not following a pattern) the references to
those (bootstrap_scss and font_awesome) have been fixed.
Change-Id: Ia5be0e96fff1a4ddd6058d6b030ddf96da4b46e7
A dashboard enabled file in local/enabled is not able to appear before,
or inbetween any core panels.
The list of panels appears to be intended to be sorted by file name,
but all files in /enabled and always presented in the nav ahead of
any files from local/enabled, no matter the file name.
This appears to be a bug in util/settings.py that does an rsplit to
separate file name from path, but accidentally uses the full list of
split items, instead of just the file name.
For example, a file with __name__ of
'openstack_dashboard.enabled._1040_project_volumes_panel' splits into
['openstack_dashboard.enabled', '_1040_project_volumes_panel']. When
this list is fed to cmp(), it will always come before a panel in
local/enabled such as
['openstack_dashboard.local.enabled', '_0001_my_new_panel']
Change-Id: Ic169ccf0db1e04ec42fe999df6648117ce9efe84
Closes-Bug: 1567047
Horizon still uses django.utils.importlib which is removed from Django
1.9. We should use:
from importlib import import_module
instead of:
from django.utils.importlib import import_module
Change-Id: I422e14546468cb9c5627e746023948aab107a338
Closes-Bug: #1534522
Partially-Implements: blueprint drop-dj17
Co-Authored-By: Rob Cresswell <robert.cresswell@outlook.com>
It's not possible for plugins to contribute translations to the javascript
message catalog. Right now our files are hardcoded to allow only
contributions from horizon and openstack_dashboard. This patch fixes
the issue.
Change-Id: Idde2fc6ac0bf7f762a595cf139ed5184dad64540
Closes-Bug: #1523930
This patch does three things:
1) It adds the extensible service which can be used to allow plugins
to customize various containers by adding and removing items such as
workflow steps, table actions, and form fields.
2) It adds support for a "feature" plugin that can be used to add
angular modules that can then be used to customize various panels.
The feature plugin is different from a typical plugin in that it does
not add a dashboard or panel, it only adds angular modules, JS files,
HTML templates, spec files, styles, etc.
3) It updates the workflow service to make each workflow extensible
and adds IDs to the launch instance workflow steps so that this
workflow instance is now extensible.
An example feature plugin is available here:
https://drive.google.com/open?id=0Bye7buoZvOxFOXJvMTNNUTdNNUk
Documentation will be provided by this commit:
https://review.openstack.org/244407
Implements: blueprint angular-workflow-plugin
Change-Id: I8b426b1644c26b1af063d570da19a75ac8c97c27
The iteritems() method of Python 2 dictionaries was renamed to items()
on Python 3. The overhead of creating a temporary list for items() on
Python 2 is negligible.
Replace also dict.itervalues() with six.itervalues(dict) in
horizon/test/utils.py.
Partial-Implements: blueprint porting-python3
Change-Id: Ib2d62236be2620c4626099ce80e6c8a9397a4533
When AUTO_DISCOVER_STATIC_FILES enabled in a plugin dashboard,
static files including JavaScript files and static angular html
templates will be automatically discovered.
Change-Id: I7a88983f2604b71431b5b18c97a5c22c37961141
Partially-Implements: blueprint auto-js-file-finding
Users can add custom scss via the ADD_SCSS_FILES in enabled file.
Keeping the dashboard.scss for now, will remove in later patches.
Tests provided in a follow-on patch:
https://review.openstack.org/#/c/195781/
Co-Authored-By: Shaoquan Chen <sean.chen2@hp.com>
Implements: blueprint pluggable-scss
Change-Id: I34c7dd2a69eb194a0b28275baba49bdea3348f70
This change moves the controller ImageFormCtrl and
hzNamespaceResourceTypeFormController from horizon (the framework)
to openstack_dashboard (the application) where they belong.
Co-Authored-By: Tyr Johanson <tyr@hp.com>
Change-Id: I2309f0867c2f657a6065003475dcb10448f907bc
Partial-Bug: #1458697
Defines a new option, ADD_INSTALLED_APPS, which gets prepended
to the beginning of INSTALLED_APPS.
Change-Id: I956835c3e18edee9e223a607005b47a5c5977687
Closes-bug: #1343342
Horizon has a well-defined plug-in architecture, but the
architecture doesn't cover Horizon's Jasmine spec runner.
This patch fills the gap.
This patch also
- defines a new field `js_spec_file` in HORIZON_CONFIG in settings.
- fix a bug openstack_dashboard/utils/settings.py where using python set
to collect js files, which will cause the order of the js file lost.
Change is made to use list to respect the js files order.
- update doc/source/topics/settings.rst to include the newly added field.
Change-Id: Idc122e8b1f917cdd344aa8f4b48fd80a6bdddb70
Close-Bug: 1421778
Make config of ADD_EXCEPTIONS plugin append to the
exception category list and not replace it.
Change-Id: Ib52012bc93311ac019312b0f92b5fcb8842de53d
Co-Authored-By: Eric Peterson <eric.peterson1@twcable.com>
Closes-Bug: #1404032
E127 continuation line over-indented for visual indent
Also fixes E127 introduces by other reviews
after other E127 fixes were merged.
Closes-Bug: #1375931
Change-Id: I0a09f1c2f74c707fc8a347f0ea5975bf2679976e
Dashboards are now configured via the pluggable dashboard/panel
mechanism and the order can be specified in the pluggable config.
On the other hand, we have HORIZON "dashboards" and its tuple order
overrides the order specified in the pluggable config.
It is confusing to be able to configure the order of dashboards
in two places, and we no longer need to have "dashboards" config
parameter in settings.py and a sample local_settings.py.
* If HORIZON_CONFIG contains "dashboards" and update_dashboards
is called, a deprecation warning will be displayed. It is useful
to warn operators to change OpenStack Dashboard settings.
* HORIZON_CONFIG "dashboard" parameter itself still works and
there is no chnage in the behavior, so it is a safe change
and have no upgrade impact.
* This change also removes default_dashboard from settings because
it can be configured via pluggable dashboard config too.
After removing "dashboards" config, the order of the dashboards
are now controlled by the order of openstack_dashboard/enabled and
"Identity" dashboard is displayed before "Settings" dashboard
in the navigation menu.
Closes-Bug: #1366270
Change-Id: Ifa35128691c4fa4843b3c3c051682392e59905a6
Without this change, if HORIZON_CONFIG is defined in local_settings.py
and does not have an 'exceptions' entry, then horizon throws and
exception and fails to start.
Change-Id: I74f244974982d1c56ac36bdcc032d5acb2a0b274
Closes-Bug: #1368361
Warnings H904, H307 and H405 are new or considerably changed, and will
be fixed in a separate patch.
Closes-bug: #1349820
Partial-bug: #1347472
Change-Id: I4fd28990dacf16f03a4eaa6074ef59c37f1a2c14
the call to update_dashboards() can rewrite the existing order
of dashboards, especially a simple plugin is writen to just
add a panel to an existing dashboard
Change-Id: I67a8c58f4b367262c2d6d0df9d78ec4a5d7b944b
Closes-bug: #1342999
This change allows panel plugins tell horizon which exceptions to treat as recoverable.
Previously only dashboard plugins were allowed to register exceptions.
Since there are now more settings that are common than specific to pluggable use case,
the doc was restructured to describe in general pluggable settings and then describe
the specific use cases.
Change-Id: I013ece33ae2b979e92be9c7ba50182025a1ecb91
Closes-bug: #1332688
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
According to https://wiki.openstack.org/wiki/Python3 dict.iteritems()
should be replaced with six.iteritems(dict).
Change-Id: Ia2dcabbd071e1fcdf111ba83573785989a77aef0
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
When we use the 'enabled' mechanism to add panels,
__builtins__ is also getting added to HORIZON_CONFIG.
Since that is undesirable, it is now prevented
by stripping it out before it gets added.
Change-Id: I3dc772210de8da9810795368df9bf1123388624d
Closes-Bug: bug 1312180
Sometimes we want our pluggable dashboard to change more than just
the selected handful of options in the HORIZON_CONFIG. This patch
lets the configuration files for the plugins add and modify any
horizon settings.
Change-Id: I25aec577733631d1e2057bde0b12f1e50c56b05b
Closes-bug: #1302387
Change the parsing of plugin configuration files to allow
a new Django application to be added. This enables the static file
finder to find the plugin's static files when they are referenced.
Previously only plugins that defined a new dashboard could do this.
Change-Id: I69bd8f24fa0855174a05203eabe7c932246dda21
Closes-Bug: #1309183
Panels can be added through plugin configuration, but it is broken
if the user can only use existing panel groups. This adds the
capability to create an empty panel group that can be used by panel
configuration to add itself to the group.
Change-Id: I28d6072fc05b3a4ef5a41cd68337a7864c560525
Closes-Bug: #1287981