Merge "Deprecate Django based Panel for Images, Keypair, and roles"

This commit is contained in:
Zuul 2022-06-04 07:25:36 +00:00 committed by Gerrit Code Review
commit 5ac974cf67
5 changed files with 51 additions and 0 deletions

View File

@ -44,6 +44,13 @@ ANGULAR_FEATURES
.. versionadded:: 10.0.0(Newton)
.. deprecated:: 22.2.0(Zed)
The Django version of the Images, Keypairs, and Roles panels are deprecated.
As a result, "images_panel", "key_pairs_panel" and "roles_panel" keys in
this setting are deprecated. Consider switching to the AngujarJS version
by setting corresponding entries to True (the default value).
Default:
.. code-block:: python

View File

@ -12,6 +12,8 @@
# License for the specific language governing permissions and limitations
# under the License.
import logging
from django.urls import reverse
from django.urls import reverse_lazy
from django.utils.translation import gettext_lazy as _
@ -32,10 +34,19 @@ from openstack_dashboard.dashboards.identity.roles \
import tables as project_tables
LOG = logging.getLogger(__name__)
class IndexView(tables.DataTableView):
table_class = project_tables.RolesTable
page_title = _("Roles")
def __init__(self):
super().__init__()
LOG.warning('The Django version of the Roles panel is deprecated '
'since Zed release. Switch to the AngularJS version by '
'setting "ANGULAR_FEATURES[\'roles_panel\'] = True".')
def needs_filter_first(self, table):
return self._needs_filter_first

View File

@ -21,6 +21,8 @@
Views for managing Images and Snapshots.
"""
import logging
from django.utils.translation import gettext_lazy as _
from horizon import exceptions
@ -34,10 +36,19 @@ from openstack_dashboard.dashboards.project.images.images \
import tables as images_tables
LOG = logging.getLogger(__name__)
class IndexView(tables.DataTableView):
table_class = images_tables.ImagesTable
page_title = _("Images")
def __init__(self):
super().__init__()
LOG.warning('The Django version of the Images panel is deprecated '
'since Zed release. Switch to the AngularJS version by '
'setting "ANGULAR_FEATURES[\'images_panel\'] = True".')
def has_prev_data(self, table):
return getattr(self, "_prev", False)

View File

@ -12,6 +12,8 @@
# License for the specific language governing permissions and limitations
# under the License.
import logging
from django.urls import reverse
from django.urls import reverse_lazy
from django.utils.translation import gettext_lazy as _
@ -29,11 +31,19 @@ from openstack_dashboard.dashboards.project.key_pairs \
import tables as key_pairs_tables
from openstack_dashboard import policy
LOG = logging.getLogger(__name__)
class IndexView(tables.DataTableView):
table_class = key_pairs_tables.KeyPairsTable
page_title = _("Key Pairs")
def __init__(self):
super().__init__()
LOG.warning('The Django version of the Key Pairs panel is deprecated '
'since Zed release. Switch to the AngularJS version by '
'setting "ANGULAR_FEATURES[\'key_pairs_panel\'] = True".')
def get_data(self):
if not policy.check(
(("compute", "os_compute_api:os-keypairs:index"),),

View File

@ -0,0 +1,12 @@
---
deprecations:
- |
The Django version of the Images, Keypairs, and Roles panels
is deprecated now. Switch to the AngularJS version by setting
``images_panel``, ``key_pairs_panel`` and ``roles_panel`` keys
in ``ANGULAR_FEATURES`` setting to ``True``
(or dropping these keys from ``ANGULAR_FEATURES`` setting).
The horizon team believes that feature gaps between Django and
AngularJS implementations have been closed for all these panels and
we can drop the Django version. If you see any feature gap, please
file a bug to horizon or contact the horizon team.