@acorex/modules 20.4.2 → 20.5.0-next.1

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.
Files changed (106) hide show
  1. package/common/index.d.ts +16 -18
  2. package/data-management/index.d.ts +69 -5
  3. package/fesm2022/{acorex-modules-application-management-acorex-modules-application-management-3Z51H2O-.mjs → acorex-modules-application-management-acorex-modules-application-management-BqYLpEvY.mjs} +18 -15
  4. package/fesm2022/acorex-modules-application-management-acorex-modules-application-management-BqYLpEvY.mjs.map +1 -0
  5. package/fesm2022/acorex-modules-application-management-menu-list.component-D4uW0aXY.mjs +830 -0
  6. package/fesm2022/acorex-modules-application-management-menu-list.component-D4uW0aXY.mjs.map +1 -0
  7. package/fesm2022/acorex-modules-application-management.mjs +1 -1
  8. package/fesm2022/{acorex-modules-auth-acorex-modules-auth-BwMF7mXK.mjs → acorex-modules-auth-acorex-modules-auth-D1GLmcE-.mjs} +10 -10
  9. package/fesm2022/{acorex-modules-auth-acorex-modules-auth-BwMF7mXK.mjs.map → acorex-modules-auth-acorex-modules-auth-D1GLmcE-.mjs.map} +1 -1
  10. package/fesm2022/{acorex-modules-auth-app-chooser.component-Y8ccBUCa.mjs → acorex-modules-auth-app-chooser.component-BwuQ1IDp.mjs} +2 -2
  11. package/fesm2022/{acorex-modules-auth-app-chooser.component-Y8ccBUCa.mjs.map → acorex-modules-auth-app-chooser.component-BwuQ1IDp.mjs.map} +1 -1
  12. package/fesm2022/{acorex-modules-auth-login.module-B-nJmy3_.mjs → acorex-modules-auth-login.module-C3YVgPHp.mjs} +4 -4
  13. package/fesm2022/{acorex-modules-auth-login.module-B-nJmy3_.mjs.map → acorex-modules-auth-login.module-C3YVgPHp.mjs.map} +1 -1
  14. package/fesm2022/{acorex-modules-auth-master.layout-BhsnK28w.mjs → acorex-modules-auth-master.layout-D0iHJc_T.mjs} +2 -2
  15. package/fesm2022/{acorex-modules-auth-master.layout-BhsnK28w.mjs.map → acorex-modules-auth-master.layout-D0iHJc_T.mjs.map} +1 -1
  16. package/fesm2022/{acorex-modules-auth-oauth-callback.component-DojO-qYk.mjs → acorex-modules-auth-oauth-callback.component-CfTRvv9t.mjs} +2 -2
  17. package/fesm2022/{acorex-modules-auth-oauth-callback.component-DojO-qYk.mjs.map → acorex-modules-auth-oauth-callback.component-CfTRvv9t.mjs.map} +1 -1
  18. package/fesm2022/{acorex-modules-auth-password.component-DauiGRQb.mjs → acorex-modules-auth-password.component-C-aos_5o.mjs} +2 -2
  19. package/fesm2022/{acorex-modules-auth-password.component-DauiGRQb.mjs.map → acorex-modules-auth-password.component-C-aos_5o.mjs.map} +1 -1
  20. package/fesm2022/{acorex-modules-auth-password.component-DxzlLZWK.mjs → acorex-modules-auth-password.component-DzWcZlfs.mjs} +2 -2
  21. package/fesm2022/{acorex-modules-auth-password.component-DxzlLZWK.mjs.map → acorex-modules-auth-password.component-DzWcZlfs.mjs.map} +1 -1
  22. package/fesm2022/{acorex-modules-auth-routes-BwJilKAK.mjs → acorex-modules-auth-routes-CR8yYe3M.mjs} +2 -2
  23. package/fesm2022/{acorex-modules-auth-routes-BwJilKAK.mjs.map → acorex-modules-auth-routes-CR8yYe3M.mjs.map} +1 -1
  24. package/fesm2022/{acorex-modules-auth-two-factor.module-CV70xdxY.mjs → acorex-modules-auth-two-factor.module-BzFLnBad.mjs} +2 -2
  25. package/fesm2022/{acorex-modules-auth-two-factor.module-CV70xdxY.mjs.map → acorex-modules-auth-two-factor.module-BzFLnBad.mjs.map} +1 -1
  26. package/fesm2022/{acorex-modules-auth-user-sessions.component-CYtCo5d1.mjs → acorex-modules-auth-user-sessions.component-Bfb74eNc.mjs} +3 -3
  27. package/fesm2022/acorex-modules-auth-user-sessions.component-Bfb74eNc.mjs.map +1 -0
  28. package/fesm2022/acorex-modules-auth.mjs +1 -1
  29. package/fesm2022/acorex-modules-common.mjs +489 -545
  30. package/fesm2022/acorex-modules-common.mjs.map +1 -1
  31. package/fesm2022/acorex-modules-dashboard-management.mjs +1 -1
  32. package/fesm2022/acorex-modules-dashboard-management.mjs.map +1 -1
  33. package/fesm2022/acorex-modules-data-management.mjs +447 -11
  34. package/fesm2022/acorex-modules-data-management.mjs.map +1 -1
  35. package/fesm2022/{acorex-modules-document-management-acorex-modules-document-management-CwVDh52l.mjs → acorex-modules-document-management-acorex-modules-document-management-BsfSETMk.mjs} +18 -18
  36. package/fesm2022/acorex-modules-document-management-acorex-modules-document-management-BsfSETMk.mjs.map +1 -0
  37. package/fesm2022/{acorex-modules-document-management-attachment-widget.component-KTVXeYE1.mjs → acorex-modules-document-management-attachment-widget.component-C4KhZ0gC.mjs} +2 -2
  38. package/fesm2022/{acorex-modules-document-management-attachment-widget.component-KTVXeYE1.mjs.map → acorex-modules-document-management-attachment-widget.component-C4KhZ0gC.mjs.map} +1 -1
  39. package/fesm2022/{acorex-modules-document-management-details-view.component-Blo7DEM9.mjs → acorex-modules-document-management-details-view.component-DeI-r7-g.mjs} +2 -2
  40. package/fesm2022/{acorex-modules-document-management-details-view.component-Blo7DEM9.mjs.map → acorex-modules-document-management-details-view.component-DeI-r7-g.mjs.map} +1 -1
  41. package/fesm2022/{acorex-modules-document-management-document-signature-popup.component-wVF422mD.mjs → acorex-modules-document-management-document-signature-popup.component-DMFqz5jZ.mjs} +2 -2
  42. package/fesm2022/{acorex-modules-document-management-document-signature-popup.component-wVF422mD.mjs.map → acorex-modules-document-management-document-signature-popup.component-DMFqz5jZ.mjs.map} +1 -1
  43. package/fesm2022/{acorex-modules-document-management-drive-choose.component-Bk62GMxv.mjs → acorex-modules-document-management-drive-choose.component-BcLME_up.mjs} +2 -2
  44. package/fesm2022/{acorex-modules-document-management-drive-choose.component-Bk62GMxv.mjs.map → acorex-modules-document-management-drive-choose.component-BcLME_up.mjs.map} +1 -1
  45. package/fesm2022/{acorex-modules-document-management-drive.component-CdauFuwi.mjs → acorex-modules-document-management-drive.component-BVgm40pD.mjs} +2 -2
  46. package/fesm2022/{acorex-modules-document-management-drive.component-CdauFuwi.mjs.map → acorex-modules-document-management-drive.component-BVgm40pD.mjs.map} +1 -1
  47. package/fesm2022/{acorex-modules-document-management-large-icons-view.component-BkeEB1i8.mjs → acorex-modules-document-management-large-icons-view.component-D9NtNlWh.mjs} +2 -2
  48. package/fesm2022/{acorex-modules-document-management-large-icons-view.component-BkeEB1i8.mjs.map → acorex-modules-document-management-large-icons-view.component-D9NtNlWh.mjs.map} +1 -1
  49. package/fesm2022/{acorex-modules-document-management-large-tiles-view.component-CTp5hvCU.mjs → acorex-modules-document-management-large-tiles-view.component-DUvlPflF.mjs} +2 -2
  50. package/fesm2022/{acorex-modules-document-management-large-tiles-view.component-CTp5hvCU.mjs.map → acorex-modules-document-management-large-tiles-view.component-DUvlPflF.mjs.map} +1 -1
  51. package/fesm2022/{acorex-modules-document-management-link-dialog.component-BXzePJlW.mjs → acorex-modules-document-management-link-dialog.component-Gc-Cwsq-.mjs} +2 -2
  52. package/fesm2022/acorex-modules-document-management-link-dialog.component-Gc-Cwsq-.mjs.map +1 -0
  53. package/fesm2022/{acorex-modules-document-management-list-view.component-Ctk28jwC.mjs → acorex-modules-document-management-list-view.component-CulR4iN1.mjs} +2 -2
  54. package/fesm2022/{acorex-modules-document-management-list-view.component-Ctk28jwC.mjs.map → acorex-modules-document-management-list-view.component-CulR4iN1.mjs.map} +1 -1
  55. package/fesm2022/{acorex-modules-document-management-share-dialog.component-PCK4_jcD.mjs → acorex-modules-document-management-share-dialog.component-Cie7I04V.mjs} +2 -2
  56. package/fesm2022/acorex-modules-document-management-share-dialog.component-Cie7I04V.mjs.map +1 -0
  57. package/fesm2022/{acorex-modules-document-management-share-email-dialog.component-DZEoX29V.mjs → acorex-modules-document-management-share-email-dialog.component-DbRYaPFI.mjs} +2 -2
  58. package/fesm2022/acorex-modules-document-management-share-email-dialog.component-DbRYaPFI.mjs.map +1 -0
  59. package/fesm2022/{acorex-modules-document-management-small-icons-view.component-D81OAgYf.mjs → acorex-modules-document-management-small-icons-view.component-DJI_f_9F.mjs} +2 -2
  60. package/fesm2022/{acorex-modules-document-management-small-icons-view.component-D81OAgYf.mjs.map → acorex-modules-document-management-small-icons-view.component-DJI_f_9F.mjs.map} +1 -1
  61. package/fesm2022/{acorex-modules-document-management-small-tiles-view.component-BNuswkkU.mjs → acorex-modules-document-management-small-tiles-view.component-kNOOhmcY.mjs} +2 -2
  62. package/fesm2022/{acorex-modules-document-management-small-tiles-view.component-BNuswkkU.mjs.map → acorex-modules-document-management-small-tiles-view.component-kNOOhmcY.mjs.map} +1 -1
  63. package/fesm2022/acorex-modules-document-management.mjs +1 -1
  64. package/fesm2022/{acorex-modules-help-desk-acorex-modules-help-desk-CcVD1arq.mjs → acorex-modules-help-desk-acorex-modules-help-desk-BR0maKeU.mjs} +3 -3
  65. package/fesm2022/{acorex-modules-help-desk-acorex-modules-help-desk-CcVD1arq.mjs.map → acorex-modules-help-desk-acorex-modules-help-desk-BR0maKeU.mjs.map} +1 -1
  66. package/fesm2022/{acorex-modules-help-desk-capture-screen.component-BAD2K3Yk.mjs → acorex-modules-help-desk-capture-screen.component-DZFQUHUd.mjs} +2 -2
  67. package/fesm2022/{acorex-modules-help-desk-capture-screen.component-BAD2K3Yk.mjs.map → acorex-modules-help-desk-capture-screen.component-DZFQUHUd.mjs.map} +1 -1
  68. package/fesm2022/acorex-modules-help-desk.mjs +1 -1
  69. package/fesm2022/{acorex-modules-human-capital-management-acorex-modules-human-capital-management-OuRcuL44.mjs → acorex-modules-human-capital-management-acorex-modules-human-capital-management-cb1hY8I2.mjs} +9 -9
  70. package/fesm2022/{acorex-modules-human-capital-management-acorex-modules-human-capital-management-OuRcuL44.mjs.map → acorex-modules-human-capital-management-acorex-modules-human-capital-management-cb1hY8I2.mjs.map} +1 -1
  71. package/fesm2022/{acorex-modules-human-capital-management-employee-skill.entity-CcfQMQcK.mjs → acorex-modules-human-capital-management-employee-skill.entity-DfdiUEju.mjs} +2 -2
  72. package/fesm2022/{acorex-modules-human-capital-management-employee-skill.entity-CcfQMQcK.mjs.map → acorex-modules-human-capital-management-employee-skill.entity-DfdiUEju.mjs.map} +1 -1
  73. package/fesm2022/{acorex-modules-human-capital-management-employee.entity-DstZ_ed2.mjs → acorex-modules-human-capital-management-employee.entity-CP0J0udU.mjs} +2 -2
  74. package/fesm2022/{acorex-modules-human-capital-management-employee.entity-DstZ_ed2.mjs.map → acorex-modules-human-capital-management-employee.entity-CP0J0udU.mjs.map} +1 -1
  75. package/fesm2022/{acorex-modules-human-capital-management-employment-type.entity-Cxpm2FR4.mjs → acorex-modules-human-capital-management-employment-type.entity-0nT4XSi2.mjs} +2 -2
  76. package/fesm2022/{acorex-modules-human-capital-management-employment-type.entity-Cxpm2FR4.mjs.map → acorex-modules-human-capital-management-employment-type.entity-0nT4XSi2.mjs.map} +1 -1
  77. package/fesm2022/{acorex-modules-human-capital-management-leave-request.entity-wNFknszR.mjs → acorex-modules-human-capital-management-leave-request.entity-YGyl6MWh.mjs} +2 -2
  78. package/fesm2022/{acorex-modules-human-capital-management-leave-request.entity-wNFknszR.mjs.map → acorex-modules-human-capital-management-leave-request.entity-YGyl6MWh.mjs.map} +1 -1
  79. package/fesm2022/{acorex-modules-human-capital-management-leave-type.entity-CS5I6afy.mjs → acorex-modules-human-capital-management-leave-type.entity-J9p3UIlS.mjs} +2 -2
  80. package/fesm2022/{acorex-modules-human-capital-management-leave-type.entity-CS5I6afy.mjs.map → acorex-modules-human-capital-management-leave-type.entity-J9p3UIlS.mjs.map} +1 -1
  81. package/fesm2022/{acorex-modules-human-capital-management-position-assignment.entity-ClzIrdYi.mjs → acorex-modules-human-capital-management-position-assignment.entity-DBz-A04O.mjs} +2 -2
  82. package/fesm2022/{acorex-modules-human-capital-management-position-assignment.entity-ClzIrdYi.mjs.map → acorex-modules-human-capital-management-position-assignment.entity-DBz-A04O.mjs.map} +1 -1
  83. package/fesm2022/{acorex-modules-human-capital-management-skill-level.entity-CA_afJbJ.mjs → acorex-modules-human-capital-management-skill-level.entity-CV9vEbTH.mjs} +2 -2
  84. package/fesm2022/{acorex-modules-human-capital-management-skill-level.entity-CA_afJbJ.mjs.map → acorex-modules-human-capital-management-skill-level.entity-CV9vEbTH.mjs.map} +1 -1
  85. package/fesm2022/{acorex-modules-human-capital-management-skill.entity-B0rZeAGS.mjs → acorex-modules-human-capital-management-skill.entity-n6HyUWfU.mjs} +9 -3
  86. package/fesm2022/acorex-modules-human-capital-management-skill.entity-n6HyUWfU.mjs.map +1 -0
  87. package/fesm2022/acorex-modules-human-capital-management.mjs +1 -1
  88. package/fesm2022/{acorex-modules-report-management-report-create-root.component-Cy7fMpif.mjs → acorex-modules-report-management-report-create-root.component-w6pWujhV.mjs} +2 -2
  89. package/fesm2022/acorex-modules-report-management-report-create-root.component-w6pWujhV.mjs.map +1 -0
  90. package/fesm2022/acorex-modules-report-management.mjs +1 -1
  91. package/fesm2022/acorex-modules-security-management.mjs +2 -2
  92. package/fesm2022/acorex-modules-security-management.mjs.map +1 -1
  93. package/fesm2022/acorex-modules-text-template-management.mjs +1 -251
  94. package/fesm2022/acorex-modules-text-template-management.mjs.map +1 -1
  95. package/package.json +6 -6
  96. package/text-template-management/index.d.ts +2 -23
  97. package/fesm2022/acorex-modules-application-management-acorex-modules-application-management-3Z51H2O-.mjs.map +0 -1
  98. package/fesm2022/acorex-modules-application-management-menu-list.component-LIRwdWs6.mjs +0 -731
  99. package/fesm2022/acorex-modules-application-management-menu-list.component-LIRwdWs6.mjs.map +0 -1
  100. package/fesm2022/acorex-modules-auth-user-sessions.component-CYtCo5d1.mjs.map +0 -1
  101. package/fesm2022/acorex-modules-document-management-acorex-modules-document-management-CwVDh52l.mjs.map +0 -1
  102. package/fesm2022/acorex-modules-document-management-link-dialog.component-BXzePJlW.mjs.map +0 -1
  103. package/fesm2022/acorex-modules-document-management-share-dialog.component-PCK4_jcD.mjs.map +0 -1
  104. package/fesm2022/acorex-modules-document-management-share-email-dialog.component-DZEoX29V.mjs.map +0 -1
  105. package/fesm2022/acorex-modules-human-capital-management-skill.entity-B0rZeAGS.mjs.map +0 -1
  106. package/fesm2022/acorex-modules-report-management-report-create-root.component-Cy7fMpif.mjs.map +0 -1
@@ -1,11 +1,11 @@
1
1
  import { AXP_PERMISSION_DEFINITION_PROVIDER, AXPSessionService } from '@acorex/platform/auth';
2
- import { AXPEntityCommandScope, createQueryView, AXPRefreshEvent, createAllQueryView, AXPEntityQueryType, AXPVersioningService, AXPSettingService, AXPSearchService, AXPLockService, AXPHomePageService, AXPSearchCommandProvider, AXP_MENU_PROVIDER, AXP_SETTING_DEFINITION_PROVIDER, AXP_SEARCH_PROVIDER } from '@acorex/platform/common';
2
+ import { AXPEntityCommandScope, createQueryView, AXPRefreshEvent, createAllQueryView, AXPEntityQueryType, AXPVersioningService, AXPSettingService, AXPSearchService, AXPHomePageService, AXPSearchCommandProvider, AXP_MENU_PROVIDER, AXP_SETTING_DEFINITION_PROVIDER, AXP_SEARCH_PROVIDER, AXPLockService } from '@acorex/platform/common';
3
3
  import * as i1$2 from '@acorex/platform/core';
4
4
  import { AXPExpressionEvaluatorService, getSmart, AXPPlatformScope, AXP_EXPRESSION_EVALUATOR_SCOPE_PROVIDER } from '@acorex/platform/core';
5
+ import { ensureListActions, actionExists, AXPEntityDefinitionRegistryService, AXP_ENTITY_ACTION_PLUGIN, AXMEntityCrudServiceImpl, entityMasterCrudActions, entityMasterDeleteAction, AXP_ENTITY_DEFINITION_LOADER, AXP_ENTITY_STORAGE_BACKEND, AXP_ENTITY_STORAGE_MIDDLEWARE, AXPEntityService } from '@acorex/platform/layout/entity';
5
6
  import { AXPWidgetsModule } from '@acorex/platform/layout/widgets';
6
7
  import * as i0 from '@angular/core';
7
- import { inject, Injectable, NgModule, Injector, runInInjectionContext, input, signal, ViewEncapsulation, Component, InjectionToken, HostListener, computed } from '@angular/core';
8
- import { ensureListActions, actionExists, AXPEntityDefinitionRegistryService, AXP_ENTITY_ACTION_PLUGIN, AXMEntityCrudServiceImpl, entityMasterCrudActions, entityMasterDeleteAction, AXP_ENTITY_DEFINITION_LOADER, AXP_ENTITY_STORAGE_BACKEND, AXP_ENTITY_STORAGE_MIDDLEWARE } from '@acorex/platform/layout/entity';
8
+ import { inject, Injector, Injectable, NgModule, runInInjectionContext, input, signal, ViewEncapsulation, Component, InjectionToken, HostListener, computed } from '@angular/core';
9
9
  import * as i1 from '@acorex/platform/workflow';
10
10
  import { createWorkFlowEvent, AXPWorkflowAction, AXPWorkflowModule, AXPWorkflowService } from '@acorex/platform/workflow';
11
11
  import { AXDialogService } from '@acorex/components/dialog';
@@ -28,15 +28,54 @@ import { get, set } from 'lodash-es';
28
28
  import { provideCommandSetups } from '@acorex/platform/runtime';
29
29
  import { AXTextBoxModule } from '@acorex/components/text-box';
30
30
  import { Subject, firstValueFrom } from 'rxjs';
31
- import { AXPLayoutBuilderService } from '@acorex/platform/layout/builder';
32
31
  import { AXCalendarService } from '@acorex/core/date-time';
32
+ import { AXPLayoutBuilderService } from '@acorex/platform/layout/builder';
33
+
34
+ const config = {
35
+ i18n: 'common',
36
+ module: 'Common',
37
+ };
38
+ const RootConfig = {
39
+ config,
40
+ module: {
41
+ route: 'common',
42
+ name: config.module,
43
+ title: '@common:module-name',
44
+ icon: 'fa-light fa-file-invoice',
45
+ },
46
+ entities: {},
47
+ };
48
+
49
+ //#region ---- Common Module Entity Provider ----
50
+ class AXMCommonModuleEntityProvider {
51
+ constructor() {
52
+ this.injector = inject(Injector);
53
+ }
54
+ preload() {
55
+ const module = RootConfig.module.name;
56
+ return Array.from(Object.values(RootConfig.entities)).map((entity) => ({
57
+ module: module,
58
+ entity: entity.name,
59
+ }));
60
+ }
61
+ async get(moduleName, entityName) {
62
+ return null;
63
+ }
64
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMCommonModuleEntityProvider, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
65
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMCommonModuleEntityProvider }); }
66
+ }
67
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMCommonModuleEntityProvider, decorators: [{
68
+ type: Injectable
69
+ }] });
33
70
 
34
71
  const AXPWidgetsList = {
35
72
  Editors: {
36
73
  DocumentAttachment: 'document-attachment-editor',
37
74
  TagBox: 'tagable-editor',
75
+ TagEditor: 'tag-editor',
38
76
  CheckBox: 'checkbox-editor',
39
77
  ColorBox: 'color-editor',
78
+ ColorPalette: 'color-palette-editor',
40
79
  DateTimeBox: 'date-time-editor',
41
80
  Direction: 'direction',
42
81
  LargeTextBox: 'large-text-editor',
@@ -1803,8 +1842,10 @@ const colorPlugin = {
1803
1842
  schema: {
1804
1843
  dataType: 'string',
1805
1844
  interface: {
1806
- type: AXPWidgetsList.Theme.ThemeColorChooser,
1807
- options: {},
1845
+ type: AXPWidgetsList.Editors.ColorPalette,
1846
+ options: {
1847
+ swatches: options?.swatches,
1848
+ },
1808
1849
  },
1809
1850
  },
1810
1851
  validations: [],
@@ -1817,6 +1858,24 @@ const colorPlugin = {
1817
1858
  },
1818
1859
  });
1819
1860
  }
1861
+ //#region ---- Add Column to List View ----
1862
+ // Add color column to list view if enabled (default: true)
1863
+ const columnEnabled = options?.column?.enabled ?? true;
1864
+ if (columnEnabled) {
1865
+ const columns = ctx.columns.list() ?? [];
1866
+ if (!columns.some((c) => c.name === 'color')) {
1867
+ ctx.columns.add({
1868
+ name: 'color',
1869
+ title: '@general:terms.common.color',
1870
+ sort: { enabled: false },
1871
+ options: {
1872
+ visible: options?.column?.visible ?? true,
1873
+ width: `${options?.column?.width ?? 120}px`,
1874
+ },
1875
+ });
1876
+ }
1877
+ }
1878
+ //#endregion
1820
1879
  ctx.interfaces.master.create.update((create) => {
1821
1880
  const next = create ?? { sections: [], properties: [] };
1822
1881
  next.sections = next.sections ?? [];
@@ -1828,7 +1887,7 @@ const colorPlugin = {
1828
1887
  next.properties.push({
1829
1888
  name: 'color',
1830
1889
  layout: {
1831
- positions: { lg: { colSpan: options?.colSpan ?? 6 } },
1890
+ positions: { lg: { colSpan: 6 } },
1832
1891
  },
1833
1892
  });
1834
1893
  }
@@ -1845,7 +1904,7 @@ const colorPlugin = {
1845
1904
  next.properties.push({
1846
1905
  name: 'color',
1847
1906
  layout: {
1848
- positions: { lg: { colSpan: options?.colSpan ?? 6 } },
1907
+ positions: { lg: { colSpan: 6 } },
1849
1908
  },
1850
1909
  });
1851
1910
  }
@@ -1862,7 +1921,7 @@ const colorPlugin = {
1862
1921
  next.properties.push({
1863
1922
  name: 'color',
1864
1923
  layout: {
1865
- positions: { lg: { colSpan: options?.colSpan ?? 6 } },
1924
+ positions: { lg: { colSpan: 6 } },
1866
1925
  },
1867
1926
  });
1868
1927
  }
@@ -3838,6 +3897,24 @@ const iconPlugin = {
3838
3897
  },
3839
3898
  });
3840
3899
  }
3900
+ //#region ---- Add Column to List View ----
3901
+ // Add icon column to list view if enabled (default: true)
3902
+ const columnEnabled = options?.column?.enabled ?? true;
3903
+ if (columnEnabled) {
3904
+ const columns = ctx.columns.list() ?? [];
3905
+ if (!columns.some((c) => c.name === 'icon')) {
3906
+ ctx.columns.add({
3907
+ name: 'icon',
3908
+ title: '@general:terms.common.icon',
3909
+ sort: { enabled: false },
3910
+ options: {
3911
+ visible: options?.column?.visible ?? true,
3912
+ width: `${options?.column?.width ?? 120}px`,
3913
+ },
3914
+ });
3915
+ }
3916
+ }
3917
+ //#endregion
3841
3918
  ctx.interfaces.master.create.update((create) => {
3842
3919
  const next = create ?? { sections: [], properties: [] };
3843
3920
  next.sections = next.sections ?? [];
@@ -3849,7 +3926,7 @@ const iconPlugin = {
3849
3926
  next.properties.push({
3850
3927
  name: 'icon',
3851
3928
  layout: {
3852
- positions: { lg: { colSpan: options?.colSpan ?? 6 } },
3929
+ positions: { lg: { colSpan: 6 } },
3853
3930
  },
3854
3931
  });
3855
3932
  }
@@ -3866,7 +3943,7 @@ const iconPlugin = {
3866
3943
  next.properties.push({
3867
3944
  name: 'icon',
3868
3945
  layout: {
3869
- positions: { lg: { colSpan: options?.colSpan ?? 6 } },
3946
+ positions: { lg: { colSpan: 6 } },
3870
3947
  },
3871
3948
  });
3872
3949
  }
@@ -3883,7 +3960,7 @@ const iconPlugin = {
3883
3960
  next.properties.push({
3884
3961
  name: 'icon',
3885
3962
  layout: {
3886
- positions: { lg: { colSpan: options?.colSpan ?? 6 } },
3963
+ positions: { lg: { colSpan: 6 } },
3887
3964
  },
3888
3965
  });
3889
3966
  }
@@ -3907,525 +3984,193 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImpor
3907
3984
  }]
3908
3985
  }] });
3909
3986
 
3910
- const lockGuardMiddleware = {
3911
- target: { ops: ['update', 'delete'], order: 10 },
3912
- execute: async (ctx, next) => {
3913
- const lockService = inject(AXPLockService);
3914
- const session = inject(AXPSessionService);
3915
- const lock = await lockService.check({ refId: ctx.id, refType: ctx.entityName });
3916
- if (lock) {
3917
- const info = await lockService.getInfo({ refId: ctx.id, refType: ctx.entityName });
3918
- if (info && session.user && info.lockedBy.id !== session.user.id) {
3919
- throw new Error('This record is locked and cannot be edited.');
3920
- }
3987
+ const primaryPlugin = {
3988
+ name: 'primary',
3989
+ order: 66,
3990
+ apply: (ctx) => {
3991
+ ensureListActions(ctx);
3992
+ //#region ---- Add isPrimary Property ----
3993
+ // Ensure settings group exists
3994
+ const groupId = 'settings';
3995
+ const groups = ctx.groups.list() ?? [];
3996
+ if (!groups.some((g) => g.id === groupId)) {
3997
+ ctx.groups.add({ id: groupId, title: '@general:terms.interface.settings' });
3921
3998
  }
3922
- await next();
3999
+ // Add isPrimary property if it doesn't exist
4000
+ const props = ctx.properties.list();
4001
+ if (!props.some((p) => p.name === 'isPrimary')) {
4002
+ ctx.properties.add({
4003
+ name: 'isPrimary',
4004
+ title: '@general:terms.status.states.is-primary',
4005
+ groupId,
4006
+ schema: {
4007
+ dataType: 'boolean',
4008
+ interface: {
4009
+ type: AXPWidgetsList.Editors.ToggleSwitch,
4010
+ options: {
4011
+ // Default to false (not primary)
4012
+ defaultValue: false,
4013
+ negative: false,
4014
+ nullValue: false,
4015
+ },
4016
+ },
4017
+ },
4018
+ validations: [],
4019
+ options: {
4020
+ sort: { enabled: true },
4021
+ filter: {
4022
+ advance: { enabled: true },
4023
+ inline: { enabled: true }
4024
+ }
4025
+ }
4026
+ });
4027
+ }
4028
+ //#endregion
4029
+ // Add isPrimary to columns for list view
4030
+ const columns = ctx.columns.list() ?? [];
4031
+ if (!columns.some((c) => c.name === 'isPrimary')) {
4032
+ ctx.columns.add({
4033
+ name: 'isPrimary',
4034
+ title: '@general:terms.status.states.is-primary',
4035
+ width: 100,
4036
+ sortable: true,
4037
+ filterable: true,
4038
+ });
4039
+ }
4040
+ //#endregion
4041
+ //#region ---- Add Primary Actions ----
4042
+ ctx.interfaces.update((i) => {
4043
+ const setPrimaryCmdName = 'set-primary-entity';
4044
+ // Add set primary action to list view
4045
+ const listActions = i.master.list.actions;
4046
+ if (!actionExists(listActions, setPrimaryCmdName)) {
4047
+ listActions.push({
4048
+ title: '@general:actions.set-primary.title',
4049
+ command: {
4050
+ name: setPrimaryCmdName,
4051
+ options: {
4052
+ refId: '{{ context.eval("id") }}',
4053
+ refType: `${ctx.entity.module}.${ctx.entity.name}`,
4054
+ },
4055
+ },
4056
+ priority: 'secondary',
4057
+ type: 'update',
4058
+ scope: AXPEntityCommandScope.Individual,
4059
+ hidden: `{{ context.eval("isPrimary") }}`,
4060
+ });
4061
+ }
4062
+ // Add set primary action to single view
4063
+ const singleActions = i.master?.single?.actions || [];
4064
+ if (!actionExists(singleActions, setPrimaryCmdName)) {
4065
+ singleActions.push({
4066
+ title: '@general:actions.set-primary.title',
4067
+ command: {
4068
+ name: setPrimaryCmdName,
4069
+ options: {
4070
+ refId: '{{ context.eval("id") }}',
4071
+ refType: `${ctx.entity.module}.${ctx.entity.name}`,
4072
+ },
4073
+ },
4074
+ priority: 'secondary',
4075
+ type: 'update',
4076
+ scope: AXPEntityCommandScope.Individual,
4077
+ hidden: `{{ context.eval("isPrimary") }}`,
4078
+ });
4079
+ }
4080
+ return i;
4081
+ });
4082
+ //#endregion
4083
+ //#region ---- Update Interface Layouts ----
4084
+ // Ensure create view includes isPrimary
4085
+ ctx.interfaces.master.create.update((create) => {
4086
+ const next = create ?? { sections: [], properties: [] };
4087
+ next.sections = next.sections ?? [];
4088
+ if (!next.sections.some((s) => s.id === groupId)) {
4089
+ next.sections.push({ id: groupId });
4090
+ }
4091
+ next.properties = next.properties ?? [];
4092
+ if (!next.properties.some((p) => p.name === 'isPrimary')) {
4093
+ next.properties.push({
4094
+ name: 'isPrimary',
4095
+ layout: {
4096
+ positions: { lg: { colSpan: 6, order: 90 } },
4097
+ },
4098
+ });
4099
+ }
4100
+ return next;
4101
+ });
4102
+ // Ensure update view includes isPrimary
4103
+ ctx.interfaces.master.modify.update((update) => {
4104
+ const next = update ?? { sections: [], properties: [] };
4105
+ next.sections = next.sections ?? [];
4106
+ if (!next.sections.some((s) => s.id === groupId)) {
4107
+ next.sections.push({ id: groupId });
4108
+ }
4109
+ next.properties = next.properties ?? [];
4110
+ if (!next.properties.some((p) => p.name === 'isPrimary')) {
4111
+ next.properties.push({
4112
+ name: 'isPrimary',
4113
+ layout: {
4114
+ positions: { lg: { colSpan: 6, order: 90 } },
4115
+ },
4116
+ });
4117
+ }
4118
+ return next;
4119
+ });
4120
+ // Ensure single view includes isPrimary
4121
+ ctx.interfaces.master.single.update((single) => {
4122
+ const next = single ?? { title: ctx.entity.title, sections: [], properties: [] };
4123
+ next.sections = next.sections ?? [];
4124
+ if (!next.sections.some((s) => s.id === groupId)) {
4125
+ next.sections.push({ id: groupId, order: 150 });
4126
+ }
4127
+ next.properties = next.properties ?? [];
4128
+ if (!next.properties.some((p) => p.name === 'isPrimary')) {
4129
+ next.properties.push({
4130
+ name: 'isPrimary',
4131
+ layout: {
4132
+ positions: { lg: { colSpan: 6, order: 90 } },
4133
+ },
4134
+ });
4135
+ }
4136
+ return next;
4137
+ });
4138
+ // Add primary view to show only primary items
4139
+ ctx.interfaces.master.list.update((list) => {
4140
+ const next = list ?? { actions: [], views: [] };
4141
+ next.views = next.views ?? [];
4142
+ // Check if primary view already exists
4143
+ if (!next.views.some((v) => v.name === 'primary')) {
4144
+ next.views.push(createQueryView('primary', '@general:terms.status.states.is-primary', false, {
4145
+ conditions: [
4146
+ {
4147
+ name: 'isPrimary',
4148
+ operator: { type: 'equal' },
4149
+ value: true,
4150
+ hidden: true
4151
+ },
4152
+ ],
4153
+ sorts: [
4154
+ { name: 'updatedAt', dir: 'desc' },
4155
+ { name: 'title', dir: 'asc' },
4156
+ ],
4157
+ }));
4158
+ }
4159
+ return next;
4160
+ });
4161
+ //#endregion
3923
4162
  },
3924
4163
  };
3925
4164
 
3926
- class AXMLockPopupWorkflowAction extends AXPWorkflowAction {
3927
- constructor() {
3928
- super(...arguments);
3929
- this.translationService = inject(AXTranslationService);
3930
- this.layoutBuilder = inject(AXPLayoutBuilderService);
3931
- this.lockService = inject(AXPLockService);
3932
- this.sessionService = inject(AXPSessionService);
3933
- }
3934
- async execute(context) {
3935
- const refId = context.getVariable('options.refId');
3936
- const refType = context.getVariable('options.refType');
3937
- const durationOptions = [
3938
- {
3939
- value: '1h',
3940
- text: await this.translationService.translateAsync('@lock-system:lock.duration.options.1h'),
3941
- hours: 1,
3942
- },
4165
+ class AXPPrimaryPluginModule {
4166
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPPrimaryPluginModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
4167
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.4", ngImport: i0, type: AXPPrimaryPluginModule }); }
4168
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPPrimaryPluginModule, providers: [
4169
+ // Register the primary plugin
3943
4170
  {
3944
- value: '1d',
3945
- text: await this.translationService.translateAsync('@lock-system:lock.duration.options.1d'),
3946
- hours: 24,
3947
- },
3948
- {
3949
- value: 'infinite',
3950
- text: await this.translationService.translateAsync('@lock-system:lock.duration.options.infinite'),
3951
- },
3952
- ];
3953
- const dialogTitle = await this.translationService.translateAsync('@lock-system:lock.dialog.title');
3954
- const dialogRef = await this.layoutBuilder
3955
- .create()
3956
- .dialog(dialog => {
3957
- dialog
3958
- .setTitle(dialogTitle)
3959
- .setContext({ duration: '1h', reason: '' })
3960
- .content(flex => {
3961
- flex
3962
- .setDirection('column')
3963
- .formField('@lock-system:lock.duration.title', field => {
3964
- field.path('duration');
3965
- field.selectBox({
3966
- valueField: 'value',
3967
- textField: 'text',
3968
- dataSource: durationOptions,
3969
- validations: [{ rule: 'required' }],
3970
- });
3971
- })
3972
- .formField('@lock-system:lock.reason.title', field => {
3973
- field.path('reason');
3974
- field.largeTextBox({
3975
- rows: 3,
3976
- placeholder: '@lock-system:lock.reason.placeholder',
3977
- });
3978
- });
3979
- })
3980
- .setActions(actions => {
3981
- actions.cancel('@lock-system:lock.dialog.cancel');
3982
- const confirmAction = {
3983
- title: '@lock-system:lock.dialog.confirm',
3984
- color: 'primary',
3985
- command: { name: 'submit', options: { validate: true } },
3986
- };
3987
- actions.custom(confirmAction);
3988
- });
3989
- })
3990
- .show();
3991
- const action = dialogRef.action();
3992
- if (action === 'cancel') {
3993
- context.setOutput('isCanceled', true);
3994
- dialogRef.close();
3995
- return;
3996
- }
3997
- const form = dialogRef.context();
3998
- const selected = form?.duration ?? '1h';
3999
- const selectedDuration = durationOptions.find((d) => d.value === selected);
4000
- const expireAt = selectedDuration?.hours
4001
- ? new Date(Date.now() + selectedDuration.hours * 60 * 60 * 1000)
4002
- : undefined;
4003
- await this.lockService.lock({
4004
- refId,
4005
- refType,
4006
- type: 'user',
4007
- date: new Date().toISOString(),
4008
- expireAt,
4009
- lockedBy: {
4010
- id: this.sessionService.user?.id ?? 'system',
4011
- type: 'oidc.users',
4012
- },
4013
- });
4014
- dialogRef.close();
4015
- context.setOutput('isCanceled', false);
4016
- context.setOutput('lockDuration', form?.duration ?? '1h');
4017
- context.setOutput('lockReason', form?.reason ?? '');
4018
- }
4019
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMLockPopupWorkflowAction, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
4020
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMLockPopupWorkflowAction }); }
4021
- }
4022
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMLockPopupWorkflowAction, decorators: [{
4023
- type: Injectable
4024
- }] });
4025
- const AXMLockPopupWorkflow = {
4026
- startStepId: 'lock-popup',
4027
- steps: {
4028
- 'lock-popup': {
4029
- action: 'AXMLockPopupWorkflowAction',
4030
- nextSteps: [
4031
- {
4032
- conditions: [{ type: 'SINGLE', expression: 'context.getOutput("isCanceled") == false' }],
4033
- nextStepId: 'successToast',
4034
- },
4035
- ],
4036
- },
4037
- successToast: {
4038
- id: 'successToast',
4039
- action: 'AXPToastAction',
4040
- input: {
4041
- color: 'success',
4042
- title: 'workflow.entity-modified-title',
4043
- content: 'workflow.entity-modified-body',
4044
- },
4045
- nextSteps: [
4046
- {
4047
- conditions: [],
4048
- nextStepId: 'modifyConfirmed',
4049
- },
4050
- ],
4051
- },
4052
- modifyConfirmed: {
4053
- id: 'modifyConfirmed',
4054
- action: 'AXPEntityModifyConfirmedAction',
4055
- },
4056
- },
4057
- };
4058
-
4059
- class AXMUnlockConfirmWorkflowAction extends AXPWorkflowAction {
4060
- constructor() {
4061
- super(...arguments);
4062
- this.dialogService = inject(AXDialogService);
4063
- this.translationService = inject(AXTranslationService);
4064
- this.lockService = inject(AXPLockService);
4065
- this.sessionService = inject(AXPSessionService);
4066
- }
4067
- async execute(context) {
4068
- const refId = context.getVariable('options.refId');
4069
- const refType = context.getVariable('options.refType');
4070
- // Show confirmation dialog
4071
- const dialogResult = await this.dialogService.confirm(await this.translationService.translateAsync('@lock-system:unlock.dialog.title'), await this.translationService.translateAsync('@lock-system:unlock.dialog.description'), 'warning', 'horizontal', false, 'cancel');
4072
- if (dialogResult.result) {
4073
- try {
4074
- // Perform unlock
4075
- await this.lockService.unlock({
4076
- refId: refId,
4077
- refType: refType,
4078
- type: 'user',
4079
- });
4080
- context.setOutput('isCanceled', false);
4081
- context.setOutput('unlocked', true);
4082
- }
4083
- catch (error) {
4084
- console.error('Unlock failed:', error);
4085
- // Show error dialog
4086
- await this.dialogService.alert(await this.translationService.translateAsync('@lock-system:unlock.error.title'), await this.translationService.translateAsync('@lock-system:unlock.error.description'), 'danger');
4087
- context.setOutput('isCanceled', true);
4088
- context.setOutput('unlocked', false);
4089
- }
4090
- }
4091
- else {
4092
- context.setOutput('isCanceled', true);
4093
- context.setOutput('unlocked', false);
4094
- }
4095
- }
4096
- }
4097
- const AXMUnlockConfirmWorkflow = {
4098
- startStepId: 'unlock-confirm',
4099
- steps: {
4100
- 'unlock-confirm': {
4101
- action: 'AXMUnlockConfirmWorkflowAction',
4102
- nextSteps: [
4103
- {
4104
- conditions: [{ type: 'SINGLE', expression: 'context.getOutput("unlocked") == true' }],
4105
- nextStepId: 'successToast',
4106
- },
4107
- ],
4108
- },
4109
- successToast: {
4110
- id: 'successToast',
4111
- action: 'AXPToastAction',
4112
- input: {
4113
- color: 'success',
4114
- title: 'workflow.entity-modified-title',
4115
- content: 'workflow.entity-modified-body',
4116
- },
4117
- nextSteps: [
4118
- {
4119
- conditions: [],
4120
- nextStepId: 'modifyConfirmed',
4121
- },
4122
- ],
4123
- },
4124
- modifyConfirmed: {
4125
- id: 'modifyConfirmed',
4126
- action: 'AXPEntityModifyConfirmedAction',
4127
- },
4128
- },
4129
- };
4130
-
4131
- class AXMLockEvaluatorScopeProvider {
4132
- constructor() {
4133
- this.lockService = inject(AXPLockService);
4134
- }
4135
- async provide(context) {
4136
- context.addScope('lock', {
4137
- check: async (refId, refType) => {
4138
- const lock = await this.lockService.check({
4139
- refId, refType
4140
- });
4141
- return lock;
4142
- }
4143
- });
4144
- }
4145
- }
4146
-
4147
- const lockPlugin = {
4148
- name: 'lock',
4149
- order: 50,
4150
- apply: (ctx) => {
4151
- ensureListActions(ctx);
4152
- ctx.interfaces.update((i) => {
4153
- const actions = i.master.list.actions;
4154
- ctx.properties.list().forEach(p => {
4155
- if (p.schema.interface) {
4156
- p.schema.interface.options = {
4157
- ...p.schema.interface.options,
4158
- readonly: `{{ lock.check(context.eval("id"), "${ctx.entity.module}.${ctx.entity.name}") }}`
4159
- };
4160
- }
4161
- });
4162
- if (!actions.some((a) => a.name === 'lock-entity')) {
4163
- actions.push({
4164
- title: '@lock-system:lock.title',
4165
- name: 'lock-entity',
4166
- command: {
4167
- name: 'lock-popup',
4168
- options: {
4169
- refId: '{{ context.eval("id") }}',
4170
- refType: `${ctx.entity.module}.${ctx.entity.name}`,
4171
- },
4172
- },
4173
- priority: 'secondary',
4174
- type: 'lock',
4175
- scope: AXPEntityCommandScope.Individual,
4176
- hidden: `{{ lock.check(context.eval("id"), "${ctx.entity.module}.${ctx.entity.name}") }}`,
4177
- });
4178
- }
4179
- if (!actions.some((a) => a.name === 'unlock-entity')) {
4180
- actions.push({
4181
- title: '@lock-system:unlock.title',
4182
- name: 'unlock-entity',
4183
- command: {
4184
- name: 'unlock-confirm',
4185
- options: {
4186
- refId: '{{ context.eval("id") }}',
4187
- refType: `${ctx.entity.module}.${ctx.entity.name}`,
4188
- },
4189
- },
4190
- priority: 'secondary',
4191
- type: 'unlock',
4192
- scope: AXPEntityCommandScope.Individual,
4193
- hidden: `{{ (await lock.check(context.eval("id"), "${ctx.entity.module}.${ctx.entity.name}")) == false }}`,
4194
- });
4195
- }
4196
- return i;
4197
- });
4198
- },
4199
- };
4200
-
4201
- class AXMLockSystemModule {
4202
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMLockSystemModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
4203
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.4", ngImport: i0, type: AXMLockSystemModule, imports: [i1.AXPWorkflowModule] }); }
4204
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMLockSystemModule, providers: [
4205
- { provide: AXP_EXPRESSION_EVALUATOR_SCOPE_PROVIDER, multi: true, useClass: AXMLockEvaluatorScopeProvider },
4206
- { provide: AXP_ENTITY_ACTION_PLUGIN, multi: true, useValue: lockPlugin },
4207
- { provide: AXP_ENTITY_STORAGE_MIDDLEWARE, multi: true, useValue: lockGuardMiddleware },
4208
- ], imports: [AXPWorkflowModule.forChild({
4209
- actions: {
4210
- AXMLockPopupWorkflowAction,
4211
- AXMUnlockConfirmWorkflowAction,
4212
- },
4213
- workflows: {
4214
- 'lock-popup': AXMLockPopupWorkflow,
4215
- 'unlock-confirm': AXMUnlockConfirmWorkflow,
4216
- },
4217
- })] }); }
4218
- }
4219
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMLockSystemModule, decorators: [{
4220
- type: NgModule,
4221
- args: [{
4222
- imports: [
4223
- AXPWorkflowModule.forChild({
4224
- actions: {
4225
- AXMLockPopupWorkflowAction,
4226
- AXMUnlockConfirmWorkflowAction,
4227
- },
4228
- workflows: {
4229
- 'lock-popup': AXMLockPopupWorkflow,
4230
- 'unlock-confirm': AXMUnlockConfirmWorkflow,
4231
- },
4232
- }),
4233
- ],
4234
- providers: [
4235
- { provide: AXP_EXPRESSION_EVALUATOR_SCOPE_PROVIDER, multi: true, useClass: AXMLockEvaluatorScopeProvider },
4236
- { provide: AXP_ENTITY_ACTION_PLUGIN, multi: true, useValue: lockPlugin },
4237
- { provide: AXP_ENTITY_STORAGE_MIDDLEWARE, multi: true, useValue: lockGuardMiddleware },
4238
- ],
4239
- }]
4240
- }] });
4241
-
4242
- const primaryPlugin = {
4243
- name: 'primary',
4244
- order: 66,
4245
- apply: (ctx) => {
4246
- ensureListActions(ctx);
4247
- //#region ---- Add isPrimary Property ----
4248
- // Ensure settings group exists
4249
- const groupId = 'settings';
4250
- const groups = ctx.groups.list() ?? [];
4251
- if (!groups.some((g) => g.id === groupId)) {
4252
- ctx.groups.add({ id: groupId, title: '@general:terms.interface.settings' });
4253
- }
4254
- // Add isPrimary property if it doesn't exist
4255
- const props = ctx.properties.list();
4256
- if (!props.some((p) => p.name === 'isPrimary')) {
4257
- ctx.properties.add({
4258
- name: 'isPrimary',
4259
- title: '@general:terms.status.states.is-primary',
4260
- groupId,
4261
- schema: {
4262
- dataType: 'boolean',
4263
- interface: {
4264
- type: AXPWidgetsList.Editors.ToggleSwitch,
4265
- options: {
4266
- // Default to false (not primary)
4267
- defaultValue: false,
4268
- negative: false,
4269
- nullValue: false,
4270
- },
4271
- },
4272
- },
4273
- validations: [],
4274
- options: {
4275
- sort: { enabled: true },
4276
- filter: {
4277
- advance: { enabled: true },
4278
- inline: { enabled: true }
4279
- }
4280
- }
4281
- });
4282
- }
4283
- //#endregion
4284
- // Add isPrimary to columns for list view
4285
- const columns = ctx.columns.list() ?? [];
4286
- if (!columns.some((c) => c.name === 'isPrimary')) {
4287
- ctx.columns.add({
4288
- name: 'isPrimary',
4289
- title: '@general:terms.status.states.is-primary',
4290
- width: 100,
4291
- sortable: true,
4292
- filterable: true,
4293
- });
4294
- }
4295
- //#endregion
4296
- //#region ---- Add Primary Actions ----
4297
- ctx.interfaces.update((i) => {
4298
- const setPrimaryCmdName = 'set-primary-entity';
4299
- // Add set primary action to list view
4300
- const listActions = i.master.list.actions;
4301
- if (!actionExists(listActions, setPrimaryCmdName)) {
4302
- listActions.push({
4303
- title: '@general:actions.set-primary.title',
4304
- command: {
4305
- name: setPrimaryCmdName,
4306
- options: {
4307
- refId: '{{ context.eval("id") }}',
4308
- refType: `${ctx.entity.module}.${ctx.entity.name}`,
4309
- },
4310
- },
4311
- priority: 'secondary',
4312
- type: 'update',
4313
- scope: AXPEntityCommandScope.Individual,
4314
- hidden: `{{ context.eval("isPrimary") }}`,
4315
- });
4316
- }
4317
- // Add set primary action to single view
4318
- const singleActions = i.master?.single?.actions || [];
4319
- if (!actionExists(singleActions, setPrimaryCmdName)) {
4320
- singleActions.push({
4321
- title: '@general:actions.set-primary.title',
4322
- command: {
4323
- name: setPrimaryCmdName,
4324
- options: {
4325
- refId: '{{ context.eval("id") }}',
4326
- refType: `${ctx.entity.module}.${ctx.entity.name}`,
4327
- },
4328
- },
4329
- priority: 'secondary',
4330
- type: 'update',
4331
- scope: AXPEntityCommandScope.Individual,
4332
- hidden: `{{ context.eval("isPrimary") }}`,
4333
- });
4334
- }
4335
- return i;
4336
- });
4337
- //#endregion
4338
- //#region ---- Update Interface Layouts ----
4339
- // Ensure create view includes isPrimary
4340
- ctx.interfaces.master.create.update((create) => {
4341
- const next = create ?? { sections: [], properties: [] };
4342
- next.sections = next.sections ?? [];
4343
- if (!next.sections.some((s) => s.id === groupId)) {
4344
- next.sections.push({ id: groupId });
4345
- }
4346
- next.properties = next.properties ?? [];
4347
- if (!next.properties.some((p) => p.name === 'isPrimary')) {
4348
- next.properties.push({
4349
- name: 'isPrimary',
4350
- layout: {
4351
- positions: { lg: { colSpan: 6, order: 90 } },
4352
- },
4353
- });
4354
- }
4355
- return next;
4356
- });
4357
- // Ensure update view includes isPrimary
4358
- ctx.interfaces.master.modify.update((update) => {
4359
- const next = update ?? { sections: [], properties: [] };
4360
- next.sections = next.sections ?? [];
4361
- if (!next.sections.some((s) => s.id === groupId)) {
4362
- next.sections.push({ id: groupId });
4363
- }
4364
- next.properties = next.properties ?? [];
4365
- if (!next.properties.some((p) => p.name === 'isPrimary')) {
4366
- next.properties.push({
4367
- name: 'isPrimary',
4368
- layout: {
4369
- positions: { lg: { colSpan: 6, order: 90 } },
4370
- },
4371
- });
4372
- }
4373
- return next;
4374
- });
4375
- // Ensure single view includes isPrimary
4376
- ctx.interfaces.master.single.update((single) => {
4377
- const next = single ?? { title: ctx.entity.title, sections: [], properties: [] };
4378
- next.sections = next.sections ?? [];
4379
- if (!next.sections.some((s) => s.id === groupId)) {
4380
- next.sections.push({ id: groupId, order: 150 });
4381
- }
4382
- next.properties = next.properties ?? [];
4383
- if (!next.properties.some((p) => p.name === 'isPrimary')) {
4384
- next.properties.push({
4385
- name: 'isPrimary',
4386
- layout: {
4387
- positions: { lg: { colSpan: 6, order: 90 } },
4388
- },
4389
- });
4390
- }
4391
- return next;
4392
- });
4393
- // Add primary view to show only primary items
4394
- ctx.interfaces.master.list.update((list) => {
4395
- const next = list ?? { actions: [], views: [] };
4396
- next.views = next.views ?? [];
4397
- // Check if primary view already exists
4398
- if (!next.views.some((v) => v.name === 'primary')) {
4399
- next.views.push(createQueryView('primary', '@general:terms.status.states.is-primary', false, {
4400
- conditions: [
4401
- {
4402
- name: 'isPrimary',
4403
- operator: { type: 'equal' },
4404
- value: true,
4405
- hidden: true
4406
- },
4407
- ],
4408
- sorts: [
4409
- { name: 'updatedAt', dir: 'desc' },
4410
- { name: 'title', dir: 'asc' },
4411
- ],
4412
- }));
4413
- }
4414
- return next;
4415
- });
4416
- //#endregion
4417
- },
4418
- };
4419
-
4420
- class AXPPrimaryPluginModule {
4421
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPPrimaryPluginModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
4422
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.4", ngImport: i0, type: AXPPrimaryPluginModule }); }
4423
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPPrimaryPluginModule, providers: [
4424
- // Register the primary plugin
4425
- {
4426
- provide: AXP_ENTITY_ACTION_PLUGIN,
4427
- useValue: primaryPlugin,
4428
- multi: true,
4171
+ provide: AXP_ENTITY_ACTION_PLUGIN,
4172
+ useValue: primaryPlugin,
4173
+ multi: true,
4429
4174
  },
4430
4175
  ] }); }
4431
4176
  }
@@ -4598,20 +4343,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImpor
4598
4343
  }]
4599
4344
  }] });
4600
4345
 
4601
- const config = {
4602
- i18n: 'common',
4603
- };
4604
- const RootConfig = {
4605
- config,
4606
- module: {
4607
- module: 'common',
4608
- name: 'Common',
4609
- title: `t('module-name', {scope:"${config.i18n}"})`,
4610
- icon: 'fa-light fa-file-invoice',
4611
- },
4612
- entities: {},
4613
- };
4614
-
4615
4346
  const AXPCommonMenuKeys = {
4616
4347
  Home: 'app:home',
4617
4348
  };
@@ -4620,6 +4351,7 @@ class AXMMenuProvider {
4620
4351
  constructor() {
4621
4352
  this.sessionService = inject(AXPSessionService);
4622
4353
  this.homePageService = inject(AXPHomePageService);
4354
+ this.entityService = inject(AXPEntityService);
4623
4355
  }
4624
4356
  async provide(context) {
4625
4357
  const scope = RootConfig.config.i18n;
@@ -4717,8 +4449,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImpor
4717
4449
 
4718
4450
  class AXMCommonModule {
4719
4451
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMCommonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
4720
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.4", ngImport: i0, type: AXMCommonModule, imports: [AXMLockSystemModule,
4721
- AXPExtraPropertiesModule,
4452
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.4", ngImport: i0, type: AXMCommonModule, imports: [AXPExtraPropertiesModule,
4722
4453
  AXPCategoryModule,
4723
4454
  AXPGlobalSearchModule,
4724
4455
  AXPWidgetsModule,
@@ -4763,8 +4494,12 @@ class AXMCommonModule {
4763
4494
  useClass: AXPTranslateEvaluatorScopeProvider,
4764
4495
  multi: true,
4765
4496
  },
4766
- ], imports: [AXMLockSystemModule,
4767
- AXPExtraPropertiesModule,
4497
+ {
4498
+ provide: AXP_ENTITY_DEFINITION_LOADER,
4499
+ useClass: AXMCommonModuleEntityProvider,
4500
+ multi: true,
4501
+ },
4502
+ ], imports: [AXPExtraPropertiesModule,
4768
4503
  AXPCategoryModule,
4769
4504
  AXPGlobalSearchModule,
4770
4505
  AXPWidgetsModule,
@@ -4783,7 +4518,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImpor
4783
4518
  type: NgModule,
4784
4519
  args: [{
4785
4520
  imports: [
4786
- AXMLockSystemModule,
4787
4521
  AXPExtraPropertiesModule,
4788
4522
  AXPCategoryModule,
4789
4523
  AXPGlobalSearchModule,
@@ -4832,10 +4566,220 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImpor
4832
4566
  useClass: AXPTranslateEvaluatorScopeProvider,
4833
4567
  multi: true,
4834
4568
  },
4569
+ {
4570
+ provide: AXP_ENTITY_DEFINITION_LOADER,
4571
+ useClass: AXMCommonModuleEntityProvider,
4572
+ multi: true,
4573
+ },
4835
4574
  ],
4836
4575
  }]
4837
4576
  }] });
4838
4577
 
4578
+ class AXMLockPopupWorkflowAction extends AXPWorkflowAction {
4579
+ constructor() {
4580
+ super(...arguments);
4581
+ this.translationService = inject(AXTranslationService);
4582
+ this.layoutBuilder = inject(AXPLayoutBuilderService);
4583
+ this.lockService = inject(AXPLockService);
4584
+ this.sessionService = inject(AXPSessionService);
4585
+ }
4586
+ async execute(context) {
4587
+ const refId = context.getVariable('options.refId');
4588
+ const refType = context.getVariable('options.refType');
4589
+ const durationOptions = [
4590
+ {
4591
+ value: '1h',
4592
+ text: await this.translationService.translateAsync('@lock-system:lock.duration.options.1h'),
4593
+ hours: 1,
4594
+ },
4595
+ {
4596
+ value: '1d',
4597
+ text: await this.translationService.translateAsync('@lock-system:lock.duration.options.1d'),
4598
+ hours: 24,
4599
+ },
4600
+ {
4601
+ value: 'infinite',
4602
+ text: await this.translationService.translateAsync('@lock-system:lock.duration.options.infinite'),
4603
+ },
4604
+ ];
4605
+ const dialogTitle = await this.translationService.translateAsync('@lock-system:lock.dialog.title');
4606
+ const dialogRef = await this.layoutBuilder
4607
+ .create()
4608
+ .dialog(dialog => {
4609
+ dialog
4610
+ .setTitle(dialogTitle)
4611
+ .setContext({ duration: '1h', reason: '' })
4612
+ .content(flex => {
4613
+ flex
4614
+ .setDirection('column')
4615
+ .formField('@lock-system:lock.duration.title', field => {
4616
+ field.path('duration');
4617
+ field.selectBox({
4618
+ valueField: 'value',
4619
+ textField: 'text',
4620
+ dataSource: durationOptions,
4621
+ validations: [{ rule: 'required' }],
4622
+ });
4623
+ })
4624
+ .formField('@lock-system:lock.reason.title', field => {
4625
+ field.path('reason');
4626
+ field.largeTextBox({
4627
+ rows: 3,
4628
+ placeholder: '@lock-system:lock.reason.placeholder',
4629
+ });
4630
+ });
4631
+ })
4632
+ .setActions(actions => {
4633
+ actions.cancel('@lock-system:lock.dialog.cancel');
4634
+ const confirmAction = {
4635
+ title: '@lock-system:lock.dialog.confirm',
4636
+ color: 'primary',
4637
+ command: { name: 'submit', options: { validate: true } },
4638
+ };
4639
+ actions.custom(confirmAction);
4640
+ });
4641
+ })
4642
+ .show();
4643
+ const action = dialogRef.action();
4644
+ if (action === 'cancel') {
4645
+ context.setOutput('isCanceled', true);
4646
+ dialogRef.close();
4647
+ return;
4648
+ }
4649
+ const form = dialogRef.context();
4650
+ const selected = form?.duration ?? '1h';
4651
+ const selectedDuration = durationOptions.find((d) => d.value === selected);
4652
+ const expireAt = selectedDuration?.hours
4653
+ ? new Date(Date.now() + selectedDuration.hours * 60 * 60 * 1000)
4654
+ : undefined;
4655
+ await this.lockService.lock({
4656
+ refId,
4657
+ refType,
4658
+ type: 'user',
4659
+ date: new Date().toISOString(),
4660
+ expireAt,
4661
+ lockedBy: {
4662
+ id: this.sessionService.user?.id ?? 'system',
4663
+ type: 'oidc.users',
4664
+ },
4665
+ });
4666
+ dialogRef.close();
4667
+ context.setOutput('isCanceled', false);
4668
+ context.setOutput('lockDuration', form?.duration ?? '1h');
4669
+ context.setOutput('lockReason', form?.reason ?? '');
4670
+ }
4671
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMLockPopupWorkflowAction, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
4672
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMLockPopupWorkflowAction }); }
4673
+ }
4674
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMLockPopupWorkflowAction, decorators: [{
4675
+ type: Injectable
4676
+ }] });
4677
+ const AXMLockPopupWorkflow = {
4678
+ startStepId: 'lock-popup',
4679
+ steps: {
4680
+ 'lock-popup': {
4681
+ action: 'AXMLockPopupWorkflowAction',
4682
+ nextSteps: [
4683
+ {
4684
+ conditions: [{ type: 'SINGLE', expression: 'context.getOutput("isCanceled") == false' }],
4685
+ nextStepId: 'successToast',
4686
+ },
4687
+ ],
4688
+ },
4689
+ successToast: {
4690
+ id: 'successToast',
4691
+ action: 'AXPToastAction',
4692
+ input: {
4693
+ color: 'success',
4694
+ title: 'workflow.entity-modified-title',
4695
+ content: 'workflow.entity-modified-body',
4696
+ },
4697
+ nextSteps: [
4698
+ {
4699
+ conditions: [],
4700
+ nextStepId: 'modifyConfirmed',
4701
+ },
4702
+ ],
4703
+ },
4704
+ modifyConfirmed: {
4705
+ id: 'modifyConfirmed',
4706
+ action: 'AXPEntityModifyConfirmedAction',
4707
+ },
4708
+ },
4709
+ };
4710
+
4711
+ class AXMUnlockConfirmWorkflowAction extends AXPWorkflowAction {
4712
+ constructor() {
4713
+ super(...arguments);
4714
+ this.dialogService = inject(AXDialogService);
4715
+ this.translationService = inject(AXTranslationService);
4716
+ this.lockService = inject(AXPLockService);
4717
+ this.sessionService = inject(AXPSessionService);
4718
+ }
4719
+ async execute(context) {
4720
+ const refId = context.getVariable('options.refId');
4721
+ const refType = context.getVariable('options.refType');
4722
+ // Show confirmation dialog
4723
+ const dialogResult = await this.dialogService.confirm(await this.translationService.translateAsync('@lock-system:unlock.dialog.title'), await this.translationService.translateAsync('@lock-system:unlock.dialog.description'), 'warning', 'horizontal', false, 'cancel');
4724
+ if (dialogResult.result) {
4725
+ try {
4726
+ // Perform unlock
4727
+ await this.lockService.unlock({
4728
+ refId: refId,
4729
+ refType: refType,
4730
+ type: 'user',
4731
+ });
4732
+ context.setOutput('isCanceled', false);
4733
+ context.setOutput('unlocked', true);
4734
+ }
4735
+ catch (error) {
4736
+ console.error('Unlock failed:', error);
4737
+ // Show error dialog
4738
+ await this.dialogService.alert(await this.translationService.translateAsync('@lock-system:unlock.error.title'), await this.translationService.translateAsync('@lock-system:unlock.error.description'), 'danger');
4739
+ context.setOutput('isCanceled', true);
4740
+ context.setOutput('unlocked', false);
4741
+ }
4742
+ }
4743
+ else {
4744
+ context.setOutput('isCanceled', true);
4745
+ context.setOutput('unlocked', false);
4746
+ }
4747
+ }
4748
+ }
4749
+ const AXMUnlockConfirmWorkflow = {
4750
+ startStepId: 'unlock-confirm',
4751
+ steps: {
4752
+ 'unlock-confirm': {
4753
+ action: 'AXMUnlockConfirmWorkflowAction',
4754
+ nextSteps: [
4755
+ {
4756
+ conditions: [{ type: 'SINGLE', expression: 'context.getOutput("unlocked") == true' }],
4757
+ nextStepId: 'successToast',
4758
+ },
4759
+ ],
4760
+ },
4761
+ successToast: {
4762
+ id: 'successToast',
4763
+ action: 'AXPToastAction',
4764
+ input: {
4765
+ color: 'success',
4766
+ title: 'workflow.entity-modified-title',
4767
+ content: 'workflow.entity-modified-body',
4768
+ },
4769
+ nextSteps: [
4770
+ {
4771
+ conditions: [],
4772
+ nextStepId: 'modifyConfirmed',
4773
+ },
4774
+ ],
4775
+ },
4776
+ modifyConfirmed: {
4777
+ id: 'modifyConfirmed',
4778
+ action: 'AXPEntityModifyConfirmedAction',
4779
+ },
4780
+ },
4781
+ };
4782
+
4839
4783
  /**
4840
4784
  * Generated bundle index. Do not edit.
4841
4785
  */