Commit Graph

36 Commits

Author SHA1 Message Date
Akihiro Motoki cd7c1b5110 Address RemovedInDjango40Warning (2)
django.utils.translation.ugettext(), ugettext_lazy(), ugettext_noop(),
ungettext(), and ungettext_lazy() are deprecated in favor of the
functions that they’re aliases for: django.utils.translation.gettext(),
gettext_lazy(), gettext_noop(), ngettext(), and ngettext_lazy().

https://docs.djangoproject.com/en/4.0/releases/3.0/#id3

Change-Id: I77878f84e9d10cf6a136dada81eabf4e18676250
2022-02-04 16:22:07 +09:00
YuehuiLei 87f498bee5 Drop the usage of unicode prefix from unicode strings
All strings are considered as unicode strings in python 3,
so we no longer need "u" prefix (u'...').

Co-Authored-By: Akihiro Motoki <amotoki@gmail.com>
Change-Id: I796d2fcdca066475bbf29d25cbf2aa67b2b2178b
2021-02-12 13:05:27 -06:00
Akihiro Motoki e5d09edc20 Use python3-style super()
In python3, super() does not always require a class and self reference.
In other words, super() is enough for most cases.
This is much simpler and it is time to switch it to the newer style.

pylint provides a check for this.
Let's enable 'super-with-arguments' check.

NOTE: _prepare_mappings() method of FormRegion in
openstack_dashboard/test/integration_tests/regions/forms.py is refactored.
super() (without explicit class and self referece) does not work when
a subclass method calls a same method in a parent class multiple times.
It looks better to prepare a separate method to provide a common logic.

Change-Id: Id9512a14be9f20dbd5ebd63d446570c7b7c825ff
2020-10-15 14:37:20 +09:00
Akihiro Motoki 692778f8cf pylint: Address no-else-return warning
This pylint check 'no-else-return' might be debatable.
but as far as I checked it works in most cases.

Change-Id: Ie8574d4a529454c6e050fa62a7a17ea097d00240
2020-09-27 12:44:16 +09:00
Ivan Kolodyazhny ee6fa9a245 Remove Keystone v2 related code
Kyestone V2 support was removed in Train, so it's safe to do such cleanup.

* Functions which just return horizon settings are dropped and
  the settings are referred directly now.
* The service catalog in the sample test data is updated to match
  the format of the keystone API v3.
* Related to the above change of the sample service catalog,
  openstack_dashboard.test.unit.api.test_keystone.ServiceAPITests is
  updated to specify the region name explicitly because 'RegionTwo'
  endpoint is no longer the second entry of the endpoint list in the
  keystone API v3.

Co-Authored-By: Akihiro Motoki <amotoki@gmail.com>
Change-Id: Ib60f360c96341fa5c618595f4a9bfdfe7ec5ae83
2020-04-23 11:43:12 +09:00
Ivan Kolodyazhny f33e5fd8ac Drop deprecated Keystone V2 API support
Keystone V2 API was deprecated in Stein release in Horizon and
removed from Keystone in Queens release.

Change-Id: I917e273d3174adf0874e516b3d635ccb8ba58a27
2019-09-12 17:15:07 +00:00
Akihiro Motoki 786fb183e8 pylint: fix trailing-comma-tuple warning
Change-Id: I72fa6cacef70e80f95b76e2aa3cefbffad73edb5
2019-01-16 13:06:55 +09:00
Akihiro Motoki a257b52b85 project: Split quota update into a separate workflow
This commit converts the quota update workflow tab into
a separate workflow. After this change, admin cannot set
a project's quotas in the project creation workflow,
but the admin can update its quotas just after creating a project,
so I think it is not a problem.

Because of splitting quota update from a project create/update workflow,
our unit tests has been simplified significantly. Previously we needed
tests for **combination** of create/update project and quota update,
but we now need only tests for create/update project and quota update
separately.

Part of blueprint horizon-plugin-tab-for-info-and-quotas
Change-Id: I7b95428e89ddc1c7a85a1162db29cef9a9674129
2018-03-16 16:45:19 +09:00
Akihiro Motoki e477eafa45 django2: Replace django.core.urlresolves with django.urls
(In Django 2.0) The django.core.urlresolvers module is removed
in favor of its new location, django.urls.
It was depreacted in Django 1.10:
https://docs.djangoproject.com/en/2.0/releases/1.10/#id3

blueprint django2-support
Change-Id: I46ab5c325491274b8eaffbf848e5d80f83c2fd26
2018-02-17 01:36:48 +09:00
Yaguang Tang c61ae4f083 Update Horizon to use latest nova policy rules for validation
As Nova's API is unified to os_compute_api, the API policies are also
updated to use this format, Horizon needs to use Nova  policy enforce
rules in the codebase. This patch also update nova_policy.json using
oslo-config-generator for Nova policy file.

Co-Authored-By: Rob Cresswell <robert.cresswell@outlook.com>
Implements: blueprint update-nova-enforce-policies

Change-Id: Id7d01a39930c88592301a5035f0befe5293a78fa
2017-03-13 13:43:02 +00:00
Cindy Lu e483dd047b Project table has an extra Enabled column definition
There are two Enabled column definitions, remove
the one attached to v3 enabled (unrelated to v3 too).

Closes-Bug: #1633288
Change-Id: I8ba74eba843b72ba1d55c5237d2972c45057afb7
2016-10-14 01:43:59 +00:00
Eddie Ramirez bc1fb4910b Server-side filtering for Identity
Implements server-side filtering in Identity->Projects

Projects (Only V3 supports server filtering)
Users (Only V3 supports server filtering)
Groups
Roles

This filtering method allows a user to filter by
several fields:
- Name
- UUID
- Enabled

Cannot implement filter by email ttps://review.openstack.org/#/c/110970/

Implements blueprint: server-side-filtering
Co-Authored-By: Daniel Castellanos <luis.daniel.castellanos@intel.com>

Change-Id: I37d6afdef84593e2779d21bec0c2f55e2794ab78
2016-09-13 10:06:27 -05:00
Rob Cresswell 07d33cf462 Prevent long names breaking table layouts
Adds a word-break class that can be added to tables to prevent large
column values breaking the table shape.

Change-Id: Icca10d9c29254d176dc7f8b7c039bc19c3f52c72
Related-Bug: 1565724
Closes-Bug: 1584785
2016-08-19 09:21:33 +01:00
Jenkins de29bbce85 Merge "Removed inline_edit functionality for tables" 2016-08-19 03:15:34 +00:00
Luis Daniel Castellanos 241eda4273 Removed inline_edit functionality for tables
As per agreed in Austin summit and then confirmed in the midcycle,
the inline_edit form/functionality is more an issue than a solution.
It leads to many bugs and UX is not the best.

Implements: blueprint remove-table-inline-edit
Change-Id: I91394e4a63afadb66659b6b7c04cb7f8da948ff8
2016-08-18 09:45:52 +00:00
Steve McLellan 018e99d20e Allow horizon to function without nova
Adds conditional block to nova quotas to exclude them if nova is not
enabled; adds 'permission' checks to the project overview and
access_and_security panels to only enable them if compute is enabled;
adds permission checks on compute and image to the admin overview
and metadef panels; disables 'modify quota' and 'view usage' project
actions; disables 'update defaults' if there are no quotas available.

The 'access and security' panel still appears (under Compute) but
tabs other than the keystone endpoint and RC download tab are hidden.

Closes-Bug: #1580116
Change-Id: I1b2ddee0395ad9f55692111604b31618c4eaf69e
2016-07-26 09:15:48 -05:00
Kenji Ishii e05a8fe574 Hide project switch menu when project is disabled
Same as a project list on header area, hide project switch menu
in project list page when project is disabled.

Change-Id: I9e8d893cf6e89f4c5c32d5e3e687977ef3000631
Closes-bug: #1562488
2016-03-27 10:52:22 +00:00
daniel-a-nguyen 2b846515f3 Retrieve domain scoped token
This patch supports using domain scoped tokens against keystone v3.

Use Cases:

Cloud Admin - view and manage identity resources across domains
Domain Admin - view and manage identity resources in the domain logged in
User - view identity project in the domain logged in

Regression:

Supports keystone v2 through local_settings.py configuration
Supports keystone v3 with multidomain = False
Supports keystone v3 with mulitdomain = True

Relates to https://review.openstack.org/#/c/141153/

Background on how to test is here
https://wiki.openstack.org/wiki/Horizon/DomainWorkFlow

Co-Authored-By: Brad Pokorny <Brad_Pokorny@symantec.com>
Co-Authored-By: Brian Tully <brian.tully@hp.com>
Co-Authored-By: Michael Hagedorn <mike.hagedorn@hp.com>
Co-Authored-By: woomatt <matt.wood@hp.com>

Partially Implements: blueprint domain-scoped-tokens

Closes-Bug: #1413851
Change-Id: Iaa19bfef9b0c70304ff81d083c62b218b2d02479
2016-03-08 15:17:38 -08:00
Jenkins 45d5d19792 Merge "Remove usage of user project caching" 2015-12-09 01:53:39 +00:00
chenqiaomin eee3b0e162 Add policy check for project detail link
This change does a policy check for each row, to determine if
the link should be displayed or not.

Change-Id: Ia07c88216cdeb81c87da5c813bafb85e43c58e14
Closes-Bug: #1494548
Closes-Bug: #1418246
2015-11-18 08:15:18 -07:00
lin-hua-cheng 6f83d38da2 Remove usage of user project caching
The caching is done only per process, so the cleanup during logout
does not really work since the during could be handled by another
process. So the cache will just keep on growing.

Change-Id: I793fbee44eb5f9befc316efe6716971b0e32172b
Partial-Bug: #1451943
2015-11-11 22:06:22 -08:00
Vlad Okhrimenko 9264c72caa Update project list in the header bar.
After create new projects, in the header bar,
show only active projects.

Change-Id: I0ab6bd8c90de4c4646e2f01abbd036c0281246e9
Closes-Bug: #1456266
2015-06-29 10:26:55 +00:00
lin-hua-cheng e2616fa25d Read user project directly from request.user
User project should be read from request.user instead of
request.user.token.project.

Change-Id: Ic25d34c29698698b9a45fccf823a04dbf9f0b790
2015-05-01 11:42:15 -07:00
lin-hua-cheng 0cde6aa055 Move to hacking 0.10
Release notes:
http://git.openstack.org/cgit/openstack-dev/hacking/tag/?id=0.10.0

Per the release notes, H307, H803 and H904 has been removed.

Fix code issues with H238 and W292.

Change-Id: I747ebb64db5825bc70f1ae19c1c1f5ca2089c06d
2015-02-04 20:27:07 -08:00
Jenkins b26e633d3e Merge "Create a "Identity Projects details" page" 2015-02-04 22:57:31 +00:00
nikunj2512 104f652f34 Create a "Identity Projects details" page
This patch add the detail page for the "Projects" (Identity -> Projects)
table/resource. So when user clicks on the project name, it will show
the drill down details to the end user.

Change-Id: I00589f139570758f5645e7862de36487ca844b34
Closes-bug: #1380600
2015-01-30 10:55:21 -08:00
Doug Fish b9b2e77477 Make Enabled column values translated
In Identity->Projects the Enabled column values need to be translatable.

Change-Id: Ie1d2e98a4b3d50a7e9ecb0c338f861c93e69a985
Closes-Bug: 1416110
2015-01-29 16:01:22 -06:00
Jenkins b4735c6ce6 Merge "Prevent user from disabling her current project" 2015-01-05 20:25:05 +00:00
Timur Sufiev 257cf49047 Prevent user from disabling her current project
Disabling user's current project is like shooting yourself in the foot
- once it's done, it's irreversible in the current tenant because it's
no longer possible to edit any Project/User/etc. Thus it is forbidden
both when using Edit Project modal or when inline-editing the
corresponding cell at Projects table.

Closes-Bug: #1398331
Change-Id: Iacca383f1d982a9b16c41c9f945fdcdde9f803a1
2014-12-29 16:51:12 -08:00
Vlad Okhrimenko a47c984623 Update project list in the header bar.
Use function for clean cache (from openstack_auth), after project
members were changed(for project cache is invalidated).
Now, in the header bar, show only active projects.

Change-Id: Ia2561b591b4f3de29a14aaa4b666b16fc1d4cec8
Closes-Bug: #1393659
2014-12-11 18:22:38 +02:00
liyingjun 0d1664d6a6 Change "Modify Users" to "Manage Members"
Change "Modify Users" to "Manage Members" in the Project, Group and
Domain Panels in-row Actions. This allows us to be consistent with the
tab headings in both panels.

Change-Id: I7f99624efe623d3cb7fe5861c9cd8ceab8ca3661
Closes-bug: #1398224
2014-12-02 11:13:39 +08:00
David Lyle 4f9d5b186e Replaces always disabled context selection link
In the context selection dropdown, there is currently an always disabled
link to do more advanced filtering. The original intent was to open a
modal to do more advanced context selection. With the use of RBAC in a
previous bp, the Identity->Projects panel is always accessible. This
panel provides the entire project list for the user. We can just use
this to provide the larger project list to select from.

Change-Id: I0d6674e75785206f3be48c8bf004a29906bb6860
Closes-Bug: #1382650
2014-10-20 15:50:12 -06:00
Cindy Lu d114dfe009 Reduce height for "Description" text areas
Textarea widget defaults to 10 rows which seems unnecessary.
Reduced to 4.

Change-Id: I03cfd0087ffb1225c6ce893d98481a9a66e2ab3c
Closes-Bug: #1370271
2014-10-06 16:20:43 -07:00
Doug Fish 3e97f885f8 Fix concatenation in identity related actions
Fix concatenation and pluralization issues from
Delete Groups, Remove Users, Add Users, Delete
Projects, and Delete Domains actions.

Change-Id: I7ba06a1acd720165af23a6fb475d061d2cab0e8a
partial-bug: 1307476
2014-09-25 09:37:26 -05:00
lin-hua-cheng 49241ab7e7 Fix LinkAction class name for Domain and Project
Update the class name to match its behavior.

Change-Id: If7bc027a8aa617175364776ac67f91643f89fa83
Closes-bug: 1363809
2014-09-01 10:42:02 -07:00
David Lyle 18e8ea810d Separating Identity Dashboard and using RBAC
Moving identity panels to their own dashboard.

RBAC is now used to determine the data to load in the identity
dashboard. Using the default policy file, a user with role member
will now be able to see their project list.

Also, adding a policy check mechanism at the panel and dashboard
level to determine which panels and dashboards the user can access.

Implements blueprint separate-identity-dash

Change-Id: I7ebfec2bf6e44899bec79d3b23c90d56a976200f
2014-08-18 16:40:56 -06:00