Commit Graph

50 Commits

Author SHA1 Message Date
Tatiana Ovchinnikova 71ed12f622 Fix Angular mediumDateFilter
Angular mediumDateFilter provides user with a readable date format
using predefined localizable format "medium". However it should be
more flexible with different types of inputs. This patch fixes the
filter and applies it at the images overview page.

Change-Id: I7079c306c6f98f13c779e6dae7357ccabba2d460
Closes-Bug: #1841049
2020-08-26 17:06:50 -05:00
Radomir Dopieralski ef4055e288 Fix use of ngettext in registry getName
The setNames and getNames functions in the resource registry were
calling ngettext() on already translated strings that were marked for
translation with gettext() and not ngetttext(). That lead to some
page titles in some locales being displayed as single characters.

Closes-Bug: #1762089
Change-Id: I0ef365e0c0de6ae27a2e80bcb5257132f8c6ba29
2019-12-20 09:44:48 +00:00
pengyuesheng 3d899d9078 the name needs to be word wrap
if the name is too long,
it will affect the display.

Change-Id: Ib1e35d32b0b3f82a0f949d94a2f4c8bcfd4eff41
Closes-Bug: #1801862
2019-01-07 14:29:44 +08:00
Shu Muto 8275d67949 Reproduce navigations on refreshing ngdetails view
To setup proper navigation to side bar and breadcrumb,
this patch adds new 'defaultIndexUrl' parameter and
its getter/setter into resource-type-service.

The 'defaultIndexUrl' parameter makes details view
enable to set navigations properly in Angular-side.

Each panel module should set URL for default index view
using 'defaultIndexUrl' parameter. So, this patch adds
the `defaultIndexUrl` parameter into existing panel
modules that have Angularized details view.

Also, if query string has 'nav' parameter, the
navigation setting will be overwitten with it.
This URL overwriting may be used by panels that has
multiple index panels, like images panel.

Change-Id: I2edd44e55eb10114e5282cec1762e9635881f733
Closes-Bug: #1746706
2018-03-29 15:01:59 +09:00
Abdallah Banishamsa 687d224485 Fix displayed type for instance snapshots
Fix displayed type for instance snapshots in image list

Change-Id: I780e6a8aecca421e6273c0e1ad39fbbaefaba956
Closes-bug: #1650373
2017-12-29 18:20:04 +00:00
Shu Muto 9a758638ee Remove deprecated scope handling
The `initScope` function is deprecated since ocata, so this patch
replaces it into `initAction` if it needed, or removes it.
Also, gets scope from second parameter of perform function.
Futher more, removes deprecated `scope` parameter for `modal`
function of wizard-modal-service.

Change-Id: I8979b699a9b4383b894db9bdcbad80f15c1df150
Closes-Bug: #1640049
2017-11-01 14:51:50 +09:00
Beth Elwell fbcddd712d Cleaned up date formats for images panel
Date format added for created_at and updated_at properties of images
panel. This makes the dates much clearer for users.

Change-Id: I2a74d17bc3b8cc5ce99ce44db669d01532812028
2017-09-14 16:39:28 -06:00
Jenkins b12422c3f5 Merge "Attribute "isServer" of images visibility filter should be true." 2017-07-14 03:41:04 +00:00
zhangdebo 3724066224 Attribute "isServer" of images visibility filter should be true.
I found an interesting bug in images panel.
In images panel, set filter to be "visibility: public", I got one
image listed in the table, then I changed language from "en" to
"zh_CN" and filter images again, I got none.

In the tab of browser developer tool, I saw a correct response
with one image data, but it was not appeared in the table. Later
I found the attribute "isServer" of visibility filter is false,
that caused the above bug.

Change-Id: I130d07727fe74ce65aba72d3e63fdfe0c8721795
Closes-Bug: #1691683
2017-05-18 00:46:04 -07:00
zhangdebo d884143ce3 Fix a filter error in images panel.
In images panel, I set the filter to be "visibility: unknown",
then an error appeared at top right corner of the page:
"Error: Unable to retrieve the images."

I open the developer tool of browser, I found an error response
in the network tab:
"Invalid visibility value: unknown".

The possible values for image visibility includes public, private,
shared and community, so I fixed it in the filter.

Change-Id: I48fc32ed37ac1c8ef36d0a0b8c05082c649a8534
Closes-Bug: #1691669
2017-05-17 23:47:22 -07:00
Luis Daniel Castellanos 89100d488b Implement "FILTER_DATA_FIRST" in angular views
This patch implements the FILTER_DATA_FIRST setting in angular views
specifically for the resource-table.
As a first approach this was implemented in NG admin > images.

To implement in other views, the following must be done:

- Add the FILTER_DATA_FIRST setting to the
  REST_API_ADDITIONAL_SETTINGS array in the local_settings.py file:
  REST_API_ADDITIONAL_SETTINGS = ['FILTER_DATA_FIRST']

- Enable the FILTER_DATA_FIRST setting:
  FILTER_DATA_FIRST = { 'admin.images': true }

P.S for this to work each panel must implement the check for the
setting accordingly.

Implements: blueprint admin-views-filter-first
(https://blueprints.launchpad.net/horizon/+spec/admin-views-filter-first)

Change-Id: Ieeedffbc621291251d50e7d8f254d3ce4def896c
2017-03-22 09:29:31 -05:00
Cindy Lu c73e1c8fa8 NG details view route should not be '/project/...'
Right now the route includes the name 'project'
but we may have details view for 'identity' and
'admin' too, so it should be more general.

Picked just 'ngdetails' instead and moved this out as a
constant. Since this constant needs to be used
by the config blocks, I moved it out into its own
constant module.

Change-Id: I7603250dd70eb40568aa74be2ae4821ee8fcefcc
Closes-Bug: #1641250
2017-02-13 13:24:02 -08:00
Jenkins b8118b9421 Merge "Angular images deactivate status fix" 2016-12-03 00:27:42 +00:00
eric e2f6b7db12 Angular images deactivate status fix
The images screen does not alway show the status
for deactivated images.

Change-Id: Id95aa3e8a4dbdc8c78c765da6f714e09de475356
Closes-Bug: #1646974
2016-12-02 14:53:20 -07:00
Richard Jones f9b3bc7b2b Remove use of scope from action service
The scope being handed to (and retained on) the action
service was being used for two purposes:

1. handing data down to the underlying wizard steps, and
2. receiving data back from the underlying wizard steps.

This patch provides a mechanism for passing data down through
injection, and removes the need for event-based data return
by explicitly passing the captured wizard data to the submit()
resolution.

It also adds the controller scope to the allowed() and
perform() action service handlers to grant access to
contextual information without needing to attach state
to the service.

Change-Id: Ieb293d0a849cd84d15e7aae0a68558fde80fd2c2
Fixes-Bug: 1640049
2016-11-24 18:42:49 +11:00
Richard Jones 84c238d35f Revert "In Images Overview, dates should be properly formatted"
This fails when the test is run in a non-UTC timezone.

This reverts commit 8baf0b8fcb.

Change-Id: Ib043a86d544f511c540f59f2b46f21ac7b05312d
2016-11-18 17:21:23 +00:00
Jenkins b959054e8b Merge "In Images Overview, dates should be properly formatted" 2016-11-16 20:04:47 +00:00
eric 70d2059f58 Image listing by visibility fix
The image filtering by visibility is using the incorrect values
for the various filter types.  See this reference for background:
https://wiki.openstack.org/wiki/Glance-v2-community-image-visibility-design

Change-Id: Ibc33bfd771ba6ba1cbbcbf342f4ae5f76f730e8b
Closes-Bug: #1634205
2016-10-17 11:55:16 -06:00
Cindy Lu 8baf0b8fcb In Images Overview, dates should be properly formatted
We should apply date filters on created_at and updated_at
for readability.

Angular's dateFilter (https://docs.angularjs.org/api/ng/filter/date)
does not take into account browser locale or timezone,
so we use javascript's Date() where we can pass in
locale information.

Updated simpleDateFilter to account for locale information
using settings.py's languageCode.

Change-Id: I2948785ced73b38fad0024e138be28e9b07a44dc
2016-10-07 11:12:51 -07:00
Maxim Nestratov 142cfab720 add ploop type to the list of image backends
Ploop is a disk loopback block device, which is used by OpenVZ/Virtuozzo
containers, described here: https://openvz.org/Ploop
This type of backend is supported since Virtuozzo support was added in
Kilo release. Implemented as a part of
https://blueprints.launchpad.net/nova/+spec/pcs-support
then pcs was renamed to virtuozzo
https://blueprints.launchpad.net/nova/+spec/rename-pcs-to-virtuozzo

Change-Id: Ica7852f8b5d45938b66ae7ef71b4713eb2dd2a3c
2016-10-06 19:30:10 +03:00
Thai Tran a084444a78 Cleanup setProperties in image module
Uses the new setProperties sugar method to clean up some code in
image module.

Change-Id: Ic4ac66e8734e38db5cc297147c9ff1baad62def9
2016-09-06 14:30:07 -07:00
Kenji Ishii f91d38bd6e Fix unnecessary requests in angular image panel
When displaying angular image panel, the request to get images is
called twice. This is caused by the setting of routeProvider.
This patch will fix it.

Change-Id: I37db691e846d3b80fa21794922e1998cc23243e3
Closes-Bug: #1615573
2016-08-26 04:23:00 +00:00
Matt Borland 2289190653 Final changes to Angular Images before making default
This addresses the suggestions found by Rob and Travis:

- The Admin panel doesn't show *all* images, just those either in the current
  project or exposed as public (same as Project). (Travis)

  FIX: The Admin panel now supplies is_public: None as the Python code does,
  which allows all images to be shown.

- The 'Is Public' attribute is in the drawer now (even on large screen sizes)
and we can't sort by shared, public etc, as far as I can tell. I don't think
we specifically need the buttons like the previous design had, but it feels
like a regression to have no filtering or sorting on that field? Perhaps
someone with better glance knowledge could correct me.

  FIX: Added 'visibility' as a synthesized field and added as a facet, making
  sure to use the current project to correctly identify 'Shared with Project'.
  Did *not* add 'Is Public' as that is a vestigial concept.

- Create/Edit Image > Image Details tab needs help text. Create has some info,
but Edit has nothing really. Also, we can drop that "description" header in
the help text; it doesnt add any value. This would be a nice improvement over
the Python version for novice users, and shouldnt take long to enter - just
pull info from the API docs.

  NO CHANGE: Let's not block enablement on verbiage. I think we need a better
  consistency and I don't believe the last-minute is the best time to add this
  because it's very easy to create/find nits.

- Create Volume help text is also entirely blank. We should fill that out
with some useful instructions, IMO.

  FIX: Added basic help text.

- Create Volume should default to the first Availability Zone if there is
only one, as it is a required field anyway.

  FIX: I added logic for this, and also added in some test features so we don't
  lose coverage.

- The Image Details page now longer lists the owner ID. I don't think this
is addressed by Travis' patch either.

  FIX: This is now under the 'Security' heading.

- Kernel ID and Ramdisk ID seem empty in angular image details, but populated
in the python equivalent.

  FIX: This was a regression that this patch fixes.

- Why are created/updated/ID separated into "Record Properties"? Is there
something in the API about this, or is it just a presentation construct?

  CHANGE: Moved into the general 'Image' header.  Added a filter so that these
  can be implemented as basic property registrations.

- I think 'Filename' in angular image details can be hidden if empty.

  CHANGE: Instead of hiding, we can show the standard '-' if no filename.

Change-Id: I4b770f9e61f9a8b1bd735d95c2ccc75bc21dd944
Partially-Implements: blueprint angularize-images-table
2016-08-23 09:22:58 -06:00
Travis Tripp 2166e5a0c5 Support project column in admin view of NG images
This adds the project name column to ng images, which
is required in order to support an admin view for images.

In addition the hz-property directive could not handle
promises, which is required for doing things like
looking up the project name from the project id.
This adds limited support for that.

Change-Id: I0bb3782a23cf6ddff249459089b96a532aa8a0d8
Partially-Implements: blueprint angularize-images-table
2016-08-18 05:34:39 +00:00
Jenkins f3f2ea1d62 Merge "[NG] Enhance Create Image workflow with upload tracking" 2016-08-10 16:29:48 +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
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
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
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
Matt Borland 146256f8c7 Modify hz-cell to use hz-field
hz-cell doesn't use params, which causes lots of problems when trying to
render changes to data...since it evaluates only once, reading what's assumed
to be on scope.

This patch adds 'table,' 'column,' and 'item' params so they may be better
watched by the directive.

hz-field does use params and thus is useful in many situations outside
of hz-cell.  This patch provides hz-field and lets hz-cell use it so
all output logic is shared.

hz-field also: a) accepts 'values' as a column configuration as we discussed
in the last mid-cycle, so codes, etc. may be supplied without use of a filter;
and b) accepts 'urlFunction' which translates the given item to a url which is
linked on the outputted name (rather than having to write a template for a
common link function).

Follow-on patches will demonstrate use.

Change-Id: I0835a90e61d0e708233da795964595f88616388c
Partially-Implements: blueprint angular-registry
2016-07-05 13:00:27 -06:00
Matt Borland 96399aa008 Registry-based client/server-side faceted search
This patch allows the magic-search filter facets to be registered,
so that resource types may have faceted searching (both client- and
server-side).  This patch also demonstrates the use with the Images
feature.

Change-Id: If2a46d8574974ceadc56ba07081bd707ab022cf4
Partially-Implements: blueprint server-side-filtering
2016-06-29 13:54:25 -06:00
Matt Borland 7e6ca1a6cc Using registration for auto-generation of Image feature
This patch removes the hard-coded table and uses instead the auto-table
feature.

Change-Id: I334b70fe9e4c6ef166b41c0e41f27e105e9af682
2016-06-21 17:37:57 +00:00
Jenkins 139fde3776 Merge "Trivial: Remove unused 'horizon.app.core.images.events'" 2016-06-17 18:02:33 +00:00
wangbo fffb26991c Trivial: Remove unused 'horizon.app.core.images.events'
Some javascript files are not using 'horizon.app.core.images.events'
after patch[1]. Remove the unused codes.

[1]https://review.openstack.org/#/c/291846/

Change-Id: I23b5ad60e03007096c0e250ee35c6cc0dd4d8f94
2016-06-16 20:41:19 +08:00
Matt Borland f85891aa8a Register Image Names via .setNames()
The Image registry is using an unsupported method of setting values for names.
This patch fixes that by using the supported .setNames() method.

Change-Id: I54ea5bea45ce71c8ca60683bcb55aff6d3f5aa9a
Closes-Bug: 1592543
2016-06-14 14:36:39 -06:00
Matt Borland cd03154e69 Images uses generic/extensible details views
This patch adds examples of how to use the descriptor on detail views so you
don't have to constantly reload items via an API (just load base object
once per detail view)

Removes the old custom page for Image and replaces the link from
the table with a link to the Generic detail display.

Renames ./images/detail/ to ./images/details/ as we call these features
'details.'

Renames the image-detail.module.js to just details.module.js to match basic
dir-name-for-module pattern.

Adds result handling to the generic details page that simply reloads the
page on an action completing.

Change-Id: I9e7f1a41cf9421f437811efdab67b41485121744
Partially-Implements: blueprint angularize-images-table
2016-05-23 20:09:39 +00:00
Matt Borland adc9ab14cf Cleaning up lint warnings for Image work
This patch simply cleans up eslint warnings for the Angular Image work.
Please note, we still have many warnings due to injectables apparently
needing documentation; I'd prefer to not have to redocument all the
injectables.  So there are still warnings, but all of the same type.

Change-Id: Iea465225b725d7378ecab48571d59fc323848d3e
Partial-Bug: 1554824
2016-05-06 14:02:26 -06:00
Rajat Vig 5b06cda113 Adding Edit Image Action to angular images panel
Adds the ability to edit an image from the table.

To test set DISABLED = False in _1051_project_ng_images_panel.py

Also, ensure in your local_settings.py that you set:
REST_API_REQUIRED_SETTINGS to include 'OPENSTACK_IMAGE_FORMATS'

Co-Authored-By: Rajat Vig<rajatv@thoughtworks.com>
Co-Authored-By: Nathan Zeplowitz<nzeplowi@thoughtworks.com>
Co-Authored-By: Matt Borland <matt.borland@hpe.com>
Co-Authored-By: Kyle Olivo<keolivo@thoughtworks.com>

Change-Id: I046eca486ebc0d2d980ee706105e202bf9b15ba8
Partially-Implements: blueprint angularize-images-table
2016-04-15 16:02:08 +00:00
Matt Borland 8f878166f3 Adding Resource Type registration
This patch adds to the registry service to allow for resource types
to have their properties registered with configuration information.

It provides various convenience methods for outputting the property
labels and values, all determined through the registry, and provides
for singular and plural names to be defined.

This patch also registers many of the OpenStack resource types so
they may be used by implementations.  Ideally those are broken into
component modules, but until those are written they can reside here.

Change-Id: I71bebe253452944ff518f85b8840cfe921602544
Partially-Implements: blueprint angularize-images-table
2016-03-01 15:28:33 -07:00
Jenkins f0173d3135 Merge "Fixed over-application of webroot in disabled image panel" 2016-03-01 12:47:27 +00:00
Matt Borland d63ca41da8 Fixed over-application of webroot in disabled image panel
In haste to accommodate webroot settings for angular routing in the
images panel, we neglected to notice that the angular routing already
takes the base tag into account, and removes the base from the route path.
As a result, we can code a static path in and it will survive webroot
settings just fine.

To test: try using the Images panel with webroot both as / and as something
else (on your devstack).

Fixes-Bug: 1549530
Change-Id: I48479e88acf35c259016a615221c805bd46af291
2016-02-25 15:14:00 -07:00
Matt Borland 3c6ad1ce24 Updating registry to include some concepts
* Move registration to actions module
 * rename rowActions
 * Add Priority

Change-Id: I059d25a44226b2227f7c033cd71d34736ac4c887
2016-02-24 12:23:15 -07:00
Matt Borland 622ab37514 Adding resource type registry service
In the Angular code we have established Actions that we are using in
table rows and headings.  These actions right now are collected by
individual custom services which are in turn used by pages that need
the actions (Image table page uses Image row and batch actions).

This patch eliminates the need to write custom services and instead
centralizes the registration of these actions.  On registraton they are
associated with a string which is a resource-type specification (used
in Searchlight, for example: 'OS::Glance::Image').  This makes the actions
available to any party needing to use them.

The actions are registered in modules' run clauses so they are
automatically registered, with the desired actions injected into the
registration.  This makes it easy for people to add their own actions
or their own resource types.

Change-Id: Ied6040b41513e9eaccecf59e82da1634df6ac08b
Partially-Implements: blueprint angularize-images-table
2016-02-18 16:02:16 -07:00
Jenkins ca951539af Merge "Image Detail Redesign (Angular/UX)" 2016-02-12 06:19:50 +00:00
Rajat Vig 1a17b8608f Image Detail Redesign (Angular/UX)
Image Detail UX redesign, implemented in AngularJS.  This uses the design
at http://invis.io/962Q35HVQ as its base.  For now, basic properties are
displayed.

The actions on the detail screen will be implemented in a later patch.

To test, modify openstack_dashboard/enabled/_1051_project_ng_images_panel.py
and set DISABLED = False

There's a bug around translation of images which is introduced
by this change https://bugs.launchpad.net/horizon/+bug/1487590

Partially-Implements: blueprint angularize-images-table

Co-Authored-By: Rajat Vig <rajatv@thoughtworks.com>
Co-Authored-By: Dan Siwiec <dan.siwiec@thoughtworks.com>
Co-Authored-By: Kyle Olivo <kyle@kyleolivo.com>
Co-Authored-By: Coleman Beasley <coleman.beasley@thoughtworks.com>
Co-Authored-By: Matt Borland <matt.borland@hpe.com>
Co-Authored-By: Tyr Johanson <tyr@hpe.com>

Change-Id: I9882970b40b52a402e5693f6993f1b50c0a819f6
2016-02-11 13:32:31 -07:00
Rajat Vig 876fede86d Adding multiple row actions for the Image table
1. Adds the ability to update metadata for an image
from the images panel.
2. Adds the ability to launch an instance for an image.

To test set DISABLED = False in _1051_project_ng_images_panel.py

Co-Authored-By: Rajat Vig<rajatv@thoughtworks.com>
Co-Authored-By: Kyle Olivo<keolivo@thoughtworks.com>
Co-Authored-By: Matt Borland <matt.borland@hpe.com>

Partially-Implements: blueprint angularize-images-table
Change-Id: I824e14aad06040f77280a7f7db2702818d959c2d
2016-02-10 12:29:41 -07:00
Rajat Vig f58c1301e2 Add Create Volume Action for the Image
This adds a 'Create Volume' action for creating
volumes from the images panel.

Co-Authored-By: Kristine Brown<kbrown@thoughtworks.com>
Co-Authored-By: Errol Pais<epais@thoughtworks.com>
Co-Authored-By: Nathan Zeplowitz<nzeplowi@thoughtworks.com>
Co-Authored-By: Matt Borland <matt.borland@hpe.com>

Partially-Implements: blueprint angularize-images-table

Change-Id: I2ce7b4241f0a2082145233ae487f42151765cc7a
2016-02-05 10:45:44 -07:00
Rajat Vig 2b3ab06715 Add Action to delete multiple and single images to images panel
Adds the ability to delete multiple images
from the images panel.
Adding row action to delete single image to angular images panel

Work needs to be done on the actionss directive per the feedback

To test set DISABLED = False in _1051_project_ng_images_panel.py

Co-Authored-By: Kristine Brown<kbrown@thoughtworks.com>
Co-Authored-By: Errol Pais<epais@thoughtworks.com>
Co-Authored-By: Kyle Olivo<keolivo@thoughtworks.com>

Change-Id: I59d13e0b2225f2b3a05f93b2356029561dbd28bc
Partially-Implements: blueprint angularize-images-table
2016-01-07 11:14:19 -08:00
Travis Tripp eaf27075b6 Adding Angular Project Images Table
This patch adds the images table to the projects panel.

It follows the pattern established by the following review:
https://review.openstack.org/#/c/197373/

However, it pre-fixes the table files with images- to make them
easier to find via search in tools like the pycharms debugger
and it the javascript console on various browsers.

To be added in subsequent patches:
 - Actions
 - Forms
 - Common images table directive (TBD)
 - Filters via Magic Search
 - Integration to Searchlight

To test set DISABLED = False in _203_project_images_panel.py

Change-Id: I5e509fb807c356d3fb4b58e974ffa160828dbf88
Partially-Implements: blueprint angularize-images-table
2015-07-27 11:50:50 -06:00