@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.
- package/fesm2022/acorex-platform-common.mjs +13 -8
- package/fesm2022/acorex-platform-common.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-entity.mjs +22 -11
- package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -1
- package/fesm2022/acorex-platform-themes-default.mjs +2 -2
- package/fesm2022/acorex-platform-themes-default.mjs.map +1 -1
- package/fesm2022/acorex-platform-widgets.mjs +340 -324
- package/fesm2022/acorex-platform-widgets.mjs.map +1 -1
- package/fesm2022/acorex-platform-workflow.mjs +57 -1
- package/fesm2022/acorex-platform-workflow.mjs.map +1 -1
- package/package.json +9 -9
- package/widgets/index.d.ts +2 -1
- package/widgets/lib/widgets/editors/contact/contact-widget-edit.component.d.ts +1 -1
- package/widgets/lib/widgets/editors/contact/contact-widget-view.component.d.ts +1 -1
- package/widgets/lib/widgets/editors/select/select-box-widget-edit.component.d.ts +2 -0
- package/widgets/lib/widgets.config.d.ts +7 -0
- package/workflow/lib/workflow-registery.service.d.ts +5 -1
|
@@ -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
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
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
|
-
|
|
978
|
-
|
|
979
|
-
|
|
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
|
-
|
|
986
|
-
|
|
987
|
-
|
|
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
|
-
|
|
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 {
|