Bulk actions provides an API to perform bulk operations from within a list view UI.
To define a bulk action you create a class that inherits from the base class FluidityBulkAction
and implements the abstract configuration properties.
// Example
public class DeleteBulkAction : FluidityBulkAction
{
public override string Name => "Delete";
public override string Alias => "delete";
public override string Icon => "icon-trash";
public override string AngularServiceName => "fluidityDeleteBulkActionService";
}
The required configuration options are:
The actual logic for a bulk action needs to be encapsulated in an angular service with the following signature:
(function () {
'use strict';
function fluidityDeleteBulkAction(fluidityResource) {
return {
performAction: function(section, collection, id) {
return fluidityResource.deleteEntity(section, collection, id);
},
getConfirmMessage: function (count) {
return "Are you sure you want to delete " + count + " items?";
},
getProgressMessage: function(count, total) {
return count + " of " + total + " items deleted";
},
getCompleteMessage: function(total) {
return total + " items successfully deleted";
}
}
}
angular.module("umbraco.services").factory("fluidityDeleteBulkActionService", fluidityDeleteBulkAction);
})();
The required service methods are:
The optional service methods are:
getConfirmMessage
method is defined.getProgressMessage
method is defined.getCompleteMessage
method is defined.You’ll need to ensure your angular service as well as any resources needed by your service are loaded before it can be used. This is a bit out of scope for the Fluidity documentation, however in summary you will want to:
package.manifest
file in your plugin folder.package.manifest
.Bulk actions are added to a list view as part of the list view configuration. See List View API documentation for more info.