@acorex-platform/module-tenant-management-client 0.0.59 → 0.0.60
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-tenant-management-client-approve-tenant-request.command-D18-n5Lc.mjs +91 -0
- package/fesm2022/acorex-platform-module-tenant-management-client-approve-tenant-request.command-D18-n5Lc.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-tenant-management-client-contracts-entities-resource-share.mjs +6 -0
- package/fesm2022/acorex-platform-module-tenant-management-client-contracts-entities-resource-share.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-tenant-management-client-contracts-entities-tenant-user-app-access.mjs +110 -5
- package/fesm2022/acorex-platform-module-tenant-management-client-contracts-entities-tenant-user-app-access.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-tenant-management-client-contracts-entities-tenant-user.mjs +186 -9
- package/fesm2022/acorex-platform-module-tenant-management-client-contracts-entities-tenant-user.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-tenant-management-client-contracts-entities-tenant.mjs +158 -24
- package/fesm2022/acorex-platform-module-tenant-management-client-contracts-entities-tenant.mjs.map +1 -1
- package/fesm2022/{acorex-platform-module-tenant-management-client-contracts-entity-catalog-acorex-platform-module-tenant-management-client-contracts-entity-catalog-CDfoKWOn.mjs → acorex-platform-module-tenant-management-client-contracts-entity-catalog-acorex-platform-module-tenant-management-client-contracts-entity-catalog-DqBYnske.mjs} +11 -5
- package/fesm2022/acorex-platform-module-tenant-management-client-contracts-entity-catalog-acorex-platform-module-tenant-management-client-contracts-entity-catalog-DqBYnske.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-tenant-management-client-contracts-entity-catalog-resource-share.entity-BPbgUTEH.mjs → acorex-platform-module-tenant-management-client-contracts-entity-catalog-resource-share.entity-Bf7keWah.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-tenant-management-client-contracts-entity-catalog-resource-share.entity-BPbgUTEH.mjs.map → acorex-platform-module-tenant-management-client-contracts-entity-catalog-resource-share.entity-Bf7keWah.mjs.map} +1 -1
- package/fesm2022/acorex-platform-module-tenant-management-client-contracts-entity-catalog-tenant-user-admin-scope-C6Ekm0Qg.mjs +43 -0
- package/fesm2022/acorex-platform-module-tenant-management-client-contracts-entity-catalog-tenant-user-admin-scope-C6Ekm0Qg.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-tenant-management-client-contracts-entity-catalog-tenant-user-app-access.entity-nA_yhhRD.mjs → acorex-platform-module-tenant-management-client-contracts-entity-catalog-tenant-user-app-access.entity-BhkM_HyR.mjs} +66 -7
- package/fesm2022/acorex-platform-module-tenant-management-client-contracts-entity-catalog-tenant-user-app-access.entity-BhkM_HyR.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-tenant-management-client-contracts-entity-catalog-tenant-user.entity-CmUdRisR.mjs → acorex-platform-module-tenant-management-client-contracts-entity-catalog-tenant-user.entity-Dk8LTu5B.mjs} +142 -11
- package/fesm2022/acorex-platform-module-tenant-management-client-contracts-entity-catalog-tenant-user.entity-Dk8LTu5B.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-tenant-management-client-contracts-entity-catalog-tenant.entity-ZpnmQnXF.mjs → acorex-platform-module-tenant-management-client-contracts-entity-catalog-tenant.entity-cOVeFcEP.mjs} +154 -26
- package/fesm2022/acorex-platform-module-tenant-management-client-contracts-entity-catalog-tenant.entity-cOVeFcEP.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-tenant-management-client-contracts-entity-catalog.mjs +1 -1
- package/fesm2022/acorex-platform-module-tenant-management-client-contracts.mjs +96 -3
- package/fesm2022/acorex-platform-module-tenant-management-client-contracts.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-tenant-management-client-reject-tenant-request.command-CKSHPw1a.mjs +80 -0
- package/fesm2022/acorex-platform-module-tenant-management-client-reject-tenant-request.command-CKSHPw1a.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-tenant-management-client.mjs +350 -14
- package/fesm2022/acorex-platform-module-tenant-management-client.mjs.map +1 -1
- package/i18n/en-AU/tenant-management.json +91 -10
- package/i18n/en-US/tenant-management.json +91 -10
- package/i18n/fa-IR/tenant-management.json +92 -11
- package/package.json +1 -1
- package/types/acorex-platform-module-tenant-management-client-contracts.d.ts +178 -4
- package/types/acorex-platform-module-tenant-management-client.d.ts +25 -1
- package/fesm2022/acorex-platform-module-tenant-management-client-contracts-entity-catalog-acorex-platform-module-tenant-management-client-contracts-entity-catalog-CDfoKWOn.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-tenant-management-client-contracts-entity-catalog-tenant-user-app-access.entity-nA_yhhRD.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-tenant-management-client-contracts-entity-catalog-tenant-user.entity-CmUdRisR.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-tenant-management-client-contracts-entity-catalog-tenant.entity-ZpnmQnXF.mjs.map +0 -1
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import { AXPMiddlewareAbortError, AXPEntityService, AXP_ENTITY_STORAGE_MIDDLEWARE } from '@acorex-platform/framework-client/layout/entity';
|
|
1
|
+
import { AXPMiddlewareAbortError, AXPEntityService, configureEntityListColumnsSettingsMigrateDrop, configureEntityListColumnsSettingsVersion, AXP_ENTITY_STORAGE_MIDDLEWARE } from '@acorex-platform/framework-client/layout/entity';
|
|
2
2
|
import { AXP_FEATURE_DEFINITION_PROVIDER, AXP_CONTEXT_DEFINITION_PROVIDER } from '@acorex-platform/framework-client/core';
|
|
3
3
|
import { AXPSearchCommandProvider, createEntitySearchCommand, AXP_STATUS_PROVIDERS, AXP_MENU_PROVIDER, AXP_SETTING_DEFINITION_PROVIDER, AXP_SEARCH_PROVIDER } from '@acorex-platform/framework-client/common';
|
|
4
4
|
import { AXP_PERMISSION_DEFINITION_PROVIDER } from '@acorex-platform/framework-client/auth';
|
|
5
|
+
import { provideCommandSetups } from '@acorex-platform/framework-client/runtime';
|
|
6
|
+
import { RootConfig, AXP_TENANT_USER_ADMIN_SCOPE_PARAM, resolveTenantUserAdminScopeFromUrl, AXP_TENANT_USER_ADMIN_SCOPE_HEADER, AXMTenantManagementFeatureKeys, AXPApplicationsPlatformPermissionKeys, AXP_TENANT_USERS_VIEW, AXMTenantManagementMenuKeys, AXM_TENANT_APPROVE_REQUEST_COMMAND, AXM_TENANT_REJECT_REQUEST_COMMAND } from '@acorex-platform/module-tenant-management-client/contracts';
|
|
7
|
+
import { HTTP_INTERCEPTORS } from '@angular/common/http';
|
|
5
8
|
import * as i0 from '@angular/core';
|
|
6
|
-
import {
|
|
7
|
-
import { AXPStatusProvider, AXPSystemStatusType, systemStatusToDefinition } from '@acorex-platform/framework-shared/core';
|
|
8
|
-
import {
|
|
9
|
+
import { inject, Injectable, NgModule, InjectionToken } from '@angular/core';
|
|
10
|
+
import { AXPStatusProvider, AXPSystemStatusType, systemStatusToDefinition, AXPWidgetsList } from '@acorex-platform/framework-shared/core';
|
|
11
|
+
import { Router } from '@angular/router';
|
|
9
12
|
import { AXPCommonPermissionGroupKeys, AXPCommonMenuKeys } from '@acorex-platform/module-common-client/contracts';
|
|
10
13
|
import { AXM_TENANT_CONTEXT_DEFINITIONS } from '@acorex-platform/module-tenant-management-client/contracts';
|
|
11
14
|
|
|
@@ -38,13 +41,14 @@ class AXMTenantStatusProvider extends AXPStatusProvider {
|
|
|
38
41
|
title: '@tenant-management:tenants.states.pending',
|
|
39
42
|
generateView: true,
|
|
40
43
|
}),
|
|
44
|
+
systemStatusToDefinition(AXPSystemStatusType.Rejected, {
|
|
45
|
+
title: '@tenant-management:tenants.states.rejected',
|
|
46
|
+
generateView: true,
|
|
47
|
+
}),
|
|
41
48
|
];
|
|
42
49
|
this.transitions = [
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
to: AXPSystemStatusType.Active,
|
|
46
|
-
title: '@tenant-management:tenants.transitions.activate',
|
|
47
|
-
},
|
|
50
|
+
// Pending → Active / Rejected: use primary Approve / Reject request actions only
|
|
51
|
+
// (status-chip UpdateStatus would skip invite / email / provisioning).
|
|
48
52
|
{
|
|
49
53
|
from: AXPSystemStatusType.Active,
|
|
50
54
|
to: AXPSystemStatusType.Inactive,
|
|
@@ -258,19 +262,136 @@ const tenantUserAccountHolderMiddleware = {
|
|
|
258
262
|
};
|
|
259
263
|
//#endregion
|
|
260
264
|
|
|
265
|
+
//#region ----- Imports -----
|
|
266
|
+
//#endregion
|
|
267
|
+
//#region ----- Tenant Users admin scope (client) -----
|
|
268
|
+
const TENANT_USER_ENTITY_NAME = `${RootConfig.module.name}.${RootConfig.entities.tenantUser.name}`;
|
|
269
|
+
const TENANT_USER_APP_ACCESS_ENTITY_NAME = `${RootConfig.module.name}.${RootConfig.entities.tenantUserAppAccess.name}`;
|
|
270
|
+
function isTenantUserAdminScopeEntity(entityName) {
|
|
271
|
+
return (entityName === TENANT_USER_ENTITY_NAME || entityName === TENANT_USER_APP_ACCESS_ENTITY_NAME);
|
|
272
|
+
}
|
|
273
|
+
function withTenantUserAdminScopeParam(params, scope) {
|
|
274
|
+
return {
|
|
275
|
+
...(params ?? {}),
|
|
276
|
+
[AXP_TENANT_USER_ADMIN_SCOPE_PARAM]: scope,
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
//#endregion
|
|
280
|
+
|
|
281
|
+
//#region ----- Imports -----
|
|
282
|
+
//#endregion
|
|
283
|
+
//#region ----- Tenant Users admin scope (client entity middleware) -----
|
|
284
|
+
/**
|
|
285
|
+
* Injects explicit `tenantUserAdminScope=current-tenant` on TenantUser /
|
|
286
|
+
* TenantUserAppAccess queries when the open surface carries `view=tenant-users`
|
|
287
|
+
* — not for generic / PC / shared entity routes without that view.
|
|
288
|
+
*/
|
|
289
|
+
const tenantUserAdminScopeMiddleware = {
|
|
290
|
+
target: {
|
|
291
|
+
ops: ['query'],
|
|
292
|
+
order: 8,
|
|
293
|
+
},
|
|
294
|
+
execute: async (ctx, next) => {
|
|
295
|
+
if (!isTenantUserAdminScopeEntity(ctx.entityName)) {
|
|
296
|
+
await next();
|
|
297
|
+
return;
|
|
298
|
+
}
|
|
299
|
+
const router = inject(Router);
|
|
300
|
+
const scope = resolveTenantUserAdminScopeFromUrl(router.url);
|
|
301
|
+
if (scope === 'current-tenant' && ctx.request) {
|
|
302
|
+
ctx.request = {
|
|
303
|
+
...ctx.request,
|
|
304
|
+
params: withTenantUserAdminScopeParam(ctx.request.params, scope),
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
await next();
|
|
308
|
+
},
|
|
309
|
+
};
|
|
310
|
+
//#endregion
|
|
311
|
+
|
|
312
|
+
//#region ----- Imports -----
|
|
313
|
+
//#endregion
|
|
314
|
+
//#region ----- Tenant Users admin scope interceptor -----
|
|
315
|
+
/**
|
|
316
|
+
* Attaches admin-scope header for TenantUser / TenantUserAppAccess runtime
|
|
317
|
+
* calls so getOne / update / delete honor the same Tenant Users operation
|
|
318
|
+
* as the open list/detail surface.
|
|
319
|
+
*/
|
|
320
|
+
class TenantUserAdminScopeInterceptor {
|
|
321
|
+
constructor() {
|
|
322
|
+
this.router = inject(Router);
|
|
323
|
+
}
|
|
324
|
+
intercept(request, next) {
|
|
325
|
+
if (!this.targetsTenantUserEntities(request)) {
|
|
326
|
+
return next.handle(request);
|
|
327
|
+
}
|
|
328
|
+
const scope = resolveTenantUserAdminScopeFromUrl(this.router.url);
|
|
329
|
+
if (scope !== 'current-tenant') {
|
|
330
|
+
return next.handle(request);
|
|
331
|
+
}
|
|
332
|
+
return next.handle(request.clone({
|
|
333
|
+
setHeaders: {
|
|
334
|
+
[AXP_TENANT_USER_ADMIN_SCOPE_HEADER]: scope,
|
|
335
|
+
},
|
|
336
|
+
}));
|
|
337
|
+
}
|
|
338
|
+
targetsTenantUserEntities(request) {
|
|
339
|
+
const body = request.body;
|
|
340
|
+
if (body && typeof body === 'object' && !Array.isArray(body)) {
|
|
341
|
+
const record = body;
|
|
342
|
+
const input = record['input'];
|
|
343
|
+
const entityFromInput = input && typeof input === 'object' && !Array.isArray(input)
|
|
344
|
+
? input['entity']
|
|
345
|
+
: undefined;
|
|
346
|
+
const entity = record['entity'] ?? entityFromInput;
|
|
347
|
+
if (typeof entity === 'string' && isTenantUserAdminScopeEntity(entity)) {
|
|
348
|
+
return true;
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
const entityQuery = request.params?.get?.('entity');
|
|
352
|
+
if (typeof entityQuery === 'string' && isTenantUserAdminScopeEntity(entityQuery)) {
|
|
353
|
+
return true;
|
|
354
|
+
}
|
|
355
|
+
return (request.url.includes('TenantUserAppAccess') || request.url.includes('/TenantUser'));
|
|
356
|
+
}
|
|
357
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: TenantUserAdminScopeInterceptor, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
358
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: TenantUserAdminScopeInterceptor }); }
|
|
359
|
+
}
|
|
360
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: TenantUserAdminScopeInterceptor, decorators: [{
|
|
361
|
+
type: Injectable
|
|
362
|
+
}] });
|
|
363
|
+
|
|
261
364
|
//#region ---- Middleware Exports ----
|
|
262
365
|
//#endregion
|
|
263
366
|
|
|
264
|
-
//#region ----
|
|
367
|
+
//#region ---- Imports ----
|
|
265
368
|
//#endregion
|
|
266
|
-
//#region ----
|
|
369
|
+
//#region ---- Feature Definition Provider ----
|
|
267
370
|
/**
|
|
268
371
|
* Tenant Management Feature Definition Provider.
|
|
269
372
|
* Provides feature definitions for the Tenant Management module.
|
|
270
373
|
*/
|
|
271
374
|
class AXMTenantManagementFeatureDefinitionProvider {
|
|
272
375
|
async provide(context) {
|
|
273
|
-
|
|
376
|
+
const i18n = RootConfig.config.i18n;
|
|
377
|
+
context.addFeature(AXMTenantManagementFeatureKeys.ManagePlatformTenants, {
|
|
378
|
+
title: `@${i18n}:features.manage-platform-tenants.title`,
|
|
379
|
+
description: `@${i18n}:features.manage-platform-tenants.description`,
|
|
380
|
+
defaultValue: false,
|
|
381
|
+
type: 'boolean',
|
|
382
|
+
});
|
|
383
|
+
context.addFeature(AXMTenantManagementFeatureKeys.TenantConsole, {
|
|
384
|
+
title: `@${i18n}:features.tenant-console.title`,
|
|
385
|
+
description: `@${i18n}:features.tenant-console.description`,
|
|
386
|
+
defaultValue: false,
|
|
387
|
+
type: 'boolean',
|
|
388
|
+
});
|
|
389
|
+
context.addFeature(AXMTenantManagementFeatureKeys.InviteMultiApplication, {
|
|
390
|
+
title: `@${i18n}:features.invite-multi-application.title`,
|
|
391
|
+
description: `@${i18n}:features.invite-multi-application.description`,
|
|
392
|
+
defaultValue: false,
|
|
393
|
+
type: 'boolean',
|
|
394
|
+
});
|
|
274
395
|
}
|
|
275
396
|
}
|
|
276
397
|
//#endregion
|
|
@@ -305,6 +426,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
305
426
|
|
|
306
427
|
//#region ---- Imports ----
|
|
307
428
|
//#endregion
|
|
429
|
+
//#region ---- Constants ----
|
|
430
|
+
/** Stable capability keys (avoid importing SecurityManagement client — cycle risk). */
|
|
431
|
+
const MAINTAIN_USERS_AND_ROLES = 'Administration:Permission:MaintainUsersAndRoles';
|
|
432
|
+
const MANAGE_SESSIONS = 'Administration:Permission:ManageSessions';
|
|
433
|
+
const SECURITY_MODULE = 'SecurityManagement';
|
|
434
|
+
const DEVICE_SESSIONS_ENTITY = 'DeviceSessions';
|
|
435
|
+
/** Explicit tenant-sessions list view (operation-owned scope; not inferred from TM app id). */
|
|
436
|
+
const TENANT_SESSIONS_VIEW = 'tenant-sessions';
|
|
437
|
+
/**
|
|
438
|
+
* Durable Tenant Users operation signal on the menu path.
|
|
439
|
+
* Prefer `tenantUserAdminScope=` over `view=` alone — entity list rewrites
|
|
440
|
+
* unknown/hidden views to `all` and would drop a view-only signal.
|
|
441
|
+
*/
|
|
442
|
+
const TENANT_USERS_OPERATION_QUERY = `${AXP_TENANT_USER_ADMIN_SCOPE_PARAM}=current-tenant&view=${AXP_TENANT_USERS_VIEW}`;
|
|
443
|
+
//#endregion
|
|
308
444
|
//#region ---- Menu Provider ----
|
|
309
445
|
class AXMTenantManagementModuleMenuProvider {
|
|
310
446
|
constructor() {
|
|
@@ -312,6 +448,7 @@ class AXMTenantManagementModuleMenuProvider {
|
|
|
312
448
|
}
|
|
313
449
|
async provide(context) {
|
|
314
450
|
const module = RootConfig.module;
|
|
451
|
+
// Platform → Tenants: Platform Console only (ADR-TEN-001 — must not appear in TM).
|
|
315
452
|
context.find(AXPCommonMenuKeys.Platform).addItems([
|
|
316
453
|
{
|
|
317
454
|
name: AXMTenantManagementMenuKeys.Tenants,
|
|
@@ -320,12 +457,52 @@ class AXMTenantManagementModuleMenuProvider {
|
|
|
320
457
|
icon: RootConfig.entities.tenant.icon,
|
|
321
458
|
priority: 4,
|
|
322
459
|
policy: {
|
|
323
|
-
features: [
|
|
460
|
+
features: [AXMTenantManagementFeatureKeys.ManagePlatformTenants],
|
|
324
461
|
permissions: [AXPApplicationsPlatformPermissionKeys.MaintainTenants],
|
|
325
462
|
},
|
|
326
463
|
},
|
|
327
464
|
{ name: `${AXMTenantManagementMenuKeys.Root}:divider`, text: '', type: 'break', priority: 5 },
|
|
328
465
|
]);
|
|
466
|
+
// TM Administration surfaces (ADR-TEN-001 D-04 / D-07) — TM application only.
|
|
467
|
+
// Gated by TenantConsole (TM Standard edition); not by TenantManagement module alone
|
|
468
|
+
// (PC also enables the module for Platform → Tenants).
|
|
469
|
+
// Application Users remain under Administration → Security → Users (SecurityManagement provider).
|
|
470
|
+
context.find(AXPCommonMenuKeys.Administration).addItems([
|
|
471
|
+
{
|
|
472
|
+
name: AXMTenantManagementMenuKeys.TenantUsers,
|
|
473
|
+
text: RootConfig.entities.tenantUser.titlePlural,
|
|
474
|
+
// Explicit Tenant Users operation (current-tenant scope; not Application.code).
|
|
475
|
+
path: `${this.entityService.createPath(module.name, RootConfig.entities.tenantUser.name)}?${TENANT_USERS_OPERATION_QUERY}`,
|
|
476
|
+
icon: RootConfig.entities.tenantUser.icon,
|
|
477
|
+
priority: 20,
|
|
478
|
+
policy: {
|
|
479
|
+
features: [AXMTenantManagementFeatureKeys.TenantConsole],
|
|
480
|
+
permissions: [MAINTAIN_USERS_AND_ROLES],
|
|
481
|
+
},
|
|
482
|
+
},
|
|
483
|
+
{
|
|
484
|
+
name: AXMTenantManagementMenuKeys.TenantApplicationAccess,
|
|
485
|
+
text: RootConfig.entities.tenantUserAppAccess.titlePlural,
|
|
486
|
+
path: `${this.entityService.createPath(module.name, RootConfig.entities.tenantUserAppAccess.name)}?${TENANT_USERS_OPERATION_QUERY}`,
|
|
487
|
+
icon: RootConfig.entities.tenantUserAppAccess.icon,
|
|
488
|
+
priority: 21,
|
|
489
|
+
policy: {
|
|
490
|
+
features: [AXMTenantManagementFeatureKeys.TenantConsole],
|
|
491
|
+
permissions: [MAINTAIN_USERS_AND_ROLES],
|
|
492
|
+
},
|
|
493
|
+
},
|
|
494
|
+
{
|
|
495
|
+
name: AXMTenantManagementMenuKeys.TenantSessions,
|
|
496
|
+
text: `@${RootConfig.config.i18n}:module.menus.tenant-sessions.title`,
|
|
497
|
+
path: `${this.entityService.createPath(SECURITY_MODULE, DEVICE_SESSIONS_ENTITY)}?view=${TENANT_SESSIONS_VIEW}`,
|
|
498
|
+
icon: 'fa-light fa-laptop-mobile',
|
|
499
|
+
priority: 22,
|
|
500
|
+
policy: {
|
|
501
|
+
features: [AXMTenantManagementFeatureKeys.TenantConsole, SECURITY_MODULE],
|
|
502
|
+
permissions: [MANAGE_SESSIONS],
|
|
503
|
+
},
|
|
504
|
+
},
|
|
505
|
+
]);
|
|
329
506
|
}
|
|
330
507
|
}
|
|
331
508
|
//#endregion
|
|
@@ -374,6 +551,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
374
551
|
type: Injectable
|
|
375
552
|
}] });
|
|
376
553
|
|
|
554
|
+
//#region ----- Boot configure (once) -----
|
|
555
|
+
/**
|
|
556
|
+
* Stale AppAccess list prefs pinned `tenantUser.userId` / bare `userDisplayName`
|
|
557
|
+
* text columns; list now uses `userId` lookup (display via userDisplayName expose).
|
|
558
|
+
*/
|
|
559
|
+
configureEntityListColumnsSettingsMigrateDrop([
|
|
560
|
+
'tenantUser.userId',
|
|
561
|
+
'tenantUserId',
|
|
562
|
+
'userDisplayName',
|
|
563
|
+
]);
|
|
564
|
+
configureEntityListColumnsSettingsVersion(5);
|
|
565
|
+
//#endregion
|
|
377
566
|
// Entity Modules
|
|
378
567
|
class AXMTenantManagementModule {
|
|
379
568
|
constructor() { }
|
|
@@ -396,6 +585,16 @@ class AXMTenantManagementModule {
|
|
|
396
585
|
useValue: tenantUserAccountHolderMiddleware,
|
|
397
586
|
multi: true,
|
|
398
587
|
},
|
|
588
|
+
{
|
|
589
|
+
provide: AXP_ENTITY_STORAGE_MIDDLEWARE,
|
|
590
|
+
useValue: tenantUserAdminScopeMiddleware,
|
|
591
|
+
multi: true,
|
|
592
|
+
},
|
|
593
|
+
{
|
|
594
|
+
provide: HTTP_INTERCEPTORS,
|
|
595
|
+
useClass: TenantUserAdminScopeInterceptor,
|
|
596
|
+
multi: true,
|
|
597
|
+
},
|
|
399
598
|
// Provider references (now using tokens)
|
|
400
599
|
{
|
|
401
600
|
provide: AXP_FEATURE_DEFINITION_PROVIDER,
|
|
@@ -427,6 +626,16 @@ class AXMTenantManagementModule {
|
|
|
427
626
|
useClass: AXMTenantManagementContextDefinitionProvider,
|
|
428
627
|
multi: true,
|
|
429
628
|
},
|
|
629
|
+
provideCommandSetups([
|
|
630
|
+
{
|
|
631
|
+
key: AXM_TENANT_APPROVE_REQUEST_COMMAND,
|
|
632
|
+
command: () => import('./acorex-platform-module-tenant-management-client-approve-tenant-request.command-D18-n5Lc.mjs').then((c) => c.AXPApproveTenantRequestCommand),
|
|
633
|
+
},
|
|
634
|
+
{
|
|
635
|
+
key: AXM_TENANT_REJECT_REQUEST_COMMAND,
|
|
636
|
+
command: () => import('./acorex-platform-module-tenant-management-client-reject-tenant-request.command-CKSHPw1a.mjs').then((c) => c.AXPRejectTenantRequestCommand),
|
|
637
|
+
},
|
|
638
|
+
]),
|
|
430
639
|
] }); }
|
|
431
640
|
}
|
|
432
641
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMTenantManagementModule, decorators: [{
|
|
@@ -454,6 +663,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
454
663
|
useValue: tenantUserAccountHolderMiddleware,
|
|
455
664
|
multi: true,
|
|
456
665
|
},
|
|
666
|
+
{
|
|
667
|
+
provide: AXP_ENTITY_STORAGE_MIDDLEWARE,
|
|
668
|
+
useValue: tenantUserAdminScopeMiddleware,
|
|
669
|
+
multi: true,
|
|
670
|
+
},
|
|
671
|
+
{
|
|
672
|
+
provide: HTTP_INTERCEPTORS,
|
|
673
|
+
useClass: TenantUserAdminScopeInterceptor,
|
|
674
|
+
multi: true,
|
|
675
|
+
},
|
|
457
676
|
// Provider references (now using tokens)
|
|
458
677
|
{
|
|
459
678
|
provide: AXP_FEATURE_DEFINITION_PROVIDER,
|
|
@@ -485,13 +704,130 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
485
704
|
useClass: AXMTenantManagementContextDefinitionProvider,
|
|
486
705
|
multi: true,
|
|
487
706
|
},
|
|
707
|
+
provideCommandSetups([
|
|
708
|
+
{
|
|
709
|
+
key: AXM_TENANT_APPROVE_REQUEST_COMMAND,
|
|
710
|
+
command: () => import('./acorex-platform-module-tenant-management-client-approve-tenant-request.command-D18-n5Lc.mjs').then((c) => c.AXPApproveTenantRequestCommand),
|
|
711
|
+
},
|
|
712
|
+
{
|
|
713
|
+
key: AXM_TENANT_REJECT_REQUEST_COMMAND,
|
|
714
|
+
command: () => import('./acorex-platform-module-tenant-management-client-reject-tenant-request.command-CKSHPw1a.mjs').then((c) => c.AXPRejectTenantRequestCommand),
|
|
715
|
+
},
|
|
716
|
+
]),
|
|
488
717
|
],
|
|
489
718
|
}]
|
|
490
719
|
}], ctorParameters: () => [] });
|
|
491
720
|
|
|
721
|
+
//#region ----- Tenant extra field providers -----
|
|
722
|
+
/**
|
|
723
|
+
* Multi provider: each demo product (e.g. Safetyminder) supplies field defs
|
|
724
|
+
* that merge into Tenant.extra on the public request form / PC layout.
|
|
725
|
+
*/
|
|
726
|
+
const AXP_TENANT_EXTRA_FIELD_DEFINITIONS = new InjectionToken('AXP_TENANT_EXTRA_FIELD_DEFINITIONS');
|
|
727
|
+
//#endregion
|
|
728
|
+
|
|
729
|
+
//#region ----- Build layout for Tenant.extra -----
|
|
730
|
+
/** Flattens multi-provider arrays into one field list (later providers override by name). */
|
|
731
|
+
function mergeTenantExtraFieldDefinitions(batches) {
|
|
732
|
+
const byName = new Map();
|
|
733
|
+
for (const batch of batches) {
|
|
734
|
+
if (!Array.isArray(batch)) {
|
|
735
|
+
continue;
|
|
736
|
+
}
|
|
737
|
+
for (const field of batch) {
|
|
738
|
+
const name = String(field?.name ?? '').trim();
|
|
739
|
+
if (!name) {
|
|
740
|
+
continue;
|
|
741
|
+
}
|
|
742
|
+
byName.set(name, field);
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
return [...byName.values()];
|
|
746
|
+
}
|
|
747
|
+
/**
|
|
748
|
+
* Builds an `axp-layout-renderer` tree bound under context path `extra.*`.
|
|
749
|
+
*/
|
|
750
|
+
function buildTenantExtraFieldsLayout(fields) {
|
|
751
|
+
if (!fields.length) {
|
|
752
|
+
return null;
|
|
753
|
+
}
|
|
754
|
+
return {
|
|
755
|
+
type: AXPWidgetsList.Layouts.FlexLayout,
|
|
756
|
+
mode: 'edit',
|
|
757
|
+
options: {
|
|
758
|
+
flexDirection: 'column',
|
|
759
|
+
gap: '16px',
|
|
760
|
+
},
|
|
761
|
+
children: fields.map((field) => buildFieldNode(field)),
|
|
762
|
+
};
|
|
763
|
+
}
|
|
764
|
+
function buildFieldNode(field) {
|
|
765
|
+
const editorType = (field.editorType ?? AXPWidgetsList.Editors.TextBox).trim();
|
|
766
|
+
const path = `extra.${field.name}`;
|
|
767
|
+
const validations = field.required ? [{ rule: 'required' }] : [];
|
|
768
|
+
const editorOptions = {
|
|
769
|
+
placeholder: field.placeholder,
|
|
770
|
+
validations,
|
|
771
|
+
};
|
|
772
|
+
if (editorType === AXPWidgetsList.Editors.SelectBox && Array.isArray(field.selectOptions)) {
|
|
773
|
+
editorOptions['dataSource'] = field.selectOptions;
|
|
774
|
+
editorOptions['valueField'] = 'id';
|
|
775
|
+
editorOptions['textField'] = 'title';
|
|
776
|
+
}
|
|
777
|
+
return {
|
|
778
|
+
type: AXPWidgetsList.Layouts.FormField,
|
|
779
|
+
mode: 'edit',
|
|
780
|
+
options: {
|
|
781
|
+
label: field.title,
|
|
782
|
+
showLabel: true,
|
|
783
|
+
},
|
|
784
|
+
children: [
|
|
785
|
+
{
|
|
786
|
+
type: editorType,
|
|
787
|
+
mode: 'edit',
|
|
788
|
+
path,
|
|
789
|
+
name: field.name,
|
|
790
|
+
options: editorOptions,
|
|
791
|
+
},
|
|
792
|
+
],
|
|
793
|
+
};
|
|
794
|
+
}
|
|
795
|
+
/**
|
|
796
|
+
* Meta-data-editor `listMeta` shape (interface is a JSON widget tree string).
|
|
797
|
+
*/
|
|
798
|
+
function toTenantExtraMetaDataList(fields) {
|
|
799
|
+
return fields.map((field) => {
|
|
800
|
+
const editorType = (field.editorType ?? AXPWidgetsList.Editors.TextBox).trim();
|
|
801
|
+
const editorNode = {
|
|
802
|
+
type: editorType,
|
|
803
|
+
mode: 'edit',
|
|
804
|
+
path: field.name,
|
|
805
|
+
name: field.name,
|
|
806
|
+
options: {
|
|
807
|
+
placeholder: field.placeholder,
|
|
808
|
+
...(editorType === AXPWidgetsList.Editors.SelectBox && Array.isArray(field.selectOptions)
|
|
809
|
+
? {
|
|
810
|
+
dataSource: field.selectOptions,
|
|
811
|
+
valueField: 'id',
|
|
812
|
+
textField: 'title',
|
|
813
|
+
}
|
|
814
|
+
: {}),
|
|
815
|
+
},
|
|
816
|
+
};
|
|
817
|
+
return {
|
|
818
|
+
name: field.name,
|
|
819
|
+
title: field.title,
|
|
820
|
+
interface: JSON.stringify({
|
|
821
|
+
children: [{ children: [editorNode] }],
|
|
822
|
+
}),
|
|
823
|
+
};
|
|
824
|
+
});
|
|
825
|
+
}
|
|
826
|
+
//#endregion
|
|
827
|
+
|
|
492
828
|
/**
|
|
493
829
|
* Generated bundle index. Do not edit.
|
|
494
830
|
*/
|
|
495
831
|
|
|
496
|
-
export { AXMTenantManagementFeatureDefinitionProvider, AXMTenantManagementModule, AXMTenantManagementModuleMenuProvider, AXMTenantSearchCommandProvider, AXMTenantSettingProvider };
|
|
832
|
+
export { AXMTenantManagementFeatureDefinitionProvider, AXMTenantManagementModule, AXMTenantManagementModuleMenuProvider, AXMTenantSearchCommandProvider, AXMTenantSettingProvider, AXP_TENANT_EXTRA_FIELD_DEFINITIONS, buildTenantExtraFieldsLayout, mergeTenantExtraFieldDefinitions, toTenantExtraMetaDataList };
|
|
497
833
|
//# sourceMappingURL=acorex-platform-module-tenant-management-client.mjs.map
|