From 14ab4d1c0cd97d0e8bb9cde2b6d7e90b84f9b26a Mon Sep 17 00:00:00 2001 From: Ying Zuo Date: Wed, 21 Sep 2016 10:53:28 -0700 Subject: [PATCH] Fixed inconsistent names set for BatchAction The name of a BatchAction should be one word. Change-Id: I5172454b23a5aab951a089f05b0f5a04e1a72ba6 Closes-bug: #1626210 --- horizon/tables/actions.py | 3 ++- openstack_dashboard/dashboards/identity/groups/tables.py | 2 +- openstack_dashboard/dashboards/identity/groups/tests.py | 2 +- openstack_dashboard/dashboards/project/routers/tables.py | 2 +- .../integration_tests/pages/project/network/routerspage.py | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/horizon/tables/actions.py b/horizon/tables/actions.py index 1459bd5242..358a0701a9 100644 --- a/horizon/tables/actions.py +++ b/horizon/tables/actions.py @@ -599,7 +599,8 @@ class BatchAction(Action): .. attribute:: name - An internal name for this action. + A short name or "slug" representing this action. + Should be one word such as "delete", "add", "disable", etc. .. method:: action_present diff --git a/openstack_dashboard/dashboards/identity/groups/tables.py b/openstack_dashboard/dashboards/identity/groups/tables.py index 6c98b6b2a0..9797517106 100644 --- a/openstack_dashboard/dashboards/identity/groups/tables.py +++ b/openstack_dashboard/dashboards/identity/groups/tables.py @@ -221,7 +221,7 @@ class AddMembers(tables.BatchAction): count ) - name = "addMember" + name = "add" icon = "plus" requires_input = True success_url = constants.GROUPS_MANAGE_URL diff --git a/openstack_dashboard/dashboards/identity/groups/tests.py b/openstack_dashboard/dashboards/identity/groups/tests.py index c80451c596..52ef4b1d7c 100644 --- a/openstack_dashboard/dashboards/identity/groups/tests.py +++ b/openstack_dashboard/dashboards/identity/groups/tests.py @@ -303,7 +303,7 @@ class GroupsViewTests(test.BaseAdminViewTests): self.mox.ReplayAll() - formData = {'action': 'group_non_members__addMember__%s' % user.id} + formData = {'action': 'group_non_members__add__%s' % user.id} res = self.client.post(GROUP_ADD_MEMBER_URL, formData) self.assertRedirectsNoFollow(res, GROUP_MANAGE_URL) diff --git a/openstack_dashboard/dashboards/project/routers/tables.py b/openstack_dashboard/dashboards/project/routers/tables.py index 29dc09ba15..1cb493b6c8 100644 --- a/openstack_dashboard/dashboards/project/routers/tables.py +++ b/openstack_dashboard/dashboards/project/routers/tables.py @@ -146,7 +146,7 @@ class ClearGateway(policy.PolicyTargetMixin, tables.BatchAction): count ) - name = "cleargateway" + name = "clear" classes = ('btn-cleargateway',) redirect_url = "horizon:project:routers:index" policy_rules = (("network", "update_router"),) diff --git a/openstack_dashboard/test/integration_tests/pages/project/network/routerspage.py b/openstack_dashboard/test/integration_tests/pages/project/network/routerspage.py index e70de8a808..386d43b982 100644 --- a/openstack_dashboard/test/integration_tests/pages/project/network/routerspage.py +++ b/openstack_dashboard/test/integration_tests/pages/project/network/routerspage.py @@ -42,7 +42,7 @@ class RoutersTable(tables.TableRegion): delete_button.click() return forms.BaseFormRegion(self.driver, self.conf) - @tables.bind_row_action('cleargateway') + @tables.bind_row_action('clear') def clear_gateway(self, clear_gateway_button, row): clear_gateway_button.click() return forms.BaseFormRegion(self.driver, self.conf)