From 65d748fb252aaa8b0946100bfa8a59bddaf8f720 Mon Sep 17 00:00:00 2001 From: manchandavishal Date: Mon, 18 Apr 2022 23:30:04 +0530 Subject: [PATCH] Deprecate Django based Panel for Images, Keypair, and roles As discussed in the horizon meetings or in horizon PTG sessions, horizon team agreed to deprecate django version of Images, Keypair and Roles panel as we think that feature gaps between the two implementations have been closed. Let's mark the Django version as deprecated for all these panels and gather more attention from operators. Change-Id: I965f9dbdd5e78b52a788f73b359c1c6fbc18637e --- doc/source/configuration/settings.rst | 7 +++++++ .../dashboards/identity/roles/views.py | 11 +++++++++++ .../dashboards/project/images/views.py | 11 +++++++++++ .../dashboards/project/key_pairs/views.py | 10 ++++++++++ ...-for-images-keyspairs-roles-36b9c234eef71b51.yaml | 12 ++++++++++++ 5 files changed, 51 insertions(+) create mode 100644 releasenotes/notes/deprecate-django-panels-for-images-keyspairs-roles-36b9c234eef71b51.yaml diff --git a/doc/source/configuration/settings.rst b/doc/source/configuration/settings.rst index 7c84f656f7..e2cbf0c6ee 100644 --- a/doc/source/configuration/settings.rst +++ b/doc/source/configuration/settings.rst @@ -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 diff --git a/openstack_dashboard/dashboards/identity/roles/views.py b/openstack_dashboard/dashboards/identity/roles/views.py index f66ff4612a..c2270c7855 100644 --- a/openstack_dashboard/dashboards/identity/roles/views.py +++ b/openstack_dashboard/dashboards/identity/roles/views.py @@ -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 diff --git a/openstack_dashboard/dashboards/project/images/views.py b/openstack_dashboard/dashboards/project/images/views.py index a241caa564..43f50404c9 100644 --- a/openstack_dashboard/dashboards/project/images/views.py +++ b/openstack_dashboard/dashboards/project/images/views.py @@ -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) diff --git a/openstack_dashboard/dashboards/project/key_pairs/views.py b/openstack_dashboard/dashboards/project/key_pairs/views.py index cacf467108..9ed42ca29b 100644 --- a/openstack_dashboard/dashboards/project/key_pairs/views.py +++ b/openstack_dashboard/dashboards/project/key_pairs/views.py @@ -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"),), diff --git a/releasenotes/notes/deprecate-django-panels-for-images-keyspairs-roles-36b9c234eef71b51.yaml b/releasenotes/notes/deprecate-django-panels-for-images-keyspairs-roles-36b9c234eef71b51.yaml new file mode 100644 index 0000000000..013412891d --- /dev/null +++ b/releasenotes/notes/deprecate-django-panels-for-images-keyspairs-roles-36b9c234eef71b51.yaml @@ -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.