@acorex/modules 21.0.0-next.73 → 21.0.0-next.74
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-modules-ai-management.mjs +48 -15
- package/fesm2022/acorex-modules-ai-management.mjs.map +1 -1
- package/fesm2022/{acorex-modules-assessment-management-acorex-modules-assessment-management-FKvCLWhj.mjs → acorex-modules-assessment-management-acorex-modules-assessment-management-yboYQ8I-.mjs} +24 -24
- package/fesm2022/{acorex-modules-assessment-management-acorex-modules-assessment-management-FKvCLWhj.mjs.map → acorex-modules-assessment-management-acorex-modules-assessment-management-yboYQ8I-.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-assessment-management-assessment-case.entity-B59NvUDv.mjs → acorex-modules-assessment-management-assessment-case.entity-BBWeshSs.mjs} +2 -2
- package/fesm2022/{acorex-modules-assessment-management-assessment-case.entity-B59NvUDv.mjs.map → acorex-modules-assessment-management-assessment-case.entity-BBWeshSs.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-assessment-management-assessment-session-answers-view.util-DY3kcvHv.mjs → acorex-modules-assessment-management-assessment-session-answers-view.util-UCYBAHLk.mjs} +2 -2
- package/fesm2022/{acorex-modules-assessment-management-assessment-session-answers-view.util-DY3kcvHv.mjs.map → acorex-modules-assessment-management-assessment-session-answers-view.util-UCYBAHLk.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-assessment-management-assessment-session.entity-NZgnUnIg.mjs → acorex-modules-assessment-management-assessment-session.entity-Bp_dS1Js.mjs} +2 -2
- package/fesm2022/{acorex-modules-assessment-management-assessment-session.entity-NZgnUnIg.mjs.map → acorex-modules-assessment-management-assessment-session.entity-Bp_dS1Js.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-assessment-management-fill-assessment-session.command-DTpp9nGB.mjs → acorex-modules-assessment-management-fill-assessment-session.command-VivCLw2H.mjs} +2 -2
- package/fesm2022/{acorex-modules-assessment-management-fill-assessment-session.command-DTpp9nGB.mjs.map → acorex-modules-assessment-management-fill-assessment-session.command-VivCLw2H.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-assessment-management-preview-question.command-DLN9rq0h.mjs → acorex-modules-assessment-management-preview-question.command-CKF4BjCx.mjs} +2 -2
- package/fesm2022/{acorex-modules-assessment-management-preview-question.command-DLN9rq0h.mjs.map → acorex-modules-assessment-management-preview-question.command-CKF4BjCx.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-assessment-management-preview-questionnaire.command-D5RxnsfD.mjs → acorex-modules-assessment-management-preview-questionnaire.command-B_2o4jC2.mjs} +2 -2
- package/fesm2022/{acorex-modules-assessment-management-preview-questionnaire.command-D5RxnsfD.mjs.map → acorex-modules-assessment-management-preview-questionnaire.command-B_2o4jC2.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-assessment-management-question-bank-interface-editor-widget-edit.component-j6Pzk1UT.mjs → acorex-modules-assessment-management-question-bank-interface-editor-widget-edit.component-s8KcR3D0.mjs} +2 -2
- package/fesm2022/{acorex-modules-assessment-management-question-bank-interface-editor-widget-edit.component-j6Pzk1UT.mjs.map → acorex-modules-assessment-management-question-bank-interface-editor-widget-edit.component-s8KcR3D0.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-assessment-management-question-bank-item.entity-C8jxKIKe.mjs → acorex-modules-assessment-management-question-bank-item.entity-Sj-5woTX.mjs} +2 -2
- package/fesm2022/{acorex-modules-assessment-management-question-bank-item.entity-C8jxKIKe.mjs.map → acorex-modules-assessment-management-question-bank-item.entity-Sj-5woTX.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-assessment-management-questionnaire-viewer-popup.component-DYtzVNK8.mjs → acorex-modules-assessment-management-questionnaire-viewer-popup.component-ClvQ18w6.mjs} +5 -375
- package/fesm2022/acorex-modules-assessment-management-questionnaire-viewer-popup.component-ClvQ18w6.mjs.map +1 -0
- package/fesm2022/{acorex-modules-assessment-management-questionnaire.entity-Ca-oiaZ5.mjs → acorex-modules-assessment-management-questionnaire.entity-BbyNZvoc.mjs} +2 -2
- package/fesm2022/{acorex-modules-assessment-management-questionnaire.entity-Ca-oiaZ5.mjs.map → acorex-modules-assessment-management-questionnaire.entity-BbyNZvoc.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-assessment-management-review-assessment-session.command-CXSelp7y.mjs → acorex-modules-assessment-management-review-assessment-session.command-B2QViI9d.mjs} +3 -3
- package/fesm2022/{acorex-modules-assessment-management-review-assessment-session.command-CXSelp7y.mjs.map → acorex-modules-assessment-management-review-assessment-session.command-B2QViI9d.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-assessment-management-view-session-answers.command-BQDyUTwa.mjs → acorex-modules-assessment-management-view-session-answers.command-CWdBtkn1.mjs} +3 -3
- package/fesm2022/{acorex-modules-assessment-management-view-session-answers.command-BQDyUTwa.mjs.map → acorex-modules-assessment-management-view-session-answers.command-CWdBtkn1.mjs.map} +1 -1
- package/fesm2022/acorex-modules-assessment-management.mjs +1 -1
- package/fesm2022/{acorex-modules-content-management-acorex-modules-content-management-CVyrVwfU.mjs → acorex-modules-content-management-acorex-modules-content-management-B5zqb3b_.mjs} +5 -5
- package/fesm2022/{acorex-modules-content-management-acorex-modules-content-management-CVyrVwfU.mjs.map → acorex-modules-content-management-acorex-modules-content-management-B5zqb3b_.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-content-management-permission-definition.provider-BnnCEroN.mjs → acorex-modules-content-management-permission-definition.provider-DxI6NmP4.mjs} +2 -2
- package/fesm2022/{acorex-modules-content-management-permission-definition.provider-BnnCEroN.mjs.map → acorex-modules-content-management-permission-definition.provider-DxI6NmP4.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-content-management-template-content-editor-widget-edit.component-B3Scw9SG.mjs → acorex-modules-content-management-template-content-editor-widget-edit.component-ChmkpMy9.mjs} +3 -3
- package/fesm2022/{acorex-modules-content-management-template-content-editor-widget-edit.component-B3Scw9SG.mjs.map → acorex-modules-content-management-template-content-editor-widget-edit.component-ChmkpMy9.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-content-management-template-content-editor-widget-view.component-D7EBdcU9.mjs → acorex-modules-content-management-template-content-editor-widget-view.component-LyoQmopL.mjs} +2 -2
- package/fesm2022/{acorex-modules-content-management-template-content-editor-widget-view.component-D7EBdcU9.mjs.map → acorex-modules-content-management-template-content-editor-widget-view.component-LyoQmopL.mjs.map} +1 -1
- package/fesm2022/acorex-modules-content-management.mjs +1 -1
- package/fesm2022/{acorex-modules-conversation-acorex-modules-conversation-p9c5_MMk.mjs → acorex-modules-conversation-acorex-modules-conversation-lPw23AJc.mjs} +10 -9
- package/fesm2022/acorex-modules-conversation-acorex-modules-conversation-lPw23AJc.mjs.map +1 -0
- package/fesm2022/{acorex-modules-conversation-assist-delegated-agent-detail-popup.component-DQiGLMAZ.mjs → acorex-modules-conversation-assist-delegated-agent-detail-popup.component-D0SGSQC8.mjs} +2 -2
- package/fesm2022/{acorex-modules-conversation-assist-delegated-agent-detail-popup.component-DQiGLMAZ.mjs.map → acorex-modules-conversation-assist-delegated-agent-detail-popup.component-D0SGSQC8.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-conversation-comments-page.component-rY_6dZ3X.mjs → acorex-modules-conversation-comments-page.component-Bqeplzuy.mjs} +2 -2
- package/fesm2022/{acorex-modules-conversation-comments-page.component-rY_6dZ3X.mjs.map → acorex-modules-conversation-comments-page.component-Bqeplzuy.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-conversation-send-assist-chat-message.command-Bi1MZ0AE.mjs → acorex-modules-conversation-send-assist-chat-message.command-CFwkUHCc.mjs} +2 -2
- package/fesm2022/{acorex-modules-conversation-send-assist-chat-message.command-Bi1MZ0AE.mjs.map → acorex-modules-conversation-send-assist-chat-message.command-CFwkUHCc.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-conversation-start-assist-chat.command-1Mro9mxs.mjs → acorex-modules-conversation-start-assist-chat.command-aEOnD6ax.mjs} +2 -2
- package/fesm2022/{acorex-modules-conversation-start-assist-chat.command-1Mro9mxs.mjs.map → acorex-modules-conversation-start-assist-chat.command-aEOnD6ax.mjs.map} +1 -1
- package/fesm2022/acorex-modules-conversation.mjs +1 -1
- package/fesm2022/{acorex-modules-dashboard-management-acorex-modules-dashboard-management-DLOyCwM3.mjs → acorex-modules-dashboard-management-acorex-modules-dashboard-management-D2TrYnCW.mjs} +4 -4
- package/fesm2022/{acorex-modules-dashboard-management-acorex-modules-dashboard-management-DLOyCwM3.mjs.map → acorex-modules-dashboard-management-acorex-modules-dashboard-management-D2TrYnCW.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-dashboard-management-index-DlrkqIge.mjs → acorex-modules-dashboard-management-index-DAQNEq43.mjs} +2 -2
- package/fesm2022/{acorex-modules-dashboard-management-index-DlrkqIge.mjs.map → acorex-modules-dashboard-management-index-DAQNEq43.mjs.map} +1 -1
- package/fesm2022/acorex-modules-dashboard-management.mjs +1 -1
- package/fesm2022/acorex-modules-data-management.mjs +2 -1
- package/fesm2022/acorex-modules-data-management.mjs.map +1 -1
- package/fesm2022/acorex-modules-document-management.mjs.map +1 -1
- package/fesm2022/acorex-modules-help-desk-acorex-modules-help-desk-B8de7ifz.mjs.map +1 -1
- package/fesm2022/{acorex-modules-platform-management-acorex-modules-platform-management-SYgMvrE2.mjs → acorex-modules-platform-management-acorex-modules-platform-management-ilmoyxAw.mjs} +95 -4442
- package/fesm2022/acorex-modules-platform-management-acorex-modules-platform-management-ilmoyxAw.mjs.map +1 -0
- package/fesm2022/{acorex-modules-platform-management-menu-list.component-CKiFNjU0.mjs → acorex-modules-platform-management-menu-list.component-MJCUVTho.mjs} +2 -2
- package/fesm2022/{acorex-modules-platform-management-menu-list.component-CKiFNjU0.mjs.map → acorex-modules-platform-management-menu-list.component-MJCUVTho.mjs.map} +1 -1
- package/fesm2022/acorex-modules-platform-management.mjs +1 -1
- package/fesm2022/{acorex-modules-task-management-acorex-modules-task-management-Dfx7mO_y.mjs → acorex-modules-task-management-acorex-modules-task-management-Bv7Ye6d1.mjs} +2 -2
- package/fesm2022/{acorex-modules-task-management-acorex-modules-task-management-Dfx7mO_y.mjs.map → acorex-modules-task-management-acorex-modules-task-management-Bv7Ye6d1.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-task-management-task-board.page-eXpBudGO.mjs → acorex-modules-task-management-task-board.page-CfgeDnBx.mjs} +3 -3
- package/fesm2022/{acorex-modules-task-management-task-board.page-eXpBudGO.mjs.map → acorex-modules-task-management-task-board.page-CfgeDnBx.mjs.map} +1 -1
- package/fesm2022/acorex-modules-task-management.mjs +1 -1
- package/fesm2022/acorex-modules-workflow-management-acorex-modules-workflow-management-LJ8Bb-CT.mjs.map +1 -1
- package/fesm2022/acorex-modules-workflow-management-activity-command-configurator-widget-edit.component-BW6kK9Av.mjs.map +1 -1
- package/fesm2022/acorex-modules-workflow-management-index--D61tV-f.mjs.map +1 -1
- package/fesm2022/acorex-modules-workflow-management-index-DXIQw3Ao.mjs.map +1 -1
- package/fesm2022/acorex-modules-workflow-management-save-workflow-definition-activities.command-huamhFhc.mjs.map +1 -1
- package/fesm2022/acorex-modules-workflow-management-workflow-activity-instance-rows.utils-L8W4ogSI.mjs.map +1 -1
- package/fesm2022/acorex-modules-workflow-management-workflow-run-history-popup.component-FLqOdI2t.mjs.map +1 -1
- package/fesm2022/acorex-modules-workflow-management-workflow-run-history-visual-tab.component-3gnqTYdJ.mjs.map +1 -1
- package/package.json +2 -2
- package/types/acorex-modules-ai-management.d.ts +2 -2
- package/types/acorex-modules-content-management.d.ts +2 -1
- package/types/acorex-modules-data-management.d.ts +2 -1
- package/types/acorex-modules-notification-management.d.ts +2 -1
- package/types/acorex-modules-platform-management.d.ts +3 -137
- package/types/acorex-modules-workflow-management.d.ts +2 -1
- package/fesm2022/acorex-modules-assessment-management-questionnaire-viewer-popup.component-DYtzVNK8.mjs.map +0 -1
- package/fesm2022/acorex-modules-conversation-acorex-modules-conversation-p9c5_MMk.mjs.map +0 -1
- package/fesm2022/acorex-modules-platform-management-acorex-modules-platform-management-SYgMvrE2.mjs.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { AXPSettingsService, AXPMenuProviderService, AXPTokenDefinitionService, AXP_TOKEN_DEFINITION_PROVIDER, AXP_PROTECTED_ROUTE_GUARDS, AXP_MENU_MIDDLEWARE, AXP_MENU_PROVIDER, createAllQueryView,
|
|
3
|
-
import { AXPPlatformScope, AXPExpressionEvaluatorService, AXP_DISTRIBUTED_EVENT_LISTENER_PROVIDER, AXP_MODULE_MANIFEST_PROVIDER, AXP_FEATURE_DEFINITION_PROVIDER
|
|
4
|
-
import { AXPEntityService, AXP_ENTITY_DEFINITION_LOADER, entityMasterCrudActions,
|
|
1
|
+
import { AXP_PERMISSION_DEFINITION_PROVIDER } from '@acorex/platform/auth';
|
|
2
|
+
import { AXPSettingsService, AXPMenuProviderService, AXPTokenDefinitionService, AXP_TOKEN_DEFINITION_PROVIDER, AXP_PROTECTED_ROUTE_GUARDS, AXP_MENU_MIDDLEWARE, AXP_MENU_PROVIDER, createAllQueryView, AXPEntityCommandScope } from '@acorex/platform/common';
|
|
3
|
+
import { AXPPlatformScope, AXPExpressionEvaluatorService, AXP_DISTRIBUTED_EVENT_LISTENER_PROVIDER, AXP_MODULE_MANIFEST_PROVIDER, AXP_FEATURE_DEFINITION_PROVIDER } from '@acorex/platform/core';
|
|
4
|
+
import { AXPEntityService, AXP_ENTITY_DEFINITION_LOADER, entityMasterCrudActions, entityMasterRecordActions } from '@acorex/platform/layout/entity';
|
|
5
5
|
import { AXPRootLayoutComponent } from '@acorex/platform/themes/default';
|
|
6
6
|
import { provideCommandSetups, provideQuerySetups } from '@acorex/platform/runtime';
|
|
7
7
|
import * as i0 from '@angular/core';
|
|
@@ -17,8 +17,6 @@ import { AXPPopupLayoutBaseComponent, AXPPopupLayoutComponent, AXPPopupLayoutBas
|
|
|
17
17
|
import { AXDialogService } from '@acorex/components/dialog';
|
|
18
18
|
import { SwUpdate } from '@angular/service-worker';
|
|
19
19
|
import { AXPCommonMenuKeys, AXPWidgetsList } from '@acorex/modules/common';
|
|
20
|
-
import { AXPWidgetsCatalog, AXPWidgetGroupEnum } from '@acorex/platform/layout/widget-core';
|
|
21
|
-
import { AXPRelationshipCardinality, AXPRelationshipKind } from '@acorex/platform/domain';
|
|
22
20
|
import { AXPanViewDirective } from '@acorex/cdk/pan-view';
|
|
23
21
|
import * as i1$2 from '@acorex/components/button';
|
|
24
22
|
import { AXButtonModule } from '@acorex/components/button';
|
|
@@ -49,61 +47,6 @@ const RootConfig = {
|
|
|
49
47
|
title: `@${config.i18n}:tokens.entities.token.title`,
|
|
50
48
|
icon: 'fa-light fa-object-exclude',
|
|
51
49
|
},
|
|
52
|
-
moduleDefinition: {
|
|
53
|
-
name: 'ModuleDefinitions',
|
|
54
|
-
title: `@${config.i18n}:definitions.modules.title`,
|
|
55
|
-
icon: 'fa-light fa-cubes',
|
|
56
|
-
},
|
|
57
|
-
aggregateDefinition: {
|
|
58
|
-
name: 'AggregateDefinitions',
|
|
59
|
-
title: `@${config.i18n}:definitions.aggregates.title`,
|
|
60
|
-
icon: 'fa-light fa-layer-group',
|
|
61
|
-
},
|
|
62
|
-
entityDefinition: {
|
|
63
|
-
name: 'EntityDefinitions',
|
|
64
|
-
title: `@${config.i18n}:definitions.entities.title`,
|
|
65
|
-
icon: 'fa-light fa-database',
|
|
66
|
-
},
|
|
67
|
-
interfaceDefinition: {
|
|
68
|
-
name: 'InterfaceDefinitions',
|
|
69
|
-
title: `@${config.i18n}:definitions.interfaces.title`,
|
|
70
|
-
icon: 'fa-light fa-puzzle-piece',
|
|
71
|
-
},
|
|
72
|
-
pluginDefinition: {
|
|
73
|
-
name: 'PluginDefinitions',
|
|
74
|
-
title: `@${config.i18n}:definitions.plugins.title`,
|
|
75
|
-
icon: 'fa-light fa-plug',
|
|
76
|
-
},
|
|
77
|
-
relationDefinition: {
|
|
78
|
-
name: 'RelationDefinitions',
|
|
79
|
-
title: `@${config.i18n}:definitions.relations.title`,
|
|
80
|
-
icon: 'fa-light fa-link',
|
|
81
|
-
},
|
|
82
|
-
validationDefinition: {
|
|
83
|
-
name: 'ValidationDefinitions',
|
|
84
|
-
title: `@${config.i18n}:definitions.validations.title`,
|
|
85
|
-
icon: 'fa-light fa-check-double',
|
|
86
|
-
},
|
|
87
|
-
menuDefinition: {
|
|
88
|
-
name: 'MenuDefinitions',
|
|
89
|
-
title: `@${config.i18n}:definitions.menus.title`,
|
|
90
|
-
icon: 'fa-light fa-bars',
|
|
91
|
-
},
|
|
92
|
-
permissionGroupDefinition: {
|
|
93
|
-
name: 'PermissionGroupDefinitions',
|
|
94
|
-
title: `@${config.i18n}:definitions.permissionGroups.title`,
|
|
95
|
-
icon: 'fa-light fa-key',
|
|
96
|
-
},
|
|
97
|
-
commandDefinition: {
|
|
98
|
-
name: 'Commands',
|
|
99
|
-
title: `@${config.i18n}:definitions.commands.title`,
|
|
100
|
-
icon: 'fa-light fa-terminal',
|
|
101
|
-
},
|
|
102
|
-
queryDefinition: {
|
|
103
|
-
name: 'Queries',
|
|
104
|
-
title: `@${config.i18n}:definitions.queries.title`,
|
|
105
|
-
icon: 'fa-light fa-database',
|
|
106
|
-
},
|
|
107
50
|
},
|
|
108
51
|
};
|
|
109
52
|
|
|
@@ -124,61 +67,6 @@ class AXMEntityLoader {
|
|
|
124
67
|
resolve(tokenEntityFactory());
|
|
125
68
|
break;
|
|
126
69
|
}
|
|
127
|
-
case RootConfig.entities.moduleDefinition.name: {
|
|
128
|
-
const { moduleDefinitionEntityFactory } = await Promise.resolve().then(function () { return moduleDefinition_entity; });
|
|
129
|
-
resolve(moduleDefinitionEntityFactory());
|
|
130
|
-
break;
|
|
131
|
-
}
|
|
132
|
-
case RootConfig.entities.aggregateDefinition.name: {
|
|
133
|
-
const { aggregateDefinitionEntityFactory } = await Promise.resolve().then(function () { return aggregateDefinition_entity; });
|
|
134
|
-
resolve(aggregateDefinitionEntityFactory());
|
|
135
|
-
break;
|
|
136
|
-
}
|
|
137
|
-
// case RootConfig.entities.entityDefinition.name: {
|
|
138
|
-
// const { entityDefinitionEntityFactory } = await import('./entities');
|
|
139
|
-
// resolve(resolve(entityDefinitionEntityFactory());
|
|
140
|
-
// break;
|
|
141
|
-
// }
|
|
142
|
-
case RootConfig.entities.relationDefinition.name: {
|
|
143
|
-
const { relationDefinitionEntityFactory } = await Promise.resolve().then(function () { return index; });
|
|
144
|
-
resolve(relationDefinitionEntityFactory());
|
|
145
|
-
break;
|
|
146
|
-
}
|
|
147
|
-
case RootConfig.entities.interfaceDefinition.name: {
|
|
148
|
-
const { interfaceDefinitionEntityFactory } = await Promise.resolve().then(function () { return index; });
|
|
149
|
-
resolve(interfaceDefinitionEntityFactory());
|
|
150
|
-
break;
|
|
151
|
-
}
|
|
152
|
-
case RootConfig.entities.pluginDefinition.name: {
|
|
153
|
-
const { pluginDefinitionEntityFactory } = await Promise.resolve().then(function () { return index; });
|
|
154
|
-
resolve(pluginDefinitionEntityFactory());
|
|
155
|
-
break;
|
|
156
|
-
}
|
|
157
|
-
case RootConfig.entities.validationDefinition.name: {
|
|
158
|
-
const { validationDefinitionEntityFactory } = await Promise.resolve().then(function () { return index; });
|
|
159
|
-
resolve(validationDefinitionEntityFactory());
|
|
160
|
-
break;
|
|
161
|
-
}
|
|
162
|
-
case RootConfig.entities.menuDefinition.name: {
|
|
163
|
-
const { menuDefinitionEntityFactory } = await Promise.resolve().then(function () { return menuDefinition_entity; });
|
|
164
|
-
resolve(menuDefinitionEntityFactory());
|
|
165
|
-
break;
|
|
166
|
-
}
|
|
167
|
-
case RootConfig.entities.permissionGroupDefinition.name: {
|
|
168
|
-
const { permissionGroupDefinitionEntityFactory } = await Promise.resolve().then(function () { return permissionDefinition_entity; });
|
|
169
|
-
resolve(permissionGroupDefinitionEntityFactory());
|
|
170
|
-
break;
|
|
171
|
-
}
|
|
172
|
-
case RootConfig.entities.commandDefinition.name: {
|
|
173
|
-
const { commandDefinitionEntityFactory } = await Promise.resolve().then(function () { return command_entity; });
|
|
174
|
-
resolve(commandDefinitionEntityFactory());
|
|
175
|
-
break;
|
|
176
|
-
}
|
|
177
|
-
case RootConfig.entities.queryDefinition.name: {
|
|
178
|
-
const { queryDefinitionEntityFactory } = await Promise.resolve().then(function () { return query_entity; });
|
|
179
|
-
resolve(queryDefinitionEntityFactory());
|
|
180
|
-
break;
|
|
181
|
-
}
|
|
182
70
|
default:
|
|
183
71
|
resolve(null);
|
|
184
72
|
}
|
|
@@ -1639,18 +1527,6 @@ const AXPPlatformManagementMenuKeys = {
|
|
|
1639
1527
|
AdministrationGroup: 'administration:group',
|
|
1640
1528
|
Root: 'platform-management:menu',
|
|
1641
1529
|
Tokens: 'platform-management:menu:tokens',
|
|
1642
|
-
/** Parent menu for definition entities (modules, entities, interfaces, …) */
|
|
1643
|
-
Definitions: 'platform-management:menu:definitions',
|
|
1644
|
-
Modules: 'platform-management:menu:modules',
|
|
1645
|
-
Interfaces: 'platform-management:menu:interfaces',
|
|
1646
|
-
Relations: 'platform-management:menu:relations',
|
|
1647
|
-
Plugins: 'platform-management:menu:plugins',
|
|
1648
|
-
Validations: 'platform-management:menu:validations',
|
|
1649
|
-
PermissionGroupDefinitions: 'platform-management:menu:permission-group-definitions',
|
|
1650
|
-
Commands: 'platform-management:menu:commands',
|
|
1651
|
-
Queries: 'platform-management:menu:queries',
|
|
1652
|
-
/** @deprecated Use Definitions > Entities instead */
|
|
1653
|
-
EntityDefinitions: 'platform-management:menu:entity-definitions',
|
|
1654
1530
|
Glossary: 'platform-management:menu:glossary',
|
|
1655
1531
|
UserMenuManagement: 'platform-management:user:menus',
|
|
1656
1532
|
MenuManagement: 'platform-management:menus',
|
|
@@ -1674,25 +1550,16 @@ const AXPPlatformManagementPermissionKeys = {
|
|
|
1674
1550
|
Delete: 'PlatformManagement:Permission:MenuManagement.Delete',
|
|
1675
1551
|
Create: 'PlatformManagement:Permission:MenuManagement.Create',
|
|
1676
1552
|
},
|
|
1677
|
-
EntityDefinition: {
|
|
1678
|
-
Management: 'PlatformManagement:Permission:EntityDefinition.Management',
|
|
1679
|
-
View: 'PlatformManagement:Permission:EntityDefinition.View',
|
|
1680
|
-
Edit: 'PlatformManagement:Permission:EntityDefinition.Edit',
|
|
1681
|
-
Delete: 'PlatformManagement:Permission:EntityDefinition.Delete',
|
|
1682
|
-
Create: 'PlatformManagement:Permission:EntityDefinition.Create',
|
|
1683
|
-
},
|
|
1684
1553
|
},
|
|
1685
1554
|
};
|
|
1686
1555
|
|
|
1687
1556
|
class AXMMenuProvider {
|
|
1688
1557
|
constructor() {
|
|
1689
1558
|
this.entityService = inject(AXPEntityService);
|
|
1690
|
-
this.sessionService = inject(AXPSessionService);
|
|
1691
1559
|
}
|
|
1692
1560
|
async provide(context) {
|
|
1693
1561
|
const scope = RootConfig.config.i18n;
|
|
1694
1562
|
const moduleName = RootConfig.module.name;
|
|
1695
|
-
// Add Tokens and Definitions (Entities, Plugins, Interfaces, …) under Data and Content
|
|
1696
1563
|
context.find(AXPCommonMenuKeys.DataAndContent).addItems([
|
|
1697
1564
|
{
|
|
1698
1565
|
name: AXPPlatformManagementMenuKeys.Tokens,
|
|
@@ -1705,107 +1572,6 @@ class AXMMenuProvider {
|
|
|
1705
1572
|
permissions: [AXPPlatformManagementPermissionKeys.PlatformManagement.Token.Management],
|
|
1706
1573
|
},
|
|
1707
1574
|
},
|
|
1708
|
-
{
|
|
1709
|
-
name: AXPPlatformManagementMenuKeys.Definitions,
|
|
1710
|
-
priority: 15,
|
|
1711
|
-
text: `@${scope}:definitions.terms.title`,
|
|
1712
|
-
icon: 'fa-light fa-file-code',
|
|
1713
|
-
type: 'menu',
|
|
1714
|
-
policy: {
|
|
1715
|
-
features: [moduleName],
|
|
1716
|
-
permissions: [AXPPlatformManagementPermissionKeys.PlatformManagement.EntityDefinition.Management],
|
|
1717
|
-
},
|
|
1718
|
-
children: [
|
|
1719
|
-
{
|
|
1720
|
-
name: AXPPlatformManagementMenuKeys.Modules,
|
|
1721
|
-
priority: 1,
|
|
1722
|
-
text: `@${scope}:definitions.modules.title`,
|
|
1723
|
-
path: this.entityService.createPath(moduleName, RootConfig.entities.moduleDefinition.name),
|
|
1724
|
-
icon: RootConfig.entities.moduleDefinition.icon,
|
|
1725
|
-
policy: {
|
|
1726
|
-
features: [moduleName],
|
|
1727
|
-
permissions: [AXPPlatformManagementPermissionKeys.PlatformManagement.EntityDefinition.Management],
|
|
1728
|
-
},
|
|
1729
|
-
},
|
|
1730
|
-
{
|
|
1731
|
-
name: AXPPlatformManagementMenuKeys.Relations,
|
|
1732
|
-
priority: 2,
|
|
1733
|
-
text: `@${scope}:definitions.relations.title`,
|
|
1734
|
-
path: this.entityService.createPath(moduleName, RootConfig.entities.relationDefinition.name),
|
|
1735
|
-
icon: RootConfig.entities.relationDefinition.icon,
|
|
1736
|
-
policy: {
|
|
1737
|
-
features: [moduleName],
|
|
1738
|
-
permissions: [AXPPlatformManagementPermissionKeys.PlatformManagement.EntityDefinition.Management],
|
|
1739
|
-
},
|
|
1740
|
-
},
|
|
1741
|
-
{
|
|
1742
|
-
name: AXPPlatformManagementMenuKeys.Plugins,
|
|
1743
|
-
priority: 3,
|
|
1744
|
-
text: `@${scope}:definitions.plugins.title`,
|
|
1745
|
-
path: this.entityService.createPath(moduleName, RootConfig.entities.pluginDefinition.name),
|
|
1746
|
-
icon: RootConfig.entities.pluginDefinition.icon,
|
|
1747
|
-
policy: {
|
|
1748
|
-
features: [moduleName],
|
|
1749
|
-
permissions: [AXPPlatformManagementPermissionKeys.PlatformManagement.EntityDefinition.Management],
|
|
1750
|
-
},
|
|
1751
|
-
},
|
|
1752
|
-
{
|
|
1753
|
-
name: AXPPlatformManagementMenuKeys.Interfaces,
|
|
1754
|
-
priority: 4,
|
|
1755
|
-
text: `@${scope}:definitions.interfaces.title`,
|
|
1756
|
-
path: this.entityService.createPath(moduleName, RootConfig.entities.interfaceDefinition.name),
|
|
1757
|
-
icon: RootConfig.entities.interfaceDefinition.icon,
|
|
1758
|
-
policy: {
|
|
1759
|
-
features: [moduleName],
|
|
1760
|
-
permissions: [AXPPlatformManagementPermissionKeys.PlatformManagement.EntityDefinition.Management],
|
|
1761
|
-
},
|
|
1762
|
-
},
|
|
1763
|
-
{
|
|
1764
|
-
name: AXPPlatformManagementMenuKeys.Validations,
|
|
1765
|
-
priority: 5,
|
|
1766
|
-
text: `@${scope}:definitions.validations.title`,
|
|
1767
|
-
path: this.entityService.createPath(moduleName, RootConfig.entities.validationDefinition.name),
|
|
1768
|
-
icon: RootConfig.entities.validationDefinition.icon,
|
|
1769
|
-
policy: {
|
|
1770
|
-
features: [moduleName],
|
|
1771
|
-
permissions: [AXPPlatformManagementPermissionKeys.PlatformManagement.EntityDefinition.Management],
|
|
1772
|
-
},
|
|
1773
|
-
},
|
|
1774
|
-
{
|
|
1775
|
-
name: AXPPlatformManagementMenuKeys.PermissionGroupDefinitions,
|
|
1776
|
-
priority: 6,
|
|
1777
|
-
text: `@${scope}:definitions.permissionGroups.title`,
|
|
1778
|
-
path: this.entityService.createPath(moduleName, RootConfig.entities.permissionGroupDefinition.name),
|
|
1779
|
-
icon: RootConfig.entities.permissionGroupDefinition.icon,
|
|
1780
|
-
policy: {
|
|
1781
|
-
features: [moduleName],
|
|
1782
|
-
permissions: [AXPPlatformManagementPermissionKeys.PlatformManagement.EntityDefinition.Management],
|
|
1783
|
-
},
|
|
1784
|
-
},
|
|
1785
|
-
{
|
|
1786
|
-
name: AXPPlatformManagementMenuKeys.Commands,
|
|
1787
|
-
priority: 7,
|
|
1788
|
-
text: `@${scope}:definitions.commands.title`,
|
|
1789
|
-
path: this.entityService.createPath(moduleName, RootConfig.entities.commandDefinition.name),
|
|
1790
|
-
icon: RootConfig.entities.commandDefinition.icon,
|
|
1791
|
-
policy: {
|
|
1792
|
-
features: [moduleName],
|
|
1793
|
-
permissions: [AXPPlatformManagementPermissionKeys.PlatformManagement.EntityDefinition.Management],
|
|
1794
|
-
},
|
|
1795
|
-
},
|
|
1796
|
-
{
|
|
1797
|
-
name: AXPPlatformManagementMenuKeys.Queries,
|
|
1798
|
-
priority: 8,
|
|
1799
|
-
text: `@${scope}:definitions.queries.title`,
|
|
1800
|
-
path: this.entityService.createPath(moduleName, RootConfig.entities.queryDefinition.name),
|
|
1801
|
-
icon: RootConfig.entities.queryDefinition.icon,
|
|
1802
|
-
policy: {
|
|
1803
|
-
features: [moduleName],
|
|
1804
|
-
permissions: [AXPPlatformManagementPermissionKeys.PlatformManagement.EntityDefinition.Management],
|
|
1805
|
-
},
|
|
1806
|
-
},
|
|
1807
|
-
],
|
|
1808
|
-
},
|
|
1809
1575
|
]);
|
|
1810
1576
|
}
|
|
1811
1577
|
}
|
|
@@ -1834,13 +1600,6 @@ class AXMPermissionDefinitionProvider {
|
|
|
1834
1600
|
.addChild(keys.MenuManagement.Delete, await this.translateService.translateAsync('@platform-management:menu-management.permissions.menu-management.actions.delete.title'), await this.translateService.translateAsync('@platform-management:menu-management.permissions.menu-management.actions.delete.description'))
|
|
1835
1601
|
.endPermission()
|
|
1836
1602
|
//
|
|
1837
|
-
.addPermission(keys.EntityDefinition.Management, await this.translateService.translateAsync('@platform-management:entity-definitions.permissions.manage.title'), await this.translateService.translateAsync('@platform-management:entity-definitions.permissions.manage.description'))
|
|
1838
|
-
.addChild(keys.EntityDefinition.View, await this.translateService.translateAsync('@platform-management:entity-definitions.permissions.view.title'), await this.translateService.translateAsync('@platform-management:entity-definitions.permissions.view.description'))
|
|
1839
|
-
.addChild(keys.EntityDefinition.Create, await this.translateService.translateAsync('@platform-management:entity-definitions.permissions.create.title'), await this.translateService.translateAsync('@platform-management:entity-definitions.permissions.create.description'))
|
|
1840
|
-
.addChild(keys.EntityDefinition.Edit, await this.translateService.translateAsync('@platform-management:entity-definitions.permissions.edit.title'), await this.translateService.translateAsync('@platform-management:entity-definitions.permissions.edit.description'))
|
|
1841
|
-
.addChild(keys.EntityDefinition.Delete, await this.translateService.translateAsync('@platform-management:entity-definitions.permissions.delete.title'), await this.translateService.translateAsync('@platform-management:entity-definitions.permissions.delete.description'))
|
|
1842
|
-
.endPermission()
|
|
1843
|
-
//
|
|
1844
1603
|
.endGroup();
|
|
1845
1604
|
}
|
|
1846
1605
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXMPermissionDefinitionProvider, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
@@ -1861,7 +1620,7 @@ function routesFactory() {
|
|
|
1861
1620
|
children: [
|
|
1862
1621
|
{
|
|
1863
1622
|
path: '',
|
|
1864
|
-
loadComponent: () => import('./acorex-modules-platform-management-menu-list.component-
|
|
1623
|
+
loadComponent: () => import('./acorex-modules-platform-management-menu-list.component-MJCUVTho.mjs').then((c) => c.AXMMenuListComponent),
|
|
1865
1624
|
data: { reuse: true },
|
|
1866
1625
|
},
|
|
1867
1626
|
],
|
|
@@ -2011,311 +1770,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
2011
1770
|
}]
|
|
2012
1771
|
}] });
|
|
2013
1772
|
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
function normalizeModuleSegment(s) {
|
|
2017
|
-
return s?.trim().toLowerCase().replace(/-/g, '') ?? '';
|
|
2018
|
-
}
|
|
2019
|
-
function countEntities(def) {
|
|
2020
|
-
const entities = def['entities'];
|
|
2021
|
-
if (entities && typeof entities === 'object' && !Array.isArray(entities)) {
|
|
2022
|
-
return Object.keys(entities).length;
|
|
2023
|
-
}
|
|
2024
|
-
return 0;
|
|
2025
|
-
}
|
|
2026
|
-
/**
|
|
2027
|
-
* Reads the first `equal` / `eq` condition value for a field from a nested filter tree
|
|
2028
|
-
* (related list passes a wrapper with `filters: [...]`).
|
|
2029
|
-
*/
|
|
2030
|
-
function extractEqualFilterFieldValue(filter, field) {
|
|
2031
|
-
if (!filter) {
|
|
2032
|
-
return undefined;
|
|
2033
|
-
}
|
|
2034
|
-
if (filter.filters?.length) {
|
|
2035
|
-
for (const f of filter.filters) {
|
|
2036
|
-
const v = extractEqualFilterFieldValue(f, field);
|
|
2037
|
-
if (v !== undefined) {
|
|
2038
|
-
return v;
|
|
2039
|
-
}
|
|
2040
|
-
}
|
|
2041
|
-
return undefined;
|
|
2042
|
-
}
|
|
2043
|
-
const op = filter.operator?.type;
|
|
2044
|
-
if (filter.field === field && (op === 'equal' || String(op) === 'eq')) {
|
|
2045
|
-
const v = filter.value;
|
|
2046
|
-
return v != null && String(v).length > 0 ? String(v) : undefined;
|
|
2047
|
-
}
|
|
2048
|
-
return undefined;
|
|
2049
|
-
}
|
|
2050
|
-
//#endregion
|
|
2051
|
-
async function aggregateDefinitionEntityFactory() {
|
|
2052
|
-
// const crud = injector.get(AXP_ENTITY_DEFINITION_CRUD_SERVICE) as AXPEntityDefinitionCrudService | null;
|
|
2053
|
-
const entityDef = {
|
|
2054
|
-
module: RootConfig.module.name,
|
|
2055
|
-
name: RootConfig.entities.aggregateDefinition.name,
|
|
2056
|
-
title: RootConfig.entities.aggregateDefinition.title,
|
|
2057
|
-
icon: RootConfig.entities.aggregateDefinition.icon,
|
|
2058
|
-
formats: {
|
|
2059
|
-
individual: 'Aggregate Definition',
|
|
2060
|
-
plural: 'Aggregate Definitions',
|
|
2061
|
-
},
|
|
2062
|
-
plugins: [],
|
|
2063
|
-
relatedEntities: [],
|
|
2064
|
-
// relatedEntities: crud
|
|
2065
|
-
// ? [
|
|
2066
|
-
// {
|
|
2067
|
-
// entity: `${RootConfig.module.name}.${RootConfig.entities.entityDefinition.name}`,
|
|
2068
|
-
// title: `${I18N}.pages.entities`,
|
|
2069
|
-
// icon: RootConfig.entities.entityDefinition.icon,
|
|
2070
|
-
// columns: ['name', 'module', 'aggregateRootId'],
|
|
2071
|
-
// conditions: [
|
|
2072
|
-
// {
|
|
2073
|
-
// name: 'aggregateRootId',
|
|
2074
|
-
// operator: { type: 'equal' },
|
|
2075
|
-
// value: '{{ context.eval("id") }}',
|
|
2076
|
-
// },
|
|
2077
|
-
// ],
|
|
2078
|
-
// layout: { type: 'page-list', position: 'after', order: 10 },
|
|
2079
|
-
// },
|
|
2080
|
-
// ]
|
|
2081
|
-
// : [],
|
|
2082
|
-
groups: [{ id: 'overview', title: `${I18N$9}.pages.overview` }],
|
|
2083
|
-
properties: [
|
|
2084
|
-
{
|
|
2085
|
-
name: 'id',
|
|
2086
|
-
title: '@general:terms.common.id',
|
|
2087
|
-
groupId: 'overview',
|
|
2088
|
-
schema: {
|
|
2089
|
-
dataType: 'string',
|
|
2090
|
-
interface: { type: AXPWidgetsCatalog.text, options: { disabled: true } },
|
|
2091
|
-
},
|
|
2092
|
-
options: { filter: { advance: { enabled: true }, inline: { enabled: true } }, sort: { enabled: true } },
|
|
2093
|
-
},
|
|
2094
|
-
{
|
|
2095
|
-
name: 'module',
|
|
2096
|
-
title: `${I18N$9}.fields.module`,
|
|
2097
|
-
groupId: 'overview',
|
|
2098
|
-
schema: {
|
|
2099
|
-
dataType: 'string',
|
|
2100
|
-
interface: {
|
|
2101
|
-
type: AXPWidgetsCatalog.select,
|
|
2102
|
-
options: {
|
|
2103
|
-
dataSource: AXPPlatformCoreDataSourceKeys.ModuleManifests,
|
|
2104
|
-
valueField: 'id',
|
|
2105
|
-
textField: 'title',
|
|
2106
|
-
allowSearch: true,
|
|
2107
|
-
hasClearButton: true,
|
|
2108
|
-
},
|
|
2109
|
-
},
|
|
2110
|
-
},
|
|
2111
|
-
options: { filter: { advance: { enabled: true }, inline: { enabled: true } }, sort: { enabled: true } },
|
|
2112
|
-
},
|
|
2113
|
-
{
|
|
2114
|
-
name: 'name',
|
|
2115
|
-
title: `${I18N$9}.fields.aggregate-name`,
|
|
2116
|
-
groupId: 'overview',
|
|
2117
|
-
schema: {
|
|
2118
|
-
dataType: 'string',
|
|
2119
|
-
interface: { type: AXPWidgetsCatalog.text },
|
|
2120
|
-
},
|
|
2121
|
-
validations: [{ rule: 'required' }],
|
|
2122
|
-
options: { filter: { advance: { enabled: true }, inline: { enabled: true } }, sort: { enabled: true } },
|
|
2123
|
-
},
|
|
2124
|
-
{
|
|
2125
|
-
name: 'title',
|
|
2126
|
-
title: '@general:terms.common.title',
|
|
2127
|
-
groupId: 'overview',
|
|
2128
|
-
schema: {
|
|
2129
|
-
dataType: 'string',
|
|
2130
|
-
interface: { type: AXPWidgetsCatalog.text },
|
|
2131
|
-
},
|
|
2132
|
-
options: { filter: { advance: { enabled: true }, inline: { enabled: true } }, sort: { enabled: true } },
|
|
2133
|
-
},
|
|
2134
|
-
{
|
|
2135
|
-
name: 'entityCount',
|
|
2136
|
-
title: `${I18N$9}.fields.entity-count`,
|
|
2137
|
-
groupId: 'overview',
|
|
2138
|
-
schema: {
|
|
2139
|
-
dataType: 'number',
|
|
2140
|
-
interface: { type: AXPWidgetsCatalog.text, options: { disabled: true } },
|
|
2141
|
-
},
|
|
2142
|
-
},
|
|
2143
|
-
],
|
|
2144
|
-
columns: [{ name: 'id' }, { name: 'module' }, { name: 'name' }, { name: 'title' }, { name: 'entityCount' }],
|
|
2145
|
-
// commands: crud
|
|
2146
|
-
// ? {
|
|
2147
|
-
// create: {
|
|
2148
|
-
// execute: async (data: Record<string, unknown>) => {
|
|
2149
|
-
// const moduleId = String(data['module'] ?? '').trim();
|
|
2150
|
-
// const aggName = String(data['name'] ?? '').trim();
|
|
2151
|
-
// if (!moduleId || !aggName) {
|
|
2152
|
-
// throw new Error('Module and aggregate name are required');
|
|
2153
|
-
// }
|
|
2154
|
-
// const title = String(data['title'] ?? aggName).trim();
|
|
2155
|
-
// const id = `${normalizeModuleSegment(moduleId)}.${normalizeModuleSegment(aggName)}`;
|
|
2156
|
-
// const definition: Record<string, unknown> = {
|
|
2157
|
-
// name: aggName,
|
|
2158
|
-
// title,
|
|
2159
|
-
// entities: {},
|
|
2160
|
-
// validations: [],
|
|
2161
|
-
// actions: [],
|
|
2162
|
-
// };
|
|
2163
|
-
// await crud.createAggregate(id, definition);
|
|
2164
|
-
// return { id };
|
|
2165
|
-
// },
|
|
2166
|
-
// },
|
|
2167
|
-
// update: {
|
|
2168
|
-
// execute: async (data: Record<string, unknown>) => {
|
|
2169
|
-
// const id = String(data['id'] ?? '').trim();
|
|
2170
|
-
// if (!id) {
|
|
2171
|
-
// throw new Error('Aggregate id is required');
|
|
2172
|
-
// }
|
|
2173
|
-
// const existing = await crud.getAggregate(id);
|
|
2174
|
-
// if (!existing) {
|
|
2175
|
-
// throw new Error(`Aggregate not found: ${id}`);
|
|
2176
|
-
// }
|
|
2177
|
-
// const definition: Record<string, unknown> = {
|
|
2178
|
-
// ...existing,
|
|
2179
|
-
// name: String(data['name'] ?? existing['name']).trim(),
|
|
2180
|
-
// title: String(data['title'] ?? existing['title'] ?? '').trim(),
|
|
2181
|
-
// };
|
|
2182
|
-
// await crud.updateAggregate(id, definition);
|
|
2183
|
-
// },
|
|
2184
|
-
// },
|
|
2185
|
-
// delete: {
|
|
2186
|
-
// execute: async (id: string) => {
|
|
2187
|
-
// await crud.deleteAggregate(id);
|
|
2188
|
-
// },
|
|
2189
|
-
// },
|
|
2190
|
-
// }
|
|
2191
|
-
// : undefined,
|
|
2192
|
-
// queries: crud
|
|
2193
|
-
// ? {
|
|
2194
|
-
// byKey: {
|
|
2195
|
-
// execute: async (id: string) => {
|
|
2196
|
-
// const def = await crud.getAggregate(id);
|
|
2197
|
-
// if (!def) {
|
|
2198
|
-
// return null;
|
|
2199
|
-
// }
|
|
2200
|
-
// const parts = id.split('.');
|
|
2201
|
-
// const moduleNorm = parts[0] ?? '';
|
|
2202
|
-
// const modules = await crud.listModules();
|
|
2203
|
-
// const manifestRegistry = injector.get(AXPModuleManifestRegistry);
|
|
2204
|
-
// await manifestRegistry.initialize();
|
|
2205
|
-
// const match =
|
|
2206
|
-
// modules.find((m) => normalizeModuleSegment(m.name) === moduleNorm) ??
|
|
2207
|
-
// manifestRegistry.getAll().find((m) => normalizeModuleSegment(m.name) === moduleNorm);
|
|
2208
|
-
// const moduleId = match?.name ?? moduleNorm;
|
|
2209
|
-
// return {
|
|
2210
|
-
// id,
|
|
2211
|
-
// name: def['name'],
|
|
2212
|
-
// title: def['title'] ?? def['name'],
|
|
2213
|
-
// module: moduleId,
|
|
2214
|
-
// entityCount: countEntities(def),
|
|
2215
|
-
// };
|
|
2216
|
-
// },
|
|
2217
|
-
// type: AXPEntityQueryType.Single,
|
|
2218
|
-
// },
|
|
2219
|
-
// list: {
|
|
2220
|
-
// execute: async (request?: AXPQueryRequest) => {
|
|
2221
|
-
// const manifestRegistry = injector.get(AXPModuleManifestRegistry);
|
|
2222
|
-
// await manifestRegistry.initialize();
|
|
2223
|
-
// const modules = await crud.listModules();
|
|
2224
|
-
// const byNorm = new Map(modules.map((m) => [normalizeModuleSegment(m.name), m.name] as const));
|
|
2225
|
-
// const manifests = manifestRegistry.getAll();
|
|
2226
|
-
// const moduleIdFromNorm = (norm: string): string =>
|
|
2227
|
-
// byNorm.get(norm) ??
|
|
2228
|
-
// manifests.find((m) => normalizeModuleSegment(m.name) === norm)?.name ??
|
|
2229
|
-
// norm;
|
|
2230
|
-
//
|
|
2231
|
-
// const moduleEqual = extractEqualFilterFieldValue(request?.filter, 'module');
|
|
2232
|
-
// const list = await crud.listAggregates(moduleEqual ? { module: moduleEqual } : undefined);
|
|
2233
|
-
// let items = list.map((row) => {
|
|
2234
|
-
// const parts = row.id.split('.');
|
|
2235
|
-
// const moduleNorm = parts[0] ?? '';
|
|
2236
|
-
// const moduleId = moduleEqual ?? moduleIdFromNorm(moduleNorm);
|
|
2237
|
-
// const def = row.definition;
|
|
2238
|
-
// return {
|
|
2239
|
-
// id: row.id,
|
|
2240
|
-
// name: def['name'],
|
|
2241
|
-
// title: def['title'] ?? def['name'],
|
|
2242
|
-
// module: moduleId,
|
|
2243
|
-
// entityCount: countEntities(def),
|
|
2244
|
-
// };
|
|
2245
|
-
// });
|
|
2246
|
-
// if (request?.filter) {
|
|
2247
|
-
// items = applyFilterArray(items, [request.filter], request.filter.logic ?? 'and');
|
|
2248
|
-
// }
|
|
2249
|
-
// if (request?.sort?.length) {
|
|
2250
|
-
// items = applySortArray(items, request.sort);
|
|
2251
|
-
// }
|
|
2252
|
-
// const total = items.length;
|
|
2253
|
-
// const skip = request?.skip ?? 0;
|
|
2254
|
-
// const take = request?.take ?? total;
|
|
2255
|
-
// return { items: items.slice(skip, skip + take), total };
|
|
2256
|
-
// },
|
|
2257
|
-
// type: AXPEntityQueryType.List,
|
|
2258
|
-
// },
|
|
2259
|
-
// }
|
|
2260
|
-
// : undefined,
|
|
2261
|
-
interfaces: {
|
|
2262
|
-
master: {
|
|
2263
|
-
create: {
|
|
2264
|
-
sections: [{ id: 'overview' }],
|
|
2265
|
-
properties: [
|
|
2266
|
-
{ name: 'module', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
2267
|
-
{ name: 'name', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
2268
|
-
{ name: 'title', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
2269
|
-
],
|
|
2270
|
-
},
|
|
2271
|
-
update: {
|
|
2272
|
-
sections: [{ id: 'overview' }],
|
|
2273
|
-
properties: [
|
|
2274
|
-
{ name: 'id', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
2275
|
-
{ name: 'name', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
2276
|
-
{ name: 'title', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
2277
|
-
],
|
|
2278
|
-
},
|
|
2279
|
-
single: {
|
|
2280
|
-
title: '{{title}}',
|
|
2281
|
-
sections: [{ id: 'overview' }],
|
|
2282
|
-
properties: [
|
|
2283
|
-
{ name: 'id', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
2284
|
-
{ name: 'name', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
2285
|
-
{ name: 'title', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
2286
|
-
{ name: 'entityCount', layout: { positions: { lg: { colSpan: 4 } } } },
|
|
2287
|
-
],
|
|
2288
|
-
actions: [],
|
|
2289
|
-
},
|
|
2290
|
-
list: {
|
|
2291
|
-
actions: [...entityMasterCrudActions()],
|
|
2292
|
-
views: [createAllQueryView()],
|
|
2293
|
-
},
|
|
2294
|
-
},
|
|
2295
|
-
},
|
|
2296
|
-
};
|
|
2297
|
-
return entityDef;
|
|
2298
|
-
}
|
|
2299
|
-
|
|
2300
|
-
var aggregateDefinition_entity = /*#__PURE__*/Object.freeze({
|
|
2301
|
-
__proto__: null,
|
|
2302
|
-
aggregateDefinitionEntityFactory: aggregateDefinitionEntityFactory
|
|
2303
|
-
});
|
|
2304
|
-
|
|
2305
|
-
//#region ---- Constants ----
|
|
2306
|
-
const I18N$8 = '@platform-management:definitions.commands.detail';
|
|
2307
|
-
//#endregion
|
|
2308
|
-
//#region ---- Entity factory ----
|
|
2309
|
-
async function commandDefinitionEntityFactory() {
|
|
2310
|
-
// const crud = injector.get(AXP_ENTITY_DEFINITION_CRUD_SERVICE) as AXPEntityDefinitionCrudService | null;
|
|
1773
|
+
async function tokenEntityFactory() {
|
|
1774
|
+
const i18n = RootConfig.config.i18n;
|
|
2311
1775
|
const entityDef = {
|
|
2312
1776
|
module: RootConfig.module.name,
|
|
2313
|
-
name: RootConfig.entities.
|
|
2314
|
-
title: RootConfig.entities.
|
|
2315
|
-
icon: RootConfig.entities.
|
|
1777
|
+
name: RootConfig.entities.token.name,
|
|
1778
|
+
title: RootConfig.entities.token.title,
|
|
1779
|
+
icon: RootConfig.entities.token.icon,
|
|
2316
1780
|
formats: {
|
|
2317
|
-
individual: '
|
|
2318
|
-
plural: '
|
|
1781
|
+
individual: 'Token',
|
|
1782
|
+
plural: 'Tokens',
|
|
2319
1783
|
},
|
|
2320
1784
|
plugins: [
|
|
2321
1785
|
{
|
|
@@ -2325,28 +1789,24 @@ async function commandDefinitionEntityFactory() {
|
|
|
2325
1789
|
scope: 'global',
|
|
2326
1790
|
},
|
|
2327
1791
|
},
|
|
1792
|
+
{
|
|
1793
|
+
name: 'category',
|
|
1794
|
+
options: {
|
|
1795
|
+
appearance: { icon: true, color: true },
|
|
1796
|
+
},
|
|
1797
|
+
},
|
|
1798
|
+
{ name: 'history' },
|
|
1799
|
+
{ name: 'compare' },
|
|
2328
1800
|
],
|
|
2329
1801
|
relatedEntities: [],
|
|
2330
1802
|
groups: [
|
|
2331
1803
|
{
|
|
2332
1804
|
id: 'basic-info',
|
|
2333
|
-
title:
|
|
2334
|
-
},
|
|
2335
|
-
{
|
|
2336
|
-
id: 'command-description',
|
|
2337
|
-
title: `${I18N$8}.sections.description`,
|
|
2338
|
-
},
|
|
2339
|
-
{
|
|
2340
|
-
id: 'catalog-metadata',
|
|
2341
|
-
title: `${I18N$8}.sections.catalog-metadata`,
|
|
2342
|
-
},
|
|
2343
|
-
{
|
|
2344
|
-
id: 'input-parameters',
|
|
2345
|
-
title: `${I18N$8}.sections.input-parameters`,
|
|
1805
|
+
title: `@${i18n}:tokens.entities.token.groups.basic-info`,
|
|
2346
1806
|
},
|
|
2347
1807
|
{
|
|
2348
|
-
id: '
|
|
2349
|
-
title:
|
|
1808
|
+
id: 'value',
|
|
1809
|
+
title: `@${i18n}:tokens.entities.token.groups.value`,
|
|
2350
1810
|
},
|
|
2351
1811
|
],
|
|
2352
1812
|
properties: [
|
|
@@ -2356,13 +1816,15 @@ async function commandDefinitionEntityFactory() {
|
|
|
2356
1816
|
groupId: 'basic-info',
|
|
2357
1817
|
schema: {
|
|
2358
1818
|
dataType: 'string',
|
|
2359
|
-
readonly: true,
|
|
2360
1819
|
interface: {
|
|
2361
|
-
type:
|
|
2362
|
-
options: {},
|
|
1820
|
+
type: AXPWidgetsList.Editors.TextBox,
|
|
2363
1821
|
},
|
|
2364
1822
|
},
|
|
2365
|
-
validations: [
|
|
1823
|
+
validations: [
|
|
1824
|
+
{
|
|
1825
|
+
rule: 'required',
|
|
1826
|
+
},
|
|
1827
|
+
],
|
|
2366
1828
|
options: {
|
|
2367
1829
|
filter: {
|
|
2368
1830
|
inline: {
|
|
@@ -2375,3639 +1837,96 @@ async function commandDefinitionEntityFactory() {
|
|
|
2375
1837
|
},
|
|
2376
1838
|
},
|
|
2377
1839
|
{
|
|
2378
|
-
name: '
|
|
2379
|
-
title: '@general:terms.common.
|
|
2380
|
-
groupId: '
|
|
1840
|
+
name: 'title',
|
|
1841
|
+
title: '@general:terms.common.title',
|
|
1842
|
+
groupId: 'basic-info',
|
|
2381
1843
|
schema: {
|
|
2382
1844
|
dataType: 'string',
|
|
2383
1845
|
interface: {
|
|
2384
|
-
type:
|
|
2385
|
-
options: {},
|
|
1846
|
+
type: AXPWidgetsList.Editors.TextBox,
|
|
2386
1847
|
},
|
|
2387
1848
|
},
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
title: `${I18N$8}.fields.catalog-title`,
|
|
2392
|
-
groupId: 'catalog-metadata',
|
|
2393
|
-
schema: {
|
|
2394
|
-
dataType: 'string',
|
|
2395
|
-
readonly: true,
|
|
2396
|
-
interface: {
|
|
2397
|
-
type: AXPWidgetsCatalog.text,
|
|
2398
|
-
options: {},
|
|
1849
|
+
validations: [
|
|
1850
|
+
{
|
|
1851
|
+
rule: 'required',
|
|
2399
1852
|
},
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
schema: {
|
|
2407
|
-
dataType: 'string',
|
|
2408
|
-
readonly: true,
|
|
2409
|
-
interface: {
|
|
2410
|
-
type: AXPWidgetsCatalog.text,
|
|
2411
|
-
options: {},
|
|
1853
|
+
],
|
|
1854
|
+
options: {
|
|
1855
|
+
filter: {
|
|
1856
|
+
inline: {
|
|
1857
|
+
enabled: true,
|
|
1858
|
+
},
|
|
2412
1859
|
},
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
{
|
|
2416
|
-
name: 'outcomesDefinitionJson',
|
|
2417
|
-
title: `${I18N$8}.fields.outcomes-definition`,
|
|
2418
|
-
groupId: 'catalog-metadata',
|
|
2419
|
-
schema: {
|
|
2420
|
-
dataType: 'string',
|
|
2421
|
-
readonly: true,
|
|
2422
|
-
interface: {
|
|
2423
|
-
type: AXPWidgetsCatalog.largeText,
|
|
2424
|
-
options: {},
|
|
1860
|
+
sort: {
|
|
1861
|
+
enabled: true,
|
|
2425
1862
|
},
|
|
2426
1863
|
},
|
|
2427
1864
|
},
|
|
2428
1865
|
{
|
|
2429
|
-
name: '
|
|
2430
|
-
title:
|
|
2431
|
-
groupId: '
|
|
1866
|
+
name: 'description',
|
|
1867
|
+
title: '@general:terms.common.description',
|
|
1868
|
+
groupId: 'basic-info',
|
|
2432
1869
|
schema: {
|
|
2433
1870
|
dataType: 'string',
|
|
2434
|
-
readonly: true,
|
|
2435
1871
|
interface: {
|
|
2436
|
-
type:
|
|
2437
|
-
options: {},
|
|
1872
|
+
type: AXPWidgetsList.Editors.LargeTextBox,
|
|
2438
1873
|
},
|
|
2439
1874
|
},
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
schema: {
|
|
2446
|
-
dataType: 'string',
|
|
2447
|
-
readonly: true,
|
|
2448
|
-
interface: {
|
|
2449
|
-
type: AXPWidgetsCatalog.text,
|
|
2450
|
-
options: {},
|
|
1875
|
+
options: {
|
|
1876
|
+
filter: {
|
|
1877
|
+
advance: {
|
|
1878
|
+
enabled: true,
|
|
1879
|
+
},
|
|
2451
1880
|
},
|
|
2452
1881
|
},
|
|
2453
1882
|
},
|
|
2454
1883
|
{
|
|
2455
|
-
name: '
|
|
2456
|
-
title:
|
|
2457
|
-
groupId: '
|
|
1884
|
+
name: 'kind',
|
|
1885
|
+
title: `@${i18n}:tokens.entities.token.fields.kind.title`,
|
|
1886
|
+
groupId: 'value',
|
|
2458
1887
|
schema: {
|
|
2459
|
-
dataType: '
|
|
1888
|
+
dataType: 'string',
|
|
2460
1889
|
interface: {
|
|
2461
|
-
type: AXPWidgetsList.
|
|
1890
|
+
type: AXPWidgetsList.Editors.SelectBox,
|
|
2462
1891
|
options: {
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
{
|
|
2468
|
-
{
|
|
2469
|
-
{
|
|
2470
|
-
|
|
2471
|
-
title: `${I18N$8}.fields.param-schema`,
|
|
2472
|
-
width: '280px',
|
|
2473
|
-
schema: {
|
|
2474
|
-
name: 'interface',
|
|
2475
|
-
title: 'Schema',
|
|
2476
|
-
interface: {
|
|
2477
|
-
name: AXPWidgetsList.Advanced.WidgetFieldConfigurator,
|
|
2478
|
-
title: 'Schema',
|
|
2479
|
-
options: {
|
|
2480
|
-
fieldName: "{{ context.eval('name') }}",
|
|
2481
|
-
fieldTitle: "{{ context.eval('title') }}",
|
|
2482
|
-
},
|
|
2483
|
-
},
|
|
2484
|
-
},
|
|
2485
|
-
},
|
|
2486
|
-
{ name: 'description', title: `${I18N$8}.fields.param-description` },
|
|
1892
|
+
valueField: 'value',
|
|
1893
|
+
textField: 'title',
|
|
1894
|
+
dataSource: [
|
|
1895
|
+
{ title: 'Static', value: 'Static' },
|
|
1896
|
+
{ title: 'Context', value: 'Context' },
|
|
1897
|
+
{ title: 'Event', value: 'Event' },
|
|
1898
|
+
{ title: 'Computed', value: 'Computed' },
|
|
1899
|
+
{ title: 'Secret', value: 'Secret' },
|
|
2487
1900
|
],
|
|
1901
|
+
direction: 'horizontal',
|
|
1902
|
+
multiple: false,
|
|
1903
|
+
},
|
|
1904
|
+
},
|
|
1905
|
+
},
|
|
1906
|
+
validations: [
|
|
1907
|
+
{
|
|
1908
|
+
rule: 'required',
|
|
1909
|
+
},
|
|
1910
|
+
],
|
|
1911
|
+
options: {
|
|
1912
|
+
filter: {
|
|
1913
|
+
advance: {
|
|
1914
|
+
enabled: true,
|
|
2488
1915
|
},
|
|
2489
1916
|
},
|
|
1917
|
+
sort: {
|
|
1918
|
+
enabled: true,
|
|
1919
|
+
},
|
|
2490
1920
|
},
|
|
2491
1921
|
},
|
|
2492
1922
|
{
|
|
2493
|
-
name: '
|
|
2494
|
-
title:
|
|
2495
|
-
groupId: '
|
|
1923
|
+
name: 'dataType',
|
|
1924
|
+
title: `@${i18n}:tokens.entities.token.fields.data-type.title`,
|
|
1925
|
+
groupId: 'value',
|
|
2496
1926
|
schema: {
|
|
2497
|
-
dataType: '
|
|
1927
|
+
dataType: 'string',
|
|
2498
1928
|
interface: {
|
|
2499
|
-
type: AXPWidgetsList.
|
|
2500
|
-
options: {
|
|
2501
|
-
paging: false,
|
|
2502
|
-
showIndex: true,
|
|
2503
|
-
showHeader: true,
|
|
2504
|
-
columns: [
|
|
2505
|
-
{ name: 'name', title: `${I18N$8}.fields.param-name`, width: '160px' },
|
|
2506
|
-
{ name: 'title', title: `${I18N$8}.fields.param-title`, width: '200px' },
|
|
2507
|
-
{
|
|
2508
|
-
name: 'schema',
|
|
2509
|
-
title: `${I18N$8}.fields.param-schema`,
|
|
2510
|
-
width: '280px',
|
|
2511
|
-
schema: {
|
|
2512
|
-
name: 'interface',
|
|
2513
|
-
title: 'Schema',
|
|
2514
|
-
interface: {
|
|
2515
|
-
name: AXPWidgetsList.Advanced.WidgetFieldConfigurator,
|
|
2516
|
-
title: 'Schema',
|
|
2517
|
-
options: {
|
|
2518
|
-
fieldName: "{{ context.eval('name') }}",
|
|
2519
|
-
fieldTitle: "{{ context.eval('title') }}",
|
|
2520
|
-
},
|
|
2521
|
-
},
|
|
2522
|
-
},
|
|
2523
|
-
},
|
|
2524
|
-
{ name: 'description', title: `${I18N$8}.fields.param-description` },
|
|
2525
|
-
],
|
|
2526
|
-
},
|
|
2527
|
-
},
|
|
2528
|
-
},
|
|
2529
|
-
},
|
|
2530
|
-
],
|
|
2531
|
-
columns: [
|
|
2532
|
-
{ name: 'name' },
|
|
2533
|
-
{ name: 'catalogTitle' },
|
|
2534
|
-
{ name: 'description' },
|
|
2535
|
-
],
|
|
2536
|
-
// commands: crud
|
|
2537
|
-
// ? {
|
|
2538
|
-
// update: {
|
|
2539
|
-
// execute: async (data: Record<string, unknown>) => {
|
|
2540
|
-
// const id = (data['id'] as string) ?? (data['name'] as string);
|
|
2541
|
-
// const existing = await crud.getCommand(id);
|
|
2542
|
-
// const inputSource =
|
|
2543
|
-
// data['inputOptionDefinitions'] !== undefined
|
|
2544
|
-
// ? data['inputOptionDefinitions']
|
|
2545
|
-
// : existing?.inputOptionDefinitions;
|
|
2546
|
-
// const outputSource =
|
|
2547
|
-
// data['outputOptionDefinitions'] !== undefined
|
|
2548
|
-
// ? data['outputOptionDefinitions']
|
|
2549
|
-
// : existing?.outputOptionDefinitions;
|
|
2550
|
-
// const inputOptionDefinitions = mapEntityFieldRowsInterfaceToDomain(
|
|
2551
|
-
// inputSource,
|
|
2552
|
-
// ) as AXPPropertyDefinition[];
|
|
2553
|
-
// const outputOptionDefinitions = mapEntityFieldRowsInterfaceToDomain(
|
|
2554
|
-
// outputSource,
|
|
2555
|
-
// ) as AXPPropertyDefinition[];
|
|
2556
|
-
// await crud.updateCommand(id, {
|
|
2557
|
-
// name: (data['name'] as string) ?? existing?.name ?? '',
|
|
2558
|
-
// active: existing?.active ?? true,
|
|
2559
|
-
// description:
|
|
2560
|
-
// data['description'] !== undefined
|
|
2561
|
-
// ? (data['description'] as string | undefined)
|
|
2562
|
-
// : existing?.description,
|
|
2563
|
-
// inputOptionDefinitions,
|
|
2564
|
-
// outputOptionDefinitions,
|
|
2565
|
-
// catalogTitle: existing?.catalogTitle,
|
|
2566
|
-
// executionMode: existing?.executionMode,
|
|
2567
|
-
// outcomesDefinitionJson: existing?.outcomesDefinitionJson,
|
|
2568
|
-
// aiMetadataJson: existing?.aiMetadataJson,
|
|
2569
|
-
// capabilities: existing?.capabilities,
|
|
2570
|
-
// });
|
|
2571
|
-
// },
|
|
2572
|
-
// },
|
|
2573
|
-
// }
|
|
2574
|
-
// : undefined,
|
|
2575
|
-
// queries: crud
|
|
2576
|
-
// ? {
|
|
2577
|
-
// byKey: {
|
|
2578
|
-
// execute: async (id: string) => {
|
|
2579
|
-
// const def = await crud.getCommand(id);
|
|
2580
|
-
// if (!def) return null;
|
|
2581
|
-
// return {
|
|
2582
|
-
// id,
|
|
2583
|
-
// name: def.name,
|
|
2584
|
-
// description: def.description,
|
|
2585
|
-
// catalogTitle: def.catalogTitle ?? '',
|
|
2586
|
-
// executionMode: def.executionMode ?? '',
|
|
2587
|
-
// outcomesDefinitionJson: def.outcomesDefinitionJson ?? '',
|
|
2588
|
-
// aiMetadataJson: def.aiMetadataJson ?? '',
|
|
2589
|
-
// capabilities: (def.capabilities ?? []).join(', '),
|
|
2590
|
-
// inputOptionDefinitions: mapEntityFieldRowsInterfaceForForm(def.inputOptionDefinitions ?? []),
|
|
2591
|
-
// outputOptionDefinitions: mapEntityFieldRowsInterfaceForForm(def.outputOptionDefinitions ?? []),
|
|
2592
|
-
// };
|
|
2593
|
-
// },
|
|
2594
|
-
// type: AXPEntityQueryType.Single,
|
|
2595
|
-
// },
|
|
2596
|
-
// list: {
|
|
2597
|
-
// execute: async (request?: AXPQueryRequest) => {
|
|
2598
|
-
// const list = await crud.listCommands();
|
|
2599
|
-
// let items = list.map(({ id, definition }) => ({
|
|
2600
|
-
// id,
|
|
2601
|
-
// name: definition.name,
|
|
2602
|
-
// description: definition.description ?? '',
|
|
2603
|
-
// catalogTitle: definition.catalogTitle ?? '',
|
|
2604
|
-
// active: definition.active,
|
|
2605
|
-
// aiMetadataJson: definition.aiMetadataJson ?? '',
|
|
2606
|
-
// capabilities: (definition.capabilities ?? []).join(', '),
|
|
2607
|
-
// inputOptionDefinitions: definition.inputOptionDefinitions ?? [],
|
|
2608
|
-
// }));
|
|
2609
|
-
// if (request?.filter) {
|
|
2610
|
-
// items = applyFilterArray(items, [request.filter], request.filter.logic ?? 'and');
|
|
2611
|
-
// }
|
|
2612
|
-
// if (request?.sort?.length) {
|
|
2613
|
-
// items = applySortArray(items, request.sort);
|
|
2614
|
-
// }
|
|
2615
|
-
// const total = items.length;
|
|
2616
|
-
// const skip = request?.skip ?? 0;
|
|
2617
|
-
// const take = request?.take ?? total;
|
|
2618
|
-
// const pagedItems = items.slice(skip, skip + take);
|
|
2619
|
-
// return { items: pagedItems, total };
|
|
2620
|
-
// },
|
|
2621
|
-
// type: AXPEntityQueryType.List,
|
|
2622
|
-
// },
|
|
2623
|
-
// }
|
|
2624
|
-
// : undefined,
|
|
2625
|
-
interfaces: {
|
|
2626
|
-
master: {
|
|
2627
|
-
single: {
|
|
2628
|
-
title: '{{name}}',
|
|
2629
|
-
sections: [
|
|
2630
|
-
{ id: 'basic-info' },
|
|
2631
|
-
{ id: 'command-description' },
|
|
2632
|
-
{ id: 'catalog-metadata' },
|
|
2633
|
-
{ id: 'input-parameters' },
|
|
2634
|
-
{ id: 'output-parameters' },
|
|
2635
|
-
],
|
|
2636
|
-
properties: [
|
|
2637
|
-
{
|
|
2638
|
-
name: 'name',
|
|
2639
|
-
layout: {
|
|
2640
|
-
positions: {
|
|
2641
|
-
lg: {
|
|
2642
|
-
colSpan: 12,
|
|
2643
|
-
},
|
|
2644
|
-
},
|
|
2645
|
-
},
|
|
2646
|
-
},
|
|
2647
|
-
{
|
|
2648
|
-
name: 'description',
|
|
2649
|
-
layout: {
|
|
2650
|
-
positions: {
|
|
2651
|
-
lg: {
|
|
2652
|
-
colSpan: 12,
|
|
2653
|
-
},
|
|
2654
|
-
},
|
|
2655
|
-
},
|
|
2656
|
-
},
|
|
2657
|
-
{
|
|
2658
|
-
name: 'catalogTitle',
|
|
2659
|
-
layout: {
|
|
2660
|
-
positions: {
|
|
2661
|
-
lg: {
|
|
2662
|
-
colSpan: 12,
|
|
2663
|
-
},
|
|
2664
|
-
},
|
|
2665
|
-
},
|
|
2666
|
-
},
|
|
2667
|
-
{
|
|
2668
|
-
name: 'executionMode',
|
|
2669
|
-
layout: {
|
|
2670
|
-
positions: {
|
|
2671
|
-
lg: {
|
|
2672
|
-
colSpan: 12,
|
|
2673
|
-
},
|
|
2674
|
-
},
|
|
2675
|
-
},
|
|
2676
|
-
},
|
|
2677
|
-
{
|
|
2678
|
-
name: 'outcomesDefinitionJson',
|
|
2679
|
-
layout: {
|
|
2680
|
-
positions: {
|
|
2681
|
-
lg: {
|
|
2682
|
-
colSpan: 12,
|
|
2683
|
-
},
|
|
2684
|
-
},
|
|
2685
|
-
},
|
|
2686
|
-
},
|
|
2687
|
-
{
|
|
2688
|
-
name: 'aiMetadataJson',
|
|
2689
|
-
layout: {
|
|
2690
|
-
positions: {
|
|
2691
|
-
lg: {
|
|
2692
|
-
colSpan: 12,
|
|
2693
|
-
},
|
|
2694
|
-
},
|
|
2695
|
-
},
|
|
2696
|
-
},
|
|
2697
|
-
{
|
|
2698
|
-
name: 'capabilities',
|
|
2699
|
-
layout: {
|
|
2700
|
-
positions: {
|
|
2701
|
-
lg: {
|
|
2702
|
-
colSpan: 12,
|
|
2703
|
-
},
|
|
2704
|
-
},
|
|
2705
|
-
},
|
|
2706
|
-
},
|
|
2707
|
-
{
|
|
2708
|
-
name: 'inputOptionDefinitions',
|
|
2709
|
-
layout: {
|
|
2710
|
-
positions: {
|
|
2711
|
-
lg: {
|
|
2712
|
-
colSpan: 12,
|
|
2713
|
-
},
|
|
2714
|
-
},
|
|
2715
|
-
label: {
|
|
2716
|
-
visible: false,
|
|
2717
|
-
},
|
|
2718
|
-
},
|
|
2719
|
-
},
|
|
2720
|
-
{
|
|
2721
|
-
name: 'outputOptionDefinitions',
|
|
2722
|
-
layout: {
|
|
2723
|
-
positions: {
|
|
2724
|
-
lg: {
|
|
2725
|
-
colSpan: 12,
|
|
2726
|
-
},
|
|
2727
|
-
},
|
|
2728
|
-
label: {
|
|
2729
|
-
visible: false,
|
|
2730
|
-
},
|
|
2731
|
-
},
|
|
2732
|
-
},
|
|
2733
|
-
],
|
|
2734
|
-
actions: [entityMasterEditAction()],
|
|
2735
|
-
},
|
|
2736
|
-
list: {
|
|
2737
|
-
actions: [
|
|
2738
|
-
...entityMasterCrudActions({
|
|
2739
|
-
create: false,
|
|
2740
|
-
delete: false,
|
|
2741
|
-
view: true,
|
|
2742
|
-
edit: true,
|
|
2743
|
-
}),
|
|
2744
|
-
],
|
|
2745
|
-
views: [createAllQueryView()],
|
|
2746
|
-
},
|
|
2747
|
-
},
|
|
2748
|
-
},
|
|
2749
|
-
};
|
|
2750
|
-
return entityDef;
|
|
2751
|
-
}
|
|
2752
|
-
//#endregion
|
|
2753
|
-
|
|
2754
|
-
var command_entity = /*#__PURE__*/Object.freeze({
|
|
2755
|
-
__proto__: null,
|
|
2756
|
-
commandDefinitionEntityFactory: commandDefinitionEntityFactory
|
|
2757
|
-
});
|
|
2758
|
-
|
|
2759
|
-
//#region ---- Constants ----
|
|
2760
|
-
const I18N$7 = '@platform-management:definitions.queries.detail';
|
|
2761
|
-
//#endregion
|
|
2762
|
-
//#region ---- Entity factory ----
|
|
2763
|
-
async function queryDefinitionEntityFactory() {
|
|
2764
|
-
// const crud = injector.get(AXP_ENTITY_DEFINITION_CRUD_SERVICE) as AXPEntityDefinitionCrudService | null;
|
|
2765
|
-
const entityDef = {
|
|
2766
|
-
module: RootConfig.module.name,
|
|
2767
|
-
name: RootConfig.entities.queryDefinition.name,
|
|
2768
|
-
title: RootConfig.entities.queryDefinition.title,
|
|
2769
|
-
icon: RootConfig.entities.queryDefinition.icon,
|
|
2770
|
-
formats: {
|
|
2771
|
-
individual: 'Query',
|
|
2772
|
-
plural: 'Queries',
|
|
2773
|
-
},
|
|
2774
|
-
plugins: [
|
|
2775
|
-
{
|
|
2776
|
-
name: 'unique-fields',
|
|
2777
|
-
options: {
|
|
2778
|
-
fields: 'name',
|
|
2779
|
-
scope: 'global',
|
|
2780
|
-
},
|
|
2781
|
-
},
|
|
2782
|
-
],
|
|
2783
|
-
relatedEntities: [],
|
|
2784
|
-
groups: [
|
|
2785
|
-
{
|
|
2786
|
-
id: 'basic-info',
|
|
2787
|
-
title: `${I18N$7}.sections.basic-info`,
|
|
2788
|
-
},
|
|
2789
|
-
{
|
|
2790
|
-
id: 'query-description',
|
|
2791
|
-
title: `${I18N$7}.sections.description`,
|
|
2792
|
-
},
|
|
2793
|
-
{
|
|
2794
|
-
id: 'catalog-metadata',
|
|
2795
|
-
title: `${I18N$7}.sections.catalog-metadata`,
|
|
2796
|
-
},
|
|
2797
|
-
{
|
|
2798
|
-
id: 'input-parameters',
|
|
2799
|
-
title: `${I18N$7}.sections.input-parameters`,
|
|
2800
|
-
},
|
|
2801
|
-
{
|
|
2802
|
-
id: 'output-parameters',
|
|
2803
|
-
title: `${I18N$7}.sections.output-parameters`,
|
|
2804
|
-
},
|
|
2805
|
-
],
|
|
2806
|
-
properties: [
|
|
2807
|
-
{
|
|
2808
|
-
name: 'name',
|
|
2809
|
-
title: '@general:terms.common.name',
|
|
2810
|
-
groupId: 'basic-info',
|
|
2811
|
-
schema: {
|
|
2812
|
-
dataType: 'string',
|
|
2813
|
-
readonly: true,
|
|
2814
|
-
interface: {
|
|
2815
|
-
type: AXPWidgetsCatalog.text,
|
|
2816
|
-
options: {},
|
|
2817
|
-
},
|
|
2818
|
-
},
|
|
2819
|
-
validations: [{ rule: 'required' }],
|
|
2820
|
-
options: {
|
|
2821
|
-
filter: {
|
|
2822
|
-
inline: {
|
|
2823
|
-
enabled: true,
|
|
2824
|
-
},
|
|
2825
|
-
},
|
|
2826
|
-
sort: {
|
|
2827
|
-
enabled: true,
|
|
2828
|
-
},
|
|
2829
|
-
},
|
|
2830
|
-
},
|
|
2831
|
-
{
|
|
2832
|
-
name: 'description',
|
|
2833
|
-
title: '@general:terms.common.description',
|
|
2834
|
-
groupId: 'query-description',
|
|
2835
|
-
schema: {
|
|
2836
|
-
dataType: 'string',
|
|
2837
|
-
interface: {
|
|
2838
|
-
type: AXPWidgetsCatalog.largeText,
|
|
2839
|
-
options: {},
|
|
2840
|
-
},
|
|
2841
|
-
},
|
|
2842
|
-
},
|
|
2843
|
-
{
|
|
2844
|
-
name: 'catalogTitle',
|
|
2845
|
-
title: `${I18N$7}.fields.catalog-title`,
|
|
2846
|
-
groupId: 'catalog-metadata',
|
|
2847
|
-
schema: {
|
|
2848
|
-
dataType: 'string',
|
|
2849
|
-
readonly: true,
|
|
2850
|
-
interface: {
|
|
2851
|
-
type: AXPWidgetsCatalog.text,
|
|
2852
|
-
options: {},
|
|
2853
|
-
},
|
|
2854
|
-
},
|
|
2855
|
-
},
|
|
2856
|
-
{
|
|
2857
|
-
name: 'executionMode',
|
|
2858
|
-
title: `${I18N$7}.fields.execution-mode`,
|
|
2859
|
-
groupId: 'catalog-metadata',
|
|
2860
|
-
schema: {
|
|
2861
|
-
dataType: 'string',
|
|
2862
|
-
readonly: true,
|
|
2863
|
-
interface: {
|
|
2864
|
-
type: AXPWidgetsCatalog.text,
|
|
2865
|
-
options: {},
|
|
2866
|
-
},
|
|
2867
|
-
},
|
|
2868
|
-
},
|
|
2869
|
-
{
|
|
2870
|
-
name: 'capabilities',
|
|
2871
|
-
title: `${I18N$7}.fields.capabilities`,
|
|
2872
|
-
groupId: 'catalog-metadata',
|
|
2873
|
-
schema: {
|
|
2874
|
-
dataType: 'string',
|
|
2875
|
-
readonly: true,
|
|
2876
|
-
interface: {
|
|
2877
|
-
type: AXPWidgetsCatalog.text,
|
|
2878
|
-
options: {},
|
|
2879
|
-
},
|
|
2880
|
-
},
|
|
2881
|
-
},
|
|
2882
|
-
{
|
|
2883
|
-
name: 'aiMetadataJson',
|
|
2884
|
-
title: `${I18N$7}.fields.ai-metadata`,
|
|
2885
|
-
groupId: 'catalog-metadata',
|
|
2886
|
-
schema: {
|
|
2887
|
-
dataType: 'string',
|
|
2888
|
-
readonly: true,
|
|
2889
|
-
interface: {
|
|
2890
|
-
type: AXPWidgetsCatalog.largeText,
|
|
2891
|
-
options: {},
|
|
2892
|
-
},
|
|
2893
|
-
},
|
|
2894
|
-
},
|
|
2895
|
-
{
|
|
2896
|
-
name: 'inputOptionDefinitions',
|
|
2897
|
-
title: `${I18N$7}.pages.input-parameters`,
|
|
2898
|
-
groupId: 'input-parameters',
|
|
2899
|
-
schema: {
|
|
2900
|
-
dataType: 'array',
|
|
2901
|
-
interface: {
|
|
2902
|
-
type: AXPWidgetsList.Advanced.DataList,
|
|
2903
|
-
options: {
|
|
2904
|
-
paging: false,
|
|
2905
|
-
showIndex: true,
|
|
2906
|
-
showHeader: true,
|
|
2907
|
-
columns: [
|
|
2908
|
-
{ name: 'name', title: `${I18N$7}.fields.param-name`, width: '160px' },
|
|
2909
|
-
{ name: 'title', title: `${I18N$7}.fields.param-title`, width: '200px' },
|
|
2910
|
-
{
|
|
2911
|
-
name: 'schema',
|
|
2912
|
-
title: `${I18N$7}.fields.param-schema`,
|
|
2913
|
-
width: '280px',
|
|
2914
|
-
schema: {
|
|
2915
|
-
name: 'interface',
|
|
2916
|
-
title: 'Schema',
|
|
2917
|
-
interface: {
|
|
2918
|
-
name: AXPWidgetsList.Advanced.WidgetFieldConfigurator,
|
|
2919
|
-
title: 'Schema',
|
|
2920
|
-
options: {
|
|
2921
|
-
fieldName: "{{ context.eval('name') }}",
|
|
2922
|
-
fieldTitle: "{{ context.eval('title') }}",
|
|
2923
|
-
},
|
|
2924
|
-
},
|
|
2925
|
-
},
|
|
2926
|
-
},
|
|
2927
|
-
{ name: 'description', title: `${I18N$7}.fields.param-description` },
|
|
2928
|
-
],
|
|
2929
|
-
},
|
|
2930
|
-
},
|
|
2931
|
-
},
|
|
2932
|
-
},
|
|
2933
|
-
{
|
|
2934
|
-
name: 'outputOptionDefinitions',
|
|
2935
|
-
title: `${I18N$7}.pages.output-parameters`,
|
|
2936
|
-
groupId: 'output-parameters',
|
|
2937
|
-
schema: {
|
|
2938
|
-
dataType: 'array',
|
|
2939
|
-
interface: {
|
|
2940
|
-
type: AXPWidgetsList.Advanced.DataList,
|
|
2941
|
-
options: {
|
|
2942
|
-
paging: false,
|
|
2943
|
-
showIndex: true,
|
|
2944
|
-
showHeader: true,
|
|
2945
|
-
columns: [
|
|
2946
|
-
{ name: 'name', title: `${I18N$7}.fields.param-name`, width: '160px' },
|
|
2947
|
-
{ name: 'title', title: `${I18N$7}.fields.param-title`, width: '200px' },
|
|
2948
|
-
{
|
|
2949
|
-
name: 'schema',
|
|
2950
|
-
title: `${I18N$7}.fields.param-schema`,
|
|
2951
|
-
width: '280px',
|
|
2952
|
-
schema: {
|
|
2953
|
-
name: 'interface',
|
|
2954
|
-
title: 'Schema',
|
|
2955
|
-
interface: {
|
|
2956
|
-
name: AXPWidgetsList.Advanced.WidgetFieldConfigurator,
|
|
2957
|
-
title: 'Schema',
|
|
2958
|
-
options: {
|
|
2959
|
-
fieldName: "{{ context.eval('name') }}",
|
|
2960
|
-
fieldTitle: "{{ context.eval('title') }}",
|
|
2961
|
-
},
|
|
2962
|
-
},
|
|
2963
|
-
},
|
|
2964
|
-
},
|
|
2965
|
-
{ name: 'description', title: `${I18N$7}.fields.param-description` },
|
|
2966
|
-
],
|
|
2967
|
-
},
|
|
2968
|
-
},
|
|
2969
|
-
},
|
|
2970
|
-
},
|
|
2971
|
-
],
|
|
2972
|
-
columns: [
|
|
2973
|
-
{ name: 'name' },
|
|
2974
|
-
{ name: 'catalogTitle' },
|
|
2975
|
-
{ name: 'description' },
|
|
2976
|
-
],
|
|
2977
|
-
// commands: crud
|
|
2978
|
-
// ? {
|
|
2979
|
-
// update: {
|
|
2980
|
-
// execute: async (data: Record<string, unknown>) => {
|
|
2981
|
-
// const id = (data['id'] as string) ?? (data['name'] as string);
|
|
2982
|
-
// const existing = await crud.getQuery(id);
|
|
2983
|
-
// const inputSource =
|
|
2984
|
-
// data['inputOptionDefinitions'] !== undefined
|
|
2985
|
-
// ? data['inputOptionDefinitions']
|
|
2986
|
-
// : existing?.inputOptionDefinitions;
|
|
2987
|
-
// const outputSource =
|
|
2988
|
-
// data['outputOptionDefinitions'] !== undefined
|
|
2989
|
-
// ? data['outputOptionDefinitions']
|
|
2990
|
-
// : existing?.outputOptionDefinitions;
|
|
2991
|
-
// const inputOptionDefinitions = mapEntityFieldRowsInterfaceToDomain(
|
|
2992
|
-
// inputSource,
|
|
2993
|
-
// ) as AXPPropertyDefinition[];
|
|
2994
|
-
// const outputOptionDefinitions = mapEntityFieldRowsInterfaceToDomain(
|
|
2995
|
-
// outputSource,
|
|
2996
|
-
// ) as AXPPropertyDefinition[];
|
|
2997
|
-
// await crud.updateQuery(id, {
|
|
2998
|
-
// name: (data['name'] as string) ?? existing?.name ?? '',
|
|
2999
|
-
// active: existing?.active ?? true,
|
|
3000
|
-
// description:
|
|
3001
|
-
// data['description'] !== undefined
|
|
3002
|
-
// ? (data['description'] as string | undefined)
|
|
3003
|
-
// : existing?.description,
|
|
3004
|
-
// inputOptionDefinitions,
|
|
3005
|
-
// outputOptionDefinitions,
|
|
3006
|
-
// catalogTitle: existing?.catalogTitle,
|
|
3007
|
-
// executionMode: existing?.executionMode,
|
|
3008
|
-
// aiMetadataJson: existing?.aiMetadataJson,
|
|
3009
|
-
// capabilities: existing?.capabilities,
|
|
3010
|
-
// });
|
|
3011
|
-
// },
|
|
3012
|
-
// },
|
|
3013
|
-
// }
|
|
3014
|
-
// : undefined,
|
|
3015
|
-
// queries: crud
|
|
3016
|
-
// ? {
|
|
3017
|
-
// byKey: {
|
|
3018
|
-
// execute: async (id: string) => {
|
|
3019
|
-
// const def = await crud.getQuery(id);
|
|
3020
|
-
// if (!def) return null;
|
|
3021
|
-
// return {
|
|
3022
|
-
// id,
|
|
3023
|
-
// name: def.name,
|
|
3024
|
-
// description: def.description,
|
|
3025
|
-
// catalogTitle: def.catalogTitle ?? '',
|
|
3026
|
-
// executionMode: def.executionMode ?? '',
|
|
3027
|
-
// capabilities: (def.capabilities ?? []).join(', '),
|
|
3028
|
-
// aiMetadataJson: def.aiMetadataJson ?? '',
|
|
3029
|
-
// inputOptionDefinitions: mapEntityFieldRowsInterfaceForForm(def.inputOptionDefinitions ?? []),
|
|
3030
|
-
// outputOptionDefinitions: mapEntityFieldRowsInterfaceForForm(def.outputOptionDefinitions ?? []),
|
|
3031
|
-
// };
|
|
3032
|
-
// },
|
|
3033
|
-
// type: AXPEntityQueryType.Single,
|
|
3034
|
-
// },
|
|
3035
|
-
// list: {
|
|
3036
|
-
// execute: async (request?: AXPQueryRequest) => {
|
|
3037
|
-
// const list = await crud.listQueries();
|
|
3038
|
-
// let items = list.map(({ id, definition }) => ({
|
|
3039
|
-
// id,
|
|
3040
|
-
// name: definition.name,
|
|
3041
|
-
// description: definition.description ?? '',
|
|
3042
|
-
// catalogTitle: definition.catalogTitle ?? '',
|
|
3043
|
-
// active: definition.active,
|
|
3044
|
-
// capabilities: (definition.capabilities ?? []).join(', '),
|
|
3045
|
-
// aiMetadataJson: definition.aiMetadataJson ?? '',
|
|
3046
|
-
// inputOptionDefinitions: definition.inputOptionDefinitions ?? [],
|
|
3047
|
-
// }));
|
|
3048
|
-
// if (request?.filter) {
|
|
3049
|
-
// items = applyFilterArray(items, [request.filter], request.filter.logic ?? 'and');
|
|
3050
|
-
// }
|
|
3051
|
-
// if (request?.sort?.length) {
|
|
3052
|
-
// items = applySortArray(items, request.sort);
|
|
3053
|
-
// }
|
|
3054
|
-
// const total = items.length;
|
|
3055
|
-
// const skip = request?.skip ?? 0;
|
|
3056
|
-
// const take = request?.take ?? total;
|
|
3057
|
-
// const pagedItems = items.slice(skip, skip + take);
|
|
3058
|
-
// return { items: pagedItems, total };
|
|
3059
|
-
// },
|
|
3060
|
-
// type: AXPEntityQueryType.List,
|
|
3061
|
-
// },
|
|
3062
|
-
// }
|
|
3063
|
-
// : undefined,
|
|
3064
|
-
interfaces: {
|
|
3065
|
-
master: {
|
|
3066
|
-
single: {
|
|
3067
|
-
title: '{{name}}',
|
|
3068
|
-
sections: [
|
|
3069
|
-
{ id: 'basic-info' },
|
|
3070
|
-
{ id: 'query-description' },
|
|
3071
|
-
{ id: 'catalog-metadata' },
|
|
3072
|
-
{ id: 'input-parameters' },
|
|
3073
|
-
{ id: 'output-parameters' },
|
|
3074
|
-
],
|
|
3075
|
-
properties: [
|
|
3076
|
-
{
|
|
3077
|
-
name: 'name',
|
|
3078
|
-
layout: {
|
|
3079
|
-
positions: {
|
|
3080
|
-
lg: {
|
|
3081
|
-
colSpan: 12,
|
|
3082
|
-
},
|
|
3083
|
-
},
|
|
3084
|
-
},
|
|
3085
|
-
},
|
|
3086
|
-
{
|
|
3087
|
-
name: 'description',
|
|
3088
|
-
layout: {
|
|
3089
|
-
positions: {
|
|
3090
|
-
lg: {
|
|
3091
|
-
colSpan: 12,
|
|
3092
|
-
},
|
|
3093
|
-
},
|
|
3094
|
-
},
|
|
3095
|
-
},
|
|
3096
|
-
{
|
|
3097
|
-
name: 'catalogTitle',
|
|
3098
|
-
layout: {
|
|
3099
|
-
positions: {
|
|
3100
|
-
lg: {
|
|
3101
|
-
colSpan: 12,
|
|
3102
|
-
},
|
|
3103
|
-
},
|
|
3104
|
-
},
|
|
3105
|
-
},
|
|
3106
|
-
{
|
|
3107
|
-
name: 'executionMode',
|
|
3108
|
-
layout: {
|
|
3109
|
-
positions: {
|
|
3110
|
-
lg: {
|
|
3111
|
-
colSpan: 12,
|
|
3112
|
-
},
|
|
3113
|
-
},
|
|
3114
|
-
},
|
|
3115
|
-
},
|
|
3116
|
-
{
|
|
3117
|
-
name: 'capabilities',
|
|
3118
|
-
layout: {
|
|
3119
|
-
positions: {
|
|
3120
|
-
lg: {
|
|
3121
|
-
colSpan: 12,
|
|
3122
|
-
},
|
|
3123
|
-
},
|
|
3124
|
-
},
|
|
3125
|
-
},
|
|
3126
|
-
{
|
|
3127
|
-
name: 'aiMetadataJson',
|
|
3128
|
-
layout: {
|
|
3129
|
-
positions: {
|
|
3130
|
-
lg: {
|
|
3131
|
-
colSpan: 12,
|
|
3132
|
-
},
|
|
3133
|
-
},
|
|
3134
|
-
},
|
|
3135
|
-
},
|
|
3136
|
-
{
|
|
3137
|
-
name: 'inputOptionDefinitions',
|
|
3138
|
-
layout: {
|
|
3139
|
-
positions: {
|
|
3140
|
-
lg: {
|
|
3141
|
-
colSpan: 12,
|
|
3142
|
-
},
|
|
3143
|
-
},
|
|
3144
|
-
label: {
|
|
3145
|
-
visible: false,
|
|
3146
|
-
},
|
|
3147
|
-
},
|
|
3148
|
-
},
|
|
3149
|
-
{
|
|
3150
|
-
name: 'outputOptionDefinitions',
|
|
3151
|
-
layout: {
|
|
3152
|
-
positions: {
|
|
3153
|
-
lg: {
|
|
3154
|
-
colSpan: 12,
|
|
3155
|
-
},
|
|
3156
|
-
},
|
|
3157
|
-
label: {
|
|
3158
|
-
visible: false,
|
|
3159
|
-
},
|
|
3160
|
-
},
|
|
3161
|
-
},
|
|
3162
|
-
],
|
|
3163
|
-
actions: [entityMasterEditAction()],
|
|
3164
|
-
},
|
|
3165
|
-
list: {
|
|
3166
|
-
actions: [
|
|
3167
|
-
...entityMasterCrudActions({
|
|
3168
|
-
create: false,
|
|
3169
|
-
delete: false,
|
|
3170
|
-
view: true,
|
|
3171
|
-
edit: true,
|
|
3172
|
-
}),
|
|
3173
|
-
],
|
|
3174
|
-
views: [createAllQueryView()],
|
|
3175
|
-
},
|
|
3176
|
-
},
|
|
3177
|
-
},
|
|
3178
|
-
};
|
|
3179
|
-
return entityDef;
|
|
3180
|
-
}
|
|
3181
|
-
//#endregion
|
|
3182
|
-
|
|
3183
|
-
var query_entity = /*#__PURE__*/Object.freeze({
|
|
3184
|
-
__proto__: null,
|
|
3185
|
-
queryDefinitionEntityFactory: queryDefinitionEntityFactory
|
|
3186
|
-
});
|
|
3187
|
-
|
|
3188
|
-
// export * from './entity-definition.entity';
|
|
3189
|
-
|
|
3190
|
-
const I18N$6 = '@platform-management:definitions.interfaces.detail';
|
|
3191
|
-
async function interfaceDefinitionEntityFactory() {
|
|
3192
|
-
// const crud = injector.get(AXP_ENTITY_DEFINITION_CRUD_SERVICE) as AXPEntityDefinitionCrudService | null;
|
|
3193
|
-
const entityDef = {
|
|
3194
|
-
module: RootConfig.module.name,
|
|
3195
|
-
name: RootConfig.entities.interfaceDefinition.name,
|
|
3196
|
-
title: RootConfig.entities.interfaceDefinition.title,
|
|
3197
|
-
icon: RootConfig.entities.interfaceDefinition.icon,
|
|
3198
|
-
formats: {
|
|
3199
|
-
individual: 'Interface Definition',
|
|
3200
|
-
plural: 'Interface Definitions',
|
|
3201
|
-
},
|
|
3202
|
-
plugins: [
|
|
3203
|
-
{
|
|
3204
|
-
name: 'computed-property',
|
|
3205
|
-
options: {
|
|
3206
|
-
fields: [
|
|
3207
|
-
{
|
|
3208
|
-
name: 'categoriesDisplay',
|
|
3209
|
-
title: `${I18N$6}.sections.categories`,
|
|
3210
|
-
value: '{{ (context.eval("categories") || []).map(function(x) { return typeof x === "string" ? x : (x && (x.title || x.name || x)); }).filter(Boolean).join(" - ") }}',
|
|
3211
|
-
group: { id: 'configuration', title: `${I18N$6}.sections.configuration` },
|
|
3212
|
-
showAs: { type: AXPWidgetsCatalog.text },
|
|
3213
|
-
},
|
|
3214
|
-
{
|
|
3215
|
-
name: 'groupsDisplay',
|
|
3216
|
-
title: `${I18N$6}.sections.groups`,
|
|
3217
|
-
value: '{{ (context.eval("groups") || []).map(function(x) { return typeof x === "string" ? x : (x && (x.title || x.name || x)); }).filter(Boolean).join(" - ") }}',
|
|
3218
|
-
group: { id: 'configuration', title: `${I18N$6}.sections.configuration` },
|
|
3219
|
-
showAs: { type: AXPWidgetsCatalog.text },
|
|
3220
|
-
},
|
|
3221
|
-
],
|
|
3222
|
-
},
|
|
3223
|
-
},
|
|
3224
|
-
],
|
|
3225
|
-
relatedEntities: [],
|
|
3226
|
-
groups: [
|
|
3227
|
-
{ id: 'basic-info', title: `${I18N$6}.sections.basic-info` },
|
|
3228
|
-
{ id: 'configuration', title: `${I18N$6}.sections.configuration` },
|
|
3229
|
-
{ id: 'categories', title: `${I18N$6}.sections.categories` },
|
|
3230
|
-
{ id: 'groups', title: `${I18N$6}.sections.groups` },
|
|
3231
|
-
{ id: 'option-definitions', title: `${I18N$6}.pages.option-definitions` },
|
|
3232
|
-
],
|
|
3233
|
-
properties: [
|
|
3234
|
-
{
|
|
3235
|
-
name: 'name',
|
|
3236
|
-
title: '@general:terms.common.name',
|
|
3237
|
-
groupId: 'basic-info',
|
|
3238
|
-
schema: {
|
|
3239
|
-
dataType: 'string',
|
|
3240
|
-
interface: { type: AXPWidgetsCatalog.text, options: { disabled: true } },
|
|
3241
|
-
},
|
|
3242
|
-
validations: [{ rule: 'required' }],
|
|
3243
|
-
options: {
|
|
3244
|
-
filter: { advance: { enabled: true }, inline: { enabled: true } },
|
|
3245
|
-
sort: { enabled: true },
|
|
3246
|
-
},
|
|
3247
|
-
},
|
|
3248
|
-
{
|
|
3249
|
-
name: 'title',
|
|
3250
|
-
title: '@general:terms.common.title',
|
|
3251
|
-
groupId: 'basic-info',
|
|
3252
|
-
schema: {
|
|
3253
|
-
dataType: 'string',
|
|
3254
|
-
interface: { type: AXPWidgetsCatalog.text, options: { disabled: true } },
|
|
3255
|
-
},
|
|
3256
|
-
options: {
|
|
3257
|
-
filter: { advance: { enabled: true }, inline: { enabled: true } },
|
|
3258
|
-
sort: { enabled: true },
|
|
3259
|
-
},
|
|
3260
|
-
},
|
|
3261
|
-
{
|
|
3262
|
-
name: 'type',
|
|
3263
|
-
title: `${I18N$6}.fields.type`,
|
|
3264
|
-
groupId: 'basic-info',
|
|
3265
|
-
schema: {
|
|
3266
|
-
dataType: 'string',
|
|
3267
|
-
interface: { type: AXPWidgetsCatalog.text, options: { disabled: true } },
|
|
3268
|
-
},
|
|
3269
|
-
},
|
|
3270
|
-
{
|
|
3271
|
-
name: 'icon',
|
|
3272
|
-
title: `${I18N$6}.fields.icon`,
|
|
3273
|
-
groupId: 'basic-info',
|
|
3274
|
-
schema: {
|
|
3275
|
-
dataType: 'string',
|
|
3276
|
-
interface: { type: AXPWidgetsCatalog.iconChooser },
|
|
3277
|
-
},
|
|
3278
|
-
},
|
|
3279
|
-
{
|
|
3280
|
-
name: 'description',
|
|
3281
|
-
title: '@general:terms.common.description',
|
|
3282
|
-
groupId: 'basic-info',
|
|
3283
|
-
schema: {
|
|
3284
|
-
dataType: 'string',
|
|
3285
|
-
interface: { type: AXPWidgetsCatalog.largeText, options: { disabled: true } },
|
|
3286
|
-
},
|
|
3287
|
-
},
|
|
3288
|
-
{
|
|
3289
|
-
name: 'categories',
|
|
3290
|
-
title: `${I18N$6}.sections.categories`,
|
|
3291
|
-
groupId: 'categories',
|
|
3292
|
-
schema: {
|
|
3293
|
-
dataType: 'array',
|
|
3294
|
-
interface: { type: AXPWidgetsList.Advanced.JsonViewer, options: { disabled: true } },
|
|
3295
|
-
},
|
|
3296
|
-
},
|
|
3297
|
-
{
|
|
3298
|
-
name: 'groups',
|
|
3299
|
-
title: `${I18N$6}.sections.groups`,
|
|
3300
|
-
groupId: 'groups',
|
|
3301
|
-
schema: {
|
|
3302
|
-
dataType: 'array',
|
|
3303
|
-
interface: { type: AXPWidgetsList.Advanced.JsonViewer, options: { disabled: true } },
|
|
3304
|
-
},
|
|
3305
|
-
},
|
|
3306
|
-
{
|
|
3307
|
-
name: 'optionDefinitions',
|
|
3308
|
-
title: `${I18N$6}.pages.option-definitions`,
|
|
3309
|
-
groupId: 'option-definitions',
|
|
3310
|
-
schema: {
|
|
3311
|
-
dataType: 'array',
|
|
3312
|
-
interface: {
|
|
3313
|
-
type: AXPWidgetsList.Advanced.DataList,
|
|
3314
|
-
options: {
|
|
3315
|
-
paging: false,
|
|
3316
|
-
showIndex: true,
|
|
3317
|
-
showHeader: true,
|
|
3318
|
-
columns: [
|
|
3319
|
-
{ name: 'name', title: `${I18N$6}.fields.option-name`, width: '160px' },
|
|
3320
|
-
{ name: 'title', title: `${I18N$6}.fields.option-title`, width: '200px' },
|
|
3321
|
-
{
|
|
3322
|
-
name: 'schema',
|
|
3323
|
-
title: `${I18N$6}.fields.option-schema`,
|
|
3324
|
-
width: '280px',
|
|
3325
|
-
schema: {
|
|
3326
|
-
name: 'interface',
|
|
3327
|
-
title: 'Schema',
|
|
3328
|
-
interface: {
|
|
3329
|
-
name: AXPWidgetsList.Advanced.WidgetFieldConfigurator,
|
|
3330
|
-
title: 'Schema',
|
|
3331
|
-
options: {
|
|
3332
|
-
fieldName: "{{ context.eval('name') }}",
|
|
3333
|
-
fieldTitle: "{{ context.eval('title') }}",
|
|
3334
|
-
},
|
|
3335
|
-
},
|
|
3336
|
-
},
|
|
3337
|
-
},
|
|
3338
|
-
{ name: 'description', title: `${I18N$6}.fields.option-description` },
|
|
3339
|
-
],
|
|
3340
|
-
},
|
|
3341
|
-
},
|
|
3342
|
-
},
|
|
3343
|
-
},
|
|
3344
|
-
],
|
|
3345
|
-
columns: [{ name: 'name' }, { name: 'title' }],
|
|
3346
|
-
// commands: crud
|
|
3347
|
-
// ? {
|
|
3348
|
-
// update: {
|
|
3349
|
-
// execute: async (data: Record<string, unknown>) => {
|
|
3350
|
-
// const name = (data['id'] ?? data['name']) as string;
|
|
3351
|
-
// const existing = await crud.getInterface(name);
|
|
3352
|
-
// const optionDefinitionsSource =
|
|
3353
|
-
// data['optionDefinitions'] !== undefined ? data['optionDefinitions'] : existing?.optionDefinitions;
|
|
3354
|
-
// const optionDefinitions = mapEntityFieldRowsInterfaceToDomain(
|
|
3355
|
-
// optionDefinitionsSource,
|
|
3356
|
-
// ) as AXPPropertyDefinition[];
|
|
3357
|
-
// const definition: AXPInterfaceDefinition = existing
|
|
3358
|
-
// ? {
|
|
3359
|
-
// ...existing,
|
|
3360
|
-
// ...data,
|
|
3361
|
-
// name: (data['name'] as string) ?? existing.name,
|
|
3362
|
-
// title: (data['title'] as string) ?? existing.title,
|
|
3363
|
-
// optionDefinitions,
|
|
3364
|
-
// }
|
|
3365
|
-
// : {
|
|
3366
|
-
// name: (data['name'] as string) ?? name,
|
|
3367
|
-
// title: (data['title'] as string) ?? name,
|
|
3368
|
-
// optionDefinitions,
|
|
3369
|
-
// };
|
|
3370
|
-
// await crud.updateInterface(name, definition);
|
|
3371
|
-
// },
|
|
3372
|
-
// },
|
|
3373
|
-
// }
|
|
3374
|
-
// : undefined,
|
|
3375
|
-
// queries: crud
|
|
3376
|
-
// ? {
|
|
3377
|
-
// byKey: {
|
|
3378
|
-
// execute: async (id: string) => {
|
|
3379
|
-
// const def = await crud.getInterface(id);
|
|
3380
|
-
// if (!def) return null;
|
|
3381
|
-
// return {
|
|
3382
|
-
// ...def,
|
|
3383
|
-
// id: def.name,
|
|
3384
|
-
// optionDefinitions: mapEntityFieldRowsInterfaceForForm(def.optionDefinitions),
|
|
3385
|
-
// };
|
|
3386
|
-
// },
|
|
3387
|
-
// type: AXPEntityQueryType.Single,
|
|
3388
|
-
// },
|
|
3389
|
-
// list: {
|
|
3390
|
-
// execute: async (request?: AXPQueryRequest) => {
|
|
3391
|
-
// const list = await crud.listInterfaces();
|
|
3392
|
-
// let items = list.map((x) => ({
|
|
3393
|
-
// id: x.name,
|
|
3394
|
-
// name: x.name,
|
|
3395
|
-
// title: x.title ?? '',
|
|
3396
|
-
// groups: x.groups ?? [],
|
|
3397
|
-
// }));
|
|
3398
|
-
// if (request?.filter) {
|
|
3399
|
-
// items = applyFilterArray(items, [request.filter], request.filter.logic ?? 'and');
|
|
3400
|
-
// }
|
|
3401
|
-
// if (request?.sort?.length) {
|
|
3402
|
-
// items = applySortArray(items, request.sort);
|
|
3403
|
-
// }
|
|
3404
|
-
// const total = items.length;
|
|
3405
|
-
// const skip = request?.skip ?? 0;
|
|
3406
|
-
// const take = request?.take ?? total;
|
|
3407
|
-
// const pagedItems = items.slice(skip, skip + take);
|
|
3408
|
-
// return { items: pagedItems, total };
|
|
3409
|
-
// },
|
|
3410
|
-
// type: AXPEntityQueryType.List,
|
|
3411
|
-
// },
|
|
3412
|
-
// }
|
|
3413
|
-
// : undefined,
|
|
3414
|
-
interfaces: {
|
|
3415
|
-
master: {
|
|
3416
|
-
single: {
|
|
3417
|
-
title: '{{title}}',
|
|
3418
|
-
sections: [{ id: 'basic-info' }, { id: 'configuration' }, { id: 'option-definitions' }],
|
|
3419
|
-
properties: [
|
|
3420
|
-
{ name: 'name', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
3421
|
-
{ name: 'title', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
3422
|
-
{ name: 'type', layout: { positions: { lg: { colSpan: 4 } } } },
|
|
3423
|
-
{ name: 'icon', layout: { positions: { lg: { colSpan: 4 } } } },
|
|
3424
|
-
{ name: 'description', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
3425
|
-
{ name: 'categoriesDisplay', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
3426
|
-
{ name: 'groupsDisplay', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
3427
|
-
{ name: 'optionDefinitions', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
3428
|
-
],
|
|
3429
|
-
actions: [],
|
|
3430
|
-
},
|
|
3431
|
-
list: {
|
|
3432
|
-
actions: [
|
|
3433
|
-
...entityMasterCrudActions({
|
|
3434
|
-
delete: false,
|
|
3435
|
-
edit: false,
|
|
3436
|
-
create: false,
|
|
3437
|
-
}),
|
|
3438
|
-
],
|
|
3439
|
-
views: [
|
|
3440
|
-
createAllQueryView({ sorts: [{ name: 'title', dir: 'asc' }] }),
|
|
3441
|
-
createQueryView(AXPWidgetGroupEnum.FormElement, '@platform-management:definitions.interfaces.list.views.form-element', true, {
|
|
3442
|
-
conditions: [{ name: 'groups', operator: { type: 'contains' }, value: AXPWidgetGroupEnum.FormElement }],
|
|
3443
|
-
sorts: [{ name: 'title', dir: 'asc' }],
|
|
3444
|
-
}),
|
|
3445
|
-
createQueryView(AXPWidgetGroupEnum.DashboardWidget, '@platform-management:definitions.interfaces.list.views.dashboard-widget', true, {
|
|
3446
|
-
conditions: [
|
|
3447
|
-
{ name: 'groups', operator: { type: 'contains' }, value: AXPWidgetGroupEnum.DashboardWidget },
|
|
3448
|
-
],
|
|
3449
|
-
sorts: [{ name: 'title', dir: 'asc' }],
|
|
3450
|
-
}),
|
|
3451
|
-
createQueryView(AXPWidgetGroupEnum.FormTemplate, '@platform-management:definitions.interfaces.list.views.form-template', true, {
|
|
3452
|
-
conditions: [
|
|
3453
|
-
{ name: 'groups', operator: { type: 'contains' }, value: AXPWidgetGroupEnum.FormTemplate },
|
|
3454
|
-
],
|
|
3455
|
-
sorts: [{ name: 'title', dir: 'asc' }],
|
|
3456
|
-
}),
|
|
3457
|
-
createQueryView(AXPWidgetGroupEnum.PropertyEditor, '@platform-management:definitions.interfaces.list.views.property-editor', true, {
|
|
3458
|
-
conditions: [
|
|
3459
|
-
{ name: 'groups', operator: { type: 'contains' }, value: AXPWidgetGroupEnum.PropertyEditor },
|
|
3460
|
-
],
|
|
3461
|
-
sorts: [{ name: 'title', dir: 'asc' }],
|
|
3462
|
-
}),
|
|
3463
|
-
createQueryView(AXPWidgetGroupEnum.MetaData, '@platform-management:definitions.interfaces.list.views.meta-data', true, {
|
|
3464
|
-
conditions: [{ name: 'groups', operator: { type: 'contains' }, value: AXPWidgetGroupEnum.MetaData }],
|
|
3465
|
-
sorts: [{ name: 'title', dir: 'asc' }],
|
|
3466
|
-
}),
|
|
3467
|
-
createQueryView(AXPWidgetGroupEnum.SettingWidget, '@platform-management:definitions.interfaces.list.views.setting-widget', true, {
|
|
3468
|
-
conditions: [
|
|
3469
|
-
{ name: 'groups', operator: { type: 'contains' }, value: AXPWidgetGroupEnum.SettingWidget },
|
|
3470
|
-
],
|
|
3471
|
-
sorts: [{ name: 'title', dir: 'asc' }],
|
|
3472
|
-
}),
|
|
3473
|
-
createQueryView(AXPWidgetGroupEnum.EntityWidget, '@platform-management:definitions.interfaces.list.views.entity-widget', true, {
|
|
3474
|
-
conditions: [
|
|
3475
|
-
{ name: 'groups', operator: { type: 'contains' }, value: AXPWidgetGroupEnum.EntityWidget },
|
|
3476
|
-
],
|
|
3477
|
-
sorts: [{ name: 'title', dir: 'asc' }],
|
|
3478
|
-
}),
|
|
3479
|
-
createQueryView(AXPWidgetGroupEnum.UtilityWidget, '@platform-management:definitions.interfaces.list.views.utility-widget', true, {
|
|
3480
|
-
conditions: [
|
|
3481
|
-
{ name: 'groups', operator: { type: 'contains' }, value: AXPWidgetGroupEnum.UtilityWidget },
|
|
3482
|
-
],
|
|
3483
|
-
sorts: [{ name: 'title', dir: 'asc' }],
|
|
3484
|
-
}),
|
|
3485
|
-
],
|
|
3486
|
-
},
|
|
3487
|
-
},
|
|
3488
|
-
},
|
|
3489
|
-
};
|
|
3490
|
-
return entityDef;
|
|
3491
|
-
}
|
|
3492
|
-
|
|
3493
|
-
const I18N$5 = '@platform-management:definitions.menus.detail';
|
|
3494
|
-
const POLICY_STRING_LIST_DATA_LIST = {
|
|
3495
|
-
paging: false,
|
|
3496
|
-
showIndex: true,
|
|
3497
|
-
showHeader: true,
|
|
3498
|
-
commands: { add: true, edit: true, remove: true },
|
|
3499
|
-
};
|
|
3500
|
-
const COMMAND_KEY_VALUE_DATA_LIST = {
|
|
3501
|
-
paging: false,
|
|
3502
|
-
showIndex: true,
|
|
3503
|
-
showHeader: true,
|
|
3504
|
-
commands: { add: true, edit: true, remove: true },
|
|
3505
|
-
};
|
|
3506
|
-
//#region ---- Mapping helpers ----
|
|
3507
|
-
function normalizeCategoryIds$1(raw) {
|
|
3508
|
-
if (raw == null) {
|
|
3509
|
-
return undefined;
|
|
3510
|
-
}
|
|
3511
|
-
if (Array.isArray(raw)) {
|
|
3512
|
-
const ids = raw.map((x) => String(x).trim()).filter((id) => id.length > 0);
|
|
3513
|
-
return ids.length ? ids : undefined;
|
|
3514
|
-
}
|
|
3515
|
-
if (typeof raw === 'string') {
|
|
3516
|
-
const s = raw.trim();
|
|
3517
|
-
return s ? [s] : undefined;
|
|
3518
|
-
}
|
|
3519
|
-
return undefined;
|
|
3520
|
-
}
|
|
3521
|
-
function normalizeCategoryLabels$1(raw) {
|
|
3522
|
-
if (!Array.isArray(raw) || raw.length === 0) {
|
|
3523
|
-
return undefined;
|
|
3524
|
-
}
|
|
3525
|
-
const out = raw
|
|
3526
|
-
.map((item) => {
|
|
3527
|
-
if (item == null || typeof item !== 'object') {
|
|
3528
|
-
return null;
|
|
3529
|
-
}
|
|
3530
|
-
const o = item;
|
|
3531
|
-
const id = String(o['id'] ?? '').trim();
|
|
3532
|
-
if (!id) {
|
|
3533
|
-
return null;
|
|
3534
|
-
}
|
|
3535
|
-
const title = typeof o['title'] === 'string' ? o['title'] : undefined;
|
|
3536
|
-
return title ? { id, title } : { id };
|
|
3537
|
-
})
|
|
3538
|
-
.filter((x) => x != null);
|
|
3539
|
-
return out.length ? out : undefined;
|
|
3540
|
-
}
|
|
3541
|
-
function clearMenuProviderCache(injector) {
|
|
3542
|
-
// try {
|
|
3543
|
-
// injector.get(AXPMenuProviderService).clearCache();
|
|
3544
|
-
// } catch {
|
|
3545
|
-
// // Optional in minimal shells
|
|
3546
|
-
// }
|
|
3547
|
-
}
|
|
3548
|
-
function stringArrayToRows(values) {
|
|
3549
|
-
if (!values?.length) {
|
|
3550
|
-
return [];
|
|
3551
|
-
}
|
|
3552
|
-
return values.map((v) => ({ key: typeof v === 'string' ? v : String(v) }));
|
|
3553
|
-
}
|
|
3554
|
-
function rowsToStringArray(rows) {
|
|
3555
|
-
if (!Array.isArray(rows) || rows.length === 0) {
|
|
3556
|
-
return undefined;
|
|
3557
|
-
}
|
|
3558
|
-
const keys = rows
|
|
3559
|
-
.map((r) => String(r.key ?? '').trim())
|
|
3560
|
-
.filter((k) => k.length > 0);
|
|
3561
|
-
return keys.length ? keys : undefined;
|
|
3562
|
-
}
|
|
3563
|
-
function recordToKeyValueRows(record) {
|
|
3564
|
-
if (!record) {
|
|
3565
|
-
return [];
|
|
3566
|
-
}
|
|
3567
|
-
return Object.entries(record).map(([key, v]) => ({
|
|
3568
|
-
key,
|
|
3569
|
-
value: typeof v === 'string' ? v : JSON.stringify(v),
|
|
3570
|
-
}));
|
|
3571
|
-
}
|
|
3572
|
-
function keyValueRowsToRecord(rows) {
|
|
3573
|
-
if (!Array.isArray(rows) || rows.length === 0) {
|
|
3574
|
-
return undefined;
|
|
3575
|
-
}
|
|
3576
|
-
const out = {};
|
|
3577
|
-
for (const row of rows) {
|
|
3578
|
-
const r = row;
|
|
3579
|
-
const k = String(r.key ?? '').trim();
|
|
3580
|
-
if (!k) {
|
|
3581
|
-
continue;
|
|
3582
|
-
}
|
|
3583
|
-
const raw = String(r.value ?? '');
|
|
3584
|
-
let parsed = raw;
|
|
3585
|
-
try {
|
|
3586
|
-
parsed = JSON.parse(raw);
|
|
3587
|
-
}
|
|
3588
|
-
catch {
|
|
3589
|
-
parsed = raw;
|
|
3590
|
-
}
|
|
3591
|
-
out[k] = parsed;
|
|
3592
|
-
}
|
|
3593
|
-
return Object.keys(out).length ? out : undefined;
|
|
3594
|
-
}
|
|
3595
|
-
function commandToFormFields(command) {
|
|
3596
|
-
if (!command) {
|
|
3597
|
-
return {
|
|
3598
|
-
commandKind: 'none',
|
|
3599
|
-
commandPath: null,
|
|
3600
|
-
commandNavigateExtras: [],
|
|
3601
|
-
commandExecuteName: null,
|
|
3602
|
-
commandExecuteOptions: [],
|
|
3603
|
-
};
|
|
3604
|
-
}
|
|
3605
|
-
if (command.kind === 'navigate') {
|
|
3606
|
-
return {
|
|
3607
|
-
commandKind: 'navigate',
|
|
3608
|
-
commandPath: command.path,
|
|
3609
|
-
commandNavigateExtras: recordToKeyValueRows(command.extras),
|
|
3610
|
-
commandExecuteName: null,
|
|
3611
|
-
commandExecuteOptions: [],
|
|
3612
|
-
};
|
|
3613
|
-
}
|
|
3614
|
-
return {
|
|
3615
|
-
commandKind: 'execute',
|
|
3616
|
-
commandPath: null,
|
|
3617
|
-
commandNavigateExtras: [],
|
|
3618
|
-
commandExecuteName: command.name,
|
|
3619
|
-
commandExecuteOptions: recordToKeyValueRows(command.options),
|
|
3620
|
-
};
|
|
3621
|
-
}
|
|
3622
|
-
function commandFromFormFields(data) {
|
|
3623
|
-
const kind = String(data['commandKind'] ?? 'none');
|
|
3624
|
-
if (kind === 'none' || kind === '') {
|
|
3625
|
-
return undefined;
|
|
3626
|
-
}
|
|
3627
|
-
if (kind === 'navigate') {
|
|
3628
|
-
const path = String(data['commandPath'] ?? '').trim();
|
|
3629
|
-
if (!path) {
|
|
3630
|
-
return undefined;
|
|
3631
|
-
}
|
|
3632
|
-
const extras = keyValueRowsToRecord(data['commandNavigateExtras']);
|
|
3633
|
-
return {
|
|
3634
|
-
kind: 'navigate',
|
|
3635
|
-
navigateType: 'router',
|
|
3636
|
-
path,
|
|
3637
|
-
...(extras ? { extras } : {}),
|
|
3638
|
-
};
|
|
3639
|
-
}
|
|
3640
|
-
if (kind === 'execute') {
|
|
3641
|
-
const name = String(data['commandExecuteName'] ?? '').trim();
|
|
3642
|
-
if (!name) {
|
|
3643
|
-
return undefined;
|
|
3644
|
-
}
|
|
3645
|
-
const options = keyValueRowsToRecord(data['commandExecuteOptions']);
|
|
3646
|
-
return {
|
|
3647
|
-
kind: 'execute',
|
|
3648
|
-
name,
|
|
3649
|
-
...(options ? { options } : {}),
|
|
3650
|
-
};
|
|
3651
|
-
}
|
|
3652
|
-
return undefined;
|
|
3653
|
-
}
|
|
3654
|
-
function rowFromMenuDefinition(id, def) {
|
|
3655
|
-
const pathLiteral = String(def.path ?? '').trim();
|
|
3656
|
-
const useLiteralPath = pathLiteral.length > 0;
|
|
3657
|
-
const moduleRef = (Array.isArray(def.categoryIds) && def.categoryIds.length > 0
|
|
3658
|
-
? String(def.categoryIds[0])
|
|
3659
|
-
: '') ||
|
|
3660
|
-
String(def.entityListRef?.module ?? '').trim() ||
|
|
3661
|
-
null;
|
|
3662
|
-
return {
|
|
3663
|
-
id,
|
|
3664
|
-
name: def.name,
|
|
3665
|
-
text: def.text,
|
|
3666
|
-
description: def.description ?? null,
|
|
3667
|
-
icon: def.icon ?? null,
|
|
3668
|
-
priority: def.priority ?? null,
|
|
3669
|
-
type: def.type ?? null,
|
|
3670
|
-
attachParentName: def.attachParentName ?? null,
|
|
3671
|
-
path: def.path ?? null,
|
|
3672
|
-
entityListModule: useLiteralPath ? null : (def.entityListRef?.module ?? null),
|
|
3673
|
-
entityListEntity: useLiteralPath ? null : (def.entityListRef?.entity ?? null),
|
|
3674
|
-
moduleRef,
|
|
3675
|
-
policyFeatures: stringArrayToRows(def.policyFeatures),
|
|
3676
|
-
policyPermissions: stringArrayToRows(def.policyPermissions),
|
|
3677
|
-
badgeKey: def.badgeKey ?? null,
|
|
3678
|
-
categoryIds: def.categoryIds,
|
|
3679
|
-
categories: def.categories,
|
|
3680
|
-
...commandToFormFields(def.command),
|
|
3681
|
-
};
|
|
3682
|
-
}
|
|
3683
|
-
function menuFormToDefinition(data) {
|
|
3684
|
-
const name = data['name'] ?? '';
|
|
3685
|
-
const pathLiteral = String(data['path'] ?? '').trim();
|
|
3686
|
-
const em = String(data['entityListModule'] ?? '').trim();
|
|
3687
|
-
const ee = String(data['entityListEntity'] ?? '').trim();
|
|
3688
|
-
const categoryIds = normalizeCategoryIds$1(data['categoryIds']);
|
|
3689
|
-
const categories = normalizeCategoryLabels$1(data['categories']);
|
|
3690
|
-
return {
|
|
3691
|
-
name,
|
|
3692
|
-
text: data['text'] ?? '',
|
|
3693
|
-
description: data['description'] || undefined,
|
|
3694
|
-
icon: data['icon'] || undefined,
|
|
3695
|
-
priority: typeof data['priority'] === 'number' ? data['priority'] : undefined,
|
|
3696
|
-
type: data['type'] ?? undefined,
|
|
3697
|
-
attachParentName: data['attachParentName'] || undefined,
|
|
3698
|
-
path: pathLiteral || undefined,
|
|
3699
|
-
entityListRef: !pathLiteral && em && ee ? { module: em, entity: ee } : undefined,
|
|
3700
|
-
policyFeatures: rowsToStringArray(data['policyFeatures']),
|
|
3701
|
-
policyPermissions: rowsToStringArray(data['policyPermissions']),
|
|
3702
|
-
badgeKey: data['badgeKey'] || undefined,
|
|
3703
|
-
command: commandFromFormFields(data),
|
|
3704
|
-
...(categoryIds?.length ? { categoryIds } : {}),
|
|
3705
|
-
...(categories?.length ? { categories } : {}),
|
|
3706
|
-
};
|
|
3707
|
-
}
|
|
3708
|
-
//#endregion
|
|
3709
|
-
async function menuDefinitionEntityFactory() {
|
|
3710
|
-
// const crud = injector.get(AXP_ENTITY_DEFINITION_CRUD_SERVICE) as AXPEntityDefinitionCrudService | null;
|
|
3711
|
-
const entityDef = {
|
|
3712
|
-
module: RootConfig.module.name,
|
|
3713
|
-
name: RootConfig.entities.menuDefinition.name,
|
|
3714
|
-
title: RootConfig.entities.menuDefinition.title,
|
|
3715
|
-
icon: RootConfig.entities.menuDefinition.icon,
|
|
3716
|
-
formats: {
|
|
3717
|
-
individual: 'Menu Definition',
|
|
3718
|
-
plural: 'Menu Definitions',
|
|
3719
|
-
},
|
|
3720
|
-
plugins: [
|
|
3721
|
-
{
|
|
3722
|
-
name: 'category',
|
|
3723
|
-
options: {
|
|
3724
|
-
categoryEntity: `${RootConfig.module.name}.${RootConfig.entities.moduleDefinition.name}`,
|
|
3725
|
-
allowMultiple: true,
|
|
3726
|
-
},
|
|
3727
|
-
},
|
|
3728
|
-
],
|
|
3729
|
-
relatedEntities: [],
|
|
3730
|
-
groups: [
|
|
3731
|
-
{ id: 'basic-info', title: `${I18N$5}.sections.basic-info` },
|
|
3732
|
-
{ id: 'placement', title: `${I18N$5}.sections.placement` },
|
|
3733
|
-
{ id: 'navigation', title: `${I18N$5}.sections.navigation` },
|
|
3734
|
-
{ id: 'policy', title: `${I18N$5}.sections.policy` },
|
|
3735
|
-
{ id: 'command-meta', title: `${I18N$5}.sections.command-meta` },
|
|
3736
|
-
],
|
|
3737
|
-
properties: [
|
|
3738
|
-
{
|
|
3739
|
-
name: 'name',
|
|
3740
|
-
title: `${I18N$5}.fields.name`,
|
|
3741
|
-
groupId: 'basic-info',
|
|
3742
|
-
schema: {
|
|
3743
|
-
dataType: 'string',
|
|
3744
|
-
interface: { type: AXPWidgetsCatalog.text, options: {} },
|
|
3745
|
-
},
|
|
3746
|
-
validations: [{ rule: 'required' }],
|
|
3747
|
-
options: { filter: { advance: { enabled: true }, inline: { enabled: true } }, sort: { enabled: true } },
|
|
3748
|
-
},
|
|
3749
|
-
{
|
|
3750
|
-
name: 'text',
|
|
3751
|
-
title: `${I18N$5}.fields.text`,
|
|
3752
|
-
groupId: 'basic-info',
|
|
3753
|
-
schema: {
|
|
3754
|
-
dataType: 'string',
|
|
3755
|
-
interface: { type: AXPWidgetsCatalog.text, options: {} },
|
|
3756
|
-
},
|
|
3757
|
-
validations: [{ rule: 'required' }],
|
|
3758
|
-
options: { filter: { advance: { enabled: true }, inline: { enabled: true } }, sort: { enabled: true } },
|
|
3759
|
-
},
|
|
3760
|
-
{
|
|
3761
|
-
name: 'moduleRef',
|
|
3762
|
-
title: `${I18N$5}.fields.module-ref`,
|
|
3763
|
-
groupId: 'basic-info',
|
|
3764
|
-
schema: {
|
|
3765
|
-
dataType: 'string',
|
|
3766
|
-
interface: { type: AXPWidgetsCatalog.text, options: { disabled: true } },
|
|
3767
|
-
},
|
|
3768
|
-
options: { filter: { advance: { enabled: true }, inline: { enabled: true } }, sort: { enabled: true } },
|
|
3769
|
-
},
|
|
3770
|
-
{
|
|
3771
|
-
name: 'description',
|
|
3772
|
-
title: `${I18N$5}.fields.description`,
|
|
3773
|
-
groupId: 'basic-info',
|
|
3774
|
-
schema: {
|
|
3775
|
-
dataType: 'string',
|
|
3776
|
-
interface: { type: AXPWidgetsCatalog.largeText, options: {} },
|
|
3777
|
-
},
|
|
3778
|
-
},
|
|
3779
|
-
{
|
|
3780
|
-
name: 'icon',
|
|
3781
|
-
title: `${I18N$5}.fields.icon`,
|
|
3782
|
-
groupId: 'basic-info',
|
|
3783
|
-
schema: {
|
|
3784
|
-
dataType: 'string',
|
|
3785
|
-
interface: { type: AXPWidgetsCatalog.iconChooser },
|
|
3786
|
-
},
|
|
3787
|
-
},
|
|
3788
|
-
{
|
|
3789
|
-
name: 'priority',
|
|
3790
|
-
title: `${I18N$5}.fields.priority`,
|
|
3791
|
-
groupId: 'basic-info',
|
|
3792
|
-
schema: {
|
|
3793
|
-
dataType: 'number',
|
|
3794
|
-
interface: { type: AXPWidgetsCatalog.number },
|
|
3795
|
-
},
|
|
3796
|
-
options: { sort: { enabled: true } },
|
|
3797
|
-
},
|
|
3798
|
-
{
|
|
3799
|
-
name: 'type',
|
|
3800
|
-
title: `${I18N$5}.fields.type`,
|
|
3801
|
-
groupId: 'basic-info',
|
|
3802
|
-
schema: {
|
|
3803
|
-
dataType: 'string',
|
|
3804
|
-
interface: {
|
|
3805
|
-
type: AXPWidgetsCatalog.select,
|
|
3806
|
-
options: {
|
|
3807
|
-
valueField: 'value',
|
|
3808
|
-
textField: 'title',
|
|
3809
|
-
dataSource: [
|
|
3810
|
-
{ value: 'menu', title: `${I18N$5}.fields.type-values.menu` },
|
|
3811
|
-
{ value: 'group', title: `${I18N$5}.fields.type-values.group` },
|
|
3812
|
-
{ value: 'break', title: `${I18N$5}.fields.type-values.break` },
|
|
3813
|
-
],
|
|
3814
|
-
},
|
|
3815
|
-
},
|
|
3816
|
-
},
|
|
3817
|
-
},
|
|
3818
|
-
{
|
|
3819
|
-
name: 'attachParentName',
|
|
3820
|
-
title: `${I18N$5}.fields.attach-parent-name`,
|
|
3821
|
-
groupId: 'placement',
|
|
3822
|
-
schema: {
|
|
3823
|
-
dataType: 'string',
|
|
3824
|
-
interface: { type: AXPWidgetsCatalog.text, options: {} },
|
|
3825
|
-
},
|
|
3826
|
-
options: { filter: { advance: { enabled: true }, inline: { enabled: true } }, sort: { enabled: true } },
|
|
3827
|
-
},
|
|
3828
|
-
{
|
|
3829
|
-
name: 'path',
|
|
3830
|
-
title: `${I18N$5}.fields.path`,
|
|
3831
|
-
groupId: 'navigation',
|
|
3832
|
-
schema: {
|
|
3833
|
-
dataType: 'string',
|
|
3834
|
-
interface: {
|
|
3835
|
-
type: AXPWidgetsCatalog.text,
|
|
3836
|
-
options: {},
|
|
3837
|
-
triggers: [
|
|
3838
|
-
{
|
|
3839
|
-
event: "{{ events.context('path') }}",
|
|
3840
|
-
action: `{{ if(String(context.eval('path') ?? '').trim()) { context.set('entityListModule', null); context.set('entityListEntity', null); } }}`,
|
|
3841
|
-
},
|
|
3842
|
-
],
|
|
3843
|
-
},
|
|
3844
|
-
},
|
|
3845
|
-
},
|
|
3846
|
-
{
|
|
3847
|
-
name: 'entityListModule',
|
|
3848
|
-
title: `${I18N$5}.fields.entity-list-module`,
|
|
3849
|
-
groupId: 'navigation',
|
|
3850
|
-
schema: {
|
|
3851
|
-
dataType: 'string',
|
|
3852
|
-
interface: {
|
|
3853
|
-
type: AXPWidgetsCatalog.select,
|
|
3854
|
-
options: {
|
|
3855
|
-
allowSearch: true,
|
|
3856
|
-
hasClearButton: true,
|
|
3857
|
-
disabled: `{{ !!String(context.eval("path") ?? "").trim() }}`,
|
|
3858
|
-
},
|
|
3859
|
-
},
|
|
3860
|
-
},
|
|
3861
|
-
},
|
|
3862
|
-
{
|
|
3863
|
-
name: 'entityListEntity',
|
|
3864
|
-
title: `${I18N$5}.fields.entity-list-entity`,
|
|
3865
|
-
groupId: 'navigation',
|
|
3866
|
-
schema: {
|
|
3867
|
-
dataType: 'string',
|
|
3868
|
-
interface: {
|
|
3869
|
-
type: AXPWidgetsCatalog.entityDefinitionProvider,
|
|
3870
|
-
options: {
|
|
3871
|
-
allowSearch: true,
|
|
3872
|
-
hasClearButton: true,
|
|
3873
|
-
filterModuleField: 'entityListModule',
|
|
3874
|
-
valueFormat: 'entityName',
|
|
3875
|
-
disabled: `{{ !!String(context.eval("path") ?? "").trim() || !context.eval("entityListModule") }}`,
|
|
3876
|
-
triggers: [
|
|
3877
|
-
{
|
|
3878
|
-
event: "{{ events.context('entityListModule') }}",
|
|
3879
|
-
action: `{{ widget.refresh() }}`,
|
|
3880
|
-
},
|
|
3881
|
-
],
|
|
3882
|
-
},
|
|
3883
|
-
},
|
|
3884
|
-
},
|
|
3885
|
-
},
|
|
3886
|
-
{
|
|
3887
|
-
name: 'policyFeatures',
|
|
3888
|
-
title: `${I18N$5}.fields.policy-features`,
|
|
3889
|
-
groupId: 'policy',
|
|
3890
|
-
schema: {
|
|
3891
|
-
dataType: 'array',
|
|
3892
|
-
interface: {
|
|
3893
|
-
type: AXPWidgetsList.Advanced.DataList,
|
|
3894
|
-
options: {
|
|
3895
|
-
...POLICY_STRING_LIST_DATA_LIST,
|
|
3896
|
-
columns: [{ name: 'key', title: `${I18N$5}.fields.feature-key`, width: '100%' }],
|
|
3897
|
-
},
|
|
3898
|
-
},
|
|
3899
|
-
},
|
|
3900
|
-
},
|
|
3901
|
-
{
|
|
3902
|
-
name: 'policyPermissions',
|
|
3903
|
-
title: `${I18N$5}.fields.policy-permissions`,
|
|
3904
|
-
groupId: 'policy',
|
|
3905
|
-
schema: {
|
|
3906
|
-
dataType: 'array',
|
|
3907
|
-
interface: {
|
|
3908
|
-
type: AXPWidgetsList.Advanced.DataList,
|
|
3909
|
-
options: {
|
|
3910
|
-
...POLICY_STRING_LIST_DATA_LIST,
|
|
3911
|
-
columns: [{ name: 'key', title: `${I18N$5}.fields.permission-key`, width: '100%' }],
|
|
3912
|
-
},
|
|
3913
|
-
},
|
|
3914
|
-
},
|
|
3915
|
-
},
|
|
3916
|
-
{
|
|
3917
|
-
name: 'badgeKey',
|
|
3918
|
-
title: `${I18N$5}.fields.badge-key`,
|
|
3919
|
-
groupId: 'command-meta',
|
|
3920
|
-
schema: {
|
|
3921
|
-
dataType: 'string',
|
|
3922
|
-
interface: { type: AXPWidgetsCatalog.text, options: {} },
|
|
3923
|
-
},
|
|
3924
|
-
},
|
|
3925
|
-
{
|
|
3926
|
-
name: 'commandKind',
|
|
3927
|
-
title: `${I18N$5}.fields.command-kind`,
|
|
3928
|
-
groupId: 'command-meta',
|
|
3929
|
-
schema: {
|
|
3930
|
-
dataType: 'string',
|
|
3931
|
-
defaultValue: 'none',
|
|
3932
|
-
interface: {
|
|
3933
|
-
type: AXPWidgetsCatalog.select,
|
|
3934
|
-
options: {
|
|
3935
|
-
valueField: 'value',
|
|
3936
|
-
textField: 'title',
|
|
3937
|
-
dataSource: [
|
|
3938
|
-
{ value: 'none', title: `${I18N$5}.fields.command-kind-values.none` },
|
|
3939
|
-
{ value: 'navigate', title: `${I18N$5}.fields.command-kind-values.navigate` },
|
|
3940
|
-
{ value: 'execute', title: `${I18N$5}.fields.command-kind-values.execute` },
|
|
3941
|
-
],
|
|
3942
|
-
},
|
|
3943
|
-
},
|
|
3944
|
-
},
|
|
3945
|
-
},
|
|
3946
|
-
{
|
|
3947
|
-
name: 'commandPath',
|
|
3948
|
-
title: `${I18N$5}.fields.command-path`,
|
|
3949
|
-
groupId: 'command-meta',
|
|
3950
|
-
schema: {
|
|
3951
|
-
dataType: 'string',
|
|
3952
|
-
interface: { type: AXPWidgetsCatalog.text, options: {} },
|
|
3953
|
-
},
|
|
3954
|
-
},
|
|
3955
|
-
{
|
|
3956
|
-
name: 'commandNavigateExtras',
|
|
3957
|
-
title: `${I18N$5}.fields.command-navigate-extras`,
|
|
3958
|
-
groupId: 'command-meta',
|
|
3959
|
-
schema: {
|
|
3960
|
-
dataType: 'array',
|
|
3961
|
-
interface: {
|
|
3962
|
-
type: AXPWidgetsList.Advanced.DataList,
|
|
3963
|
-
options: {
|
|
3964
|
-
...COMMAND_KEY_VALUE_DATA_LIST,
|
|
3965
|
-
columns: [
|
|
3966
|
-
{ name: 'key', title: `${I18N$5}.fields.kv-key`, width: '200px' },
|
|
3967
|
-
{ name: 'value', title: `${I18N$5}.fields.kv-value`, width: '280px' },
|
|
3968
|
-
],
|
|
3969
|
-
},
|
|
3970
|
-
},
|
|
3971
|
-
},
|
|
3972
|
-
},
|
|
3973
|
-
{
|
|
3974
|
-
name: 'commandExecuteName',
|
|
3975
|
-
title: `${I18N$5}.fields.command-execute-name`,
|
|
3976
|
-
groupId: 'command-meta',
|
|
3977
|
-
schema: {
|
|
3978
|
-
dataType: 'string',
|
|
3979
|
-
interface: { type: AXPWidgetsCatalog.text, options: {} },
|
|
3980
|
-
},
|
|
3981
|
-
},
|
|
3982
|
-
{
|
|
3983
|
-
name: 'commandExecuteOptions',
|
|
3984
|
-
title: `${I18N$5}.fields.command-execute-options`,
|
|
3985
|
-
groupId: 'command-meta',
|
|
3986
|
-
schema: {
|
|
3987
|
-
dataType: 'array',
|
|
3988
|
-
interface: {
|
|
3989
|
-
type: AXPWidgetsList.Advanced.DataList,
|
|
3990
|
-
options: {
|
|
3991
|
-
...COMMAND_KEY_VALUE_DATA_LIST,
|
|
3992
|
-
columns: [
|
|
3993
|
-
{ name: 'key', title: `${I18N$5}.fields.kv-key`, width: '200px' },
|
|
3994
|
-
{ name: 'value', title: `${I18N$5}.fields.kv-value`, width: '280px' },
|
|
3995
|
-
],
|
|
3996
|
-
},
|
|
3997
|
-
},
|
|
3998
|
-
},
|
|
3999
|
-
},
|
|
4000
|
-
],
|
|
4001
|
-
columns: [{ name: 'name' }, { name: 'text' }, { name: 'moduleRef' }, { name: 'attachParentName' }, { name: 'path' }],
|
|
4002
|
-
// commands: crud
|
|
4003
|
-
// ? {
|
|
4004
|
-
// create: {
|
|
4005
|
-
// execute: async (data: Record<string, unknown>) => {
|
|
4006
|
-
// const definition = menuFormToDefinition(data);
|
|
4007
|
-
// await crud.createMenu(definition.name, definition);
|
|
4008
|
-
// clearMenuProviderCache(injector);
|
|
4009
|
-
// return { id: definition.name };
|
|
4010
|
-
// },
|
|
4011
|
-
// },
|
|
4012
|
-
// update: {
|
|
4013
|
-
// execute: async (data: Record<string, unknown>) => {
|
|
4014
|
-
// const id = (data['id'] ?? data['name']) as string;
|
|
4015
|
-
// const definition = menuFormToDefinition({ ...data, name: data['name'] ?? id });
|
|
4016
|
-
// await crud.updateMenu(id, definition);
|
|
4017
|
-
// clearMenuProviderCache(injector);
|
|
4018
|
-
// },
|
|
4019
|
-
// },
|
|
4020
|
-
// delete: {
|
|
4021
|
-
// execute: async (id: string) => {
|
|
4022
|
-
// await crud.deleteMenu(id);
|
|
4023
|
-
// clearMenuProviderCache(injector);
|
|
4024
|
-
// },
|
|
4025
|
-
// },
|
|
4026
|
-
// }
|
|
4027
|
-
// : undefined,
|
|
4028
|
-
// queries: crud
|
|
4029
|
-
// ? {
|
|
4030
|
-
// byKey: {
|
|
4031
|
-
// execute: async (id: string) => {
|
|
4032
|
-
// const def = await crud.getMenu(id);
|
|
4033
|
-
// if (!def) return null;
|
|
4034
|
-
// return rowFromMenuDefinition(id, def);
|
|
4035
|
-
// },
|
|
4036
|
-
// type: AXPEntityQueryType.Single,
|
|
4037
|
-
// },
|
|
4038
|
-
// list: {
|
|
4039
|
-
// execute: async (request?: AXPQueryRequest) => {
|
|
4040
|
-
// const list = await crud.listMenus();
|
|
4041
|
-
// let items = list.map(({ id, definition }) => rowFromMenuDefinition(id, definition));
|
|
4042
|
-
// if (request?.filter) {
|
|
4043
|
-
// items = applyFilterArray(items, [request.filter], request.filter.logic ?? 'and');
|
|
4044
|
-
// }
|
|
4045
|
-
// if (request?.sort?.length) {
|
|
4046
|
-
// items = applySortArray(items, request.sort);
|
|
4047
|
-
// }
|
|
4048
|
-
// const total = items.length;
|
|
4049
|
-
// const skip = request?.skip ?? 0;
|
|
4050
|
-
// const take = request?.take ?? total;
|
|
4051
|
-
// const pagedItems = items.slice(skip, skip + take);
|
|
4052
|
-
// return { items: pagedItems, total };
|
|
4053
|
-
// },
|
|
4054
|
-
// type: AXPEntityQueryType.List,
|
|
4055
|
-
// },
|
|
4056
|
-
// }
|
|
4057
|
-
// : undefined,
|
|
4058
|
-
interfaces: {
|
|
4059
|
-
master: {
|
|
4060
|
-
create: {
|
|
4061
|
-
sections: [
|
|
4062
|
-
{ id: 'basic-info' },
|
|
4063
|
-
{ id: 'placement' },
|
|
4064
|
-
{ id: 'navigation' },
|
|
4065
|
-
{ id: 'policy' },
|
|
4066
|
-
{ id: 'command-meta' },
|
|
4067
|
-
],
|
|
4068
|
-
properties: [
|
|
4069
|
-
{ name: 'name', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
4070
|
-
{ name: 'text', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
4071
|
-
{ name: 'type', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
4072
|
-
{ name: 'priority', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
4073
|
-
{ name: 'description', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
4074
|
-
{ name: 'icon', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
4075
|
-
{ name: 'attachParentName', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
4076
|
-
{ name: 'path', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
4077
|
-
{ name: 'entityListModule', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
4078
|
-
{ name: 'entityListEntity', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
4079
|
-
{ name: 'policyFeatures', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
4080
|
-
{ name: 'policyPermissions', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
4081
|
-
{ name: 'badgeKey', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
4082
|
-
{ name: 'commandKind', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
4083
|
-
{ name: 'commandPath', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
4084
|
-
{ name: 'commandNavigateExtras', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
4085
|
-
{ name: 'commandExecuteName', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
4086
|
-
{ name: 'commandExecuteOptions', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
4087
|
-
],
|
|
4088
|
-
},
|
|
4089
|
-
update: {
|
|
4090
|
-
sections: [
|
|
4091
|
-
{ id: 'basic-info' },
|
|
4092
|
-
{ id: 'placement' },
|
|
4093
|
-
{ id: 'navigation' },
|
|
4094
|
-
{ id: 'policy' },
|
|
4095
|
-
{ id: 'command-meta' },
|
|
4096
|
-
],
|
|
4097
|
-
properties: [
|
|
4098
|
-
{ name: 'name', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
4099
|
-
{ name: 'text', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
4100
|
-
{ name: 'type', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
4101
|
-
{ name: 'priority', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
4102
|
-
{ name: 'description', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
4103
|
-
{ name: 'icon', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
4104
|
-
{ name: 'attachParentName', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
4105
|
-
{ name: 'path', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
4106
|
-
{ name: 'entityListModule', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
4107
|
-
{ name: 'entityListEntity', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
4108
|
-
{ name: 'policyFeatures', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
4109
|
-
{ name: 'policyPermissions', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
4110
|
-
{ name: 'badgeKey', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
4111
|
-
{ name: 'commandKind', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
4112
|
-
{ name: 'commandPath', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
4113
|
-
{ name: 'commandNavigateExtras', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
4114
|
-
{ name: 'commandExecuteName', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
4115
|
-
{ name: 'commandExecuteOptions', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
4116
|
-
],
|
|
4117
|
-
},
|
|
4118
|
-
single: {
|
|
4119
|
-
title: '{{name}}',
|
|
4120
|
-
sections: [
|
|
4121
|
-
{ id: 'basic-info' },
|
|
4122
|
-
{ id: 'placement' },
|
|
4123
|
-
{ id: 'navigation' },
|
|
4124
|
-
{ id: 'policy' },
|
|
4125
|
-
{ id: 'command-meta' },
|
|
4126
|
-
],
|
|
4127
|
-
properties: [
|
|
4128
|
-
{ name: 'name', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
4129
|
-
{ name: 'text', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
4130
|
-
{ name: 'type', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
4131
|
-
{ name: 'priority', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
4132
|
-
{ name: 'description', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
4133
|
-
{ name: 'icon', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
4134
|
-
{ name: 'attachParentName', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
4135
|
-
{ name: 'path', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
4136
|
-
{ name: 'entityListModule', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
4137
|
-
{ name: 'entityListEntity', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
4138
|
-
{ name: 'policyFeatures', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
4139
|
-
{ name: 'policyPermissions', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
4140
|
-
{ name: 'badgeKey', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
4141
|
-
{ name: 'commandKind', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
4142
|
-
{ name: 'commandPath', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
4143
|
-
{ name: 'commandNavigateExtras', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
4144
|
-
{ name: 'commandExecuteName', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
4145
|
-
{ name: 'commandExecuteOptions', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
4146
|
-
],
|
|
4147
|
-
actions: [],
|
|
4148
|
-
},
|
|
4149
|
-
list: {
|
|
4150
|
-
actions: [...entityMasterCrudActions()],
|
|
4151
|
-
views: [createAllQueryView()],
|
|
4152
|
-
},
|
|
4153
|
-
},
|
|
4154
|
-
},
|
|
4155
|
-
};
|
|
4156
|
-
return entityDef;
|
|
4157
|
-
}
|
|
4158
|
-
|
|
4159
|
-
var menuDefinition_entity = /*#__PURE__*/Object.freeze({
|
|
4160
|
-
__proto__: null,
|
|
4161
|
-
menuDefinitionEntityFactory: menuDefinitionEntityFactory
|
|
4162
|
-
});
|
|
4163
|
-
|
|
4164
|
-
const I18N$4 = '@platform-management:definitions.modules.detail';
|
|
4165
|
-
function relationToRow(id, relation) {
|
|
4166
|
-
return {
|
|
4167
|
-
id,
|
|
4168
|
-
source: `${relation.source.aggregate}.${relation.source.entity}.${relation.source.key}`,
|
|
4169
|
-
target: `${relation.target.aggregate}.${relation.target.entity}.${relation.target.key}`,
|
|
4170
|
-
type: String(relation.type),
|
|
4171
|
-
kind: String(relation.kind),
|
|
4172
|
-
};
|
|
4173
|
-
}
|
|
4174
|
-
async function moduleDefinitionEntityFactory() {
|
|
4175
|
-
// const crud = injector.get(AXP_ENTITY_DEFINITION_CRUD_SERVICE) as AXPEntityDefinitionCrudService | null;
|
|
4176
|
-
// const manifestRegistry = injector.get(AXPModuleManifestRegistry);
|
|
4177
|
-
// await manifestRegistry.initialize();
|
|
4178
|
-
const entityDef = {
|
|
4179
|
-
module: RootConfig.module.name,
|
|
4180
|
-
name: RootConfig.entities.moduleDefinition.name,
|
|
4181
|
-
title: RootConfig.entities.moduleDefinition.title,
|
|
4182
|
-
icon: RootConfig.entities.moduleDefinition.icon,
|
|
4183
|
-
formats: {
|
|
4184
|
-
individual: 'Module Definition',
|
|
4185
|
-
plural: 'Module Definitions',
|
|
4186
|
-
},
|
|
4187
|
-
plugins: [
|
|
4188
|
-
{
|
|
4189
|
-
name: 'history',
|
|
4190
|
-
options: {
|
|
4191
|
-
display: 'page',
|
|
4192
|
-
},
|
|
4193
|
-
},
|
|
4194
|
-
],
|
|
4195
|
-
relatedEntities: [
|
|
4196
|
-
{
|
|
4197
|
-
entity: `${RootConfig.module.name}.${RootConfig.entities.aggregateDefinition.name}`,
|
|
4198
|
-
title: `${I18N$4}.pages.aggregates`,
|
|
4199
|
-
icon: RootConfig.entities.aggregateDefinition.icon,
|
|
4200
|
-
columns: ['name', 'title', 'entityCount'],
|
|
4201
|
-
conditions: [
|
|
4202
|
-
{ name: 'module', operator: { type: 'equal' }, value: '{{ context.eval("id") }}' },
|
|
4203
|
-
],
|
|
4204
|
-
layout: { type: 'page-list', position: 'after', order: 10 },
|
|
4205
|
-
},
|
|
4206
|
-
{
|
|
4207
|
-
entity: `${RootConfig.module.name}.${RootConfig.entities.relationDefinition.name}`,
|
|
4208
|
-
title: `${I18N$4}.pages.relations`,
|
|
4209
|
-
icon: 'fa-light fa-link',
|
|
4210
|
-
columns: ['sourceLabel', 'targetLabel', 'typeLabel', 'kindLabel'],
|
|
4211
|
-
conditions: [
|
|
4212
|
-
{ name: 'source.aggregate', operator: { type: 'equal' }, value: '{{ context.eval("id") }}' },
|
|
4213
|
-
{ name: 'target.aggregate', operator: { type: 'equal' }, value: '{{ context.eval("id") }}' },
|
|
4214
|
-
],
|
|
4215
|
-
layout: { type: 'page-list', position: 'after', order: 11 },
|
|
4216
|
-
},
|
|
4217
|
-
{
|
|
4218
|
-
entity: `${RootConfig.module.name}.${RootConfig.entities.menuDefinition.name}`,
|
|
4219
|
-
title: `${I18N$4}.pages.menus`,
|
|
4220
|
-
icon: RootConfig.entities.menuDefinition.icon,
|
|
4221
|
-
columns: ['name', 'text', 'moduleRef'],
|
|
4222
|
-
conditions: [
|
|
4223
|
-
{ name: 'moduleRef', operator: { type: 'equal' }, value: '{{ context.eval("id") }}' },
|
|
4224
|
-
],
|
|
4225
|
-
layout: { type: 'page-list', position: 'after', order: 12 },
|
|
4226
|
-
},
|
|
4227
|
-
],
|
|
4228
|
-
groups: [
|
|
4229
|
-
{ id: 'overview', title: `${I18N$4}.pages.overview` },
|
|
4230
|
-
{ id: 'entities', title: `${I18N$4}.pages.entities` },
|
|
4231
|
-
{ id: 'relations', title: `${I18N$4}.pages.relations` },
|
|
4232
|
-
],
|
|
4233
|
-
properties: [
|
|
4234
|
-
{
|
|
4235
|
-
name: 'name',
|
|
4236
|
-
title: '@general:terms.common.name',
|
|
4237
|
-
groupId: 'overview',
|
|
4238
|
-
schema: {
|
|
4239
|
-
dataType: 'string',
|
|
4240
|
-
interface: { type: AXPWidgetsCatalog.text },
|
|
4241
|
-
},
|
|
4242
|
-
options: { filter: { advance: { enabled: true }, inline: { enabled: true } }, sort: { enabled: true } },
|
|
4243
|
-
},
|
|
4244
|
-
{
|
|
4245
|
-
name: 'title',
|
|
4246
|
-
title: '@general:terms.common.title',
|
|
4247
|
-
groupId: 'overview',
|
|
4248
|
-
schema: {
|
|
4249
|
-
dataType: 'string',
|
|
4250
|
-
interface: { type: AXPWidgetsCatalog.text, options: {} },
|
|
4251
|
-
},
|
|
4252
|
-
options: { filter: { advance: { enabled: true }, inline: { enabled: true } }, sort: { enabled: true } },
|
|
4253
|
-
},
|
|
4254
|
-
{
|
|
4255
|
-
name: 'icon',
|
|
4256
|
-
title: `${I18N$4}.fields.icon`,
|
|
4257
|
-
groupId: 'overview',
|
|
4258
|
-
schema: {
|
|
4259
|
-
dataType: 'string',
|
|
4260
|
-
interface: { type: AXPWidgetsCatalog.iconChooser },
|
|
4261
|
-
},
|
|
4262
|
-
},
|
|
4263
|
-
{
|
|
4264
|
-
name: 'entityCount',
|
|
4265
|
-
title: `${I18N$4}.fields.entity-count`,
|
|
4266
|
-
groupId: 'overview',
|
|
4267
|
-
schema: {
|
|
4268
|
-
dataType: 'number',
|
|
4269
|
-
interface: { type: AXPWidgetsCatalog.text, options: { disabled: true } },
|
|
4270
|
-
},
|
|
4271
|
-
},
|
|
4272
|
-
{
|
|
4273
|
-
name: 'featureCount',
|
|
4274
|
-
title: `${I18N$4}.fields.feature-count`,
|
|
4275
|
-
groupId: 'overview',
|
|
4276
|
-
schema: {
|
|
4277
|
-
dataType: 'number',
|
|
4278
|
-
interface: { type: AXPWidgetsCatalog.text, options: { disabled: true } },
|
|
4279
|
-
},
|
|
4280
|
-
},
|
|
4281
|
-
{
|
|
4282
|
-
name: 'relationCount',
|
|
4283
|
-
title: `${I18N$4}.fields.relation-count`,
|
|
4284
|
-
groupId: 'overview',
|
|
4285
|
-
schema: {
|
|
4286
|
-
dataType: 'number',
|
|
4287
|
-
interface: { type: AXPWidgetsCatalog.text, options: { disabled: true } },
|
|
4288
|
-
},
|
|
4289
|
-
},
|
|
4290
|
-
{
|
|
4291
|
-
name: 'features',
|
|
4292
|
-
title: `${I18N$4}.fields.features`,
|
|
4293
|
-
groupId: 'overview',
|
|
4294
|
-
schema: {
|
|
4295
|
-
dataType: 'array',
|
|
4296
|
-
interface: {
|
|
4297
|
-
type: AXPWidgetsList.Advanced.DataList,
|
|
4298
|
-
options: {
|
|
4299
|
-
disabled: true,
|
|
4300
|
-
paging: false,
|
|
4301
|
-
showIndex: true,
|
|
4302
|
-
showHeader: true,
|
|
4303
|
-
columns: [
|
|
4304
|
-
{ name: 'name', title: `${I18N$4}.fields.feature-name`, width: '220px' },
|
|
4305
|
-
{ name: 'title', title: `${I18N$4}.fields.feature-title`, width: '260px' },
|
|
4306
|
-
{ name: 'defaultValue', title: `${I18N$4}.fields.feature-default-value` },
|
|
4307
|
-
],
|
|
4308
|
-
},
|
|
4309
|
-
},
|
|
4310
|
-
},
|
|
4311
|
-
},
|
|
4312
|
-
{
|
|
4313
|
-
name: 'entities',
|
|
4314
|
-
title: `${I18N$4}.pages.entities`,
|
|
4315
|
-
groupId: 'entities',
|
|
4316
|
-
schema: {
|
|
4317
|
-
dataType: 'array',
|
|
4318
|
-
interface: {
|
|
4319
|
-
type: AXPWidgetsList.Advanced.DataList,
|
|
4320
|
-
options: {
|
|
4321
|
-
disabled: true,
|
|
4322
|
-
paging: false,
|
|
4323
|
-
showIndex: true,
|
|
4324
|
-
showHeader: true,
|
|
4325
|
-
columns: [
|
|
4326
|
-
{ name: 'id', title: '@general:terms.common.id', width: '280px' },
|
|
4327
|
-
{ name: 'name', title: '@general:terms.common.name', width: '220px' },
|
|
4328
|
-
{ name: 'title', title: '@general:terms.common.title' },
|
|
4329
|
-
],
|
|
4330
|
-
},
|
|
4331
|
-
},
|
|
4332
|
-
},
|
|
4333
|
-
},
|
|
4334
|
-
{
|
|
4335
|
-
name: 'relations',
|
|
4336
|
-
title: `${I18N$4}.pages.relations`,
|
|
4337
|
-
groupId: 'relations',
|
|
4338
|
-
schema: {
|
|
4339
|
-
dataType: 'array',
|
|
4340
|
-
interface: {
|
|
4341
|
-
type: AXPWidgetsList.Advanced.DataList,
|
|
4342
|
-
options: {
|
|
4343
|
-
disabled: true,
|
|
4344
|
-
paging: false,
|
|
4345
|
-
showIndex: true,
|
|
4346
|
-
showHeader: true,
|
|
4347
|
-
columns: [
|
|
4348
|
-
{ name: 'id', title: '@general:terms.common.id', width: '280px' },
|
|
4349
|
-
{ name: 'source', title: `${I18N$4}.fields.relation-source`, width: '280px' },
|
|
4350
|
-
{ name: 'target', title: `${I18N$4}.fields.relation-target`, width: '280px' },
|
|
4351
|
-
{ name: 'type', title: `${I18N$4}.fields.type`, width: '90px' },
|
|
4352
|
-
{ name: 'kind', title: `${I18N$4}.fields.kind`, width: '90px' },
|
|
4353
|
-
],
|
|
4354
|
-
},
|
|
4355
|
-
},
|
|
4356
|
-
},
|
|
4357
|
-
},
|
|
4358
|
-
],
|
|
4359
|
-
columns: [
|
|
4360
|
-
{ name: 'name' },
|
|
4361
|
-
{ name: 'title' },
|
|
4362
|
-
{ name: 'entityCount' },
|
|
4363
|
-
{ name: 'featureCount' },
|
|
4364
|
-
{ name: 'relationCount' },
|
|
4365
|
-
],
|
|
4366
|
-
// commands: crud
|
|
4367
|
-
// ? {
|
|
4368
|
-
// create: {
|
|
4369
|
-
// execute: async (data: Record<string, unknown>) => {
|
|
4370
|
-
// const name = ((data['name'] as string) ?? '').trim();
|
|
4371
|
-
// if (!name) {
|
|
4372
|
-
// throw new Error('Module name is required');
|
|
4373
|
-
// }
|
|
4374
|
-
// const title = ((data['title'] as string) ?? name).trim();
|
|
4375
|
-
// const icon = ((data['icon'] as string) ?? '').trim();
|
|
4376
|
-
// await crud.createModule(name, { name, title, icon });
|
|
4377
|
-
// return { id: name };
|
|
4378
|
-
// },
|
|
4379
|
-
// },
|
|
4380
|
-
// update: {
|
|
4381
|
-
// execute: async (data: Record<string, unknown>) => {
|
|
4382
|
-
// const id = ((data['id'] as string) ?? (data['name'] as string) ?? '').trim();
|
|
4383
|
-
// if (!id) {
|
|
4384
|
-
// throw new Error('Module id is required');
|
|
4385
|
-
// }
|
|
4386
|
-
// const title = ((data['title'] as string) ?? id).trim();
|
|
4387
|
-
// const icon = ((data['icon'] as string) ?? '').trim();
|
|
4388
|
-
// await crud.updateModule(id, { name: id, title, icon });
|
|
4389
|
-
// },
|
|
4390
|
-
// },
|
|
4391
|
-
// delete: {
|
|
4392
|
-
// execute: async (id: string) => {
|
|
4393
|
-
// await crud.deleteModule(id);
|
|
4394
|
-
// },
|
|
4395
|
-
// },
|
|
4396
|
-
// }
|
|
4397
|
-
// : undefined,
|
|
4398
|
-
// queries: crud
|
|
4399
|
-
// ? {
|
|
4400
|
-
// byKey: {
|
|
4401
|
-
// execute: async (id: string) => {
|
|
4402
|
-
// const module = await crud.getModule(id);
|
|
4403
|
-
// if (!module) return null;
|
|
4404
|
-
// const moduleEntities = (await crud.list()).filter((item) => item.module === module.name);
|
|
4405
|
-
// const entityNameSet = new Set(moduleEntities.map((item) => item.name));
|
|
4406
|
-
// const relations = await crud.listRelations();
|
|
4407
|
-
// const matchedRelations = relations
|
|
4408
|
-
// .filter((relation) => {
|
|
4409
|
-
// const sourceMatch = entityNameSet.has(relation.source.entity);
|
|
4410
|
-
// const targetMatch = entityNameSet.has(relation.target.entity);
|
|
4411
|
-
// return sourceMatch || targetMatch;
|
|
4412
|
-
// })
|
|
4413
|
-
// .map((relation) => relationToRow(relation.id, relation));
|
|
4414
|
-
// const features = manifestRegistry
|
|
4415
|
-
// .getModuleFeatures(module.name)
|
|
4416
|
-
// .map((feature) => ({
|
|
4417
|
-
// name: feature.name,
|
|
4418
|
-
// key: feature.key,
|
|
4419
|
-
// title: feature.title,
|
|
4420
|
-
// defaultValue: feature.defaultValue ?? null,
|
|
4421
|
-
// }));
|
|
4422
|
-
// return {
|
|
4423
|
-
// id: module.name,
|
|
4424
|
-
// name: module.name,
|
|
4425
|
-
// title: module.title ?? module.name,
|
|
4426
|
-
// icon: module.icon ?? '',
|
|
4427
|
-
// entityCount: moduleEntities.length,
|
|
4428
|
-
// featureCount: features.length,
|
|
4429
|
-
// relationCount: matchedRelations.length,
|
|
4430
|
-
// entities: moduleEntities.map((item) => ({
|
|
4431
|
-
// id: item.entityName ?? `${item.module}.${item.name}`,
|
|
4432
|
-
// name: item.name,
|
|
4433
|
-
// title: item.name,
|
|
4434
|
-
// })),
|
|
4435
|
-
// features,
|
|
4436
|
-
// relations: matchedRelations,
|
|
4437
|
-
// } satisfies ModuleDefinitionRow;
|
|
4438
|
-
// },
|
|
4439
|
-
// type: AXPEntityQueryType.Single,
|
|
4440
|
-
// },
|
|
4441
|
-
// list: {
|
|
4442
|
-
// execute: async (request?: AXPQueryRequest) => {
|
|
4443
|
-
// const [modules, entities, relations] = await Promise.all([
|
|
4444
|
-
// crud.listModules(),
|
|
4445
|
-
// crud.list(),
|
|
4446
|
-
// crud.listRelations(),
|
|
4447
|
-
// ]);
|
|
4448
|
-
// const moduleEntityMap = new Map<string, Array<{ name: string; entityName?: string }>>();
|
|
4449
|
-
// for (const entity of entities) {
|
|
4450
|
-
// const list = moduleEntityMap.get(entity.module) ?? [];
|
|
4451
|
-
// list.push({ name: entity.name, entityName: entity.entityName });
|
|
4452
|
-
// moduleEntityMap.set(entity.module, list);
|
|
4453
|
-
// }
|
|
4454
|
-
// const rows: ModuleDefinitionRow[] = [];
|
|
4455
|
-
// for (const module of modules) {
|
|
4456
|
-
// const moduleEntities = moduleEntityMap.get(module.name) ?? [];
|
|
4457
|
-
// const entityNameSet = new Set(moduleEntities.map((item) => item.name));
|
|
4458
|
-
// const relationCount = relations.filter((relation) => {
|
|
4459
|
-
// const sourceMatch = entityNameSet.has(relation.source.entity);
|
|
4460
|
-
// const targetMatch = entityNameSet.has(relation.target.entity);
|
|
4461
|
-
// return sourceMatch || targetMatch;
|
|
4462
|
-
// }).length;
|
|
4463
|
-
// const moduleId = module.name;
|
|
4464
|
-
// rows.push({
|
|
4465
|
-
// id: moduleId,
|
|
4466
|
-
// name: module.name,
|
|
4467
|
-
// title: module.title ?? module.name,
|
|
4468
|
-
// icon: module.icon,
|
|
4469
|
-
// entityCount: moduleEntities.length,
|
|
4470
|
-
// featureCount: manifestRegistry.getModuleFeatures(module.name).length,
|
|
4471
|
-
// relationCount,
|
|
4472
|
-
// });
|
|
4473
|
-
// }
|
|
4474
|
-
// let items = rows;
|
|
4475
|
-
// if (request?.filter) {
|
|
4476
|
-
// items = applyFilterArray(items, [request.filter], request.filter.logic ?? 'and');
|
|
4477
|
-
// }
|
|
4478
|
-
// if (request?.sort?.length) {
|
|
4479
|
-
// items = applySortArray(items, request.sort);
|
|
4480
|
-
// }
|
|
4481
|
-
// const total = items.length;
|
|
4482
|
-
// const skip = request?.skip ?? 0;
|
|
4483
|
-
// const take = request?.take ?? total;
|
|
4484
|
-
// return { items: items.slice(skip, skip + take), total };
|
|
4485
|
-
// },
|
|
4486
|
-
// type: AXPEntityQueryType.List,
|
|
4487
|
-
// },
|
|
4488
|
-
// }
|
|
4489
|
-
// : undefined,
|
|
4490
|
-
interfaces: {
|
|
4491
|
-
master: {
|
|
4492
|
-
create: {
|
|
4493
|
-
sections: [{ id: 'overview' }],
|
|
4494
|
-
properties: [
|
|
4495
|
-
{ name: 'name', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
4496
|
-
{ name: 'title', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
4497
|
-
{ name: 'icon', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
4498
|
-
],
|
|
4499
|
-
},
|
|
4500
|
-
update: {
|
|
4501
|
-
sections: [{ id: 'overview' }],
|
|
4502
|
-
properties: [
|
|
4503
|
-
{ name: 'name', layout: { positions: { lg: { colSpan: 4 } } } },
|
|
4504
|
-
{ name: 'title', layout: { positions: { lg: { colSpan: 4 } } } },
|
|
4505
|
-
{ name: 'icon', layout: { positions: { lg: { colSpan: 4 } } } },
|
|
4506
|
-
],
|
|
4507
|
-
},
|
|
4508
|
-
single: {
|
|
4509
|
-
title: '{{title}}',
|
|
4510
|
-
sections: [{ id: 'overview' }],
|
|
4511
|
-
properties: [
|
|
4512
|
-
{ name: 'name', layout: { positions: { lg: { colSpan: 4 } } } },
|
|
4513
|
-
{ name: 'title', layout: { positions: { lg: { colSpan: 4 } } } },
|
|
4514
|
-
{ name: 'icon', layout: { positions: { lg: { colSpan: 4 } } } },
|
|
4515
|
-
{ name: 'entityCount', layout: { positions: { lg: { colSpan: 4 } } } },
|
|
4516
|
-
{ name: 'featureCount', layout: { positions: { lg: { colSpan: 4 } } } },
|
|
4517
|
-
{ name: 'relationCount', layout: { positions: { lg: { colSpan: 4 } } } },
|
|
4518
|
-
{ name: 'features', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
4519
|
-
],
|
|
4520
|
-
actions: [],
|
|
4521
|
-
},
|
|
4522
|
-
list: {
|
|
4523
|
-
actions: [...entityMasterCrudActions()],
|
|
4524
|
-
views: [createAllQueryView()],
|
|
4525
|
-
},
|
|
4526
|
-
},
|
|
4527
|
-
},
|
|
4528
|
-
};
|
|
4529
|
-
return entityDef;
|
|
4530
|
-
}
|
|
4531
|
-
|
|
4532
|
-
var moduleDefinition_entity = /*#__PURE__*/Object.freeze({
|
|
4533
|
-
__proto__: null,
|
|
4534
|
-
moduleDefinitionEntityFactory: moduleDefinitionEntityFactory
|
|
4535
|
-
});
|
|
4536
|
-
|
|
4537
|
-
//#region ---- Constants ----
|
|
4538
|
-
const I18N$3 = '@platform-management:definitions.permissionGroups.detail';
|
|
4539
|
-
const PERMISSIONS_DATA_LIST_BASE = {
|
|
4540
|
-
commands: { add: true, edit: true, remove: true },
|
|
4541
|
-
paging: false,
|
|
4542
|
-
showIndex: true,
|
|
4543
|
-
showHeader: true,
|
|
4544
|
-
};
|
|
4545
|
-
/** One-level child permissions (leaf rows only; matches domain contract). */
|
|
4546
|
-
const PERMISSION_CHILDREN_DATA_LIST_OPTIONS = {
|
|
4547
|
-
...PERMISSIONS_DATA_LIST_BASE,
|
|
4548
|
-
columns: [
|
|
4549
|
-
{ name: 'name', title: `${I18N$3}.columns.permission-name`, width: '140px' },
|
|
4550
|
-
{ name: 'title', title: `${I18N$3}.columns.permission-title`, width: '160px' },
|
|
4551
|
-
{
|
|
4552
|
-
name: 'description',
|
|
4553
|
-
title: `${I18N$3}.columns.permission-description`,
|
|
4554
|
-
width: '200px',
|
|
4555
|
-
schema: {
|
|
4556
|
-
name: 'description',
|
|
4557
|
-
title: `${I18N$3}.columns.permission-description`,
|
|
4558
|
-
interface: { name: AXPWidgetsCatalog.largeText, title: 'Description', options: {} },
|
|
4559
|
-
},
|
|
4560
|
-
},
|
|
4561
|
-
{
|
|
4562
|
-
name: 'requiredFeatures',
|
|
4563
|
-
title: `${I18N$3}.columns.required-features`,
|
|
4564
|
-
width: '220px',
|
|
4565
|
-
schema: {
|
|
4566
|
-
name: 'requiredFeatures',
|
|
4567
|
-
title: `${I18N$3}.columns.required-features`,
|
|
4568
|
-
interface: { name: AXPWidgetsCatalog.text, title: 'Required features', options: {} },
|
|
4569
|
-
},
|
|
4570
|
-
},
|
|
4571
|
-
],
|
|
4572
|
-
};
|
|
4573
|
-
//#endregion
|
|
4574
|
-
//#region ---- Mapping helpers ----
|
|
4575
|
-
function normalizeCategoryIds(raw) {
|
|
4576
|
-
if (raw == null) {
|
|
4577
|
-
return undefined;
|
|
4578
|
-
}
|
|
4579
|
-
if (Array.isArray(raw)) {
|
|
4580
|
-
const ids = raw.map((x) => String(x).trim()).filter((id) => id.length > 0);
|
|
4581
|
-
return ids.length ? ids : undefined;
|
|
4582
|
-
}
|
|
4583
|
-
if (typeof raw === 'string') {
|
|
4584
|
-
const s = raw.trim();
|
|
4585
|
-
return s ? [s] : undefined;
|
|
4586
|
-
}
|
|
4587
|
-
return undefined;
|
|
4588
|
-
}
|
|
4589
|
-
function normalizeCategoryLabels(raw) {
|
|
4590
|
-
if (!Array.isArray(raw) || raw.length === 0) {
|
|
4591
|
-
return undefined;
|
|
4592
|
-
}
|
|
4593
|
-
const out = raw
|
|
4594
|
-
.map((item) => {
|
|
4595
|
-
if (item == null || typeof item !== 'object') {
|
|
4596
|
-
return null;
|
|
4597
|
-
}
|
|
4598
|
-
const o = item;
|
|
4599
|
-
const id = String(o['id'] ?? '').trim();
|
|
4600
|
-
if (!id) {
|
|
4601
|
-
return null;
|
|
4602
|
-
}
|
|
4603
|
-
const title = typeof o['title'] === 'string' ? o['title'] : undefined;
|
|
4604
|
-
return title ? { id, title } : { id };
|
|
4605
|
-
})
|
|
4606
|
-
.filter((x) => x != null);
|
|
4607
|
-
return out.length ? out : undefined;
|
|
4608
|
-
}
|
|
4609
|
-
async function reloadPermissionDefinitions(injector) {
|
|
4610
|
-
// try {
|
|
4611
|
-
// await injector.get(AXPPermissionDefinitionService).reload();
|
|
4612
|
-
// } catch {
|
|
4613
|
-
// // Optional in minimal shells
|
|
4614
|
-
// }
|
|
4615
|
-
}
|
|
4616
|
-
function optionalString(value) {
|
|
4617
|
-
if (value == null) {
|
|
4618
|
-
return undefined;
|
|
4619
|
-
}
|
|
4620
|
-
const s = String(value).trim();
|
|
4621
|
-
return s || undefined;
|
|
4622
|
-
}
|
|
4623
|
-
function parseCommaSeparatedFeatures(raw) {
|
|
4624
|
-
return raw
|
|
4625
|
-
.split(',')
|
|
4626
|
-
.map((s) => s.trim())
|
|
4627
|
-
.filter(Boolean);
|
|
4628
|
-
}
|
|
4629
|
-
function formatCommaSeparatedFeatures(features) {
|
|
4630
|
-
if (!features?.length) {
|
|
4631
|
-
return '';
|
|
4632
|
-
}
|
|
4633
|
-
return features.join(', ');
|
|
4634
|
-
}
|
|
4635
|
-
function normalizeRequiredFeatures(raw) {
|
|
4636
|
-
if (raw == null) {
|
|
4637
|
-
return undefined;
|
|
4638
|
-
}
|
|
4639
|
-
if (Array.isArray(raw)) {
|
|
4640
|
-
const arr = raw.map((x) => String(x).trim()).filter(Boolean);
|
|
4641
|
-
return arr.length ? arr : undefined;
|
|
4642
|
-
}
|
|
4643
|
-
if (typeof raw === 'string') {
|
|
4644
|
-
const arr = parseCommaSeparatedFeatures(raw);
|
|
4645
|
-
return arr.length ? arr : undefined;
|
|
4646
|
-
}
|
|
4647
|
-
return undefined;
|
|
4648
|
-
}
|
|
4649
|
-
function normalizeLeafRow(raw) {
|
|
4650
|
-
if (raw == null || typeof raw !== 'object') {
|
|
4651
|
-
return null;
|
|
4652
|
-
}
|
|
4653
|
-
const o = raw;
|
|
4654
|
-
const name = String(o['name'] ?? '').trim();
|
|
4655
|
-
if (!name) {
|
|
4656
|
-
return null;
|
|
4657
|
-
}
|
|
4658
|
-
const title = String(o['title'] ?? '').trim();
|
|
4659
|
-
const description = optionalString(o['description']);
|
|
4660
|
-
const requiredFeatures = normalizeRequiredFeatures(o['requiredFeatures']);
|
|
4661
|
-
const result = { name, title };
|
|
4662
|
-
if (description) {
|
|
4663
|
-
result.description = description;
|
|
4664
|
-
}
|
|
4665
|
-
if (requiredFeatures?.length) {
|
|
4666
|
-
result.requiredFeatures = requiredFeatures;
|
|
4667
|
-
}
|
|
4668
|
-
return result;
|
|
4669
|
-
}
|
|
4670
|
-
function normalizeRootPermissionRow(raw) {
|
|
4671
|
-
if (raw == null || typeof raw !== 'object') {
|
|
4672
|
-
return null;
|
|
4673
|
-
}
|
|
4674
|
-
const o = raw;
|
|
4675
|
-
const name = String(o['name'] ?? '').trim();
|
|
4676
|
-
if (!name) {
|
|
4677
|
-
return null;
|
|
4678
|
-
}
|
|
4679
|
-
const title = String(o['title'] ?? '').trim();
|
|
4680
|
-
const description = optionalString(o['description']);
|
|
4681
|
-
const requiredFeatures = normalizeRequiredFeatures(o['requiredFeatures']);
|
|
4682
|
-
const childrenRaw = o['children'];
|
|
4683
|
-
let children;
|
|
4684
|
-
if (Array.isArray(childrenRaw)) {
|
|
4685
|
-
const mapped = childrenRaw.map(normalizeLeafRow).filter((x) => x != null);
|
|
4686
|
-
children = mapped.length ? mapped : undefined;
|
|
4687
|
-
}
|
|
4688
|
-
const result = { name, title };
|
|
4689
|
-
if (description) {
|
|
4690
|
-
result.description = description;
|
|
4691
|
-
}
|
|
4692
|
-
if (requiredFeatures?.length) {
|
|
4693
|
-
result.requiredFeatures = requiredFeatures;
|
|
4694
|
-
}
|
|
4695
|
-
if (children?.length) {
|
|
4696
|
-
result.children = children;
|
|
4697
|
-
}
|
|
4698
|
-
return result;
|
|
4699
|
-
}
|
|
4700
|
-
/**
|
|
4701
|
-
* Maps persisted / form rows to domain records. Supports legacy JSON string and domain-shaped arrays.
|
|
4702
|
-
*/
|
|
4703
|
-
function normalizePermissions(raw) {
|
|
4704
|
-
if (raw == null) {
|
|
4705
|
-
return [];
|
|
4706
|
-
}
|
|
4707
|
-
if (typeof raw === 'string') {
|
|
4708
|
-
try {
|
|
4709
|
-
const parsed = JSON.parse(raw);
|
|
4710
|
-
return normalizePermissions(parsed);
|
|
4711
|
-
}
|
|
4712
|
-
catch {
|
|
4713
|
-
return [];
|
|
4714
|
-
}
|
|
4715
|
-
}
|
|
4716
|
-
if (Array.isArray(raw)) {
|
|
4717
|
-
return raw
|
|
4718
|
-
.map((item) => normalizeRootPermissionRow(item))
|
|
4719
|
-
.filter((x) => x != null);
|
|
4720
|
-
}
|
|
4721
|
-
return [];
|
|
4722
|
-
}
|
|
4723
|
-
function permissionLeafToFormRow(p) {
|
|
4724
|
-
return {
|
|
4725
|
-
name: p.name,
|
|
4726
|
-
title: p.title,
|
|
4727
|
-
description: p.description ?? '',
|
|
4728
|
-
requiredFeatures: formatCommaSeparatedFeatures(p.requiredFeatures),
|
|
4729
|
-
};
|
|
4730
|
-
}
|
|
4731
|
-
function permissionDefinitionToFormRow(p) {
|
|
4732
|
-
return {
|
|
4733
|
-
name: p.name,
|
|
4734
|
-
title: p.title,
|
|
4735
|
-
description: p.description ?? '',
|
|
4736
|
-
requiredFeatures: formatCommaSeparatedFeatures(p.requiredFeatures),
|
|
4737
|
-
children: (p.children ?? []).map(permissionLeafToFormRow),
|
|
4738
|
-
};
|
|
4739
|
-
}
|
|
4740
|
-
function rowFromPermissionGroup(id, def) {
|
|
4741
|
-
return {
|
|
4742
|
-
id,
|
|
4743
|
-
name: def.name,
|
|
4744
|
-
title: def.title,
|
|
4745
|
-
description: def.description ?? null,
|
|
4746
|
-
categoryIds: def.categoryIds,
|
|
4747
|
-
categories: def.categories,
|
|
4748
|
-
permissions: (def.permissions ?? []).map(permissionDefinitionToFormRow),
|
|
4749
|
-
};
|
|
4750
|
-
}
|
|
4751
|
-
//#endregion
|
|
4752
|
-
//#region ---- Entity factory ----
|
|
4753
|
-
async function permissionGroupDefinitionEntityFactory() {
|
|
4754
|
-
// const crud = injector.get(AXP_ENTITY_DEFINITION_CRUD_SERVICE) as AXPEntityDefinitionCrudService | null;
|
|
4755
|
-
const entityDef = {
|
|
4756
|
-
module: RootConfig.module.name,
|
|
4757
|
-
name: RootConfig.entities.permissionGroupDefinition.name,
|
|
4758
|
-
title: RootConfig.entities.permissionGroupDefinition.title,
|
|
4759
|
-
icon: RootConfig.entities.permissionGroupDefinition.icon,
|
|
4760
|
-
formats: {
|
|
4761
|
-
individual: 'Permission group',
|
|
4762
|
-
plural: 'Permission groups',
|
|
4763
|
-
},
|
|
4764
|
-
plugins: [
|
|
4765
|
-
{
|
|
4766
|
-
name: 'unique-fields',
|
|
4767
|
-
options: {
|
|
4768
|
-
fields: 'name',
|
|
4769
|
-
scope: 'global',
|
|
4770
|
-
},
|
|
4771
|
-
},
|
|
4772
|
-
{
|
|
4773
|
-
name: 'category',
|
|
4774
|
-
options: {
|
|
4775
|
-
categoryEntity: `${RootConfig.module.name}.${RootConfig.entities.moduleDefinition.name}`,
|
|
4776
|
-
allowMultiple: true,
|
|
4777
|
-
},
|
|
4778
|
-
},
|
|
4779
|
-
],
|
|
4780
|
-
relatedEntities: [],
|
|
4781
|
-
groups: [
|
|
4782
|
-
{ id: 'basic-info', title: `${I18N$3}.sections.basic-info` },
|
|
4783
|
-
{ id: 'permissions', title: `${I18N$3}.sections.permissions` },
|
|
4784
|
-
],
|
|
4785
|
-
properties: [
|
|
4786
|
-
{
|
|
4787
|
-
name: 'name',
|
|
4788
|
-
title: `${I18N$3}.fields.name`,
|
|
4789
|
-
groupId: 'basic-info',
|
|
4790
|
-
schema: {
|
|
4791
|
-
dataType: 'string',
|
|
4792
|
-
interface: { type: AXPWidgetsCatalog.text, options: {} },
|
|
4793
|
-
},
|
|
4794
|
-
validations: [{ rule: 'required' }],
|
|
4795
|
-
options: { filter: { advance: { enabled: true }, inline: { enabled: true } }, sort: { enabled: true } },
|
|
4796
|
-
},
|
|
4797
|
-
{
|
|
4798
|
-
name: 'title',
|
|
4799
|
-
title: `${I18N$3}.fields.title`,
|
|
4800
|
-
groupId: 'basic-info',
|
|
4801
|
-
schema: {
|
|
4802
|
-
dataType: 'string',
|
|
4803
|
-
interface: { type: AXPWidgetsCatalog.text, options: {} },
|
|
4804
|
-
},
|
|
4805
|
-
validations: [{ rule: 'required' }],
|
|
4806
|
-
options: { filter: { advance: { enabled: true }, inline: { enabled: true } }, sort: { enabled: true } },
|
|
4807
|
-
},
|
|
4808
|
-
{
|
|
4809
|
-
name: 'description',
|
|
4810
|
-
title: `${I18N$3}.fields.description`,
|
|
4811
|
-
groupId: 'basic-info',
|
|
4812
|
-
schema: {
|
|
4813
|
-
dataType: 'string',
|
|
4814
|
-
interface: { type: AXPWidgetsCatalog.largeText, options: {} },
|
|
4815
|
-
},
|
|
4816
|
-
},
|
|
4817
|
-
{
|
|
4818
|
-
name: 'permissions',
|
|
4819
|
-
title: `${I18N$3}.fields.permissions`,
|
|
4820
|
-
groupId: 'permissions',
|
|
4821
|
-
schema: {
|
|
4822
|
-
dataType: 'array',
|
|
4823
|
-
interface: {
|
|
4824
|
-
type: AXPWidgetsList.Advanced.DataList,
|
|
4825
|
-
options: {
|
|
4826
|
-
...PERMISSIONS_DATA_LIST_BASE,
|
|
4827
|
-
columns: [
|
|
4828
|
-
{ name: 'name', title: `${I18N$3}.columns.permission-name`, width: '140px' },
|
|
4829
|
-
{ name: 'title', title: `${I18N$3}.columns.permission-title`, width: '160px' },
|
|
4830
|
-
{
|
|
4831
|
-
name: 'description',
|
|
4832
|
-
title: `${I18N$3}.columns.permission-description`,
|
|
4833
|
-
width: '200px',
|
|
4834
|
-
schema: {
|
|
4835
|
-
name: 'description',
|
|
4836
|
-
title: `${I18N$3}.columns.permission-description`,
|
|
4837
|
-
interface: { name: AXPWidgetsCatalog.largeText, title: 'Description', options: {} },
|
|
4838
|
-
},
|
|
4839
|
-
},
|
|
4840
|
-
{
|
|
4841
|
-
name: 'requiredFeatures',
|
|
4842
|
-
title: `${I18N$3}.columns.required-features`,
|
|
4843
|
-
width: '220px',
|
|
4844
|
-
schema: {
|
|
4845
|
-
name: 'requiredFeatures',
|
|
4846
|
-
title: `${I18N$3}.columns.required-features`,
|
|
4847
|
-
interface: { name: AXPWidgetsCatalog.text, title: 'Required features', options: {} },
|
|
4848
|
-
},
|
|
4849
|
-
},
|
|
4850
|
-
{
|
|
4851
|
-
name: 'children',
|
|
4852
|
-
title: `${I18N$3}.columns.child-permissions`,
|
|
4853
|
-
width: '320px',
|
|
4854
|
-
schema: {
|
|
4855
|
-
name: 'children',
|
|
4856
|
-
title: `${I18N$3}.columns.child-permissions`,
|
|
4857
|
-
interface: {
|
|
4858
|
-
name: AXPWidgetsList.Advanced.DataList,
|
|
4859
|
-
title: `${I18N$3}.columns.child-permissions`,
|
|
4860
|
-
options: PERMISSION_CHILDREN_DATA_LIST_OPTIONS,
|
|
4861
|
-
},
|
|
4862
|
-
},
|
|
4863
|
-
},
|
|
4864
|
-
],
|
|
4865
|
-
},
|
|
4866
|
-
},
|
|
4867
|
-
},
|
|
4868
|
-
},
|
|
4869
|
-
],
|
|
4870
|
-
columns: [{ name: 'name' }, { name: 'title' }],
|
|
4871
|
-
// commands: crud
|
|
4872
|
-
// ? {
|
|
4873
|
-
// create: {
|
|
4874
|
-
// execute: async (data: Record<string, unknown>) => {
|
|
4875
|
-
// // const definition = formToDefinition(data);
|
|
4876
|
-
// await crud.createPermissionGroup(definition.name, definition);
|
|
4877
|
-
// await reloadPermissionDefinitions(injector);
|
|
4878
|
-
// return { id: definition.name };
|
|
4879
|
-
// },
|
|
4880
|
-
// },
|
|
4881
|
-
// update: {
|
|
4882
|
-
// execute: async (data: Record<string, unknown>) => {
|
|
4883
|
-
// const id = (data['id'] ?? data['name']) as string;
|
|
4884
|
-
// // const definition = formToDefinition({ ...data, name: data['name'] ?? id });
|
|
4885
|
-
// await crud.updatePermissionGroup(id, definition);
|
|
4886
|
-
// await reloadPermissionDefinitions(injector);
|
|
4887
|
-
// },
|
|
4888
|
-
// },
|
|
4889
|
-
// delete: {
|
|
4890
|
-
// execute: async (id: string) => {
|
|
4891
|
-
// await crud.deletePermissionGroup(id);
|
|
4892
|
-
// await reloadPermissionDefinitions(injector);
|
|
4893
|
-
// },
|
|
4894
|
-
// },
|
|
4895
|
-
// }
|
|
4896
|
-
// : undefined,
|
|
4897
|
-
// queries: crud
|
|
4898
|
-
// ? {
|
|
4899
|
-
// byKey: {
|
|
4900
|
-
// execute: async (id: string) => {
|
|
4901
|
-
// const def = await crud.getPermissionGroup(id);
|
|
4902
|
-
// if (!def) return null;
|
|
4903
|
-
// return rowFromPermissionGroup(id, def);
|
|
4904
|
-
// },
|
|
4905
|
-
// type: AXPEntityQueryType.Single,
|
|
4906
|
-
// },
|
|
4907
|
-
// list: {
|
|
4908
|
-
// execute: async (request?: AXPQueryRequest) => {
|
|
4909
|
-
// const list = await crud.listPermissionGroups();
|
|
4910
|
-
// let items = list.map(({ id, definition }) => rowFromPermissionGroup(id, definition));
|
|
4911
|
-
// if (request?.filter) {
|
|
4912
|
-
// items = applyFilterArray(items, [request.filter], request.filter.logic ?? 'and');
|
|
4913
|
-
// }
|
|
4914
|
-
// if (request?.sort?.length) {
|
|
4915
|
-
// items = applySortArray(items, request.sort);
|
|
4916
|
-
// }
|
|
4917
|
-
// const total = items.length;
|
|
4918
|
-
// const skip = request?.skip ?? 0;
|
|
4919
|
-
// const take = request?.take ?? total;
|
|
4920
|
-
// const pagedItems = items.slice(skip, skip + take);
|
|
4921
|
-
// return { items: pagedItems, total };
|
|
4922
|
-
// },
|
|
4923
|
-
// type: AXPEntityQueryType.List,
|
|
4924
|
-
// },
|
|
4925
|
-
// }
|
|
4926
|
-
// : undefined,
|
|
4927
|
-
interfaces: {
|
|
4928
|
-
master: {
|
|
4929
|
-
create: {
|
|
4930
|
-
sections: [{ id: 'basic-info' }, { id: 'permissions' }],
|
|
4931
|
-
properties: [
|
|
4932
|
-
{ name: 'name', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
4933
|
-
{ name: 'title', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
4934
|
-
{ name: 'description', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
4935
|
-
{ name: 'permissions', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
4936
|
-
],
|
|
4937
|
-
},
|
|
4938
|
-
update: {
|
|
4939
|
-
sections: [{ id: 'basic-info' }, { id: 'permissions' }],
|
|
4940
|
-
properties: [
|
|
4941
|
-
{ name: 'name', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
4942
|
-
{ name: 'title', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
4943
|
-
{ name: 'description', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
4944
|
-
{ name: 'permissions', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
4945
|
-
],
|
|
4946
|
-
},
|
|
4947
|
-
single: {
|
|
4948
|
-
title: '{{name}}',
|
|
4949
|
-
sections: [{ id: 'basic-info' }, { id: 'permissions' }],
|
|
4950
|
-
properties: [
|
|
4951
|
-
{ name: 'name', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
4952
|
-
{ name: 'title', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
4953
|
-
{ name: 'description', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
4954
|
-
{ name: 'permissions', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
4955
|
-
],
|
|
4956
|
-
actions: [],
|
|
4957
|
-
},
|
|
4958
|
-
list: {
|
|
4959
|
-
actions: [...entityMasterCrudActions()],
|
|
4960
|
-
views: [createAllQueryView()],
|
|
4961
|
-
},
|
|
4962
|
-
},
|
|
4963
|
-
},
|
|
4964
|
-
};
|
|
4965
|
-
return entityDef;
|
|
4966
|
-
}
|
|
4967
|
-
//#endregion
|
|
4968
|
-
|
|
4969
|
-
var permissionDefinition_entity = /*#__PURE__*/Object.freeze({
|
|
4970
|
-
__proto__: null,
|
|
4971
|
-
permissionGroupDefinitionEntityFactory: permissionGroupDefinitionEntityFactory
|
|
4972
|
-
});
|
|
4973
|
-
|
|
4974
|
-
const I18N$2 = '@platform-management:definitions.plugins.detail';
|
|
4975
|
-
async function pluginDefinitionEntityFactory() {
|
|
4976
|
-
// const crud = injector.get(AXP_ENTITY_DEFINITION_CRUD_SERVICE) as AXPEntityDefinitionCrudService | null;
|
|
4977
|
-
const entityDef = {
|
|
4978
|
-
module: RootConfig.module.name,
|
|
4979
|
-
name: RootConfig.entities.pluginDefinition.name,
|
|
4980
|
-
title: RootConfig.entities.pluginDefinition.title,
|
|
4981
|
-
icon: RootConfig.entities.pluginDefinition.icon,
|
|
4982
|
-
formats: {
|
|
4983
|
-
individual: 'Plugin Definition',
|
|
4984
|
-
plural: 'Plugin Definitions',
|
|
4985
|
-
},
|
|
4986
|
-
plugins: [],
|
|
4987
|
-
relatedEntities: [],
|
|
4988
|
-
groups: [
|
|
4989
|
-
{ id: 'basic-info', title: `${I18N$2}.sections.basic-info` },
|
|
4990
|
-
{ id: 'options', title: `${I18N$2}.sections.options` },
|
|
4991
|
-
],
|
|
4992
|
-
properties: [
|
|
4993
|
-
{
|
|
4994
|
-
name: 'name',
|
|
4995
|
-
title: '@general:terms.common.name',
|
|
4996
|
-
groupId: 'basic-info',
|
|
4997
|
-
schema: {
|
|
4998
|
-
dataType: 'string',
|
|
4999
|
-
interface: { type: AXPWidgetsCatalog.text, options: {} },
|
|
5000
|
-
},
|
|
5001
|
-
validations: [{ rule: 'required' }],
|
|
5002
|
-
options: {
|
|
5003
|
-
filter: { advance: { enabled: true }, inline: { enabled: true } },
|
|
5004
|
-
sort: { enabled: true },
|
|
5005
|
-
},
|
|
5006
|
-
},
|
|
5007
|
-
{
|
|
5008
|
-
name: 'title',
|
|
5009
|
-
title: '@general:terms.common.title',
|
|
5010
|
-
groupId: 'basic-info',
|
|
5011
|
-
schema: {
|
|
5012
|
-
dataType: 'string',
|
|
5013
|
-
interface: { type: AXPWidgetsCatalog.text, options: {} },
|
|
5014
|
-
},
|
|
5015
|
-
validations: [{ rule: 'required' }],
|
|
5016
|
-
options: {
|
|
5017
|
-
filter: { advance: { enabled: true }, inline: { enabled: true } },
|
|
5018
|
-
sort: { enabled: true },
|
|
5019
|
-
},
|
|
5020
|
-
},
|
|
5021
|
-
{
|
|
5022
|
-
name: 'description',
|
|
5023
|
-
title: '@general:terms.common.description',
|
|
5024
|
-
groupId: 'basic-info',
|
|
5025
|
-
schema: {
|
|
5026
|
-
dataType: 'string',
|
|
5027
|
-
interface: { type: AXPWidgetsCatalog.largeText, options: {} },
|
|
5028
|
-
},
|
|
5029
|
-
},
|
|
5030
|
-
{
|
|
5031
|
-
name: 'icon',
|
|
5032
|
-
title: `${I18N$2}.fields.icon`,
|
|
5033
|
-
groupId: 'basic-info',
|
|
5034
|
-
schema: {
|
|
5035
|
-
dataType: 'string',
|
|
5036
|
-
interface: { type: AXPWidgetsCatalog.iconChooser },
|
|
5037
|
-
},
|
|
5038
|
-
},
|
|
5039
|
-
{
|
|
5040
|
-
name: 'options',
|
|
5041
|
-
title: `${I18N$2}.sections.options`,
|
|
5042
|
-
groupId: 'options',
|
|
5043
|
-
schema: {
|
|
5044
|
-
dataType: 'array',
|
|
5045
|
-
interface: {
|
|
5046
|
-
type: AXPWidgetsList.Advanced.DataList,
|
|
5047
|
-
options: {
|
|
5048
|
-
paging: false,
|
|
5049
|
-
showIndex: true,
|
|
5050
|
-
showHeader: true,
|
|
5051
|
-
commands: { add: true, edit: true, remove: true },
|
|
5052
|
-
columns: [
|
|
5053
|
-
{ name: 'name', title: `${I18N$2}.fields.option-name`, width: '160px' },
|
|
5054
|
-
{ name: 'title', title: `${I18N$2}.fields.option-title`, width: '200px' },
|
|
5055
|
-
{
|
|
5056
|
-
name: 'schema',
|
|
5057
|
-
title: `${I18N$2}.fields.option-schema`,
|
|
5058
|
-
width: '280px',
|
|
5059
|
-
schema: {
|
|
5060
|
-
name: 'interface',
|
|
5061
|
-
title: 'Schema',
|
|
5062
|
-
interface: {
|
|
5063
|
-
name: AXPWidgetsList.Advanced.WidgetFieldConfigurator,
|
|
5064
|
-
title: 'Schema',
|
|
5065
|
-
options: {
|
|
5066
|
-
fieldName: "{{ context.eval('name') }}",
|
|
5067
|
-
fieldTitle: "{{ context.eval('title') }}",
|
|
5068
|
-
},
|
|
5069
|
-
},
|
|
5070
|
-
},
|
|
5071
|
-
},
|
|
5072
|
-
{ name: 'description', title: `${I18N$2}.fields.option-description` },
|
|
5073
|
-
],
|
|
5074
|
-
},
|
|
5075
|
-
},
|
|
5076
|
-
},
|
|
5077
|
-
},
|
|
5078
|
-
],
|
|
5079
|
-
columns: [{ name: 'name' }, { name: 'title' }],
|
|
5080
|
-
// commands: crud
|
|
5081
|
-
// ? {
|
|
5082
|
-
// create: {
|
|
5083
|
-
// execute: async (data: Record<string, unknown>) => {
|
|
5084
|
-
// const name = (data['name'] as string) ?? '';
|
|
5085
|
-
// const optionsSource = data['options'];
|
|
5086
|
-
// const options = mapEntityFieldRowsInterfaceToDomain(optionsSource) as AXPPropertyDefinition[];
|
|
5087
|
-
// const definition: AXPPluginDefinition = {
|
|
5088
|
-
// name,
|
|
5089
|
-
// title: (data['title'] as string) ?? name,
|
|
5090
|
-
// description: data['description'] as string | undefined,
|
|
5091
|
-
// icon: data['icon'] as string | undefined,
|
|
5092
|
-
// options,
|
|
5093
|
-
// };
|
|
5094
|
-
// await crud.createPlugin(name, definition);
|
|
5095
|
-
// return { id: name };
|
|
5096
|
-
// },
|
|
5097
|
-
// },
|
|
5098
|
-
// update: {
|
|
5099
|
-
// execute: async (data: Record<string, unknown>) => {
|
|
5100
|
-
// const name = (data['id'] ?? data['name']) as string;
|
|
5101
|
-
// const existing = await crud.getPlugin(name);
|
|
5102
|
-
// const optionsSource = data['options'] !== undefined ? data['options'] : existing?.options;
|
|
5103
|
-
// const options = mapEntityFieldRowsInterfaceToDomain(optionsSource) as AXPPropertyDefinition[];
|
|
5104
|
-
// const definition: AXPPluginDefinition = existing
|
|
5105
|
-
// ? {
|
|
5106
|
-
// ...existing,
|
|
5107
|
-
// name: (data['name'] as string) ?? existing.name,
|
|
5108
|
-
// title: (data['title'] as string) ?? existing.title,
|
|
5109
|
-
// description: data['description'] as string | undefined,
|
|
5110
|
-
// icon: data['icon'] as string | undefined,
|
|
5111
|
-
// options,
|
|
5112
|
-
// }
|
|
5113
|
-
// : {
|
|
5114
|
-
// name: (data['name'] as string) ?? name,
|
|
5115
|
-
// title: (data['title'] as string) ?? name,
|
|
5116
|
-
// description: data['description'] as string | undefined,
|
|
5117
|
-
// icon: data['icon'] as string | undefined,
|
|
5118
|
-
// options,
|
|
5119
|
-
// };
|
|
5120
|
-
// await crud.updatePlugin(name, definition);
|
|
5121
|
-
// },
|
|
5122
|
-
// },
|
|
5123
|
-
// delete: {
|
|
5124
|
-
// execute: async (id: string) => {
|
|
5125
|
-
// await crud.deletePlugin(id);
|
|
5126
|
-
// },
|
|
5127
|
-
// },
|
|
5128
|
-
// }
|
|
5129
|
-
// : undefined,
|
|
5130
|
-
// queries: crud
|
|
5131
|
-
// ? {
|
|
5132
|
-
// byKey: {
|
|
5133
|
-
// execute: async (id: string) => {
|
|
5134
|
-
// const def = await crud.getPlugin(id);
|
|
5135
|
-
// if (!def) return null;
|
|
5136
|
-
// return {
|
|
5137
|
-
// ...def,
|
|
5138
|
-
// id: def.name,
|
|
5139
|
-
// options: mapEntityFieldRowsInterfaceForForm(def.options),
|
|
5140
|
-
// };
|
|
5141
|
-
// },
|
|
5142
|
-
// type: AXPEntityQueryType.Single,
|
|
5143
|
-
// },
|
|
5144
|
-
// list: {
|
|
5145
|
-
// execute: async (request?: AXPQueryRequest) => {
|
|
5146
|
-
// const list = await crud.listPlugins();
|
|
5147
|
-
// let items = list.map((x) => ({
|
|
5148
|
-
// id: x.name,
|
|
5149
|
-
// name: x.name,
|
|
5150
|
-
// title: x.title ?? '',
|
|
5151
|
-
// }));
|
|
5152
|
-
// if (request?.filter) {
|
|
5153
|
-
// items = applyFilterArray(items, [request.filter], request.filter.logic ?? 'and');
|
|
5154
|
-
// }
|
|
5155
|
-
// if (request?.sort?.length) {
|
|
5156
|
-
// items = applySortArray(items, request.sort);
|
|
5157
|
-
// }
|
|
5158
|
-
// const total = items.length;
|
|
5159
|
-
// const skip = request?.skip ?? 0;
|
|
5160
|
-
// const take = request?.take ?? total;
|
|
5161
|
-
// const pagedItems = items.slice(skip, skip + take);
|
|
5162
|
-
// return { items: pagedItems, total };
|
|
5163
|
-
// },
|
|
5164
|
-
// type: AXPEntityQueryType.List,
|
|
5165
|
-
// },
|
|
5166
|
-
// }
|
|
5167
|
-
// : undefined,
|
|
5168
|
-
interfaces: {
|
|
5169
|
-
master: {
|
|
5170
|
-
create: {
|
|
5171
|
-
sections: [{ id: 'basic-info' }, { id: 'options' }],
|
|
5172
|
-
properties: [
|
|
5173
|
-
{ name: 'name', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
5174
|
-
{ name: 'title', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
5175
|
-
{ name: 'description', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
5176
|
-
{ name: 'icon', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
5177
|
-
{ name: 'options', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
5178
|
-
],
|
|
5179
|
-
},
|
|
5180
|
-
update: {
|
|
5181
|
-
sections: [{ id: 'basic-info' }, { id: 'options' }],
|
|
5182
|
-
properties: [
|
|
5183
|
-
{ name: 'name', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
5184
|
-
{ name: 'title', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
5185
|
-
{ name: 'description', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
5186
|
-
{ name: 'icon', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
5187
|
-
{ name: 'options', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
5188
|
-
],
|
|
5189
|
-
},
|
|
5190
|
-
single: {
|
|
5191
|
-
title: '{{title}}',
|
|
5192
|
-
sections: [{ id: 'basic-info' }, { id: 'options' }],
|
|
5193
|
-
properties: [
|
|
5194
|
-
{ name: 'name', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
5195
|
-
{ name: 'title', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
5196
|
-
{ name: 'description', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
5197
|
-
{ name: 'icon', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
5198
|
-
{ name: 'options', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
5199
|
-
],
|
|
5200
|
-
actions: [],
|
|
5201
|
-
},
|
|
5202
|
-
list: {
|
|
5203
|
-
actions: [...entityMasterCrudActions()],
|
|
5204
|
-
views: [createAllQueryView()],
|
|
5205
|
-
},
|
|
5206
|
-
},
|
|
5207
|
-
},
|
|
5208
|
-
};
|
|
5209
|
-
return entityDef;
|
|
5210
|
-
}
|
|
5211
|
-
|
|
5212
|
-
const I18N$1 = '@platform-management:definitions.relations.detail';
|
|
5213
|
-
const MODULE_ENTITY = `${RootConfig.module.name}.${RootConfig.entities.moduleDefinition.name}`;
|
|
5214
|
-
const ENTITY_DEFINITION_ENTITY = `${RootConfig.module.name}.${RootConfig.entities.entityDefinition.name}`;
|
|
5215
|
-
//#region ---- Flat form keys & labels ----
|
|
5216
|
-
function formatEndpointLabel(aggregate, entity, key) {
|
|
5217
|
-
return `${aggregate}.${entity}.${key}`;
|
|
5218
|
-
}
|
|
5219
|
-
function formatRelationId(def) {
|
|
5220
|
-
const src = def.source;
|
|
5221
|
-
const tgt = def.target;
|
|
5222
|
-
return `${formatEndpointLabel(src.aggregate, src.entity, src.key)} -> ${formatEndpointLabel(tgt.aggregate, tgt.entity, tgt.key)}`;
|
|
5223
|
-
}
|
|
5224
|
-
function cardinalityTitle(value) {
|
|
5225
|
-
switch (value) {
|
|
5226
|
-
case AXPRelationshipCardinality.OneToOne:
|
|
5227
|
-
return `${I18N$1}.fields.cardinality-values.one-to-one`;
|
|
5228
|
-
case AXPRelationshipCardinality.OneToMany:
|
|
5229
|
-
return `${I18N$1}.fields.cardinality-values.one-to-many`;
|
|
5230
|
-
case AXPRelationshipCardinality.ManyToMany:
|
|
5231
|
-
return `${I18N$1}.fields.cardinality-values.many-to-many`;
|
|
5232
|
-
default:
|
|
5233
|
-
return String(value);
|
|
5234
|
-
}
|
|
5235
|
-
}
|
|
5236
|
-
function kindTitle(value) {
|
|
5237
|
-
switch (value) {
|
|
5238
|
-
case AXPRelationshipKind.Association:
|
|
5239
|
-
return `${I18N$1}.fields.kind-values.association`;
|
|
5240
|
-
case AXPRelationshipKind.Composition:
|
|
5241
|
-
return `${I18N$1}.fields.kind-values.composition`;
|
|
5242
|
-
case AXPRelationshipKind.Aggregation:
|
|
5243
|
-
return `${I18N$1}.fields.kind-values.aggregation`;
|
|
5244
|
-
default:
|
|
5245
|
-
return String(value);
|
|
5246
|
-
}
|
|
5247
|
-
}
|
|
5248
|
-
/**
|
|
5249
|
-
* Expands stored relation definition into flat form fields (and list display helpers).
|
|
5250
|
-
*/
|
|
5251
|
-
function expandRelationToFlat(def) {
|
|
5252
|
-
const id = def.id;
|
|
5253
|
-
const sourceLabel = formatEndpointLabel(def.source.aggregate, def.source.entity, def.source.key);
|
|
5254
|
-
const targetLabel = formatEndpointLabel(def.target.aggregate, def.target.entity, def.target.key);
|
|
5255
|
-
return {
|
|
5256
|
-
...(id != null && id !== '' ? { id } : {}),
|
|
5257
|
-
source: def.source,
|
|
5258
|
-
target: def.target,
|
|
5259
|
-
type: def.type,
|
|
5260
|
-
kind: def.kind,
|
|
5261
|
-
isRequired: def.isRequired,
|
|
5262
|
-
sourceModule: def.source.aggregate,
|
|
5263
|
-
sourceEntity: def.source.entity,
|
|
5264
|
-
sourceKey: def.source.key,
|
|
5265
|
-
targetModule: def.target.aggregate,
|
|
5266
|
-
targetEntity: def.target.entity,
|
|
5267
|
-
targetKey: def.target.key,
|
|
5268
|
-
sourceLabel,
|
|
5269
|
-
targetLabel,
|
|
5270
|
-
typeLabel: cardinalityTitle(def.type),
|
|
5271
|
-
kindLabel: kindTitle(def.kind),
|
|
5272
|
-
};
|
|
5273
|
-
}
|
|
5274
|
-
/**
|
|
5275
|
-
* Builds domain relation from flat form payload.
|
|
5276
|
-
*/
|
|
5277
|
-
function buildRelationFromFlat(data) {
|
|
5278
|
-
return {
|
|
5279
|
-
type: data['type'] ?? AXPRelationshipCardinality.OneToMany,
|
|
5280
|
-
kind: data['kind'] ?? AXPRelationshipKind.Association,
|
|
5281
|
-
isRequired: Boolean(data['isRequired']),
|
|
5282
|
-
source: {
|
|
5283
|
-
aggregate: String(data['sourceModule'] ?? '').trim(),
|
|
5284
|
-
entity: String(data['sourceEntity'] ?? '').trim(),
|
|
5285
|
-
key: String(data['sourceKey'] ?? '').trim(),
|
|
5286
|
-
},
|
|
5287
|
-
target: {
|
|
5288
|
-
aggregate: String(data['targetModule'] ?? '').trim(),
|
|
5289
|
-
entity: String(data['targetEntity'] ?? '').trim(),
|
|
5290
|
-
key: String(data['targetKey'] ?? '').trim(),
|
|
5291
|
-
},
|
|
5292
|
-
};
|
|
5293
|
-
}
|
|
5294
|
-
//#endregion
|
|
5295
|
-
async function relationDefinitionEntityFactory() {
|
|
5296
|
-
// const crud = injector.get(AXP_ENTITY_DEFINITION_CRUD_SERVICE) as AXPEntityDefinitionCrudService | null;
|
|
5297
|
-
const entityLookupBase = {
|
|
5298
|
-
look: 'select',
|
|
5299
|
-
entity: ENTITY_DEFINITION_ENTITY,
|
|
5300
|
-
textField: 'title',
|
|
5301
|
-
valueField: 'name',
|
|
5302
|
-
columns: ['name', 'title', 'module'],
|
|
5303
|
-
};
|
|
5304
|
-
const entityDef = {
|
|
5305
|
-
module: RootConfig.module.name,
|
|
5306
|
-
name: RootConfig.entities.relationDefinition.name,
|
|
5307
|
-
title: RootConfig.entities.relationDefinition.title,
|
|
5308
|
-
icon: RootConfig.entities.relationDefinition.icon,
|
|
5309
|
-
formats: {
|
|
5310
|
-
individual: 'Relation Definition',
|
|
5311
|
-
plural: 'Relation Definitions',
|
|
5312
|
-
},
|
|
5313
|
-
plugins: [],
|
|
5314
|
-
groups: [
|
|
5315
|
-
{ id: 'basic-info', title: `${I18N$1}.sections.basic-info` },
|
|
5316
|
-
{ id: 'source', title: `${I18N$1}.sections.source` },
|
|
5317
|
-
{ id: 'target', title: `${I18N$1}.sections.target` },
|
|
5318
|
-
],
|
|
5319
|
-
properties: [
|
|
5320
|
-
//#region ---- Basic ----
|
|
5321
|
-
{
|
|
5322
|
-
name: 'id',
|
|
5323
|
-
title: '@general:terms.common.id',
|
|
5324
|
-
groupId: 'basic-info',
|
|
5325
|
-
schema: {
|
|
5326
|
-
dataType: 'string',
|
|
5327
|
-
interface: { type: AXPWidgetsCatalog.text },
|
|
5328
|
-
},
|
|
5329
|
-
validations: [{ rule: 'required' }],
|
|
5330
|
-
options: {
|
|
5331
|
-
filter: { inline: { enabled: true } },
|
|
5332
|
-
sort: { enabled: true },
|
|
5333
|
-
},
|
|
5334
|
-
},
|
|
5335
|
-
{
|
|
5336
|
-
name: 'type',
|
|
5337
|
-
title: `${I18N$1}.fields.type`,
|
|
5338
|
-
groupId: 'basic-info',
|
|
5339
|
-
schema: {
|
|
5340
|
-
dataType: 'number',
|
|
5341
|
-
interface: {
|
|
5342
|
-
type: AXPWidgetsCatalog.select,
|
|
5343
|
-
options: {
|
|
5344
|
-
valueField: 'value',
|
|
5345
|
-
textField: 'title',
|
|
5346
|
-
dataSource: [
|
|
5347
|
-
{ value: AXPRelationshipCardinality.OneToOne, title: `${I18N$1}.fields.cardinality-values.one-to-one` },
|
|
5348
|
-
{ value: AXPRelationshipCardinality.OneToMany, title: `${I18N$1}.fields.cardinality-values.one-to-many` },
|
|
5349
|
-
{
|
|
5350
|
-
value: AXPRelationshipCardinality.ManyToMany,
|
|
5351
|
-
title: `${I18N$1}.fields.cardinality-values.many-to-many`,
|
|
5352
|
-
},
|
|
5353
|
-
],
|
|
5354
|
-
},
|
|
5355
|
-
},
|
|
5356
|
-
},
|
|
5357
|
-
validations: [{ rule: 'required' }],
|
|
5358
|
-
options: { filter: { inline: { enabled: true } }, sort: { enabled: true } },
|
|
5359
|
-
},
|
|
5360
|
-
{
|
|
5361
|
-
name: 'kind',
|
|
5362
|
-
title: `${I18N$1}.fields.kind`,
|
|
5363
|
-
groupId: 'basic-info',
|
|
5364
|
-
schema: {
|
|
5365
|
-
dataType: 'number',
|
|
5366
|
-
interface: {
|
|
5367
|
-
type: AXPWidgetsCatalog.select,
|
|
5368
|
-
options: {
|
|
5369
|
-
valueField: 'value',
|
|
5370
|
-
textField: 'title',
|
|
5371
|
-
dataSource: [
|
|
5372
|
-
{ value: AXPRelationshipKind.Association, title: `${I18N$1}.fields.kind-values.association` },
|
|
5373
|
-
{ value: AXPRelationshipKind.Composition, title: `${I18N$1}.fields.kind-values.composition` },
|
|
5374
|
-
{ value: AXPRelationshipKind.Aggregation, title: `${I18N$1}.fields.kind-values.aggregation` },
|
|
5375
|
-
],
|
|
5376
|
-
},
|
|
5377
|
-
},
|
|
5378
|
-
},
|
|
5379
|
-
validations: [{ rule: 'required' }],
|
|
5380
|
-
options: { filter: { inline: { enabled: true } }, sort: { enabled: true } },
|
|
5381
|
-
},
|
|
5382
|
-
{
|
|
5383
|
-
name: 'isRequired',
|
|
5384
|
-
title: `${I18N$1}.fields.is-required`,
|
|
5385
|
-
groupId: 'basic-info',
|
|
5386
|
-
schema: {
|
|
5387
|
-
dataType: 'boolean',
|
|
5388
|
-
interface: { type: AXPWidgetsCatalog.toggle },
|
|
5389
|
-
},
|
|
5390
|
-
},
|
|
5391
|
-
//#endregion
|
|
5392
|
-
//#region ---- Source ----
|
|
5393
|
-
{
|
|
5394
|
-
name: 'sourceModule',
|
|
5395
|
-
title: `${I18N$1}.fields.source-module`,
|
|
5396
|
-
groupId: 'source',
|
|
5397
|
-
schema: {
|
|
5398
|
-
dataType: 'string',
|
|
5399
|
-
interface: {
|
|
5400
|
-
type: AXPWidgetsCatalog.lookup,
|
|
5401
|
-
options: {
|
|
5402
|
-
look: 'select',
|
|
5403
|
-
entity: MODULE_ENTITY,
|
|
5404
|
-
textField: 'title',
|
|
5405
|
-
valueField: 'id',
|
|
5406
|
-
columns: ['title', 'name'],
|
|
5407
|
-
},
|
|
5408
|
-
},
|
|
5409
|
-
},
|
|
5410
|
-
validations: [{ rule: 'required' }],
|
|
5411
|
-
options: { filter: { inline: { enabled: true } }, sort: { enabled: true } },
|
|
5412
|
-
},
|
|
5413
|
-
{
|
|
5414
|
-
name: 'sourceEntity',
|
|
5415
|
-
title: `${I18N$1}.fields.source-entity`,
|
|
5416
|
-
groupId: 'source',
|
|
5417
|
-
schema: {
|
|
5418
|
-
dataType: 'string',
|
|
5419
|
-
interface: {
|
|
5420
|
-
type: AXPWidgetsCatalog.lookup,
|
|
5421
|
-
options: {
|
|
5422
|
-
...entityLookupBase,
|
|
5423
|
-
filter: {
|
|
5424
|
-
logic: 'and',
|
|
5425
|
-
filters: [{ field: 'module', operator: { type: 'equal' }, value: '{{ context.eval("sourceModule") }}' }],
|
|
5426
|
-
},
|
|
5427
|
-
},
|
|
5428
|
-
},
|
|
5429
|
-
},
|
|
5430
|
-
validations: [{ rule: 'required' }],
|
|
5431
|
-
options: { filter: { inline: { enabled: true } }, sort: { enabled: true } },
|
|
5432
|
-
},
|
|
5433
|
-
{
|
|
5434
|
-
name: 'sourceKey',
|
|
5435
|
-
title: `${I18N$1}.fields.source-key`,
|
|
5436
|
-
groupId: 'source',
|
|
5437
|
-
schema: {
|
|
5438
|
-
dataType: 'string',
|
|
5439
|
-
interface: { type: AXPWidgetsCatalog.text },
|
|
5440
|
-
},
|
|
5441
|
-
validations: [{ rule: 'required' }],
|
|
5442
|
-
options: { filter: { inline: { enabled: true } }, sort: { enabled: true } },
|
|
5443
|
-
},
|
|
5444
|
-
//#endregion
|
|
5445
|
-
//#region ---- Target ----
|
|
5446
|
-
{
|
|
5447
|
-
name: 'targetModule',
|
|
5448
|
-
title: `${I18N$1}.fields.target-module`,
|
|
5449
|
-
groupId: 'target',
|
|
5450
|
-
schema: {
|
|
5451
|
-
dataType: 'string',
|
|
5452
|
-
interface: {
|
|
5453
|
-
type: AXPWidgetsCatalog.lookup,
|
|
5454
|
-
options: {
|
|
5455
|
-
look: 'select',
|
|
5456
|
-
entity: MODULE_ENTITY,
|
|
5457
|
-
textField: 'title',
|
|
5458
|
-
valueField: 'id',
|
|
5459
|
-
columns: ['title', 'name'],
|
|
5460
|
-
},
|
|
5461
|
-
},
|
|
5462
|
-
},
|
|
5463
|
-
validations: [{ rule: 'required' }],
|
|
5464
|
-
options: { filter: { inline: { enabled: true } }, sort: { enabled: true } },
|
|
5465
|
-
},
|
|
5466
|
-
{
|
|
5467
|
-
name: 'targetEntity',
|
|
5468
|
-
title: `${I18N$1}.fields.target-entity`,
|
|
5469
|
-
groupId: 'target',
|
|
5470
|
-
schema: {
|
|
5471
|
-
dataType: 'string',
|
|
5472
|
-
interface: {
|
|
5473
|
-
type: AXPWidgetsCatalog.lookup,
|
|
5474
|
-
options: {
|
|
5475
|
-
...entityLookupBase,
|
|
5476
|
-
filter: {
|
|
5477
|
-
logic: 'and',
|
|
5478
|
-
filters: [{ field: 'module', operator: { type: 'equal' }, value: '{{ context.eval("targetModule") }}' }],
|
|
5479
|
-
},
|
|
5480
|
-
},
|
|
5481
|
-
},
|
|
5482
|
-
},
|
|
5483
|
-
validations: [{ rule: 'required' }],
|
|
5484
|
-
options: { filter: { inline: { enabled: true } }, sort: { enabled: true } },
|
|
5485
|
-
},
|
|
5486
|
-
{
|
|
5487
|
-
name: 'targetKey',
|
|
5488
|
-
title: `${I18N$1}.fields.target-key`,
|
|
5489
|
-
groupId: 'target',
|
|
5490
|
-
schema: {
|
|
5491
|
-
dataType: 'string',
|
|
5492
|
-
interface: { type: AXPWidgetsCatalog.text },
|
|
5493
|
-
},
|
|
5494
|
-
validations: [{ rule: 'required' }],
|
|
5495
|
-
options: { filter: { inline: { enabled: true } }, sort: { enabled: true } },
|
|
5496
|
-
},
|
|
5497
|
-
//#endregion
|
|
5498
|
-
//#region ---- List display (not on forms) ----
|
|
5499
|
-
{
|
|
5500
|
-
name: 'sourceLabel',
|
|
5501
|
-
title: `${I18N$1}.fields.source-label`,
|
|
5502
|
-
groupId: 'basic-info',
|
|
5503
|
-
schema: {
|
|
5504
|
-
dataType: 'string',
|
|
5505
|
-
interface: { type: AXPWidgetsCatalog.text, options: { disabled: true } },
|
|
5506
|
-
},
|
|
5507
|
-
options: { filter: { inline: { enabled: true } }, sort: { enabled: true } },
|
|
5508
|
-
},
|
|
5509
|
-
{
|
|
5510
|
-
name: 'targetLabel',
|
|
5511
|
-
title: `${I18N$1}.fields.target-label`,
|
|
5512
|
-
groupId: 'basic-info',
|
|
5513
|
-
schema: {
|
|
5514
|
-
dataType: 'string',
|
|
5515
|
-
interface: { type: AXPWidgetsCatalog.text, options: { disabled: true } },
|
|
5516
|
-
},
|
|
5517
|
-
options: { filter: { inline: { enabled: true } }, sort: { enabled: true } },
|
|
5518
|
-
},
|
|
5519
|
-
{
|
|
5520
|
-
name: 'typeLabel',
|
|
5521
|
-
title: `${I18N$1}.fields.type`,
|
|
5522
|
-
groupId: 'basic-info',
|
|
5523
|
-
schema: {
|
|
5524
|
-
dataType: 'string',
|
|
5525
|
-
interface: { type: AXPWidgetsCatalog.text, options: { disabled: true } },
|
|
5526
|
-
},
|
|
5527
|
-
options: { filter: { inline: { enabled: true } }, sort: { enabled: true } },
|
|
5528
|
-
},
|
|
5529
|
-
{
|
|
5530
|
-
name: 'kindLabel',
|
|
5531
|
-
title: `${I18N$1}.fields.kind`,
|
|
5532
|
-
groupId: 'basic-info',
|
|
5533
|
-
schema: {
|
|
5534
|
-
dataType: 'string',
|
|
5535
|
-
interface: { type: AXPWidgetsCatalog.text, options: { disabled: true } },
|
|
5536
|
-
},
|
|
5537
|
-
options: { filter: { inline: { enabled: true } }, sort: { enabled: true } },
|
|
5538
|
-
},
|
|
5539
|
-
//#endregion
|
|
5540
|
-
],
|
|
5541
|
-
columns: [
|
|
5542
|
-
{ name: 'id' },
|
|
5543
|
-
{ name: 'typeLabel' },
|
|
5544
|
-
{ name: 'kindLabel' },
|
|
5545
|
-
{ name: 'sourceLabel' },
|
|
5546
|
-
{ name: 'targetLabel' },
|
|
5547
|
-
{ name: 'isRequired' },
|
|
5548
|
-
],
|
|
5549
|
-
// commands: crud
|
|
5550
|
-
// ? {
|
|
5551
|
-
// create: {
|
|
5552
|
-
// execute: async (data: Record<string, unknown>) => {
|
|
5553
|
-
// const id = String(data['id'] ?? '').trim();
|
|
5554
|
-
// const definition = buildRelationFromFlat(data);
|
|
5555
|
-
// await crud.createRelation(id, definition);
|
|
5556
|
-
// return { id };
|
|
5557
|
-
// },
|
|
5558
|
-
// },
|
|
5559
|
-
// update: {
|
|
5560
|
-
// execute: async (data: Record<string, unknown>) => {
|
|
5561
|
-
// const id = String(data['id'] ?? '').trim();
|
|
5562
|
-
// const definition = buildRelationFromFlat(data);
|
|
5563
|
-
// await crud.updateRelation(id, definition);
|
|
5564
|
-
// },
|
|
5565
|
-
// },
|
|
5566
|
-
// delete: {
|
|
5567
|
-
// execute: async (id: string) => {
|
|
5568
|
-
// await crud.deleteRelation(id);
|
|
5569
|
-
// },
|
|
5570
|
-
// },
|
|
5571
|
-
// }
|
|
5572
|
-
// : undefined,
|
|
5573
|
-
// queries: crud
|
|
5574
|
-
// ? {
|
|
5575
|
-
// byKey: {
|
|
5576
|
-
// execute: async (id: string) => {
|
|
5577
|
-
// const def = await crud.getRelation(id);
|
|
5578
|
-
// if (!def) return null;
|
|
5579
|
-
// return expandRelationToFlat({ ...def, id });
|
|
5580
|
-
// },
|
|
5581
|
-
// type: AXPEntityQueryType.Single,
|
|
5582
|
-
// },
|
|
5583
|
-
// list: {
|
|
5584
|
-
// execute: async (request?: AXPQueryRequest) => {
|
|
5585
|
-
// const list = await crud.listRelations();
|
|
5586
|
-
// let items = list.map((x) => ({
|
|
5587
|
-
// ...expandRelationToFlat(x),
|
|
5588
|
-
// title: formatRelationId(x),
|
|
5589
|
-
// }));
|
|
5590
|
-
// if (request?.filter) {
|
|
5591
|
-
// items = applyFilterArray(items, [request.filter], request.filter.logic ?? 'and');
|
|
5592
|
-
// }
|
|
5593
|
-
// if (request?.sort?.length) {
|
|
5594
|
-
// items = applySortArray(items, request.sort);
|
|
5595
|
-
// }
|
|
5596
|
-
// const total = items.length;
|
|
5597
|
-
// const skip = request?.skip ?? 0;
|
|
5598
|
-
// const take = request?.take ?? total;
|
|
5599
|
-
// const pagedItems = items.slice(skip, skip + take);
|
|
5600
|
-
// return { items: pagedItems, total };
|
|
5601
|
-
// },
|
|
5602
|
-
// type: AXPEntityQueryType.List,
|
|
5603
|
-
// },
|
|
5604
|
-
// }
|
|
5605
|
-
// : undefined,
|
|
5606
|
-
interfaces: {
|
|
5607
|
-
master: {
|
|
5608
|
-
create: {
|
|
5609
|
-
sections: [{ id: 'basic-info' }, { id: 'source' }, { id: 'target' }],
|
|
5610
|
-
properties: [
|
|
5611
|
-
{ name: 'id', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
5612
|
-
{ name: 'type', layout: { positions: { lg: { colSpan: 4 } } } },
|
|
5613
|
-
{ name: 'kind', layout: { positions: { lg: { colSpan: 4 } } } },
|
|
5614
|
-
{ name: 'isRequired', layout: { positions: { lg: { colSpan: 4 } } } },
|
|
5615
|
-
{ name: 'sourceModule', layout: { positions: { lg: { colSpan: 4 } } } },
|
|
5616
|
-
{ name: 'sourceEntity', layout: { positions: { lg: { colSpan: 4 } } } },
|
|
5617
|
-
{ name: 'sourceKey', layout: { positions: { lg: { colSpan: 4 } } } },
|
|
5618
|
-
{ name: 'targetModule', layout: { positions: { lg: { colSpan: 4 } } } },
|
|
5619
|
-
{ name: 'targetEntity', layout: { positions: { lg: { colSpan: 4 } } } },
|
|
5620
|
-
{ name: 'targetKey', layout: { positions: { lg: { colSpan: 4 } } } },
|
|
5621
|
-
],
|
|
5622
|
-
},
|
|
5623
|
-
update: {
|
|
5624
|
-
sections: [{ id: 'basic-info' }, { id: 'source' }, { id: 'target' }],
|
|
5625
|
-
properties: [
|
|
5626
|
-
{ name: 'id', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
5627
|
-
{ name: 'type', layout: { positions: { lg: { colSpan: 4 } } } },
|
|
5628
|
-
{ name: 'kind', layout: { positions: { lg: { colSpan: 4 } } } },
|
|
5629
|
-
{ name: 'isRequired', layout: { positions: { lg: { colSpan: 4 } } } },
|
|
5630
|
-
{ name: 'sourceModule', layout: { positions: { lg: { colSpan: 4 } } } },
|
|
5631
|
-
{ name: 'sourceEntity', layout: { positions: { lg: { colSpan: 4 } } } },
|
|
5632
|
-
{ name: 'sourceKey', layout: { positions: { lg: { colSpan: 4 } } } },
|
|
5633
|
-
{ name: 'targetModule', layout: { positions: { lg: { colSpan: 4 } } } },
|
|
5634
|
-
{ name: 'targetEntity', layout: { positions: { lg: { colSpan: 4 } } } },
|
|
5635
|
-
{ name: 'targetKey', layout: { positions: { lg: { colSpan: 4 } } } },
|
|
5636
|
-
],
|
|
5637
|
-
},
|
|
5638
|
-
single: {
|
|
5639
|
-
title: '{{id}}',
|
|
5640
|
-
sections: [{ id: 'basic-info' }, { id: 'source' }, { id: 'target' }],
|
|
5641
|
-
properties: [
|
|
5642
|
-
{ name: 'id', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
5643
|
-
{ name: 'type', layout: { positions: { lg: { colSpan: 2 } } } },
|
|
5644
|
-
{ name: 'kind', layout: { positions: { lg: { colSpan: 2 } } } },
|
|
5645
|
-
{ name: 'isRequired', layout: { positions: { lg: { colSpan: 2 } } } },
|
|
5646
|
-
{ name: 'sourceModule', layout: { positions: { lg: { colSpan: 4 } } } },
|
|
5647
|
-
{ name: 'sourceEntity', layout: { positions: { lg: { colSpan: 4 } } } },
|
|
5648
|
-
{ name: 'sourceKey', layout: { positions: { lg: { colSpan: 4 } } } },
|
|
5649
|
-
{ name: 'targetModule', layout: { positions: { lg: { colSpan: 4 } } } },
|
|
5650
|
-
{ name: 'targetEntity', layout: { positions: { lg: { colSpan: 4 } } } },
|
|
5651
|
-
{ name: 'targetKey', layout: { positions: { lg: { colSpan: 4 } } } },
|
|
5652
|
-
],
|
|
5653
|
-
actions: [...entityMasterCrudActions()],
|
|
5654
|
-
},
|
|
5655
|
-
list: {
|
|
5656
|
-
actions: [...entityMasterCrudActions()],
|
|
5657
|
-
views: [createAllQueryView()],
|
|
5658
|
-
},
|
|
5659
|
-
},
|
|
5660
|
-
},
|
|
5661
|
-
};
|
|
5662
|
-
return entityDef;
|
|
5663
|
-
}
|
|
5664
|
-
|
|
5665
|
-
/**
|
|
5666
|
-
* Maps between persisted {@link AXPInterfaceDefinitionValue} (domain: `name` + `title` + `options`)
|
|
5667
|
-
* and the `widget-field-configurator` form value (`type` + `options`, same as layout widget node).
|
|
5668
|
-
*
|
|
5669
|
-
* Shared by entity-definition (field rows) and any entity
|
|
5670
|
-
* that binds `interface` to `widget-field-configurator`.
|
|
5671
|
-
*/
|
|
5672
|
-
const DEFAULT_INTERFACE = {
|
|
5673
|
-
name: 'text',
|
|
5674
|
-
title: 'Text',
|
|
5675
|
-
options: {},
|
|
5676
|
-
};
|
|
5677
|
-
function isFormShapedInterface(raw) {
|
|
5678
|
-
if (raw == null || typeof raw !== 'object' || Array.isArray(raw)) {
|
|
5679
|
-
return false;
|
|
5680
|
-
}
|
|
5681
|
-
const o = raw;
|
|
5682
|
-
return typeof o['type'] === 'string' && o['type'].trim() !== '' && o['name'] === undefined;
|
|
5683
|
-
}
|
|
5684
|
-
/**
|
|
5685
|
-
* Converts a stored schema interface to the form field value for `widget-field-configurator`.
|
|
5686
|
-
* Accepts domain shape (`name`) or already form-shaped (`type` only).
|
|
5687
|
-
*/
|
|
5688
|
-
function widgetFieldConfiguratorValueFromInterfaceDefinition(iface) {
|
|
5689
|
-
if (iface == null) {
|
|
5690
|
-
return { type: '', options: {} };
|
|
5691
|
-
}
|
|
5692
|
-
const name = typeof iface.name === 'string' ? iface.name.trim() : '';
|
|
5693
|
-
if (name !== '') {
|
|
5694
|
-
const options = iface.options != null && typeof iface.options === 'object' && !Array.isArray(iface.options)
|
|
5695
|
-
? { ...iface.options }
|
|
5696
|
-
: {};
|
|
5697
|
-
return { type: name, options };
|
|
5698
|
-
}
|
|
5699
|
-
if (isFormShapedInterface(iface)) {
|
|
5700
|
-
const options = iface['options'] != null &&
|
|
5701
|
-
typeof iface['options'] === 'object' &&
|
|
5702
|
-
!Array.isArray(iface['options'])
|
|
5703
|
-
? { ...iface['options'] }
|
|
5704
|
-
: {};
|
|
5705
|
-
return { type: iface['type'], options };
|
|
5706
|
-
}
|
|
5707
|
-
return { type: '', options: {} };
|
|
5708
|
-
}
|
|
5709
|
-
/**
|
|
5710
|
-
* Converts form output (widget node and/or legacy domain shape) to {@link AXPInterfaceDefinitionValue} for persistence.
|
|
5711
|
-
*/
|
|
5712
|
-
function interfaceDefinitionFromWidgetFieldConfiguratorValue(raw, fallbackTitle) {
|
|
5713
|
-
if (raw == null || typeof raw !== 'object' || Array.isArray(raw)) {
|
|
5714
|
-
return { ...DEFAULT_INTERFACE };
|
|
5715
|
-
}
|
|
5716
|
-
const o = raw;
|
|
5717
|
-
const nameFromType = typeof o['type'] === 'string' ? o['type'].trim() : '';
|
|
5718
|
-
const nameFromName = typeof o['name'] === 'string' ? o['name'].trim() : '';
|
|
5719
|
-
const name = nameFromType || nameFromName || DEFAULT_INTERFACE.name;
|
|
5720
|
-
const titleRaw = typeof o['title'] === 'string' ? o['title'].trim() : '';
|
|
5721
|
-
const title = titleRaw || fallbackTitle?.trim() || name;
|
|
5722
|
-
const opt = o['options'];
|
|
5723
|
-
const options = opt != null && typeof opt === 'object' && !Array.isArray(opt)
|
|
5724
|
-
? { ...opt }
|
|
5725
|
-
: {};
|
|
5726
|
-
return { name, title, options };
|
|
5727
|
-
}
|
|
5728
|
-
/**
|
|
5729
|
-
* Normalizes any interface-like value to `{ type, options }` for DataList column display
|
|
5730
|
-
* (`widget-field-configurator` column reads `AXPWidgetNode.type` on `rawValue`).
|
|
5731
|
-
*/
|
|
5732
|
-
function toWidgetFieldConfiguratorColumnNode(raw) {
|
|
5733
|
-
if (raw == null) {
|
|
5734
|
-
return { type: '', options: {} };
|
|
5735
|
-
}
|
|
5736
|
-
if (typeof raw === 'string') {
|
|
5737
|
-
const t = raw.trim();
|
|
5738
|
-
return t ? { type: t, options: {} } : { type: '', options: {} };
|
|
5739
|
-
}
|
|
5740
|
-
if (typeof raw !== 'object' || Array.isArray(raw)) {
|
|
5741
|
-
return { type: '', options: {} };
|
|
5742
|
-
}
|
|
5743
|
-
const o = raw;
|
|
5744
|
-
if (typeof o['type'] === 'string' && o['type'].trim() !== '') {
|
|
5745
|
-
const options = o['options'] != null && typeof o['options'] === 'object' && !Array.isArray(o['options'])
|
|
5746
|
-
? { ...o['options'] }
|
|
5747
|
-
: {};
|
|
5748
|
-
return { type: o['type'].trim(), options };
|
|
5749
|
-
}
|
|
5750
|
-
if (typeof o['name'] === 'string' && o['name'].trim() !== '') {
|
|
5751
|
-
const name = o['name'].trim();
|
|
5752
|
-
const title = typeof o['title'] === 'string' ? o['title'].trim() : name;
|
|
5753
|
-
const opt = o['options'];
|
|
5754
|
-
const options = opt != null && typeof opt === 'object' && !Array.isArray(opt)
|
|
5755
|
-
? opt
|
|
5756
|
-
: undefined;
|
|
5757
|
-
const iface = { name, title, ...(options !== undefined ? { options } : {}) };
|
|
5758
|
-
return widgetFieldConfiguratorValueFromInterfaceDefinition(iface);
|
|
5759
|
-
}
|
|
5760
|
-
const nested = o['interface'];
|
|
5761
|
-
if (nested != null && typeof nested === 'object' && !Array.isArray(nested)) {
|
|
5762
|
-
return toWidgetFieldConfiguratorColumnNode(nested);
|
|
5763
|
-
}
|
|
5764
|
-
return { type: '', options: {} };
|
|
5765
|
-
}
|
|
5766
|
-
function resolveInterfaceSourceForFieldRow(row) {
|
|
5767
|
-
if (row['interface'] !== undefined && row['interface'] !== null) {
|
|
5768
|
-
return row['interface'];
|
|
5769
|
-
}
|
|
5770
|
-
const schema = row['schema'];
|
|
5771
|
-
if (typeof schema === 'string') {
|
|
5772
|
-
return schema;
|
|
5773
|
-
}
|
|
5774
|
-
if (schema != null && typeof schema === 'object' && !Array.isArray(schema)) {
|
|
5775
|
-
const s = schema;
|
|
5776
|
-
if (s['interface'] !== undefined && s['interface'] !== null) {
|
|
5777
|
-
return s['interface'];
|
|
5778
|
-
}
|
|
5779
|
-
}
|
|
5780
|
-
return undefined;
|
|
5781
|
-
}
|
|
5782
|
-
//#endregion
|
|
5783
|
-
//#region ---- Entity field rows (DataList `fields` / nested `schema.interface`) ----
|
|
5784
|
-
function mapFieldRowInterfaceForForm(row) {
|
|
5785
|
-
const source = resolveInterfaceSourceForFieldRow(row);
|
|
5786
|
-
if (source === undefined) {
|
|
5787
|
-
return row;
|
|
5788
|
-
}
|
|
5789
|
-
const cell = toWidgetFieldConfiguratorColumnNode(source);
|
|
5790
|
-
const next = { ...row, interface: cell };
|
|
5791
|
-
const schema = row['schema'];
|
|
5792
|
-
if (schema != null && typeof schema === 'object' && !Array.isArray(schema)) {
|
|
5793
|
-
const s = schema;
|
|
5794
|
-
if (s['interface'] != null) {
|
|
5795
|
-
next['schema'] = { ...s, interface: cell };
|
|
5796
|
-
}
|
|
5797
|
-
}
|
|
5798
|
-
return next;
|
|
5799
|
-
}
|
|
5800
|
-
function mapFieldRowInterfaceToDomain(row) {
|
|
5801
|
-
const title = typeof row['title'] === 'string' ? row['title'] : typeof row['name'] === 'string' ? row['name'] : undefined;
|
|
5802
|
-
let next = row;
|
|
5803
|
-
if (row['interface'] != null && typeof row['interface'] === 'object' && !Array.isArray(row['interface'])) {
|
|
5804
|
-
next = {
|
|
5805
|
-
...next,
|
|
5806
|
-
interface: interfaceDefinitionFromWidgetFieldConfiguratorValue(row['interface'], title),
|
|
5807
|
-
};
|
|
5808
|
-
}
|
|
5809
|
-
const schema = row['schema'];
|
|
5810
|
-
if (schema != null && typeof schema === 'object' && !Array.isArray(schema)) {
|
|
5811
|
-
const s = schema;
|
|
5812
|
-
if (s['interface'] != null && typeof s['interface'] === 'object' && !Array.isArray(s['interface'])) {
|
|
5813
|
-
next = {
|
|
5814
|
-
...next,
|
|
5815
|
-
schema: {
|
|
5816
|
-
...s,
|
|
5817
|
-
interface: interfaceDefinitionFromWidgetFieldConfiguratorValue(s['interface'], title),
|
|
5818
|
-
},
|
|
5819
|
-
};
|
|
5820
|
-
}
|
|
5821
|
-
}
|
|
5822
|
-
return next;
|
|
5823
|
-
}
|
|
5824
|
-
/**
|
|
5825
|
-
* Maps `fields` array for entity-definition master load: domain `interface` → form `type` for widget-field-configurator.
|
|
5826
|
-
*/
|
|
5827
|
-
function mapEntityFieldRowsInterfaceForForm(rows) {
|
|
5828
|
-
if (!Array.isArray(rows)) {
|
|
5829
|
-
return [];
|
|
5830
|
-
}
|
|
5831
|
-
return rows.map((row) => {
|
|
5832
|
-
if (row == null || typeof row !== 'object' || Array.isArray(row)) {
|
|
5833
|
-
return row;
|
|
5834
|
-
}
|
|
5835
|
-
return mapFieldRowInterfaceForForm({ ...row });
|
|
5836
|
-
});
|
|
5837
|
-
}
|
|
5838
|
-
/**
|
|
5839
|
-
* Maps `fields` array before entity-definition persist: form → domain `interface`.
|
|
5840
|
-
*/
|
|
5841
|
-
function mapEntityFieldRowsInterfaceToDomain(rows) {
|
|
5842
|
-
if (!Array.isArray(rows)) {
|
|
5843
|
-
return [];
|
|
5844
|
-
}
|
|
5845
|
-
return rows.map((row) => {
|
|
5846
|
-
if (row == null || typeof row !== 'object' || Array.isArray(row)) {
|
|
5847
|
-
return row;
|
|
5848
|
-
}
|
|
5849
|
-
return mapFieldRowInterfaceToDomain({ ...row });
|
|
5850
|
-
});
|
|
5851
|
-
}
|
|
5852
|
-
//#endregion
|
|
5853
|
-
|
|
5854
|
-
async function tokenEntityFactory() {
|
|
5855
|
-
const i18n = RootConfig.config.i18n;
|
|
5856
|
-
const entityDef = {
|
|
5857
|
-
module: RootConfig.module.name,
|
|
5858
|
-
name: RootConfig.entities.token.name,
|
|
5859
|
-
title: RootConfig.entities.token.title,
|
|
5860
|
-
icon: RootConfig.entities.token.icon,
|
|
5861
|
-
formats: {
|
|
5862
|
-
individual: 'Token',
|
|
5863
|
-
plural: 'Tokens',
|
|
5864
|
-
},
|
|
5865
|
-
plugins: [
|
|
5866
|
-
{
|
|
5867
|
-
name: 'unique-fields',
|
|
5868
|
-
options: {
|
|
5869
|
-
fields: 'name',
|
|
5870
|
-
scope: 'global',
|
|
5871
|
-
},
|
|
5872
|
-
},
|
|
5873
|
-
{
|
|
5874
|
-
name: 'category',
|
|
5875
|
-
options: {
|
|
5876
|
-
appearance: { icon: true, color: true },
|
|
5877
|
-
},
|
|
5878
|
-
},
|
|
5879
|
-
{ name: 'history' },
|
|
5880
|
-
{ name: 'compare' },
|
|
5881
|
-
],
|
|
5882
|
-
relatedEntities: [],
|
|
5883
|
-
groups: [
|
|
5884
|
-
{
|
|
5885
|
-
id: 'basic-info',
|
|
5886
|
-
title: `@${i18n}:tokens.entities.token.groups.basic-info`,
|
|
5887
|
-
},
|
|
5888
|
-
{
|
|
5889
|
-
id: 'value',
|
|
5890
|
-
title: `@${i18n}:tokens.entities.token.groups.value`,
|
|
5891
|
-
},
|
|
5892
|
-
],
|
|
5893
|
-
properties: [
|
|
5894
|
-
{
|
|
5895
|
-
name: 'name',
|
|
5896
|
-
title: '@general:terms.common.name',
|
|
5897
|
-
groupId: 'basic-info',
|
|
5898
|
-
schema: {
|
|
5899
|
-
dataType: 'string',
|
|
5900
|
-
interface: {
|
|
5901
|
-
type: AXPWidgetsCatalog.text,
|
|
5902
|
-
},
|
|
5903
|
-
},
|
|
5904
|
-
validations: [
|
|
5905
|
-
{
|
|
5906
|
-
rule: 'required',
|
|
5907
|
-
},
|
|
5908
|
-
],
|
|
5909
|
-
options: {
|
|
5910
|
-
filter: {
|
|
5911
|
-
inline: {
|
|
5912
|
-
enabled: true,
|
|
5913
|
-
},
|
|
5914
|
-
},
|
|
5915
|
-
sort: {
|
|
5916
|
-
enabled: true,
|
|
5917
|
-
},
|
|
5918
|
-
},
|
|
5919
|
-
},
|
|
5920
|
-
{
|
|
5921
|
-
name: 'title',
|
|
5922
|
-
title: '@general:terms.common.title',
|
|
5923
|
-
groupId: 'basic-info',
|
|
5924
|
-
schema: {
|
|
5925
|
-
dataType: 'string',
|
|
5926
|
-
interface: {
|
|
5927
|
-
type: AXPWidgetsCatalog.text,
|
|
5928
|
-
},
|
|
5929
|
-
},
|
|
5930
|
-
validations: [
|
|
5931
|
-
{
|
|
5932
|
-
rule: 'required',
|
|
5933
|
-
},
|
|
5934
|
-
],
|
|
5935
|
-
options: {
|
|
5936
|
-
filter: {
|
|
5937
|
-
inline: {
|
|
5938
|
-
enabled: true,
|
|
5939
|
-
},
|
|
5940
|
-
},
|
|
5941
|
-
sort: {
|
|
5942
|
-
enabled: true,
|
|
5943
|
-
},
|
|
5944
|
-
},
|
|
5945
|
-
},
|
|
5946
|
-
{
|
|
5947
|
-
name: 'description',
|
|
5948
|
-
title: '@general:terms.common.description',
|
|
5949
|
-
groupId: 'basic-info',
|
|
5950
|
-
schema: {
|
|
5951
|
-
dataType: 'string',
|
|
5952
|
-
interface: {
|
|
5953
|
-
type: AXPWidgetsCatalog.largeText,
|
|
5954
|
-
},
|
|
5955
|
-
},
|
|
5956
|
-
options: {
|
|
5957
|
-
filter: {
|
|
5958
|
-
advance: {
|
|
5959
|
-
enabled: true,
|
|
5960
|
-
},
|
|
5961
|
-
},
|
|
5962
|
-
},
|
|
5963
|
-
},
|
|
5964
|
-
{
|
|
5965
|
-
name: 'kind',
|
|
5966
|
-
title: `@${i18n}:tokens.entities.token.fields.kind.title`,
|
|
5967
|
-
groupId: 'value',
|
|
5968
|
-
schema: {
|
|
5969
|
-
dataType: 'string',
|
|
5970
|
-
interface: {
|
|
5971
|
-
type: AXPWidgetsCatalog.select,
|
|
5972
|
-
options: {
|
|
5973
|
-
valueField: 'value',
|
|
5974
|
-
textField: 'title',
|
|
5975
|
-
dataSource: [
|
|
5976
|
-
{ title: 'Static', value: 'Static' },
|
|
5977
|
-
{ title: 'Context', value: 'Context' },
|
|
5978
|
-
{ title: 'Event', value: 'Event' },
|
|
5979
|
-
{ title: 'Computed', value: 'Computed' },
|
|
5980
|
-
{ title: 'Secret', value: 'Secret' },
|
|
5981
|
-
],
|
|
5982
|
-
direction: 'horizontal',
|
|
5983
|
-
multiple: false,
|
|
5984
|
-
},
|
|
5985
|
-
},
|
|
5986
|
-
},
|
|
5987
|
-
validations: [
|
|
5988
|
-
{
|
|
5989
|
-
rule: 'required',
|
|
5990
|
-
},
|
|
5991
|
-
],
|
|
5992
|
-
options: {
|
|
5993
|
-
filter: {
|
|
5994
|
-
advance: {
|
|
5995
|
-
enabled: true,
|
|
5996
|
-
},
|
|
5997
|
-
},
|
|
5998
|
-
sort: {
|
|
5999
|
-
enabled: true,
|
|
6000
|
-
},
|
|
6001
|
-
},
|
|
6002
|
-
},
|
|
6003
|
-
{
|
|
6004
|
-
name: 'dataType',
|
|
6005
|
-
title: `@${i18n}:tokens.entities.token.fields.data-type.title`,
|
|
6006
|
-
groupId: 'value',
|
|
6007
|
-
schema: {
|
|
6008
|
-
dataType: 'string',
|
|
6009
|
-
interface: {
|
|
6010
|
-
type: AXPWidgetsCatalog.select,
|
|
1929
|
+
type: AXPWidgetsList.Editors.SelectBox,
|
|
6011
1930
|
options: {
|
|
6012
1931
|
valueField: 'value',
|
|
6013
1932
|
textField: 'title',
|
|
@@ -6047,7 +1966,7 @@ async function tokenEntityFactory() {
|
|
|
6047
1966
|
schema: {
|
|
6048
1967
|
dataType: 'string',
|
|
6049
1968
|
interface: {
|
|
6050
|
-
type:
|
|
1969
|
+
type: AXPWidgetsList.Editors.SelectBox,
|
|
6051
1970
|
options: {
|
|
6052
1971
|
valueField: 'value',
|
|
6053
1972
|
textField: 'title',
|
|
@@ -6079,7 +1998,7 @@ async function tokenEntityFactory() {
|
|
|
6079
1998
|
schema: {
|
|
6080
1999
|
dataType: 'string',
|
|
6081
2000
|
interface: {
|
|
6082
|
-
type:
|
|
2001
|
+
type: AXPWidgetsList.Editors.SelectBox,
|
|
6083
2002
|
options: {
|
|
6084
2003
|
valueField: 'value',
|
|
6085
2004
|
textField: 'title',
|
|
@@ -6126,7 +2045,7 @@ async function tokenEntityFactory() {
|
|
|
6126
2045
|
schema: {
|
|
6127
2046
|
dataType: 'string',
|
|
6128
2047
|
interface: {
|
|
6129
|
-
type:
|
|
2048
|
+
type: AXPWidgetsList.Editors.TextBox,
|
|
6130
2049
|
options: {
|
|
6131
2050
|
placeholder: `@${i18n}:tokens.entities.token.fields.sample-value.placeholder`,
|
|
6132
2051
|
},
|
|
@@ -6147,7 +2066,7 @@ async function tokenEntityFactory() {
|
|
|
6147
2066
|
schema: {
|
|
6148
2067
|
dataType: 'boolean',
|
|
6149
2068
|
interface: {
|
|
6150
|
-
type:
|
|
2069
|
+
type: AXPWidgetsList.Editors.ToggleSwitch,
|
|
6151
2070
|
},
|
|
6152
2071
|
},
|
|
6153
2072
|
options: {
|
|
@@ -6551,275 +2470,9 @@ async function tokenEntityFactory() {
|
|
|
6551
2470
|
return entityDef;
|
|
6552
2471
|
}
|
|
6553
2472
|
|
|
6554
|
-
const I18N = '@platform-management:definitions.validations.detail';
|
|
6555
|
-
async function validationDefinitionEntityFactory() {
|
|
6556
|
-
const entityDef = {
|
|
6557
|
-
module: RootConfig.module.name,
|
|
6558
|
-
name: RootConfig.entities.validationDefinition.name,
|
|
6559
|
-
title: RootConfig.entities.validationDefinition.title,
|
|
6560
|
-
icon: RootConfig.entities.validationDefinition.icon,
|
|
6561
|
-
formats: {
|
|
6562
|
-
individual: 'Validation Rule Definition',
|
|
6563
|
-
plural: 'Validation Rule Definitions',
|
|
6564
|
-
},
|
|
6565
|
-
plugins: [],
|
|
6566
|
-
relatedEntities: [],
|
|
6567
|
-
groups: [
|
|
6568
|
-
{ id: 'basic-info', title: `${I18N}.sections.basic-info` },
|
|
6569
|
-
{ id: 'option-definitions', title: `${I18N}.pages.option-definitions` },
|
|
6570
|
-
],
|
|
6571
|
-
properties: [
|
|
6572
|
-
{
|
|
6573
|
-
name: 'rule',
|
|
6574
|
-
title: '@general:terms.common.rule',
|
|
6575
|
-
groupId: 'basic-info',
|
|
6576
|
-
schema: {
|
|
6577
|
-
dataType: 'string',
|
|
6578
|
-
interface: { type: AXPWidgetsCatalog.text, options: {} },
|
|
6579
|
-
},
|
|
6580
|
-
validations: [{ rule: 'required' }],
|
|
6581
|
-
options: {
|
|
6582
|
-
filter: { advance: { enabled: true }, inline: { enabled: true } },
|
|
6583
|
-
sort: { enabled: true },
|
|
6584
|
-
},
|
|
6585
|
-
},
|
|
6586
|
-
{
|
|
6587
|
-
name: 'title',
|
|
6588
|
-
title: '@general:terms.common.title',
|
|
6589
|
-
groupId: 'basic-info',
|
|
6590
|
-
schema: {
|
|
6591
|
-
dataType: 'string',
|
|
6592
|
-
interface: { type: AXPWidgetsCatalog.text, options: {} },
|
|
6593
|
-
},
|
|
6594
|
-
validations: [{ rule: 'required' }],
|
|
6595
|
-
options: {
|
|
6596
|
-
filter: { advance: { enabled: true }, inline: { enabled: true } },
|
|
6597
|
-
sort: { enabled: true },
|
|
6598
|
-
},
|
|
6599
|
-
},
|
|
6600
|
-
{
|
|
6601
|
-
name: 'description',
|
|
6602
|
-
title: '@general:terms.common.description',
|
|
6603
|
-
groupId: 'basic-info',
|
|
6604
|
-
schema: {
|
|
6605
|
-
dataType: 'string',
|
|
6606
|
-
interface: { type: AXPWidgetsCatalog.largeText, options: {} },
|
|
6607
|
-
},
|
|
6608
|
-
},
|
|
6609
|
-
{
|
|
6610
|
-
name: 'runAt',
|
|
6611
|
-
title: `${I18N}.fields.run-at`,
|
|
6612
|
-
groupId: 'basic-info',
|
|
6613
|
-
schema: {
|
|
6614
|
-
dataType: 'string',
|
|
6615
|
-
interface: {
|
|
6616
|
-
type: AXPWidgetsCatalog.select,
|
|
6617
|
-
options: {
|
|
6618
|
-
valueField: 'value',
|
|
6619
|
-
textField: 'title',
|
|
6620
|
-
dataSource: [
|
|
6621
|
-
{ value: 'client', title: `${I18N}.fields.run-at-values.client` },
|
|
6622
|
-
{ value: 'server', title: `${I18N}.fields.run-at-values.server` },
|
|
6623
|
-
{ value: 'both', title: `${I18N}.fields.run-at-values.both` },
|
|
6624
|
-
],
|
|
6625
|
-
},
|
|
6626
|
-
},
|
|
6627
|
-
},
|
|
6628
|
-
options: {
|
|
6629
|
-
filter: { advance: { enabled: true }, inline: { enabled: true } },
|
|
6630
|
-
sort: { enabled: true },
|
|
6631
|
-
},
|
|
6632
|
-
},
|
|
6633
|
-
{
|
|
6634
|
-
name: 'options',
|
|
6635
|
-
title: `${I18N}.pages.option-definitions`,
|
|
6636
|
-
groupId: 'option-definitions',
|
|
6637
|
-
schema: {
|
|
6638
|
-
dataType: 'array',
|
|
6639
|
-
interface: {
|
|
6640
|
-
type: AXPWidgetsList.Advanced.DataList,
|
|
6641
|
-
options: {
|
|
6642
|
-
paging: false,
|
|
6643
|
-
showIndex: true,
|
|
6644
|
-
showHeader: true,
|
|
6645
|
-
columns: [
|
|
6646
|
-
{ name: 'name', title: `${I18N}.fields.option-name`, width: '160px' },
|
|
6647
|
-
{ name: 'title', title: `${I18N}.fields.option-title`, width: '200px' },
|
|
6648
|
-
{
|
|
6649
|
-
name: 'schema',
|
|
6650
|
-
title: `${I18N}.fields.option-schema`,
|
|
6651
|
-
width: '280px',
|
|
6652
|
-
schema: {
|
|
6653
|
-
name: 'interface',
|
|
6654
|
-
title: 'Schema',
|
|
6655
|
-
interface: {
|
|
6656
|
-
name: AXPWidgetsList.Advanced.WidgetFieldConfigurator,
|
|
6657
|
-
title: 'Schema',
|
|
6658
|
-
options: {
|
|
6659
|
-
fieldName: "{{ context.eval('name') }}",
|
|
6660
|
-
fieldTitle: "{{ context.eval('title') }}",
|
|
6661
|
-
},
|
|
6662
|
-
},
|
|
6663
|
-
},
|
|
6664
|
-
},
|
|
6665
|
-
{ name: 'description', title: `${I18N}.fields.option-description` },
|
|
6666
|
-
],
|
|
6667
|
-
},
|
|
6668
|
-
},
|
|
6669
|
-
},
|
|
6670
|
-
},
|
|
6671
|
-
],
|
|
6672
|
-
columns: [{ name: 'rule' }, { name: 'title' }, { name: 'runAt' }],
|
|
6673
|
-
// commands: crud
|
|
6674
|
-
// ? {
|
|
6675
|
-
// create: {
|
|
6676
|
-
// execute: async (data: Record<string, unknown>) => {
|
|
6677
|
-
// const rule = (data['rule'] as string) ?? '';
|
|
6678
|
-
// const options = mapEntityFieldRowsInterfaceToDomain(data['options'] ?? []) as AXPPropertyDefinition[];
|
|
6679
|
-
// const definition: AXPValidationRuleDefinition = {
|
|
6680
|
-
// rule,
|
|
6681
|
-
// title: (data['title'] as string) ?? rule,
|
|
6682
|
-
// description: data['description'] as string | undefined,
|
|
6683
|
-
// runAt: (data['runAt'] as AXPValidationRunAt) ?? 'client',
|
|
6684
|
-
// ...(options.length > 0 ? { options } : {}),
|
|
6685
|
-
// };
|
|
6686
|
-
// await crud.createValidation(rule, definition);
|
|
6687
|
-
// return { id: rule };
|
|
6688
|
-
// },
|
|
6689
|
-
// },
|
|
6690
|
-
// update: {
|
|
6691
|
-
// execute: async (data: Record<string, unknown>) => {
|
|
6692
|
-
// const ruleKey = (data['id'] ?? data['rule']) as string;
|
|
6693
|
-
// const existing = await crud.getValidation(ruleKey);
|
|
6694
|
-
// const optionsSource = data['options'] !== undefined ? data['options'] : existing?.options;
|
|
6695
|
-
// const options = mapEntityFieldRowsInterfaceToDomain(optionsSource) as AXPPropertyDefinition[];
|
|
6696
|
-
// const definition: AXPValidationRuleDefinition = existing
|
|
6697
|
-
// ? {
|
|
6698
|
-
// ...existing,
|
|
6699
|
-
// rule: (data['rule'] as string) ?? existing.rule,
|
|
6700
|
-
// title: (data['title'] as string) ?? existing.title,
|
|
6701
|
-
// description: (data['description'] as string | undefined) ?? existing.description,
|
|
6702
|
-
// runAt: (data['runAt'] as AXPValidationRunAt) ?? existing.runAt ?? 'client',
|
|
6703
|
-
// options,
|
|
6704
|
-
// }
|
|
6705
|
-
// : {
|
|
6706
|
-
// rule: (data['rule'] as string) ?? ruleKey,
|
|
6707
|
-
// title: (data['title'] as string) ?? ruleKey,
|
|
6708
|
-
// description: data['description'] as string | undefined,
|
|
6709
|
-
// runAt: (data['runAt'] as AXPValidationRunAt) ?? 'client',
|
|
6710
|
-
// options,
|
|
6711
|
-
// };
|
|
6712
|
-
// await crud.updateValidation(ruleKey, definition);
|
|
6713
|
-
// },
|
|
6714
|
-
// },
|
|
6715
|
-
// delete: {
|
|
6716
|
-
// execute: async (id: string) => {
|
|
6717
|
-
// await crud.deleteValidation(id);
|
|
6718
|
-
// },
|
|
6719
|
-
// },
|
|
6720
|
-
// }
|
|
6721
|
-
// : undefined,
|
|
6722
|
-
// queries: crud
|
|
6723
|
-
// ? {
|
|
6724
|
-
// byKey: {
|
|
6725
|
-
// execute: async (id: string) => {
|
|
6726
|
-
// const def = await crud.getValidation(id);
|
|
6727
|
-
// if (!def) return null;
|
|
6728
|
-
// return {
|
|
6729
|
-
// ...def,
|
|
6730
|
-
// id: def.rule,
|
|
6731
|
-
// options: mapEntityFieldRowsInterfaceForForm(def.options ?? []),
|
|
6732
|
-
// };
|
|
6733
|
-
// },
|
|
6734
|
-
// type: AXPEntityQueryType.Single,
|
|
6735
|
-
// },
|
|
6736
|
-
// list: {
|
|
6737
|
-
// execute: async (request?: AXPQueryRequest) => {
|
|
6738
|
-
// const list = await crud.listValidations();
|
|
6739
|
-
// let items = list.map((x) => ({
|
|
6740
|
-
// id: x.rule,
|
|
6741
|
-
// rule: x.rule,
|
|
6742
|
-
// title: x.title ?? '',
|
|
6743
|
-
// runAt: x.runAt ?? 'client',
|
|
6744
|
-
// }));
|
|
6745
|
-
// if (request?.filter) {
|
|
6746
|
-
// items = applyFilterArray(items, [request.filter], request.filter.logic ?? 'and');
|
|
6747
|
-
// }
|
|
6748
|
-
// if (request?.sort?.length) {
|
|
6749
|
-
// items = applySortArray(items, request.sort);
|
|
6750
|
-
// }
|
|
6751
|
-
// const total = items.length;
|
|
6752
|
-
// const skip = request?.skip ?? 0;
|
|
6753
|
-
// const take = request?.take ?? total;
|
|
6754
|
-
// const pagedItems = items.slice(skip, skip + take);
|
|
6755
|
-
// return { items: pagedItems, total };
|
|
6756
|
-
// },
|
|
6757
|
-
// type: AXPEntityQueryType.List,
|
|
6758
|
-
// },
|
|
6759
|
-
// }
|
|
6760
|
-
// : undefined,
|
|
6761
|
-
interfaces: {
|
|
6762
|
-
master: {
|
|
6763
|
-
create: {
|
|
6764
|
-
sections: [{ id: 'basic-info' }, { id: 'option-definitions' }],
|
|
6765
|
-
properties: [
|
|
6766
|
-
{ name: 'rule', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
6767
|
-
{ name: 'title', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
6768
|
-
{ name: 'runAt', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
6769
|
-
{ name: 'description', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
6770
|
-
{ name: 'options', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
6771
|
-
],
|
|
6772
|
-
},
|
|
6773
|
-
update: {
|
|
6774
|
-
sections: [{ id: 'basic-info' }, { id: 'option-definitions' }],
|
|
6775
|
-
properties: [
|
|
6776
|
-
{ name: 'rule', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
6777
|
-
{ name: 'title', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
6778
|
-
{ name: 'runAt', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
6779
|
-
{ name: 'description', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
6780
|
-
{ name: 'options', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
6781
|
-
],
|
|
6782
|
-
},
|
|
6783
|
-
single: {
|
|
6784
|
-
title: '{{title}}',
|
|
6785
|
-
sections: [{ id: 'basic-info' }, { id: 'option-definitions' }],
|
|
6786
|
-
properties: [
|
|
6787
|
-
{ name: 'rule', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
6788
|
-
{ name: 'title', layout: { positions: { lg: { colSpan: 6 } } } },
|
|
6789
|
-
{ name: 'runAt', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
6790
|
-
{ name: 'description', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
6791
|
-
{ name: 'options', layout: { positions: { lg: { colSpan: 12 } } } },
|
|
6792
|
-
],
|
|
6793
|
-
actions: [],
|
|
6794
|
-
},
|
|
6795
|
-
list: {
|
|
6796
|
-
actions: [...entityMasterCrudActions()],
|
|
6797
|
-
views: [createAllQueryView()],
|
|
6798
|
-
},
|
|
6799
|
-
},
|
|
6800
|
-
},
|
|
6801
|
-
};
|
|
6802
|
-
return entityDef;
|
|
6803
|
-
}
|
|
6804
|
-
|
|
6805
2473
|
var index = /*#__PURE__*/Object.freeze({
|
|
6806
2474
|
__proto__: null,
|
|
6807
|
-
|
|
6808
|
-
commandDefinitionEntityFactory: commandDefinitionEntityFactory,
|
|
6809
|
-
interfaceDefinitionEntityFactory: interfaceDefinitionEntityFactory,
|
|
6810
|
-
interfaceDefinitionFromWidgetFieldConfiguratorValue: interfaceDefinitionFromWidgetFieldConfiguratorValue,
|
|
6811
|
-
mapEntityFieldRowsInterfaceForForm: mapEntityFieldRowsInterfaceForForm,
|
|
6812
|
-
mapEntityFieldRowsInterfaceToDomain: mapEntityFieldRowsInterfaceToDomain,
|
|
6813
|
-
menuDefinitionEntityFactory: menuDefinitionEntityFactory,
|
|
6814
|
-
moduleDefinitionEntityFactory: moduleDefinitionEntityFactory,
|
|
6815
|
-
permissionGroupDefinitionEntityFactory: permissionGroupDefinitionEntityFactory,
|
|
6816
|
-
pluginDefinitionEntityFactory: pluginDefinitionEntityFactory,
|
|
6817
|
-
queryDefinitionEntityFactory: queryDefinitionEntityFactory,
|
|
6818
|
-
relationDefinitionEntityFactory: relationDefinitionEntityFactory,
|
|
6819
|
-
toWidgetFieldConfiguratorColumnNode: toWidgetFieldConfiguratorColumnNode,
|
|
6820
|
-
tokenEntityFactory: tokenEntityFactory,
|
|
6821
|
-
validationDefinitionEntityFactory: validationDefinitionEntityFactory,
|
|
6822
|
-
widgetFieldConfiguratorValueFromInterfaceDefinition: widgetFieldConfiguratorValueFromInterfaceDefinition
|
|
2475
|
+
tokenEntityFactory: tokenEntityFactory
|
|
6823
2476
|
});
|
|
6824
2477
|
|
|
6825
2478
|
//#region ---- Contracts barrel ----
|
|
@@ -8748,5 +4401,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
8748
4401
|
* Generated bundle index. Do not edit.
|
|
8749
4402
|
*/
|
|
8750
4403
|
|
|
8751
|
-
export { AXPMenuManagementService as A,
|
|
8752
|
-
//# sourceMappingURL=acorex-modules-platform-management-acorex-modules-platform-management-
|
|
4404
|
+
export { AXPMenuManagementService as A, RootConfig as R, AXMPlatformManagementModule as a, AXPPlatformManagementFeatureKeys as b, AXPPlatformManagementMenuKeys as c, AXPPlatformManagementPermissionKeys as d, AXPWorkflowDesignerComponent as e, AXPWorkflowPaletteItemDragDirective as f, AXP_WORKFLOW_PALETTE_MIME as g, arrangeWorkflowDiagram as h, cloneDiagram as i, connectorPath as j, createNodeFromPaletteItem as k, createPortsFromPalette as l, createWorkflowConnectorId as m, createWorkflowNodeId as n, createWorkflowPortId as o, defaultCanConnectRequest as p, findConnector as q, findNode as r, findPort as s, parsePaletteItemDragPayload as t, portAnchorOnNode as u, portCanvasPosition as v, routeOrthogonalConnector as w, snapPoint as x, snapScalar as y, tokenEntityFactory as z };
|
|
4405
|
+
//# sourceMappingURL=acorex-modules-platform-management-acorex-modules-platform-management-ilmoyxAw.mjs.map
|