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
This commit is contained in:
Shu Muto 2018-06-19 10:22:34 +09:00
parent 9190e35dc6
commit afd0cb6c8c
3 changed files with 15 additions and 6 deletions

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}