From 957240e77877262df1556777c72f98f51fc13b23 Mon Sep 17 00:00:00 2001 From: haixin Date: Mon, 5 Apr 2021 12:15:50 +0800 Subject: [PATCH] API v2.46, added 'is_default' field to share types Added 'is_default' field to share types and share group types list. 'is_default' field will show Yes if the share type or share group type is default. Partial-Bug: #1823078 Change-Id: I923cb2ae90612fb8d5d3af467654a71b83266ffc --- manila_ui/api/manila.py | 2 +- manila_ui/dashboards/admin/share_types/tables.py | 4 ++++ ...s-default-field-to-share-types-list-a76fed8ebe7eef03.yaml | 5 +++++ 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/add-is-default-field-to-share-types-list-a76fed8ebe7eef03.yaml diff --git a/manila_ui/api/manila.py b/manila_ui/api/manila.py index 3fbd2c90..43382eaf 100644 --- a/manila_ui/api/manila.py +++ b/manila_ui/api/manila.py @@ -28,7 +28,7 @@ from manilaclient import client as manila_client LOG = logging.getLogger(__name__) MANILA_UI_USER_AGENT_REPR = "manila_ui_plugin_for_horizon" -MANILA_VERSION = "2.45" +MANILA_VERSION = "2.46" MANILA_SERVICE_TYPE = "sharev2" # API static values diff --git a/manila_ui/dashboards/admin/share_types/tables.py b/manila_ui/dashboards/admin/share_types/tables.py index 8aa603cb..50666bac 100644 --- a/manila_ui/dashboards/admin/share_types/tables.py +++ b/manila_ui/dashboards/admin/share_types/tables.py @@ -94,6 +94,10 @@ class ShareTypesTable(tables.DataTable): description = tables.WrappingColumn( "description", verbose_name=_("Description")) extra_specs = tables.Column("extra_specs", verbose_name=_("Extra specs"), ) + is_default = tables.Column( + "is_default", verbose_name=_("Is default"), + filters=(lambda d: 'Yes' if d is True else '-', ), + ) visibility = tables.Column( "is_public", verbose_name=_("Visibility"), filters=(lambda d: 'public' if d is True else 'private', ), diff --git a/releasenotes/notes/add-is-default-field-to-share-types-list-a76fed8ebe7eef03.yaml b/releasenotes/notes/add-is-default-field-to-share-types-list-a76fed8ebe7eef03.yaml new file mode 100644 index 00000000..8571d1ae --- /dev/null +++ b/releasenotes/notes/add-is-default-field-to-share-types-list-a76fed8ebe7eef03.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + Added ‘is_default’ field to share types list. the Is_default Column will + show 'Yes' if the share type is default share type.