From afd0cb6c8cc2477bad274b0d7c4635a24f4222b9 Mon Sep 17 00:00:00 2001 From: Shu Muto Date: Tue, 19 Jun 2018 10:22:34 +0900 Subject: [PATCH] Clear selections for table view Item selections on table view for batch actions does not be cleared after execution of actions. This patch ensures to clear item selections by emitting 'hzTable:clearSelection' event. Change-Id: Ieb2aad733ef06a16183f9c7c1f05a6e32659d67b Closes-Bug: #1777545 --- .../cluster-templates/delete/delete.service.js | 7 +++++-- .../container-infra/clusters/delete/delete.service.js | 7 +++++-- .../container-infra/quotas/delete/delete.service.js | 7 +++++-- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/magnum_ui/static/dashboard/container-infra/cluster-templates/delete/delete.service.js b/magnum_ui/static/dashboard/container-infra/cluster-templates/delete/delete.service.js index d8c8b674..79f9e189 100644 --- a/magnum_ui/static/dashboard/container-infra/cluster-templates/delete/delete.service.js +++ b/magnum_ui/static/dashboard/container-infra/cluster-templates/delete/delete.service.js @@ -22,12 +22,14 @@ deleteService.$inject = [ '$location', '$q', + '$rootScope', 'horizon.app.core.openstack-service-api.magnum', 'horizon.app.core.openstack-service-api.policy', 'horizon.framework.util.actions.action-result.service', 'horizon.framework.util.i18n.gettext', 'horizon.framework.util.q.extensions', 'horizon.framework.widgets.modal.deleteModalService', + 'horizon.framework.widgets.table.events', 'horizon.framework.widgets.toast.service', 'horizon.dashboard.container-infra.cluster-templates.resourceType', 'horizon.dashboard.container-infra.cluster-templates.events' @@ -54,8 +56,8 @@ * On cancel, do nothing. */ function deleteService( - $location, $q, magnum, policy, actionResult, gettext, $qExtensions, deleteModal, toast, - resourceType, events + $location, $q, $rootScope, magnum, policy, actionResult, gettext, $qExtensions, + deleteModal, tableEvents, toast, resourceType, events ) { var scope; var context = { @@ -142,6 +144,7 @@ currentPath !== indexPath) { $location.path(indexPath); } else { + $rootScope.$broadcast(tableEvents.CLEAR_SELECTIONS); return result.result; } } diff --git a/magnum_ui/static/dashboard/container-infra/clusters/delete/delete.service.js b/magnum_ui/static/dashboard/container-infra/clusters/delete/delete.service.js index ccc58f32..1b0cef6b 100644 --- a/magnum_ui/static/dashboard/container-infra/clusters/delete/delete.service.js +++ b/magnum_ui/static/dashboard/container-infra/clusters/delete/delete.service.js @@ -22,12 +22,14 @@ deleteService.$inject = [ '$location', '$q', + '$rootScope', 'horizon.app.core.openstack-service-api.magnum', 'horizon.app.core.openstack-service-api.policy', 'horizon.framework.util.actions.action-result.service', 'horizon.framework.util.i18n.gettext', 'horizon.framework.util.q.extensions', 'horizon.framework.widgets.modal.deleteModalService', + 'horizon.framework.widgets.table.events', 'horizon.framework.widgets.toast.service', 'horizon.dashboard.container-infra.clusters.resourceType', 'horizon.dashboard.container-infra.clusters.events' @@ -54,8 +56,8 @@ * On cancel, do nothing. */ function deleteService( - $location, $q, magnum, policy, actionResult, gettext, $qExtensions, - deleteModal, toast, resourceType, events + $location, $q, $rootScope, magnum, policy, actionResult, gettext, $qExtensions, + deleteModal, tableEvents, toast, resourceType, events ) { var scope; var context = { @@ -142,6 +144,7 @@ currentPath !== indexPath) { $location.path(indexPath); } else { + $rootScope.$broadcast(tableEvents.CLEAR_SELECTIONS); return result.result; } } diff --git a/magnum_ui/static/dashboard/container-infra/quotas/delete/delete.service.js b/magnum_ui/static/dashboard/container-infra/quotas/delete/delete.service.js index 319dd323..3ef5d3c2 100644 --- a/magnum_ui/static/dashboard/container-infra/quotas/delete/delete.service.js +++ b/magnum_ui/static/dashboard/container-infra/quotas/delete/delete.service.js @@ -22,12 +22,14 @@ deleteService.$inject = [ '$location', '$q', + '$rootScope', 'horizon.app.core.openstack-service-api.magnum', 'horizon.app.core.openstack-service-api.policy', 'horizon.framework.util.actions.action-result.service', 'horizon.framework.util.i18n.gettext', 'horizon.framework.util.q.extensions', 'horizon.framework.widgets.modal.deleteModalService', + 'horizon.framework.widgets.table.events', 'horizon.framework.widgets.toast.service', 'horizon.dashboard.container-infra.quotas.resourceType', 'horizon.dashboard.container-infra.quotas.events' @@ -54,8 +56,8 @@ * On cancel, do nothing. */ function deleteService( - $location, $q, magnum, policy, actionResult, gettext, $qExtensions, - deleteModal, toast, resourceType, events + $location, $q, $rootScope, magnum, policy, actionResult, gettext, $qExtensions, + deleteModal, tableEvents, toast, resourceType, events ) { var scope; var context = { @@ -142,6 +144,7 @@ currentPath !== indexPath) { $location.path(indexPath); } else { + $rootScope.$broadcast(tableEvents.CLEAR_SELECTIONS); return result.result; } }