@masterteam/delegations 0.0.53 → 0.0.55

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@masterteam/delegations",
3
- "version": "0.0.53",
3
+ "version": "0.0.55",
4
4
  "publishConfig": {
5
5
  "directory": "../../../dist/masterteam/delegations",
6
6
  "linkDirectory": false,
@@ -20,9 +20,9 @@
20
20
  "tailwindcss": "^4.2.2",
21
21
  "tailwindcss-primeui": "^0.6.1",
22
22
  "@ngxs/store": "^20.1.0",
23
- "@masterteam/components": "^0.0.255",
23
+ "@masterteam/forms": "^0.0.136",
24
24
  "@masterteam/icons": "^0.0.17",
25
- "@masterteam/forms": "^0.0.130"
25
+ "@masterteam/components": "^0.0.271"
26
26
  },
27
27
  "sideEffects": false,
28
28
  "exports": {
@@ -4,13 +4,13 @@ import { OnInit, InjectionToken, EnvironmentProviders } from '@angular/core';
4
4
  import { Popover } from 'primeng/popover';
5
5
  import * as _masterteam_components_entities from '@masterteam/components/entities';
6
6
  import { EntityUserValue } from '@masterteam/components/entities';
7
+ import { ModalService } from '@masterteam/components/modal';
7
8
  import { PageHeaderTab } from '@masterteam/components/page-header';
8
9
  import { TableAction, TableStatusMapValue, ColumnDef } from '@masterteam/components/table';
9
10
  import { FormControl } from '@angular/forms';
10
11
  import { HttpContext, HttpInterceptorFn, HttpContextToken } from '@angular/common/http';
11
12
  import { DynamicFormConfig } from '@masterteam/components';
12
13
  import { ModalRef } from '@masterteam/components/dialog';
13
- import { ModalService } from '@masterteam/components/modal';
14
14
  import * as rxjs from 'rxjs';
15
15
  import { Observable } from 'rxjs';
16
16
  import { StateContext } from '@ngxs/store';
@@ -424,6 +424,7 @@ declare class TopbarDelegationMenu implements OnInit {
424
424
  private readonly facade;
425
425
  private readonly modal;
426
426
  private readonly transloco;
427
+ private readonly destroyRef;
427
428
  protected readonly popover: _angular_core.Signal<Popover | undefined>;
428
429
  protected readonly active: _angular_core.Signal<_masterteam_delegations.ActiveDelegationSession | null>;
429
430
  protected readonly candidates: _angular_core.Signal<DelegationRow[]>;
@@ -434,7 +435,15 @@ declare class TopbarDelegationMenu implements OnInit {
434
435
  private promptPending;
435
436
  private promptRefreshQueued;
436
437
  private promptFlowOpen;
437
- protected readonly mode: _angular_core.Signal<"hidden" | "active" | "candidates">;
438
+ private destroyed;
439
+ /**
440
+ * Dialogs opened through `ModalService` live on `document.body`, so they
441
+ * outlive this component. Held so the whole prompt flow can be torn down when
442
+ * the authenticated shell goes away (sign-out) instead of stranding an
443
+ * "act on behalf of" dialog over the login page.
444
+ */
445
+ private promptRefs;
446
+ protected readonly mode: _angular_core.Signal<"candidates" | "active" | "hidden">;
438
447
  constructor();
439
448
  ngOnInit(): void;
440
449
  /** Two-letter initials for a delegator avatar (matches the user-menu pattern). */
@@ -444,6 +453,9 @@ declare class TopbarDelegationMenu implements OnInit {
444
453
  private checkPromptCandidates;
445
454
  private openConfirm;
446
455
  private openCandidatesPrompt;
456
+ private trackPromptRef;
457
+ /** Tears down anything the prompt flow left on `document.body`. */
458
+ private closePromptFlow;
447
459
  private finishPromptFlow;
448
460
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<TopbarDelegationMenu, never>;
449
461
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<TopbarDelegationMenu, "mt-topbar-delegation-menu", never, { "managePath": { "alias": "managePath"; "required": false; "isSignal": true; }; "compact": { "alias": "compact"; "required": false; "isSignal": true; }; "showManageLink": { "alias": "showManageLink"; "required": false; "isSignal": true; }; "promptOnCandidates": { "alias": "promptOnCandidates"; "required": false; "isSignal": true; }; "headless": { "alias": "headless"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
@@ -474,7 +486,7 @@ declare class DelegationMenuPanel {
474
486
  protected readonly isLoadingCandidates: _angular_core.Signal<boolean>;
475
487
  protected readonly onBehalfOf: _angular_core.Signal<_masterteam_delegations.DelegationParty | null>;
476
488
  protected readonly executedBy: _angular_core.Signal<_masterteam_delegations.DelegationParty | null>;
477
- protected readonly mode: _angular_core.Signal<"hidden" | "active" | "candidates">;
489
+ protected readonly mode: _angular_core.Signal<"candidates" | "active" | "hidden">;
478
490
  /** Two-letter initials for a delegator avatar (matches the user-menu pattern). */
479
491
  protected initials(party: DelegationRow['delegator'] | null | undefined): string;
480
492
  protected start(row: DelegationRow, event: MouseEvent): void;
@@ -507,6 +519,8 @@ declare class DelegationStatusChip {
507
519
  declare class StartSessionDialog {
508
520
  readonly delegation: _angular_core.InputSignal<DelegationRow>;
509
521
  readonly intent: _angular_core.InputSignal<"start" | "switch">;
522
+ /** Supplies the shared `mt-modal-content` / `mt-modal-footer` shell classes. */
523
+ protected readonly modal: ModalService;
510
524
  private readonly ref;
511
525
  private readonly facade;
512
526
  private readonly toast;
@@ -530,6 +544,8 @@ declare class StartSessionDialog {
530
544
  */
531
545
  declare class RejectDelegationDialog {
532
546
  readonly delegation: _angular_core.InputSignal<DelegationRow>;
547
+ /** Supplies the shared `mt-modal-content` / `mt-modal-footer` shell classes. */
548
+ protected readonly modal: ModalService;
533
549
  private readonly ref;
534
550
  private readonly facade;
535
551
  protected readonly reason: _angular_core.WritableSignal<string>;
@@ -994,10 +1010,17 @@ interface DelegationPromptNamespace {
994
1010
  applicationKey: string;
995
1011
  tenantKey?: string | null;
996
1012
  }
1013
+ /**
1014
+ * Why the effective actor changed. `StartSession` / `SwitchSession` mean a new
1015
+ * delegated actor is now in force; every other value ends delegated mode. Hosts
1016
+ * should branch on this — `Logout`, `UserSwitch`, `TenantSwitch` and `AppSwitch`
1017
+ * are session teardowns where there is no new actor to load data for.
1018
+ */
1019
+ type DelegationContextChangeReason = DelegationSessionInvalidationReason | 'StartSession' | 'SwitchSession';
997
1020
  interface DelegationContextChange {
998
1021
  previous: ActiveDelegationSession | null;
999
1022
  current: ActiveDelegationSession | null;
1000
- reason: string;
1023
+ reason: DelegationContextChangeReason;
1001
1024
  }
1002
1025
  interface DelegationRuntimeConfig {
1003
1026
  resolveApplicationApiBaseUrl: () => string;
@@ -1255,6 +1278,14 @@ declare class DelegationSessionState {
1255
1278
  private vault;
1256
1279
  private runtime;
1257
1280
  private expiryTimer;
1281
+ /**
1282
+ * Bumped whenever candidates are cleared (logout / user / tenant / app
1283
+ * switch). A `LoadDelegationCandidates` response that was already in flight
1284
+ * when the actor went away resolves against a stale generation and is
1285
+ * dropped, so the previous user's delegators can never repopulate the menu —
1286
+ * or open the availability prompt — after sign-out.
1287
+ */
1288
+ private candidatesGeneration;
1258
1289
  constructor();
1259
1290
  static getActive(state: DelegationSessionStateModel): ActiveDelegationSession | null;
1260
1291
  static getCandidates(state: DelegationSessionStateModel): DelegationRow[];
@@ -1301,4 +1332,4 @@ declare class DelegationSessionFacade {
1301
1332
  }
1302
1333
 
1303
1334
  export { ApproveDelegation, CancelDelegation, ClearDelegationDetail, ClearScopePreview, CreateDelegationLegacy, CreateDelegationV2, DELEGATED_RUNTIME_REQUEST, DELEGATION_RUNTIME_CONFIG, DelegationDetailDrawer, DelegationForm, DelegationMenuPanel, DelegationSessionActionKey, DelegationSessionFacade, DelegationSessionState, DelegationStatusChip, Delegations, DelegationsActionKey, DelegationsFacade, DelegationsList, DelegationsState, EndDelegationSession, GetActiveAssignedDelegations, GetAdminDelegations, GetApprovalDelegations, GetAssignedDelegations, GetDelegationDetail, GetMyDelegations, GetScopeOptions, LoadDelegationCandidates, PreviewScope, RejectDelegation, RejectDelegationDialog, ScopePicker, StartDelegationSession, StartSessionDialog, SwitchDelegationSession, TopbarDelegationMenu, UpdateDelegationLegacy, UpdateDelegationV2, appDelegationInterceptor, provideDelegationRuntime, withDelegatedRuntime };
1304
- export type { ActiveDelegationSession, AdminCreateDelegationV2Request, AdminUpdateDelegationV2Request, ApproveDelegationRequest, CreateDelegationLegacyRequest, CreateDelegationV2Request, DelegationAllowedAction, DelegationAppAccessibility, DelegationApprovalInfo, DelegationApprovalStatus, DelegationCancellationInfo, DelegationContextChange, DelegationDayRuleMode, DelegationDetail, DelegationDisplayValue, DelegationDto, DelegationEffectiveStatus, DelegationGrant, DelegationListQuery, DelegationPage, DelegationParty, DelegationPromptNamespace, DelegationRow, DelegationRuntimeConfig, DelegationScopeAction, DelegationScopeCombinationRule, DelegationScopeDeniedItem, DelegationScopeFact, DelegationScopeHierarchyGroup, DelegationScopeHierarchyTarget, DelegationScopeLevelNode, DelegationScopeModuleNode, DelegationScopeOptions, DelegationScopePermissionGroup, DelegationScopePreview, DelegationScopePreviewRequest, DelegationScopeSelection, DelegationScopeTarget, DelegationScopeView, DelegationScopeViewLevel, DelegationScopeViewModule, DelegationScopeViewOperation, DelegationScopeViewTemplate, DelegationScopeWarning, DelegationSessionInvalidationReason, DelegationSessionStartResponse, DelegationSessionStateModel, DelegationSortDirection, DelegationStatusInfo, DelegationsStateModel, RejectDelegationRequest, UpdateDelegationLegacyRequest, UpdateDelegationV2Request };
1335
+ export type { ActiveDelegationSession, AdminCreateDelegationV2Request, AdminUpdateDelegationV2Request, ApproveDelegationRequest, CreateDelegationLegacyRequest, CreateDelegationV2Request, DelegationAllowedAction, DelegationAppAccessibility, DelegationApprovalInfo, DelegationApprovalStatus, DelegationCancellationInfo, DelegationContextChange, DelegationContextChangeReason, DelegationDayRuleMode, DelegationDetail, DelegationDisplayValue, DelegationDto, DelegationEffectiveStatus, DelegationGrant, DelegationListQuery, DelegationPage, DelegationParty, DelegationPromptNamespace, DelegationRow, DelegationRuntimeConfig, DelegationScopeAction, DelegationScopeCombinationRule, DelegationScopeDeniedItem, DelegationScopeFact, DelegationScopeHierarchyGroup, DelegationScopeHierarchyTarget, DelegationScopeLevelNode, DelegationScopeModuleNode, DelegationScopeOptions, DelegationScopePermissionGroup, DelegationScopePreview, DelegationScopePreviewRequest, DelegationScopeSelection, DelegationScopeTarget, DelegationScopeView, DelegationScopeViewLevel, DelegationScopeViewModule, DelegationScopeViewOperation, DelegationScopeViewTemplate, DelegationScopeWarning, DelegationSessionInvalidationReason, DelegationSessionStartResponse, DelegationSessionStateModel, DelegationSortDirection, DelegationStatusInfo, DelegationsStateModel, RejectDelegationRequest, UpdateDelegationLegacyRequest, UpdateDelegationV2Request };