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: I8860a135ad3ca9f0c7d80229b237519dec42b2f7
Closes-Bug: #1777545
This commit is contained in:
Shu Muto 2018-06-19 12:14:50 +09:00
parent aca6e3f342
commit 40ba040e4c
1 changed files with 5 additions and 2 deletions

View File

@ -30,20 +30,22 @@
deleteService.$inject = [
'$location',
'$q',
'$rootScope',
'horizon.app.core.openstack-service-api.{{cookiecutter.api_module}}',
'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.{{cookiecutter.panel_group}}.{{cookiecutter.panel}}s.resourceType',
'horizon.dashboard.{{cookiecutter.panel_group}}.{{cookiecutter.panel}}s.events'
];
function deleteService(
$location, $q, api, policy, actionResult, gettext, $qExtensions,
deleteModal, toast, resourceType, events
$location, $q, $rootScope, api, policy, actionResult, gettext, $qExtensions,
deleteModal, tableEvents, toast, resourceType, events
) {
var scope;
var context = {
@ -131,6 +133,7 @@
if (result.result.failed.length === 0 && result.result.deleted.length > 0) {
$location.path('/{{cookiecutter.dashboard}}/{{cookiecutter.panel}}s');
} else {
$rootScope.$broadcast(tableEvents.CLEAR_SELECTIONS);
return result.result;
}
}