@acorex/platform 19.1.11 → 19.1.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -919,6 +919,9 @@ class AXPEntityPerformDeleteAction extends AXPWorkflowAction {
919
919
  const [moduleName, entityName] = moduleEntity.split('.');
920
920
  const data = context.getVariable('data');
921
921
  const meta = context.getVariable('meta');
922
+ const options = context.getVariable('options');
923
+ const process = options?.['process'];
924
+ const showResult = process?.showResult ?? true;
922
925
  const ids = Array.isArray(data) ? data.map((c) => c.id) : [data.id];
923
926
  const entity = await this.entityRegistery.resolve(moduleName, entityName);
924
927
  let deletedCount = 0;
@@ -964,31 +967,39 @@ class AXPEntityPerformDeleteAction extends AXPWorkflowAction {
964
967
  // Handle different scenarios for alerts
965
968
  if (successfulPromises > 0 && failedPromises === 0) {
966
969
  // All items deleted successfully
967
- await this.dialogService.alert(await this.translationService.translateAsync('workflow.success-delete-title'), await this.translationService.translateAsync('workflow.success-delete-body', {
968
- params: { item: successfulPromises },
969
- }), //TODO test translation
970
- 'success');
970
+ if (showResult) {
971
+ await this.dialogService.alert(await this.translationService.translateAsync('workflow.success-delete-title'), await this.translationService.translateAsync('workflow.success-delete-body', {
972
+ params: { item: successfulPromises },
973
+ }), //TODO test translation
974
+ 'success');
975
+ }
971
976
  // Dispatch actions
972
977
  this.dispatch(AXPEntityDeletedEvent({ entity: moduleEntity, ids: ids, meta: meta }));
973
978
  this.dispatch(AXPRefreshEvent({ entity: moduleEntity }));
974
979
  }
975
980
  else if (successfulPromises > 0 && failedPromises > 0) {
976
981
  // Some items deleted successfully, some failed
977
- await this.dialogService.alert(await this.translationService.translateAsync('workflow.success-partial-delete-title'), await this.translationService.translateAsync('workflow.partial-delete-body', {
978
- params: { success: successfulPromises, fail: failedPromises },
979
- }), 'warning');
982
+ if (showResult) {
983
+ await this.dialogService.alert(await this.translationService.translateAsync('workflow.success-partial-delete-title'), await this.translationService.translateAsync('workflow.partial-delete-body', {
984
+ params: { success: successfulPromises, fail: failedPromises },
985
+ }), 'warning');
986
+ }
980
987
  // Dispatch actions
981
988
  this.dispatch(AXPEntityDeletedEvent({ entity: moduleEntity, ids: ids, meta: meta }));
982
989
  }
983
990
  else if (successfulPromises === 0 && failedPromises > 0) {
984
991
  // No items deleted, all failed
985
- await this.dialogService.alert(await this.translationService.translateAsync('workflow.fail-delete-title'), await this.translationService.translateAsync('workflow.fail-delete-body', {
986
- params: { item: failedPromises },
987
- }), 'danger');
992
+ if (showResult) {
993
+ await this.dialogService.alert(await this.translationService.translateAsync('workflow.fail-delete-title'), await this.translationService.translateAsync('workflow.fail-delete-body', {
994
+ params: { item: failedPromises },
995
+ }), 'danger');
996
+ }
988
997
  }
989
998
  else {
990
999
  // No items to delete (no successful or failed promises)
991
- await this.dialogService.alert(await this.translationService.translateAsync('workflow.no-need'), await this.translationService.translateAsync('workflow.no-item'), 'primary');
1000
+ if (showResult) {
1001
+ await this.dialogService.alert(await this.translationService.translateAsync('workflow.no-need'), await this.translationService.translateAsync('workflow.no-item'), 'primary');
1002
+ }
992
1003
  }
993
1004
  }
994
1005
  else {