Commit Graph

53 Commits

Author SHA1 Message Date
Akihiro Motoki eac3e7032a Drop Heat related code from horizon
Orchestration tab in the admin info panel needs a discussion.
It seems not to be covered by heat-dashboard yet.

blueprint heat-dashboard-split-out

Change-Id: I56e6edb1f2ac72e2f42d0e9f3291308e67f24cad
2017-12-05 07:38:55 +00:00
Akihiro Motoki af3b7e4134 flake8-import-order: Ensure to place project imports last
To ensure project imports are placed after third party import,
we need to specify application-import-names.
Previously flake8-import-check checks only standard imports or not.

Change-Id: I9beb2105f686dc7d9aebfce8e21c5e182698e2fe
2017-09-20 01:19:38 +00:00
Diana Whitten 1f11a79279 Horizon Forms should allow themable number spinners
Much like the themable selects and checkboxes, number spinners
should also be themable.

Standard number spinners are not very customizable.  We should use
existing buttons and fonts to add their functionality to allow a
richer experience if desired downstream.

An example of how to customize the spinner was placed in Material.
The example shows how to use flexbox to change layout type from
column to row, change icon order, and how to override the icons.

'autocomplete' needs to be false on this new element, otherwise
the browser will retain and load the last value without actually
triggering any JavaScript events by which we can key on and update
the state of the spinner buttons.

Change-Id: Ifd266cd515a903841e2d28e2f4731879116e3513
Closes-bug: #1598311
2017-06-28 15:50:27 -07:00
Akihiro Motoki baa4ca8dce hacking: noqa cleanup in openstack_dashboard
attribute-level imports are not checked by hacking module now.
most noqa is used to disable warnings on attribute-level imports.
This commit drops noqa for this purpose.

After this, there are only 3 noqa under openstack_dashboard/ :)

Change-Id: I4a449802f5dbd6e44e4b8b5c378a555d47d9a99f
2017-03-17 19:38:47 +00:00
Rob Cresswell 560f23a1c9 Add default common template to python table views
Many of the Python table views are using identical (or nearly identical)
table templates. This patch adds a common template and makes it the
default for a DataTableView, which allows us to remove many similar
templates and redundant lines of code.

Change-Id: I1e4e15e695ee1f21f4d44f141a854e30f1e567a1
Closes-Bug: 1653986
2017-01-05 08:59:35 +00:00
David Lyle 9f75312b07 Removing deprecated Swift UI code
The move to the angularJS based UI for swift as the default occurred
two releases ago in Mitaka. This patch removes the dead code.

Change-Id: I0322808aeacab5406c0dd3f4b19bed50bc0ff089
2016-11-17 16:00:00 -07:00
Eddie Ramirez 69e18fc42c Server-side filtering Orchestration
Included patch 12 changes
Implements blueprint: server-side-filtering
Co-authored-by: Revon Mathews <revon.mathews@intel.com>
Change-Id: I22c5c736f756b1f5640d2fc4d284ac45deaefc19
2016-10-17 15:50:17 +00:00
Rob Cresswell 3488ab3d40 Fix compatibility issues with Django 1.10
Required modifying our URL pattern decorator to
be compatible with the slightly different callback
attribute mechanism in 1.10

Modified breadcrumb structures to always be 2-tuples
as tuple unpacking is now strictly enforced in 1.10

Also made the following things changed in Django 1.10.
- fixed the now-deprecated TEMPLATE_DEBUG.
- Caught up with Request context change
- SimpleTestCase.urls is removed in 1.10.
  ROOT_URLCONF needs to be used instead.

Co-Authored-By: Richard Jones <r1chardj0n3s@gmail.com>
Co-Authored-By: Akihiro Motoki <motoki@da.jp.nec.com>
Change-Id: I59cbd8bff117813258539ed0724fe89a9f5b77ee
Implements: blueprint dj110
2016-09-20 12:29:16 +01:00
David Lyle 037d1c0927 removing httplib2 test dependency
Once upon a time, the python-*client libraries were primarily built to
use httplib2. They have subsequently shift to using requests and thus
urllib3. The horizon test helpers code was maintaining a reference to
httplib2 as it intercepted errant library calls that were not mocked.

httplib2 is not actively maintained and OpenStack is moving to remove it
as a dependency. See
http://lists.openstack.org/pipermail/openstack-dev/2016-March/089225.html
for more details.

This patch removed the httplib2 dependency. Upon removing the
dependency it exposed a missed update from httplib2 to urllib3. A
function that was intended to catch unmocked calls was only listening
for httplib2 connections. This patch updates that failsafe to work with
urllib3. Upon doing so, it pointed out many, many missing mocks and in
turn, many broken tests that appeared to work because of API call
failures. This patch adds the missing mocks and fixes the broken tests.

The new failsafe prints the stack trace when an outside connection is
attempted. Additionally, to fix the fact that a missed mock used to
allow tests to potentially pass, as documented by bug 1517704, a test
failure is now forced on tests where a missing mock is detected.

Closes-Bug: #1517704
Implements blueprint: remove-httplib2-dep
Change-Id: Iaabdf03966c14c82e0c58a3b1ab1a6755c05adcb
2016-05-02 13:19:08 -06:00
Rob Cresswell 83c9e3fead Remove all pre-Django 1.8 workarounds
This patch removes all code workarounds in Horizon for Django versions
before 1.8. As a bonus, this means an extra unit test is run that was
previously skipped.

Change-Id: I63f56953d9beefd3ea596d3e31c6032e936b140c
Partially-Implements: blueprint drop-dj17
2016-01-24 22:12:02 +00:00
eric d69fe09bc7 Correcting heat resource drill down
Previous commit broken heat resource drill down:
f38ddf2032 (diff-15e3003726d7b90816528ee8248b000f)

This patch fixes the ID attribute, correctly specifies the template,
alters the page to match other detail page styles, and adds a UT to
prevent regression.

Change-Id: Ie3f76d6666f4e3154fbcb5808c8f8b841e650a02
Co-Authored-By: Rob Cresswell <robert.cresswell@outlook.com>
Closes-bug: #1531341
2016-01-07 14:42:29 -07:00
Jenkins fe7e812001 Merge "Add handle get_file when launch stack from horizon" 2015-12-20 23:53:51 +00:00
dixiaoli d1c3b4787b Add handle get_file when launch stack from horizon
when get_file is contained in template, the stack create/update/preview
will fail due to No content found in the "files" section.
So added handle get_file code.

Change-Id: I6f125f9e5f3f53f630ab0d4f3f00631e6850e905
Closes-Bug: #1512564
2015-12-17 23:11:07 -06:00
Cindy Lu df208d6711 Add missing unit tests for Heat Stacks Details
We don't have tests for the Details page and tabs.

Change-Id: I16e16947ab18d1c059de58dc64b7af0cdd2dc54a
Closes-Bug: #1501921
2015-12-15 18:05:19 -08:00
Victor Stinner 68764f741f Port dashboard stack tests to Python 3
* On Python 3, the pretty JSON output doesn't add space before newline.
* CreateStackForm: don't compare str to int, it raises a TypeError on
  Python 3. Instead, use MinLength already converted to int.
* tox.ini: enable all stacks on Python 3.

Partial-Implements: blueprint porting-python3
Change-Id: I20cd9e83720cc3974973bec5471864f0ffc00716
2015-11-09 10:49:03 +01:00
Victor Stinner 4057ff2569 py3: Replace unicode with six.text_type
Initial patch generated by:

    sixer.py unicode horizon openstack_dashboard/ tools/

Partial-Implements: blueprint porting-python3
Change-Id: I8bdec74fbe32a6ff0e65f2f0810a0c698a3b9637
2015-08-27 01:26:02 +02:00
Victor Stinner 674a45ffe0 Replace mox with mox3
mox doesn't work on Python 3, whereas mox3 works on Python 2 and Python
3. Cinder, Nova and many other projects already replaced mox with mox3.
mox3 is now maintained by OpenStack.

Partial-Implements: blueprint porting-python3
Change-Id: I10e6a9754ebd58a2640d73ec8966527c3aa1fe9a
2015-07-13 15:02:10 +02:00
Jenkins 34de24a7b6 Merge "Clean up terminal output for stack details section" 2015-06-29 17:25:41 +00:00
Tatiana Ovchinnikova beab5bc295 Heat resource url mapping improvement
This patch set adds a few resource types to resource
url mapping to make proper links to resources from
stacks details.

Partially implements blueprint: heat-ui-improvement

Change-Id: I829c586b75c9b4c15dcf58ea317cf28eddec182b
2015-03-16 14:53:11 +03:00
Tatiana Ovchinnikova cab3912b69 Add "Preview Stack" action to Stacks table
This patch set adds "Preview Stack" button to Stacks table
to provide user with a possibility to preview stack without
creating it, as it is already implemented in CLI.

Partially implements blueprint: heat-ui-improvement

Change-Id: Idf92deb57f8213a403f102db467828087d91e79a
2015-03-13 15:35:47 +03:00
George Peristerakis 221739e1f0 Generate a drop down field for custom heat parameters
If the heat template parameter has a custom constraint of
'nova.flavor', 'nova.keypair', 'glance.image' or 'neutron.network',
the form will generate a drop down field with a list of all
possible options the current user has access to.

Change-Id: I17f99eca364f1123a950cf712225ce751728239e
blueprint: heat-template-choices
Co-Authored-By: Cédric Soulas <cedric.soulas@cloudwatt.com>
2015-02-27 15:08:05 -05:00
Jenkins 8c7439abb1 Merge "Add missing stubs to project stacks tests" 2015-02-17 16:12:56 +00:00
Sam Betts 9dfef5a6b9 Add missing stubs to project stacks tests
test_check_stack, test_suspend_stack and test_resume_stack all had
missing stubs for api.heat, causing weird logs in the tests, as well as
not testing the actions correctly as it would fail before reaching the
action code.

Change-Id: I6aeb2d2c1b6af9222e8ec3691b876051c638e3de
Partial-Bug: 1407981
2015-02-11 16:07:35 +00:00
nikunj2512 dabfe0ab92 Fixes Resource id mapping with Heat Resources
Adds a few more resources which heat backend provides. This will
take care of the resource id mapping on 'Resource Detail' page.

Closes-bug: #1335032

Change-Id: I056bf2f0340b5c9f197ebb26120eed34b2693845
2015-02-04 14:52:23 +05:30
liyingjun bdaf50455c Updating stack resource urls mapping
Needs to update OS::Quantum::** to OS::Neutron::**

Change-Id: I7671d209d30739fa5eb55cb6baadf85eb3cfed0b
Closes-bug: #1416948
2015-02-02 13:56:43 +08:00
Tatiana Ovchinnikova b2c07ad64e Add "Suspend" and "Resume" actions to Stacks table
This patch set adds "Suspend Stack" and "Resume Stack" buttons
to Stacks table to provide user with a possibility to suspend
and resume stack, like it is already implemented in CLI.

Partially implements blueprint: heat-ui-improvement

Change-Id: I6ea8cb7f342fdd8fcfd124012aefc66d9d898410
2015-01-23 17:29:56 +03:00
Tatiana Ovchinnikova a57e913e6c Add "Check Stack" action to Stacks table
This patch set adds "Check Stack" button to Stacks table
to provide user with a possibility to check stack, like it is
already implemented in CLI.

Partially implements blueprint: heat-ui-improvement

Change-Id: I0a2c6f62844a4120081e74689c4ca8d8cf35251d
2015-01-22 07:12:21 +03:00
Vic Howard 4860fa23df Clean up terminal output for stack details section
heat output section formatted poorly, fix is to output the
output filter the same as the log or console sections

Closes-Bug: 1350088
Change-Id: I23bfbe03fa33a5af06c59dcfd2b87137e3a82f51
2015-01-02 10:28:22 -05:00
Akihiro Motoki 2a9349bd67 Fix E128 errors in openstack_dashboard/dashboards/project/
E128 continuation line under-indented for visual indent

Partial-Bug: #1375929
Change-Id: I6bc8db7dab6fc2c3aad7fa54b6e07643b595f230
2014-10-16 16:53:52 +09:00
Akihiro Motoki 26da6ed48c Fix E127 errors in remaining openstack_dashboard/
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
2014-10-15 13:50:07 +09:00
Jenkins 5653f59737 Merge "Fix E127 errors in openstack_dashboard/dashboards/project/" 2014-10-14 06:33:24 +00:00
Akihiro Motoki f99981fc9c Fix E127 errors in openstack_dashboard/dashboards/project/
E127 continuation line over-indented for visual indent

Partial-Bug: #1375931
Change-Id: Ia62781d24f13407ca600743b167392dddf6c271d
2014-10-11 13:33:28 +09:00
Miguel Grinberg ad9c303504 display boolean and json parameters in stack launch form
Horizon fails to render boolean and json parameters properly in the
stack launch form, instead of rendering these fields it renders a
duplicate of the previous field.

Change-Id: Idb2fcf4b52578951fb578138a80529eefc140d1a
Closes-Bug: 1360495
2014-10-08 18:39:12 +00:00
Miguel Grinberg a8c0f89824 render stack parameters in the correct order
Parameters in a heat template are now rendered in the order specified
in the "ParameterGroups" section. If this section is not available then
they are rendered unordered.

Change-Id: I3367b42c4c3037666b705cebf9cf67ccf0ce4fce
Closes-Bug: 1364567
2014-09-10 00:44:56 +00:00
Radomir Dopieralski 4d22da179f Add templates for bootstrap's horizontal forms
Bootstrap's form-horizontal requires a little different HTML
structure than the default horiozn's field template uses. This
patch adds a _horizontal_fields.html template, that behaves like
the _form_fields.html template, only is suitable for use inside
a <form class="form-horizontal"> tag.

It also splits out the _form_errors.html, _form_field.html and
_horizontal_field.html templates, so that it is easier to build custom
forms with fieldsets by including those for every field, instead of all
the fields at once.

Change-Id: I51c8f47ba230c6a78919979cc0ef4e2383d100ba
Implements: blueprint horizontal-form
2014-09-08 10:38:16 +02:00
Miguel Grinberg 612ab2bcea Render hidden stack parameters with a password field
In the launch stack form, any heat template parameters that are
of type string and marked as hidden are now rendered as a
password field.

Change-Id: Ie9b0a051a8815525c89de31b7ab98d8148166a55
Closes-Bug: 1362846
2014-09-02 22:43:02 +00:00
Cindy Lu 1bde43d1c7 add Previous link to Project > Stacks table
Stack list API supports a sort direction and sort key which we can
use to paginate back

Following same convention as merged patch:
https://review.openstack.org/#/c/91111/

Change-Id: I511d7d27a6234e1510c7fa3c7f84c007599f3721
Partially-implements: blueprint pagination-add-prev-link
2014-08-05 15:00:48 -07:00
Jordan OMara ecdc73a339 Ensuring environment data is passed to heat template validate
- environment data was being passed to heat API on stack create,
   but not stack validate - meaning that templates that referenced
   environment files were not validating correctly

 - heat client does not support URLs for environment files - we will
   need to do this client side before POSTing back to horizon. future
   patch

Partial-Bug: #1322258

Change-Id: I40982b777abaec743ed6cbc527008522a619e817
2014-06-11 09:17:04 -04:00
He Yongli e790ac070e Remove extraneous vim configuration comments
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
2014-05-06 15:30:10 +08:00
Steve Baker 2c7db077b2 Fix formatting of heat exceptions
Heat now consistently formats error messages in returned HTTP json
and heatclient HTTPException makes every attempt to capture these
messages.

This means that the safest way to display an error or validation
message from Heat is to rely on the existing behaviour of
Horizon's exceptions.handle.

Change-Id: I80cdb67df87cb5192f220bc78a156d6e4113112f
Closes-Bug: #1241395
2014-04-14 10:46:26 +12:00
CristianFiorentino 198dba6a2d Introduces escaping in Horizon/Orchestration
1) Escape help_text a second time to avoid bootstrap tooltip XSS issue

The "Description" parameter in a Heat template is used to populate
a help_text tooltip in the dynamically generated Heat form. Bootstrap
inserts this tooltip into the DOM using .html() which undoes any
escaping we do in Django (it should be using .text()).

This was fixed by forcing the help_text content to be escaped a second
time. The issue itself is mitigated in bootstrap.js release 2.0.3
(ours is currently 2.0.1).

2) Properly escape untrusted Heat template 'outputs'

The 'outputs' parameter in a Heat template was included in a Django
template with HTML autoescaping turned off. Malicious HTML content
could be included in a Heat template and would be rendered by Horizon
when details about a created stack were displayed.

This was fixed by not disabling autoescaping and explicitly escaping
untrusted values in any strings that are later marked "safe" to render
without further escaping.

Change-Id: Icd9f9d9ca77068b12227d77469773a325c840001
Closes-Bug: #1289033
Co-Authored-By: Kieran Spear <kispear@gmail.com>
2014-04-09 00:29:56 +09:00
Jordan OMara c9befb3327 Add pagination to stack list
Implements: blueprint heat-stack-list-paging
Change-Id: I87ebd7feaeddcfe7fe76c92b075c53de7016846b
2014-04-04 10:05:12 -04:00
Jordan OMara 11eebb8aa3 Additional optional Environment data to heat template selection
Change-Id: I4e0d32e7e032d5c0ec93595c14134e780fa21d66
Implements: blueprint heat-environment-file
2014-03-06 17:25:35 -05:00
Jordan OMara 015aff2630 Heat Stack update view/form
2 Part view for updating Heat Templates. The first page allows you to
select a new template for your stack. The second allows you to set new
template parameters for your stack. Like the launch stack workflow, this
is not a horizon workflow, but two separate forms.

Implements: blueprint heat-stack-update

Change-Id: I2854e9e4bb578be5187ef962808b93f11ac6b1f1
2014-03-04 12:06:31 -05:00
lawrancejing f85ed2e595 Replace assertEqual(None, *) with assertIsNone in tests
Replace assertEqual(None, *) with assertIsNone in tests to have
more clear messages in case of failure.

Change-Id: I2506fe57adb98c52147138d8eb6c0254423ffdd7
2014-02-16 13:33:17 +08:00
Radomir Dopieralski 028332da4a Remove #noqa from most common imports and add them to import_exceptions
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
2014-01-07 12:26:35 +01:00
Leandro I. Costantino fd67686e1f Heat Stack name is missing form validation.
When creating a stack using Horizon, the form is missing name
validation, so a generic error is shown whenever the name
does not follow the regex used by Heat.
([a-zA-Z][a-zA-Z0-9_.-]*)
Add server side validation and the right error message.

Change-Id: I7a639bcf96b7c74760123b6106aab7d9311f5e2f
Closes-Bug: #1254212
2013-11-24 20:04:13 -05:00
Jenkins 728b580a69 Merge "Add support for parsing jsonfied heat error" 2013-08-30 19:55:45 +00:00
Tatiana Mazur 953d1b9793 Enable H302 check
This patch replaces some method imports with module imports and
makes H302 test enabled.

Fixes bug 1188531

Change-Id: Ibfbddeaa19cbbb244da58ffd5c918c41f03a0c65
2013-08-22 17:39:09 +04:00
Jianing YANG f056340226 Add support for parsing jsonfied heat error
Keep the legacy method for the cases that user may use
an old version of heat.

Fixes bug #1207624
Change-Id: I3346d7a6f8f51746ee5455720f093cd785623634
2013-08-05 15:49:58 +08:00