admin_state_up is a boolean value but the network and port edit forms
expected a string version of True/False. As a result, True/False string
was shown as the default value in these forms. The field is implemented
as ChoiceField, but there is no special reason not to use BooleanField
for a boolean field and admin_state(_up) fields are the only exceptions
in horizon. This commit replaces all admin_state(_up) fields to
use BooleanField.
As far as I checked, this pattern is used only in the networking
related panels and this patch clean them up.
Change-Id: I9286f6c29d67fec7a88b74661bc8eca945fd9061
Closes-Bug: #1672213
Previously translated messages are included in log messages
and it was determined what language is chosen by users.
It makes difficult for operators to understand log messgaes.
This commit tries to use English messages for all log messages.
The following policies are applied based on the past discussions
in the bug 1406333 and related reviews.
- English messages are used for log messages.
- log messages include exception messages if possible
to help operators identify what happens.
- Use ID rather than name for log messages
as ID is much more unique compared to name.
- LOG.debug() in success code path are deleted.
We don't log success messages in most places and API calls to
back-end services can be logged from python bindings.
Change-Id: Ie554463908327435d886d0d0f1671fd327c0cd00
Closes-Bug: #1406333
Based on Diana's work.
Complete for Admin Panels: https://review.openstack.org/#/c/290204/
Horizon used a standard select input. Unfortunately this type of
input is only customizable to a small extend. Note: not all
ChoiceFields were converted because they have unexpected
impact.
Change-Id: Id9405c6f0127d6e86db09dfaf772f1275a7d7547
Partially-implements: blueprint horizon-theme-css-reorg
Horizon checkboxes were using a standard checkbox. Unfortunately,
this type of checkbox is only customizable through Chrome, and
even then, its not completely flexible.
The default checkboxes have now been altered to allow for a highly
customized experience through the use of CSS pseudo elements and
Icon Fonts. This allows the color, size and unselected and selected
states of the checkbox to be customized.
The 'default' theme uses the standard Font Awesome checked and
unchecked icons. The 'material' now uses the Material Design
checkbox design.
It was also noticed (and fixed) that the help-icon on the forms
were not the same color as its corresponding text.
Partially-Implements: blueprint horizon-theme-css-reorg
Change-Id: I52602357d831a5e978fe6916b37b0cde9edb2b9b
Although Neutron API and Neutronclient support Reject action
in Firewall Rule, it is missing in Horizon. This change
proposes to add the 'Reject' action option to the Firewall
rule in the 'Add Rule' workflow and the 'Edit Rule' form.
Change-Id: Ibf6072948becdc1852464826a04f08127bd85113
Closes-Bug: #1516856
Currently IP Version can be specified during creation/updation
of firewall rules in CLI, but not in Horizon.
This patch adds the support for IP Version in Horizon.
Change-Id: I206c84501248c393167b060e0329dc1b0ea02f14
Closes-Bug: #1503947
Bunch of horizon source code files are marked as executable which is not
appropriate, this patch just 'chmod -x' to all of them.
Closes-Bug: 1468564
Change-Id: Ieadc839bc47599dbcd1a784127fcde9cf8f45bf4
The label of remove router from firewall is ambiguous, this patch rename it
to be more distinct, better to understand.
Change-Id: Iea3ab2e4ace75c14bcc3145c02f155136c49ff28
Closes-Bug: #1467208
When firewall policy/rule is set to shared, it should be seen
by any users.
This commit reimplements the support of shared firewall policies
and rules with honoring Neutron listing behavior for admin role.
Closes-bug: #1294541
Change-Id: Ie7142b10234e720b65f6540f08c7a092939e3ea8
This reverts commit ca8df08bb8.
The reverted commit introduced a regression that all firewall
related resources from all projects are shown in the project panel
if a user has admin role. It violates the design policy of the
Project dashboard (which focuses on project-related resources).
A fix for the original bug 1294541 is coming in the subsequent patch.
Closes-Bug: #1422081
Related-Bug: #1294541
Change-Id: Ie8864b92b4ffb59681c0d18ac8b5f09f636d5fba
When firewall policy is set to shared, it should be seen by any
users just like public images.
_model_query function of common_db_minxin.py in neutron has used
shared and tenant_id fields restored from token to construct the
query condition, so continuing to pass tenant_id as filters
condition will cause sql confusion, just delete them to keep
consistent with the approach python-neutronclient did.
Change-Id: Id891f735509275bd79eff52385ffce40069fc460
Closes-bug: 1294541
In several panels the network admin state is hardcoded to UP/DOWN,
this patch aims to make the admin_state translatable.
Change-Id: Ia0e5ba02a4980c1db0d914e2689956feee5fb718
Closes-bug: #1390207
we can replace set_id_as_name_if_empty with name_or_id in
in all neutron related place to reduce a extra loop call
since set_id_as_name_if_empty is called every after *_list.
Change-Id: I341adb3a581337790e22e049e5b72df11b462b44
Closes-bug: #1370986
We have git to track the authorship of files. It is not necessary to use
the @author tags in the copyright statements.
Change-Id: Ib99e53323dba7315a6c8cf73ba4c7eb7c9803ac3
Currently protocol/action initial values in UpdateRule are incorrectly
formatted: neutron returns lowercase protocol/action strings but
UpdateRule form expects uppercase strings as initial values which
implies to reorder protocol/action choices to select the right initial
values.
This change corrects initial values provided to UpdateRule which allows
to remove the trick in UpdateRule.__init__ and initial protocol/action
values become translatable.
Change-Id: I7145dd591581a7e5e3fb0591518d0e1564f38c10
Currently horizon allows to create firewall rule with protocol == 'ANY'
but horizon crashs if you try to update such rule because UpdateRule
assumes that protocol is a string and fails to convert it to uppercase
if protocol is ANY/None. Moreover horizon does not allow to update
protocol to 'ANY' despite neutron supports it.
This change updates UpdateRule in order to convert correctly ANY to
None and vice versa. It allows also to update firewall rule protocol to
ANY.
Closes-Bug: #1324382
Closes-Bug: #1370485
Change-Id: I5748b8e6c1cf0ef0d7a4317016492e064b5e8918
The Admin State choices in create forms throughout horizon
were not very clear, this patch presents that choice in a much more
readable and understandable way. The field is changed from a boolean
field to a choice field with the different states, making it more
obvious what is being decided.
Change-Id: I7091e5ccf91c57d3f64e2d4415bed952d09ada71
Closes-Bug: 1370322
Enable hacking rule H702 Formatting operation should
be outside of localization method call.
This rule is useful to avoid untranslated strings.
Change-Id: I1c32707ed418c1e64cce24b0adceee14af16200c
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
According to the Django architecture, all fields are grouped in
the django.form module, Horizon fields were dispatched in two modules
utils and form. This patch cleanup the loading of Horizon specific
fields.
Change-Id: Ib18848a8cc06dbd5984ec02d7cd647145124ced4
Closes-Bug: #1287634
We have a lot of import with #noqa that is there to ignore h302,
because it's traditional to import and use a name directly, instead
of a whole module. This hides other errors and gives people the
impression that it's actually fine to import non-modules, you just
have to slap #noqa on those lines.
I went through the code and identified about a dozen names that are
most commonly imported this way. I remove the #noqa tag from them,
and added them to the list in import_exceptions.
I also removed a few unused imports that were revealed in the process.
Change-Id: I27afb8e2b1d4759ec974ded9464d8f010312ee78
The dialog can be open from: the "Firewalls"->"Firewall Policies"
->"More" button of a policy->"Remove Rule"
The "remove rule" field should be required, otherwise, user will
hit error when no rule is select. Removed "required=False",
because it is default to True.
Added 'btn-danger' to the button style
Change-Id: Ifa21419bc93818335057bb16ed2683994c6efee7
Closes-Bug: #1252996
Previously several types of name are used for same type operations
in Neutron releated API method names.
* XXXX_modify -> XXXX_update
* <plural>_get -> <singular>_list
* <plural>_list -> <singular>_list
Closes-Bug: #1261283
Change-Id: I95c268822d1a55ea0440b44ea2c7993979ee4c36
Part of blueprint fwaas-horizon
This commit creates cross links between FWaaS resources
and resolves FWaaS resource UUID in tables to its name.
This helps users to track FWaaS resources.
This commit also improves an error handling when an error occurs
during retrieving a resource detail via API call.
While previously a detail page without item values is displayed,
now the index page is displayed for such case.
Closes-Bug: #1229433
Change-Id: I4357b5c275ab75163f0afc7158b4c1edb8cecd6c