I have created a bulk action but sometimes it is loading in the backoffice and sometimes it is not. If it is not appearing, a hard refresh makes the error always appear. It seems to be some kind of timing issue. In the browser console the following error shows up:
My code is like this:
function initializeBulkActions() {
angular.module('umbraco.commerce')
.config(['ucActionsProvider', function (ucActionsProvider) {
ucActionsProvider.bulkActions.push(["$q", "editorService", "changeDeliveryDateResource", function ($q, editorService, changeDeliveryDateResource) {
return {
name: 'Delivery date',
icon: 'icon-box-open',
configure: function (items) {
return $q(function (resolve, reject) {
editorService.open({
view: '/App_Plugins/CustomCommerce/backoffice/views/dialogs/changedeliverydate.html',
size: 'small',
config: {
storeId: items[0].storeId,
deliveryDate: items[0].properties.DeliveryDate
},
submit: function (data) {
resolve({
deliveryDate: data
});
},
close: function () {
editorService.close();
reject({
message: "Bulk action was canceled."
})
}
});
});
},
itemAction: function (item, data) {
return changeDeliveryDateResource.changeDeliveryDate(item.id, data.deliveryDate);
},
condition: function (ctx) {
return ctx.entityType == 'Order'
},
sortOrder: 110
}
}]);
}]);
}
$(document).ready(initializeBulkActions);
Commerce bulk/editor actions not loading
Hi,
I have created a bulk action but sometimes it is loading in the backoffice and sometimes it is not. If it is not appearing, a hard refresh makes the error always appear. It seems to be some kind of timing issue. In the browser console the following error shows up:
My code is like this:
I saw this GitHub issue about this subject but it didn't give me the final answer: https://github.com/umbraco/Umbraco.Commerce.Issues/issues/563. We are using Umbraco Commerce 13.1.13 and we want to stay in Umbraco 13 because of LTS. Also I followed these docs https://docs.umbraco.com/umbraco-commerce/13.latest/key-concepts/bulk-actions.
Hope someone here has the answer :)
is working on a reply...