1021 Commits

Author SHA1 Message Date
Jenkins
ca9919722c Merge "Add unit tests to edit-image to improve coverage" 2016-08-18 04:55:36 +00:00
Jenkins
70596b1d00 Merge "[Django] Allow to upload the image directly to Glance service" 2016-08-18 03:38:55 +00:00
Jenkins
77a804ea4b Merge "Add more Nova API features for NG Instances" 2016-08-18 03:32:55 +00:00
Jenkins
8194f6438a Merge "Remove embedded CSS" 2016-08-18 03:32:44 +00:00
Matt Borland
9c3f4ceffb Add unit tests to edit-image to improve coverage
This test adds unit tests that improve coverage and describe necessary code paths.

Change-Id: I93eb79a3b9d09cba777d6e1ac84196f8584c70dd
Partially-Implements: blueprint angularize-images-table
2016-08-17 12:18:13 -06:00
Timur Sufiev
93af461e40 [Django] Allow to upload the image directly to Glance service
Since large Glance images even temporarily stored on dashboard side
tend to fill up Web Server filesystem, it is desirable to route image
payload directly to Glance service (which usually streams it to
storage backend, which in turn has plenty of space).

To make it possible we need to trick Django into thinking that a file
was selected inside FileInput, while its contents are not actually
transferred to Django server. Then, once image is created client-side
code needs to know the exact url the image payload needs to be
transferred to. Both tasks are solved via using ExternalFileField /
ExternalUploadMeta classes which allow to work around the usual Django
form processing workflow with minimal changes to CreateImage form
business logic.

The client-side code relies on CORS being enabled for Glance service
(otherwise browser would forbid the PUT request to a location
different from the one form content came from). In a Devstack setup
you'll need to edit [cors] section of glance-api.conf file, setting
`allowed_origin` setting to the full hostname of the web server (say,
http://<HOST_IP>/dashboard) and restart glance-api process.

A progress bar is implemented to track the progress of a file upload,
in case a really huge image is transferred.

The new machinery could be easily switched on/off with a single
setting `HORIZON_IMAGES_UPLOAD_MODE` set to 'direct' / 'legacy'.

Related-Bug: #1467890
Closes-Bug: #1403129
Implements blueprint: horizon-glance-large-image-upload
Change-Id: I01d02f75268186b43066df6fd966aa01c08e01d7
2016-08-16 14:30:38 +03:00
Matt Borland
93b7edd694 Add more Nova API features for NG Instances
This patch adds more Nova API features for instances.  It establishes
several new proxy APIs and provides the various JavaScript libraries for
accessing those APIs as well.

Change-Id: I016be1d0598faf78b1fb02f4d0768efdaf6cb7bf
Partially-Implements: blueprint angularize-instances-table
2016-08-12 14:43:37 -06:00
Jenkins
f3f2ea1d62 Merge "[NG] Enhance Create Image workflow with upload tracking" 2016-08-10 16:29:48 +00:00
Jenkins
9ec3d74af2 Merge "Horizon Radio Buttons are now themeable." 2016-08-09 15:01:00 +00:00
Jenkins
c2916f794d Merge "hz-images have transitional states defined" 2016-08-09 13:32:33 +00:00
Timur Sufiev
60a265a10e [NG] Enhance Create Image workflow with upload tracking
Create Image service uses $scope captured in a closure var `scope` to
pass the upload progress of the local image file to Glance service
into modal form controller.

Implements blueprint: horizon-glance-large-image-upload
Change-Id: I98711e6a5e59c91ef71a726a6ff094767d421ef7
2016-08-09 14:17:47 +03:00
Jenkins
72ad1e3fd5 Merge "[NG] Support local file upload in Create Image workflow" 2016-08-08 23:01:16 +00:00
Timur Sufiev
0e1279d05c [NG] Support local file upload in Create Image workflow
First, now there are 2 '/api/glance/images/ API wrapper endpoints for
creating a new image - POST and PUT. The POST endpoint which existed
before now resides at PUT. This was done to support legacy
(i.e. proxied by web-server) file uploads in Angular Create Image,
because Django (which we need to use in that case) doesn't correctly
process PUT request. So, if local file binary payload is added to the
form contents, we send it using POST request.

Second, speaking of '/api/glance/images' PUT request previously known
as POST... Where before the POST call to Horizon REST API wrappers
returned the final image object that Glance just created, now there
are two possibilities for what happens after PUT is sent.

* When Create Image form Source Type is set to URL, then everything is
  going as before.
* When Source Type is set to File, then just a file name instead of an
  actual Blob is sent to '/api/glance/images', then the Glance Image
  is queued for creation and Horizon web-server responds with an Image
  object which dict() representation has 2 additional keys:
  'upload_url' and 'token_id'. The 'upload_url' tells the location for
  the subsequent CORS request, while 'token_id' is passed as a header
  in that request, so Keystone would let it in. CORS upload is started
  immediately as Image is queued for creation (first promise is
  resolved) and returns the second promise, which is resolved once the
  upload finishes. The modal form hangs until second promise resolves
  to indicate that upload is in progress. Upload progress notification
  is added in a follow-up patch.

DEPLOY NOTES

The client-side code relies on CORS being enabled for Glance service
(otherwise browser would forbid the PUT request to a location
different from the one form content came from). In a Devstack setup
you'll need to edit [cors] section of glance-api.conf file, setting
`allowed_origin` setting to the full hostname of the web server (say,
http://<HOST_IP>/dashboard).

Related-Bug: #1467890
Implements blueprint: horizon-glance-large-image-upload
Change-Id: I5d842d614c16d3250380ea1dc1c6e0289d206fb5
2016-08-08 20:02:22 +03:00
Jenkins
1b65c5369f Merge "Make 'switch' between legacy and Angular Images" 2016-08-08 13:11:25 +00:00
Jenkins
14eb018877 Merge "cleanup for ng create volume workflow" 2016-08-06 05:36:51 +00:00
Jenkins
ae244bbdf1 Merge "UX: System Information Overflow Fail" 2016-08-05 22:49:55 +00:00
Jenkins
87818bcd3f Merge "UX: Add IPSec Policy Modal Hint List is hard to read" 2016-08-05 17:59:37 +00:00
Diana Whitten
fc0b4e898c UX: System Information Overflow Fail
System Information End points should be big enough for URL labels
by default.

Closes-bug: #1609138
Change-Id: Ic936072435055502e268fe15c07076620e4acde3
2016-08-05 09:15:31 -07:00
Matt Borland
20bc6e1516 Make 'switch' between legacy and Angular Images
This patch follows on the example that the Containers set, providing
a 'switch' in the panel-enablement file that currently defaults to
'legacy' (Python-based Images panel) and allows for 'angular' (Angular-
based Images panel).

To be clear, this does NOT enable Angular Images.  It's just setting the
stage to do so at some point, or to allow deployers/devs to easily switch
between the two.

A switch both for HORIZON_CONFIG and for integration tests is necessary
due to the way integration tests operate.

Co-Authored-By: Timur Sufiev <tsufiev@mirantis.com>
Change-Id: I12cd33552218ed1082d2d9a2ae8982639a217a6a
Partially-Implements: blueprint angularize-images-table
2016-08-05 08:17:21 -06:00
Diana Whitten
79a86b372f UX: Add IPSec Policy Modal Hint List is hard to read
project/vpn: Add IPSec Policy: HInt test has a bulleted list that
looks odd and is hard to read, see here: https://i.imgur.com/1jlPBBj.png

Took the opportunity to also clean up the IKE Policy and VPN views as
well.

Closes-bug: #1570526

Change-Id: Idfff6c48a237ce703756b3ab8e0dd37705a35b22
2016-08-05 07:16:03 -07:00
David Lyle
41e9d62993 Remove embedded CSS
As follow on work to restoring the old network topology, this patch
separates embedded CSS in one of the html files into a separate SCSS
file.

This change is not intended to make topology themable.  There is still
much work that needs to be done and will follow up soon.

Change-Id: I46b7152a24fc1f7a26a1752ba22d80e31ff1ffdb
2016-08-04 11:05:00 -07:00
Ryan Peters
7580d15659 Horizon Radio Buttons are now themeable.
Horizon radio buttons were using the standard browser radio buttons.
The default radio buttons have 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 altered. The 'default' theme uses the
standard Font Awesome radio button icons. The 'material' theme uses
the Material Design radio buttons. It was noted, during this refactor,
that there was an error in the _themable_checkbox template. This has
been fixed.

Change-Id: I1ca2e39e893b45adddf513c0dcb2670b2876594f
Partially-Implements: blueprint horizon-theme-css-reorg
2016-08-04 18:00:43 +00:00
Rob Cresswell
0e957dd41a Add Angular Schema Form
This patch adds Angular Schema Form[1] and its requirements to Horizon.
There are a number of advantages to this over the current methods of
defining forms and workflows:

- All fields have an individual template, making theming improvements,
  bug fixes, and bootstrap conformity easier.
- The file and line count, especially for workflows, is dramatically
  reduced. The Create Net workflow, for example, goes from 12+ files to
  2, with a big reduction in boilerplate HTML.
- All field validation messages are standardised, so we can match them
  across Horizon and plugins

What this patch contains:
- Many common form fields, including things like the themable checkboxes
  and selects.
- A basic modal template that can be passed with ui-bootstraps $modal
  service to take advantage of schema-form

Next steps:
- Remove the other modal templates so we can standardise. A single
  template opened from the $modal service is fine, and we shouldn't need
  several directives. In this case, we should deprecate them, as the
  modal forms will be used elsewhere.
- Map commonly used form items, like transfer tables, to a schema form
  type like array (they serve similar purposes, so maybe thats what
  should be replaced)
- Use themable selects instead of regular ones

1. http://schemaform.io/

Co-Authored-By: Tyr Johanson <tyr@hpe.com>
Implements: blueprint angular-schema-form
Change-Id: Ib22b2d0db2c4d4775fdef62a180cc994e8ae6280
2016-08-04 16:53:41 +00:00
woodm1979
9ca0cc8d34 hz-images have transitional states defined
Using the transitional-states framework defined in
https://review.openstack.org/#/c/346174
The images generic panel now defines a call-back method for determining
if an image is in a transitional state.  Thid call-back is registered in
the registry for later use by the table.

Change-Id: Ibdb51157a540a2c23d5f5bb324d37a918c2e51ab
Co-Authored-By: Tyr Johanson tyr@hpe.com
Partially-Implements: blueprint angularize-images-table
2016-08-04 10:27:08 -06:00
Diana Whitten
2e84d55919 The sidebar caret should spin correctly.
The sidebar caret is spinning backwards 270 degrees
instead of forward 90 degrees.

Change-Id: I2523ae0ce412d6e0350ea6a31fa4d746bb206f65
2016-08-03 15:52:20 -07:00
Jenkins
c80dc119c5 Merge "NG Images Create Volume should use constant from images.module.js" 2016-08-03 12:23:32 +00:00
Travis Tripp
deda07c4c3 Memoize policy service
There is a hole in the policy service caching layer
that has something to do with ng-repeat. The angular
http cache service doesn't seem to work within a single
digest cycle or something... so I simplfied and
improved performance by using memoize to
prevent redundant checks which were happening in
hz-dynamic-table.

See bug for details on verifying this manually.

Change-Id: Ib0b3a806d1c6b065e20cb22b8255048bd836dd1b
Closes-Bug: 1608623
2016-08-01 19:04:09 -06:00
Jenkins
ccc6de3430 Merge "Remove array metadata when no items + fix case" 2016-08-01 07:29:06 +00:00
Jenkins
c5cc56db3d Merge "hz-dynamic-table: Column level permissions" 2016-07-30 02:16:42 +00:00
Travis Tripp
65f0f74390 hz-dynamic-table: Column level permissions
hz-dynamic-table doesn't have any way to dynamically determine
whether or not to display a column.  For example,
in openstack dashboard, we may want to display a column
only in certain policies pass check, if certain settings
are enabled, or services are enabled. In addition, a generic
allowed function can just be set on the column config.

This patch adds this ability as a reusable service.
The reusable service will make it possible for horizon
to easily check common sets of permissions on a
variety of objects including the hz-dynamic-table columns
(in this patch).

Child patches demonstrate its use on the images table.

Change-Id: I9f92b69d86d830387a83c28ec5829fb3c43fc4a6
Partially-Implements: blueprint angularize-images-table
Co-Authored-By: Matt Borland <matt.borland@hpe.com>
2016-07-29 21:25:32 +00:00
Travis Tripp
12f9ef8d54 Remove array metadata when no items + fix case
Array metadata appends an operator automatically, which
means the value will still contain something and it
doesn't get detected for removal.

In addition, bad APIs like glance v1 will store a property
with mixed case, but then return only lower case when
listing them. However, it will not remove the property
when you request to remove it unless it matches the original
case (sad panda).  So, this patch will reset the proper
casing for properties defined as metadata definitions before
making the request to save the metadata.

Change-Id: I1e5a6fde35b7be6118f21ac46ad0aea088280215
Closes-Bug: 1606988
2016-07-29 12:34:54 -06:00
Jenkins
806aa997b8 Merge "Allow ngdetails path to contain '/'" 2016-07-27 20:19:46 +00:00
Jenkins
7ae9c6317e Merge "Angular LI:Make sure we always get all limits" 2016-07-26 23:02:02 +00:00
Jenkins
a27854d5b2 Merge "No more space-in-parens eslint errors" 2016-07-26 07:24:46 +00:00
Jenkins
8d58c6f3c4 Merge "Cleanup the toastService in *.spec.js files" 2016-07-22 23:17:26 +00:00
woodm1979
7cbd3b7019 No more space-in-parens eslint errors
Running eslint is effectively useless nowdays because of the
overwhelming number of warnings returned.

This patch fixes the existing "space-in-parens" errors.

I've decided to only fix those errors here to keep the patch small, and
not destroy any chance of success by needing to rebase every 5 minutes.
Other fixes will be incoming.

Change-Id: Ie9292da293eea6a93751e6c17d24068b66c5d62a
Partial-Bug: #1554824
2016-07-22 15:27:22 -06:00
Tyr Johanson
8f77a68547 Allow ngdetails path to contain '/'
When the "path" portion of a route contains a '/', prevent Angular
from truncating it. This is common if the resource has a complex
key and wants to use '/' as a separator. For example:
/project/ngdns/zone/<zone_id>/recordset/<recordset_id>

Change-Id: I7b4fe1ba2b2f657ccee91de50cc9d5267544b51e
Closes-Bug: 1605670
2016-07-22 09:18:30 -06:00
Cindy Lu
4577bf0aab Cleanup the toastService in *.spec.js files
We should not use toastService to test if an API call
went through successfully. This is extraneous.

This patch was motivated by the fact that we want to
remove conf.js, so we are moving the toast config
options to toast.service.js.

Change-Id: I966fb0d492ae8e9ae70af2882655cd36b4214a4a
2016-07-21 15:09:30 -07:00
Jenkins
7ca5b3c0ff Merge "Choose a server group when booting a VM with NG launch instance" 2016-07-21 15:02:54 +00:00
Jenkins
97123bdd93 Merge "Image uses hz-property for its drawer information" 2016-07-20 23:08:42 +00:00
Matt Borland
d6c0cdc6d3 Image uses hz-property for its drawer information
The Image drawer should use the hz-property so it is kept in sync with all other
uses of the properties (in tables, etc.).

Gets rid of filters in favor of simple mappings or functions.

Moves several functions out of the module into a basic images-service so
it's easy to access/test functions.

Change-Id: I4d881744a398f9aa076830b576cb9f66335d8ba9
Partially-Implements: blueprint angular-registry
2016-07-20 13:14:16 -06:00
Cindy Lu
207513ab9e NG Images Create Volume should use constant from images.module.js
We should reuse non_bootable_types constant.

Change-Id: I7c1dcdef5cc66e9948995d11b941840c0039a692
2016-07-20 11:53:20 -07:00
Jenkins
2e77e1cf99 Merge "Fix show/hide password when clicking password icon" 2016-07-19 23:26:01 +00:00
Cindy Lu
0aacdbe2ec cleanup for ng create volume workflow
- cleanup help text in workflow and slide-out help panel (it's repetitive)
- add required asterisk to some form labels
- remove unnecessary css styles
- remove unnecessary eslint-disable/enable flags

Change-Id: I7de0dc7ee19816392003242431459eb73d141555
Closes-Bug: #1560594
2016-07-19 11:35:50 -07:00
Brad Pokorny
cf91124d0c Choose a server group when booting a VM with NG launch instance
Allow users to choose a server group when booting a VM.  Adds
an optional workflow step to the launch instance workflow that
shows the available server groups and details about each group.
The ability to choose a server groups already exists for the
legacy launch instance workflow as a dropdown list, but having
it as a separate step in the angular workflow provides the added
capability of seeing group details.

To test this patch, create a server group via the nova CLI. Example:
  nova server-group-create group1 affinity

And use the angular launch instance workflow to select a server
group. To validate the new instance was added to the server group,
use the nova CLI:
  nova server-group-get [ID of server group]

Change-Id: I651817850ef8a5afec047a9a481843a5eddbf5a9
Implements: blueprint nova-server-groups
2016-07-19 09:25:52 -07:00
Jenkins
9e4e8e00d5 Merge "Fixes issue where metadata is always removed on edit" 2016-07-19 09:24:25 +00:00
Eddie Ramirez
ccdb7b4ffd Fix show/hide password when clicking password icon
This patch overrides a Bootstrap's default property that disables
mouse events on elements with .form-control-feedback class. The password
icon had pointer-events: none; affecting password reveal functionality
in login form and Identity->Users->Create User. It also modifies the default
cursor for the password icon with pointer.

This patch also fixes a bug where the Eye Icon is misaligned when passwords
don't match (See #1604196)

Change-Id: I052321a5cc9adc1a7ffdfce4da0b55c245481a2d
Closes-bug: #1593430
Closes-bug: #1604196
2016-07-19 00:04:25 +00:00
Jenkins
ed0ec3bae5 Merge "[TrivialFix] Use more appropriate variable name" 2016-07-18 19:37:52 +00:00
Matt Borland
13339f2180 Fixes issue where metadata is always removed on edit
This patch modifies the way in which the metadata is saved so that:
 * it responds to metadata-changed events properly
 * it saves the metadata
 * it saves the image record

Change-Id: If21a7170e7a33f61619e1fa20faa32adc4bb3a90
Closes-Bug: 1584218
2016-07-14 12:33:16 -06:00
Diana Whitten
1af2a966c5 Material: Progress Bars should allow text
Material progress bars are so thin, that when you add text to them, its
unplesant. We need to support a progress bar type containing text that
is bigger by default.

Used this opportunity to align other progress bar experiences, and in
addition, generalize the text progress bar and progress loader bar for
general use everywhere.

Change-Id: I3d51c6a4582e3dc043f30632b6635a9ff17f5fbf
Closes-bug: #1602880
2016-07-13 16:30:02 -07:00