@acorex-platform/module-location-management-client 0.0.15 → 0.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/acorex-platform-module-location-management-client-assign-existing-location-to-party.command-DECKrIBR.mjs +163 -0
- package/fesm2022/acorex-platform-module-location-management-client-assign-existing-location-to-party.command-DECKrIBR.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-location-management-client-contracts.mjs +351 -0
- package/fesm2022/acorex-platform-module-location-management-client-contracts.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-location-management-client-create-location-with-assignment.command-Cl6KfruM.mjs +200 -0
- package/fesm2022/acorex-platform-module-location-management-client-create-location-with-assignment.command-Cl6KfruM.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-location-management-client.mjs +1701 -0
- package/fesm2022/acorex-platform-module-location-management-client.mjs.map +1 -0
- package/package.json +21 -5
- package/types/acorex-platform-module-location-management-client-contracts.d.ts +277 -0
- package/types/acorex-platform-module-location-management-client.d.ts +42 -0
- package/contracts/datasource.keys.d.ts +0 -6
- package/contracts/datasource.keys.js +0 -8
- package/contracts/entities/geographic-region/geographic-region.entity.d.ts +0 -2
- package/contracts/entities/geographic-region/geographic-region.entity.js +0 -725
- package/contracts/entities/geographic-region/geographic-region.types.d.ts +0 -27
- package/contracts/entities/geographic-region/geographic-region.types.js +0 -1
- package/contracts/entities/geographic-region/index.d.ts +0 -2
- package/contracts/entities/geographic-region/index.js +0 -2
- package/contracts/entities/index.d.ts +0 -5
- package/contracts/entities/index.js +0 -5
- package/contracts/entities/location/index.d.ts +0 -2
- package/contracts/entities/location/index.js +0 -2
- package/contracts/entities/location/location.entity.d.ts +0 -2
- package/contracts/entities/location/location.entity.js +0 -1075
- package/contracts/entities/location/location.types.d.ts +0 -30
- package/contracts/entities/location/location.types.js +0 -1
- package/contracts/entities/location-assignment/index.d.ts +0 -2
- package/contracts/entities/location-assignment/index.js +0 -2
- package/contracts/entities/location-assignment/location-assignment.entity.d.ts +0 -2
- package/contracts/entities/location-assignment/location-assignment.entity.js +0 -194
- package/contracts/entities/location-assignment/location-assignment.types.d.ts +0 -35
- package/contracts/entities/location-assignment/location-assignment.types.js +0 -2
- package/contracts/entities/location-role/index.d.ts +0 -2
- package/contracts/entities/location-role/index.js +0 -2
- package/contracts/entities/location-role/location-role.entity.d.ts +0 -2
- package/contracts/entities/location-role/location-role.entity.js +0 -143
- package/contracts/entities/location-role/location-role.types.d.ts +0 -6
- package/contracts/entities/location-role/location-role.types.js +0 -1
- package/contracts/entities/location-type/index.d.ts +0 -2
- package/contracts/entities/location-type/index.js +0 -2
- package/contracts/entities/location-type/location-type.entity.d.ts +0 -2
- package/contracts/entities/location-type/location-type.entity.js +0 -237
- package/contracts/entities/location-type/location-type.types.d.ts +0 -8
- package/contracts/entities/location-type/location-type.types.js +0 -1
- package/contracts/features.keys.d.ts +0 -1
- package/contracts/features.keys.js +0 -2
- package/contracts/index.d.ts +0 -8
- package/contracts/index.js +0 -10
- package/contracts/location-assignment.actions.d.ts +0 -8
- package/contracts/location-assignment.actions.js +0 -73
- package/contracts/location-assignment.utils.d.ts +0 -53
- package/contracts/location-assignment.utils.js +0 -145
- package/contracts/menu.keys.d.ts +0 -8
- package/contracts/menu.keys.js +0 -8
- package/contracts/package.json +0 -5
- package/contracts/permission.keys.d.ts +0 -33
- package/contracts/permission.keys.js +0 -42
- package/contracts/root-config.d.ts +0 -42
- package/contracts/root-config.js +0 -43
|
@@ -1,237 +0,0 @@
|
|
|
1
|
-
import { AXPWidgetsCatalog } from '@acorex-platform/framework-shared/core';
|
|
2
|
-
import { createAllQueryView, entityMasterCrudActions, entityMasterRecordActions } from '@acorex-platform/framework-shared/entity';
|
|
3
|
-
import { RootConfig } from '../../root-config';
|
|
4
|
-
export async function locationTypeFactory() {
|
|
5
|
-
const i18n = RootConfig.config.i18n;
|
|
6
|
-
const entityDef = {
|
|
7
|
-
module: RootConfig.module.name,
|
|
8
|
-
name: RootConfig.entities.locationType.name,
|
|
9
|
-
title: RootConfig.entities.locationType.title,
|
|
10
|
-
formats: {
|
|
11
|
-
individual: RootConfig.entities.locationType.title,
|
|
12
|
-
plural: RootConfig.entities.locationType.titlePlural,
|
|
13
|
-
searchResult: {
|
|
14
|
-
title: '{{ title }}',
|
|
15
|
-
description: '{{ description }}',
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
groups: [
|
|
19
|
-
{
|
|
20
|
-
id: 'basic-info',
|
|
21
|
-
title: '@general:terms.interface.basic-info',
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
id: 'appearance',
|
|
25
|
-
title: '@general:terms.interface.appearance',
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
id: 'settings',
|
|
29
|
-
title: '@general:terms.interface.settings',
|
|
30
|
-
},
|
|
31
|
-
],
|
|
32
|
-
plugins: [
|
|
33
|
-
{ name: 'archive' },
|
|
34
|
-
{ name: 'color' },
|
|
35
|
-
{ name: 'icon' },
|
|
36
|
-
],
|
|
37
|
-
properties: [
|
|
38
|
-
{
|
|
39
|
-
name: 'title',
|
|
40
|
-
title: '@general:terms.common.title',
|
|
41
|
-
groupId: 'basic-info',
|
|
42
|
-
options: {
|
|
43
|
-
sort: {
|
|
44
|
-
enabled: true,
|
|
45
|
-
},
|
|
46
|
-
filter: {
|
|
47
|
-
advance: {
|
|
48
|
-
enabled: true,
|
|
49
|
-
},
|
|
50
|
-
inline: {
|
|
51
|
-
enabled: true,
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
},
|
|
55
|
-
schema: {
|
|
56
|
-
dataType: 'string',
|
|
57
|
-
interface: {
|
|
58
|
-
type: AXPWidgetsCatalog.text,
|
|
59
|
-
options: {
|
|
60
|
-
placeholder: 'Enter location type name',
|
|
61
|
-
},
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
validations: [
|
|
65
|
-
{
|
|
66
|
-
rule: 'required',
|
|
67
|
-
},
|
|
68
|
-
],
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
name: 'description',
|
|
72
|
-
title: '@general:terms.common.description',
|
|
73
|
-
groupId: 'basic-info',
|
|
74
|
-
options: {
|
|
75
|
-
filter: {
|
|
76
|
-
advance: {
|
|
77
|
-
enabled: true,
|
|
78
|
-
},
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
schema: {
|
|
82
|
-
dataType: 'string',
|
|
83
|
-
interface: {
|
|
84
|
-
type: AXPWidgetsCatalog.largeText,
|
|
85
|
-
options: {
|
|
86
|
-
rows: 3,
|
|
87
|
-
},
|
|
88
|
-
},
|
|
89
|
-
},
|
|
90
|
-
},
|
|
91
|
-
],
|
|
92
|
-
columns: [{ name: 'title' }, { name: 'description' }],
|
|
93
|
-
interfaces: {
|
|
94
|
-
master: {
|
|
95
|
-
create: {
|
|
96
|
-
sections: [
|
|
97
|
-
{
|
|
98
|
-
id: 'basic-info',
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
id: 'appearance',
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
id: 'settings',
|
|
105
|
-
},
|
|
106
|
-
],
|
|
107
|
-
properties: [
|
|
108
|
-
{
|
|
109
|
-
name: 'title',
|
|
110
|
-
layout: {
|
|
111
|
-
positions: {
|
|
112
|
-
sm: {
|
|
113
|
-
colSpan: 12,
|
|
114
|
-
},
|
|
115
|
-
},
|
|
116
|
-
},
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
name: 'description',
|
|
120
|
-
layout: {
|
|
121
|
-
positions: {
|
|
122
|
-
sm: {
|
|
123
|
-
colSpan: 12,
|
|
124
|
-
},
|
|
125
|
-
},
|
|
126
|
-
},
|
|
127
|
-
},
|
|
128
|
-
],
|
|
129
|
-
},
|
|
130
|
-
update: {
|
|
131
|
-
sections: [
|
|
132
|
-
{
|
|
133
|
-
id: 'basic-info',
|
|
134
|
-
},
|
|
135
|
-
{
|
|
136
|
-
id: 'appearance',
|
|
137
|
-
},
|
|
138
|
-
{
|
|
139
|
-
id: 'settings',
|
|
140
|
-
},
|
|
141
|
-
],
|
|
142
|
-
properties: [
|
|
143
|
-
{
|
|
144
|
-
name: 'title',
|
|
145
|
-
layout: {
|
|
146
|
-
positions: {
|
|
147
|
-
sm: {
|
|
148
|
-
colSpan: 12,
|
|
149
|
-
},
|
|
150
|
-
},
|
|
151
|
-
},
|
|
152
|
-
},
|
|
153
|
-
{
|
|
154
|
-
name: 'description',
|
|
155
|
-
layout: {
|
|
156
|
-
positions: {
|
|
157
|
-
sm: {
|
|
158
|
-
colSpan: 12,
|
|
159
|
-
},
|
|
160
|
-
},
|
|
161
|
-
},
|
|
162
|
-
},
|
|
163
|
-
],
|
|
164
|
-
},
|
|
165
|
-
single: {
|
|
166
|
-
title: '{{title}}',
|
|
167
|
-
sections: [
|
|
168
|
-
{
|
|
169
|
-
id: 'basic-info',
|
|
170
|
-
layout: {
|
|
171
|
-
positions: {
|
|
172
|
-
lg: {
|
|
173
|
-
colSpan: 12,
|
|
174
|
-
},
|
|
175
|
-
},
|
|
176
|
-
},
|
|
177
|
-
},
|
|
178
|
-
{
|
|
179
|
-
id: 'appearance',
|
|
180
|
-
layout: {
|
|
181
|
-
positions: {
|
|
182
|
-
lg: {
|
|
183
|
-
colSpan: 12,
|
|
184
|
-
},
|
|
185
|
-
},
|
|
186
|
-
},
|
|
187
|
-
},
|
|
188
|
-
{
|
|
189
|
-
id: 'settings',
|
|
190
|
-
layout: {
|
|
191
|
-
positions: {
|
|
192
|
-
lg: {
|
|
193
|
-
colSpan: 12,
|
|
194
|
-
},
|
|
195
|
-
},
|
|
196
|
-
},
|
|
197
|
-
},
|
|
198
|
-
],
|
|
199
|
-
properties: [
|
|
200
|
-
{
|
|
201
|
-
name: 'title',
|
|
202
|
-
layout: {
|
|
203
|
-
positions: {
|
|
204
|
-
lg: {
|
|
205
|
-
colSpan: 12,
|
|
206
|
-
order: 1,
|
|
207
|
-
},
|
|
208
|
-
},
|
|
209
|
-
},
|
|
210
|
-
},
|
|
211
|
-
{
|
|
212
|
-
name: 'description',
|
|
213
|
-
layout: {
|
|
214
|
-
positions: {
|
|
215
|
-
lg: {
|
|
216
|
-
colSpan: 12,
|
|
217
|
-
order: 2,
|
|
218
|
-
},
|
|
219
|
-
},
|
|
220
|
-
},
|
|
221
|
-
},
|
|
222
|
-
],
|
|
223
|
-
actions: [...entityMasterRecordActions()],
|
|
224
|
-
},
|
|
225
|
-
list: {
|
|
226
|
-
actions: [...entityMasterCrudActions()],
|
|
227
|
-
views: [
|
|
228
|
-
createAllQueryView({
|
|
229
|
-
sorts: [{ name: 'title', dir: 'asc' }],
|
|
230
|
-
}),
|
|
231
|
-
],
|
|
232
|
-
},
|
|
233
|
-
},
|
|
234
|
-
},
|
|
235
|
-
};
|
|
236
|
-
return entityDef;
|
|
237
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { AXPEntityModel } from '@acorex-platform/framework-shared/entity';
|
|
2
|
-
export interface AXMLocationManagementLocationTypeEntityModel extends AXPEntityModel<string> {
|
|
3
|
-
title: string;
|
|
4
|
-
description?: string;
|
|
5
|
-
icon?: string;
|
|
6
|
-
color?: string;
|
|
7
|
-
isActive: boolean;
|
|
8
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const AXMLocationManagementFeatureKeys: {};
|
package/contracts/index.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export * from './datasource.keys';
|
|
2
|
-
export * from './features.keys';
|
|
3
|
-
export * from './location-assignment.actions';
|
|
4
|
-
export * from './location-assignment.utils';
|
|
5
|
-
export * from './menu.keys';
|
|
6
|
-
export * from './permission.keys';
|
|
7
|
-
export * from './root-config';
|
|
8
|
-
export * from './entities';
|
package/contracts/index.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
//#region ---- Contracts barrel ----
|
|
2
|
-
export * from './datasource.keys';
|
|
3
|
-
export * from './features.keys';
|
|
4
|
-
export * from './location-assignment.actions';
|
|
5
|
-
export * from './location-assignment.utils';
|
|
6
|
-
export * from './menu.keys';
|
|
7
|
-
export * from './permission.keys';
|
|
8
|
-
export * from './root-config';
|
|
9
|
-
//#endregion
|
|
10
|
-
export * from './entities';
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { AXPEntityAction } from '@acorex-platform/framework-shared/entity';
|
|
2
|
-
/** Read-only assignments list on Location detail (no create/update/delete). */
|
|
3
|
-
export declare function locationAssignmentReadOnlyRelatedActions(): AXPEntityAction[];
|
|
4
|
-
/**
|
|
5
|
-
* Actions for LocationAssignment when shown from Party/Customer/Supplier.
|
|
6
|
-
* Create menu: assign existing location or create new location with assignee prefilled.
|
|
7
|
-
*/
|
|
8
|
-
export declare function locationAssignmentDetailsCrudActionsForPartyContext(_partyIdContextPath?: string): AXPEntityAction[];
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { AXPSystemActionType } from '@acorex-platform/framework-shared/core';
|
|
2
|
-
import { AXPEntityCommandScope, entityDetailsEditAction, entityMasterBulkDeleteAction, entityMasterCreateAction, entityMasterDeleteAction, entityMasterViewAction, entityOverrideDetailsViewAction, } from '@acorex-platform/framework-shared/entity';
|
|
3
|
-
import { RootConfig } from './root-config';
|
|
4
|
-
//#region ---- Command keys ----
|
|
5
|
-
const ASSIGN_EXISTING_LOCATION = `${RootConfig.module.name}.${RootConfig.entities.locationAssignment.name}:AssignExistingLocation`;
|
|
6
|
-
const CREATE_WITH_NEW_LOCATION = `${RootConfig.module.name}.${RootConfig.entities.locationAssignment.name}:CreateWithNewLocation`;
|
|
7
|
-
//#endregion
|
|
8
|
-
//#region ---- Location assignment related-entity actions ----
|
|
9
|
-
const assigneeProcessOptions = () => ({
|
|
10
|
-
process: {
|
|
11
|
-
redirect: false,
|
|
12
|
-
canCreateNewOne: true,
|
|
13
|
-
data: {
|
|
14
|
-
'ownerRef.type': '{{ host.entity() }}',
|
|
15
|
-
'ownerRef.id': '{{ host.eval("id") }}',
|
|
16
|
-
'ownerRef.title': '{{ host.eval("party.title") }}',
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
});
|
|
20
|
-
/** Read-only assignments list on Location detail (no create/update/delete). */
|
|
21
|
-
export function locationAssignmentReadOnlyRelatedActions() {
|
|
22
|
-
return [
|
|
23
|
-
{ ...entityMasterCreateAction(), hidden: true },
|
|
24
|
-
{ ...entityMasterBulkDeleteAction(), hidden: true },
|
|
25
|
-
{ ...entityMasterDeleteAction(), hidden: true },
|
|
26
|
-
{ ...entityMasterViewAction(), hidden: true },
|
|
27
|
-
];
|
|
28
|
-
}
|
|
29
|
-
function locationAssignmentPartyCreateAction() {
|
|
30
|
-
const assigneeOptions = assigneeProcessOptions();
|
|
31
|
-
return {
|
|
32
|
-
name: 'Create',
|
|
33
|
-
title: '@general:actions.create.title',
|
|
34
|
-
command: { name: 'Entity:Create' },
|
|
35
|
-
icon: 'fa-light fa-plus',
|
|
36
|
-
priority: 'primary',
|
|
37
|
-
type: AXPSystemActionType.Create,
|
|
38
|
-
scope: AXPEntityCommandScope.TypeLevel,
|
|
39
|
-
items: [
|
|
40
|
-
{
|
|
41
|
-
name: 'AssignExistingLocation',
|
|
42
|
-
title: '@location-management:location-assignments.actions.assign-existing-location.title',
|
|
43
|
-
command: { name: ASSIGN_EXISTING_LOCATION, options: assigneeOptions },
|
|
44
|
-
icon: 'fa-light fa-map-marker-alt',
|
|
45
|
-
priority: 'primary',
|
|
46
|
-
type: AXPSystemActionType.Create,
|
|
47
|
-
scope: AXPEntityCommandScope.TypeLevel,
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
name: 'CreateWithNewLocation',
|
|
51
|
-
title: '@location-management:location-assignments.actions.create-with-new-location.title',
|
|
52
|
-
command: { name: CREATE_WITH_NEW_LOCATION, options: assigneeOptions },
|
|
53
|
-
icon: 'fa-light fa-location-plus',
|
|
54
|
-
priority: 'primary',
|
|
55
|
-
type: AXPSystemActionType.Create,
|
|
56
|
-
scope: AXPEntityCommandScope.TypeLevel,
|
|
57
|
-
},
|
|
58
|
-
],
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Actions for LocationAssignment when shown from Party/Customer/Supplier.
|
|
63
|
-
* Create menu: assign existing location or create new location with assignee prefilled.
|
|
64
|
-
*/
|
|
65
|
-
export function locationAssignmentDetailsCrudActionsForPartyContext(_partyIdContextPath = 'id') {
|
|
66
|
-
return [
|
|
67
|
-
{ ...entityMasterCreateAction(), hidden: true },
|
|
68
|
-
locationAssignmentPartyCreateAction(),
|
|
69
|
-
entityDetailsEditAction(),
|
|
70
|
-
entityOverrideDetailsViewAction(),
|
|
71
|
-
];
|
|
72
|
-
}
|
|
73
|
-
//#endregion
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import type { AXPEntityProperty, AXPQueryFilter } from '@acorex-platform/framework-shared/entity';
|
|
2
|
-
type LocationAssignmentLocationSnapshot = {
|
|
3
|
-
id: string;
|
|
4
|
-
title: string;
|
|
5
|
-
fullAddress?: string;
|
|
6
|
-
street1?: string;
|
|
7
|
-
street2?: string;
|
|
8
|
-
postalCode?: string;
|
|
9
|
-
city?: {
|
|
10
|
-
title: string;
|
|
11
|
-
};
|
|
12
|
-
state?: {
|
|
13
|
-
title: string;
|
|
14
|
-
};
|
|
15
|
-
country?: {
|
|
16
|
-
title: string;
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
type LocationAssignmentPersonSnapshot = {
|
|
20
|
-
id: string;
|
|
21
|
-
fullName?: string;
|
|
22
|
-
phones?: unknown[];
|
|
23
|
-
emails?: unknown[];
|
|
24
|
-
};
|
|
25
|
-
/** Canonical assignee type for party-scoped location assignment links. */
|
|
26
|
-
export declare const LOCATION_ASSIGNMENT_PARTY_TYPE = "BusinessCore.Party";
|
|
27
|
-
/** Resolves assignee display title from host/process data (plain string or multi-language object). */
|
|
28
|
-
export declare function resolveLocationAssignmentDisplayTitle(locale: string, ...candidates: unknown[]): string;
|
|
29
|
-
/** Builds a location snapshot for nested LocationAssignment display fields. */
|
|
30
|
-
export declare function buildLocationAssignmentLocationSnapshot(locationRow: Record<string, unknown>, locationId: string): LocationAssignmentLocationSnapshot;
|
|
31
|
-
/** Builds a person snapshot for nested LocationAssignment site-contact fields. */
|
|
32
|
-
export declare function buildLocationAssignmentPersonSnapshot(personRow: Record<string, unknown>, personId: string): LocationAssignmentPersonSnapshot;
|
|
33
|
-
/** Filters LocationAssignment rows for a location detail context. */
|
|
34
|
-
export declare function locationAssignmentLocationConditions(locationIdContextPath?: string): AXPQueryFilter[];
|
|
35
|
-
/** Filters LocationAssignment rows for the current details-view host entity. */
|
|
36
|
-
export declare function locationAssignmentPartyConditions(hostIdContextPath?: string): AXPQueryFilter[];
|
|
37
|
-
/** Assignee lookup omitted when injected from party/customer/supplier context. */
|
|
38
|
-
export declare const LOCATION_ASSIGNMENT_REF_PROPERTY_NAMES: readonly ["ownerRef.id", "ownerRef.type"];
|
|
39
|
-
/** Location lookup omitted when injected from location detail context. */
|
|
40
|
-
export declare const LOCATION_ASSIGNMENT_LOCATION_PROPERTY_NAMES: readonly ["locationId"];
|
|
41
|
-
type PropertyLayoutRef = {
|
|
42
|
-
name: string;
|
|
43
|
-
layout?: Record<string, unknown>;
|
|
44
|
-
};
|
|
45
|
-
export declare function omitLocationAssignmentRefFromEditLayouts<T extends PropertyLayoutRef>(layouts: T[]): T[];
|
|
46
|
-
export declare function omitLocationAssignmentLocationFromEditLayouts<T extends PropertyLayoutRef>(layouts: T[]): T[];
|
|
47
|
-
/** Polymorphic assignee lookup (AssessmentCase subjectRef pattern). */
|
|
48
|
-
export declare function createLocationAssignmentOwnerRefLookupProperty(groupId: string, options?: {
|
|
49
|
-
readonly?: boolean;
|
|
50
|
-
}): AXPEntityProperty;
|
|
51
|
-
/** Hidden assignee type field; defaults to BusinessCore.Party. */
|
|
52
|
-
export declare function createLocationAssignmentOwnerRefTypeProperty(groupId: string): AXPEntityProperty;
|
|
53
|
-
export {};
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
//#region ---- Imports ----
|
|
2
|
-
import { AXPWidgetsList, formatAddressData, resolveMultiLanguageString, } from '@acorex-platform/framework-shared/core';
|
|
3
|
-
//#endregion
|
|
4
|
-
//#region ---- Constants ----
|
|
5
|
-
/** Canonical assignee type for party-scoped location assignment links. */
|
|
6
|
-
export const LOCATION_ASSIGNMENT_PARTY_TYPE = 'BusinessCore.Party';
|
|
7
|
-
//#endregion
|
|
8
|
-
//#region ---- Display helpers ----
|
|
9
|
-
/** Resolves assignee display title from host/process data (plain string or multi-language object). */
|
|
10
|
-
export function resolveLocationAssignmentDisplayTitle(locale, ...candidates) {
|
|
11
|
-
for (const candidate of candidates) {
|
|
12
|
-
if (candidate == null || candidate === '') {
|
|
13
|
-
continue;
|
|
14
|
-
}
|
|
15
|
-
const resolved = resolveMultiLanguageString(candidate, locale).trim();
|
|
16
|
-
if (resolved) {
|
|
17
|
-
return resolved;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
return '';
|
|
21
|
-
}
|
|
22
|
-
/** Builds a location snapshot for nested LocationAssignment display fields. */
|
|
23
|
-
export function buildLocationAssignmentLocationSnapshot(locationRow, locationId) {
|
|
24
|
-
const fullAddress = locationRow['fullAddress']?.trim() || formatAddressData(locationRow)?.trim() || undefined;
|
|
25
|
-
const toRegionRef = (value) => {
|
|
26
|
-
if (value == null) {
|
|
27
|
-
return undefined;
|
|
28
|
-
}
|
|
29
|
-
if (typeof value === 'object') {
|
|
30
|
-
const record = value;
|
|
31
|
-
const title = record['title'];
|
|
32
|
-
return title != null ? { title: String(title) } : undefined;
|
|
33
|
-
}
|
|
34
|
-
return { title: String(value) };
|
|
35
|
-
};
|
|
36
|
-
return {
|
|
37
|
-
id: locationId,
|
|
38
|
-
title: locationRow['title'],
|
|
39
|
-
fullAddress,
|
|
40
|
-
street1: locationRow['street1'],
|
|
41
|
-
street2: locationRow['street2'],
|
|
42
|
-
postalCode: locationRow['postalCode'],
|
|
43
|
-
city: toRegionRef(locationRow['city']),
|
|
44
|
-
state: toRegionRef(locationRow['state']),
|
|
45
|
-
country: toRegionRef(locationRow['country']),
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
/** Builds a person snapshot for nested LocationAssignment site-contact fields. */
|
|
49
|
-
export function buildLocationAssignmentPersonSnapshot(personRow, personId) {
|
|
50
|
-
const fullName = personRow['fullName'] ??
|
|
51
|
-
[personRow['firstName'], personRow['lastName']].filter(Boolean).join(' ').trim();
|
|
52
|
-
return {
|
|
53
|
-
id: personId,
|
|
54
|
-
fullName: fullName || undefined,
|
|
55
|
-
phones: personRow['phones'],
|
|
56
|
-
emails: personRow['emails'],
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
//#endregion
|
|
60
|
-
//#region ---- Filter helpers ----
|
|
61
|
-
/** Filters LocationAssignment rows for a location detail context. */
|
|
62
|
-
export function locationAssignmentLocationConditions(locationIdContextPath = 'id') {
|
|
63
|
-
return [
|
|
64
|
-
{
|
|
65
|
-
name: 'locationId',
|
|
66
|
-
operator: { type: 'equal' },
|
|
67
|
-
value: `{{context.eval("${locationIdContextPath}")}}`,
|
|
68
|
-
},
|
|
69
|
-
];
|
|
70
|
-
}
|
|
71
|
-
/** Filters LocationAssignment rows for the current details-view host entity. */
|
|
72
|
-
export function locationAssignmentPartyConditions(hostIdContextPath = 'id') {
|
|
73
|
-
return [
|
|
74
|
-
{
|
|
75
|
-
name: 'ownerRef.type',
|
|
76
|
-
operator: { type: 'equal' },
|
|
77
|
-
value: '{{ host.entity() }}',
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
name: 'ownerRef.id',
|
|
81
|
-
operator: { type: 'equal' },
|
|
82
|
-
value: `{{ host.eval("${hostIdContextPath}") }}`,
|
|
83
|
-
},
|
|
84
|
-
];
|
|
85
|
-
}
|
|
86
|
-
//#endregion
|
|
87
|
-
//#region ---- Form layout helpers ----
|
|
88
|
-
/** Assignee lookup omitted when injected from party/customer/supplier context. */
|
|
89
|
-
export const LOCATION_ASSIGNMENT_REF_PROPERTY_NAMES = ['ownerRef.id', 'ownerRef.type'];
|
|
90
|
-
/** Location lookup omitted when injected from location detail context. */
|
|
91
|
-
export const LOCATION_ASSIGNMENT_LOCATION_PROPERTY_NAMES = ['locationId'];
|
|
92
|
-
export function omitLocationAssignmentRefFromEditLayouts(layouts) {
|
|
93
|
-
return layouts.filter((layout) => !LOCATION_ASSIGNMENT_REF_PROPERTY_NAMES.includes(layout.name));
|
|
94
|
-
}
|
|
95
|
-
export function omitLocationAssignmentLocationFromEditLayouts(layouts) {
|
|
96
|
-
return layouts.filter((layout) => !LOCATION_ASSIGNMENT_LOCATION_PROPERTY_NAMES.includes(layout.name));
|
|
97
|
-
}
|
|
98
|
-
//#endregion
|
|
99
|
-
//#region ---- Property factories ----
|
|
100
|
-
/** Polymorphic assignee lookup (AssessmentCase subjectRef pattern). */
|
|
101
|
-
export function createLocationAssignmentOwnerRefLookupProperty(groupId, options = {}) {
|
|
102
|
-
const readonly = options.readonly ?? false;
|
|
103
|
-
return {
|
|
104
|
-
name: 'ownerRef.id',
|
|
105
|
-
title: '@location-management:location-assignments.entities.location-assignment.fields.assignee.title',
|
|
106
|
-
groupId,
|
|
107
|
-
options: readonly
|
|
108
|
-
? { sort: { enabled: false }, filter: { advance: { enabled: false }, inline: { enabled: false } } }
|
|
109
|
-
: { sort: { enabled: true }, filter: { advance: { enabled: true }, inline: { enabled: true } } },
|
|
110
|
-
schema: {
|
|
111
|
-
dataType: 'string',
|
|
112
|
-
readonly,
|
|
113
|
-
interface: {
|
|
114
|
-
type: AXPWidgetsList.Editors.LookupBox,
|
|
115
|
-
options: {
|
|
116
|
-
readonly,
|
|
117
|
-
entity: "{{ context.eval('ownerRef.type') }}",
|
|
118
|
-
textField: 'title',
|
|
119
|
-
valueField: 'id',
|
|
120
|
-
expose: [
|
|
121
|
-
{ source: 'id', target: 'ownerRef.id' },
|
|
122
|
-
{ source: 'title', target: 'ownerRef.title' },
|
|
123
|
-
],
|
|
124
|
-
triggers: [{ event: "{{ events.context('ownerRef.type') }}", action: '{{ widget.refresh() }}' }],
|
|
125
|
-
},
|
|
126
|
-
},
|
|
127
|
-
},
|
|
128
|
-
validations: [{ rule: 'required' }],
|
|
129
|
-
};
|
|
130
|
-
}
|
|
131
|
-
/** Hidden assignee type field; defaults to BusinessCore.Party. */
|
|
132
|
-
export function createLocationAssignmentOwnerRefTypeProperty(groupId) {
|
|
133
|
-
return {
|
|
134
|
-
name: 'ownerRef.type',
|
|
135
|
-
title: '@location-management:location-assignments.entities.location-assignment.fields.assignee-type.title',
|
|
136
|
-
groupId,
|
|
137
|
-
schema: {
|
|
138
|
-
dataType: 'string',
|
|
139
|
-
visible: false,
|
|
140
|
-
defaultValue: LOCATION_ASSIGNMENT_PARTY_TYPE,
|
|
141
|
-
interface: { type: AXPWidgetsList.Editors.TextBox },
|
|
142
|
-
},
|
|
143
|
-
};
|
|
144
|
-
}
|
|
145
|
-
//#endregion
|
package/contracts/menu.keys.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export declare const AXPLocationManagementMenuKeys: {
|
|
2
|
-
readonly Root: "location-management:menu";
|
|
3
|
-
readonly Locations: "location-management:menu:locations";
|
|
4
|
-
readonly Divider1: "location-management:menu:divider-1";
|
|
5
|
-
readonly LocationTypes: "location-management:menu:location-types";
|
|
6
|
-
readonly LocationRoles: "location-management:menu:location-roles";
|
|
7
|
-
readonly GeographicRegions: "location-management:menu:geographic-regions";
|
|
8
|
-
};
|
package/contracts/menu.keys.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export const AXPLocationManagementMenuKeys = {
|
|
2
|
-
Root: 'location-management:menu',
|
|
3
|
-
Locations: 'location-management:menu:locations',
|
|
4
|
-
Divider1: 'location-management:menu:divider-1',
|
|
5
|
-
LocationTypes: 'location-management:menu:location-types',
|
|
6
|
-
LocationRoles: 'location-management:menu:location-roles',
|
|
7
|
-
GeographicRegions: 'location-management:menu:geographic-regions',
|
|
8
|
-
};
|
package/contracts/package.json
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
export declare const AXMLocationManagementPermissionsKeys: {
|
|
2
|
-
LocationManagement: {
|
|
3
|
-
Management: string;
|
|
4
|
-
Locations: {
|
|
5
|
-
Management: string;
|
|
6
|
-
View: string;
|
|
7
|
-
Edit: string;
|
|
8
|
-
Delete: string;
|
|
9
|
-
Create: string;
|
|
10
|
-
};
|
|
11
|
-
LocationTypes: {
|
|
12
|
-
Management: string;
|
|
13
|
-
View: string;
|
|
14
|
-
Edit: string;
|
|
15
|
-
Delete: string;
|
|
16
|
-
Create: string;
|
|
17
|
-
};
|
|
18
|
-
LocationRoles: {
|
|
19
|
-
Management: string;
|
|
20
|
-
View: string;
|
|
21
|
-
Edit: string;
|
|
22
|
-
Delete: string;
|
|
23
|
-
Create: string;
|
|
24
|
-
};
|
|
25
|
-
GeographicRegions: {
|
|
26
|
-
Management: string;
|
|
27
|
-
View: string;
|
|
28
|
-
Edit: string;
|
|
29
|
-
Delete: string;
|
|
30
|
-
Create: string;
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
|
-
};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { AXPSystemActionType } from '@acorex-platform/framework-shared/core';
|
|
2
|
-
import { RootConfig } from './root-config';
|
|
3
|
-
const moduleKey = RootConfig.module.name;
|
|
4
|
-
const entitiesKey = RootConfig.entities;
|
|
5
|
-
const manageKey = AXPSystemActionType.Manage;
|
|
6
|
-
const viewKey = AXPSystemActionType.View;
|
|
7
|
-
const updateKey = AXPSystemActionType.Update;
|
|
8
|
-
const deleteKey = AXPSystemActionType.Delete;
|
|
9
|
-
const createKey = AXPSystemActionType.Create;
|
|
10
|
-
export const AXMLocationManagementPermissionsKeys = {
|
|
11
|
-
LocationManagement: {
|
|
12
|
-
Management: `${moduleKey}:${manageKey}`,
|
|
13
|
-
Locations: {
|
|
14
|
-
Management: `${moduleKey}:${entitiesKey.location.name}:${manageKey}`,
|
|
15
|
-
View: `${moduleKey}:${entitiesKey.location.name}:${viewKey}`,
|
|
16
|
-
Edit: `${moduleKey}:${entitiesKey.location.name}:${updateKey}`,
|
|
17
|
-
Delete: `${moduleKey}:${entitiesKey.location.name}:${deleteKey}`,
|
|
18
|
-
Create: `${moduleKey}:${entitiesKey.location.name}:${createKey}`,
|
|
19
|
-
},
|
|
20
|
-
LocationTypes: {
|
|
21
|
-
Management: `${moduleKey}:${entitiesKey.locationType.name}:${manageKey}`,
|
|
22
|
-
View: `${moduleKey}:${entitiesKey.locationType.name}:${viewKey}`,
|
|
23
|
-
Edit: `${moduleKey}:${entitiesKey.locationType.name}:${updateKey}`,
|
|
24
|
-
Delete: `${moduleKey}:${entitiesKey.locationType.name}:${deleteKey}`,
|
|
25
|
-
Create: `${moduleKey}:${entitiesKey.locationType.name}:${createKey}`,
|
|
26
|
-
},
|
|
27
|
-
LocationRoles: {
|
|
28
|
-
Management: `${moduleKey}:${entitiesKey.locationRole.name}:${manageKey}`,
|
|
29
|
-
View: `${moduleKey}:${entitiesKey.locationRole.name}:${viewKey}`,
|
|
30
|
-
Edit: `${moduleKey}:${entitiesKey.locationRole.name}:${updateKey}`,
|
|
31
|
-
Delete: `${moduleKey}:${entitiesKey.locationRole.name}:${deleteKey}`,
|
|
32
|
-
Create: `${moduleKey}:${entitiesKey.locationRole.name}:${createKey}`,
|
|
33
|
-
},
|
|
34
|
-
GeographicRegions: {
|
|
35
|
-
Management: `${moduleKey}:${entitiesKey.geographicRegion.name}:${manageKey}`,
|
|
36
|
-
View: `${moduleKey}:${entitiesKey.geographicRegion.name}:${viewKey}`,
|
|
37
|
-
Edit: `${moduleKey}:${entitiesKey.geographicRegion.name}:${updateKey}`,
|
|
38
|
-
Delete: `${moduleKey}:${entitiesKey.geographicRegion.name}:${deleteKey}`,
|
|
39
|
-
Create: `${moduleKey}:${entitiesKey.geographicRegion.name}:${createKey}`,
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
};
|