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
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
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
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
Date format added for created_at and updated_at properties of images
panel. This makes the dates much clearer for users.
Change-Id: I2a74d17bc3b8cc5ce99ce44db669d01532812028
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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