@masterteam/delegations 0.0.41 → 0.0.43

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.41",
3
+ "version": "0.0.43",
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.179",
24
- "@masterteam/icons": "^0.0.15",
25
- "@masterteam/forms": "^0.0.81"
23
+ "@masterteam/icons": "^0.0.16",
24
+ "@masterteam/forms": "^0.0.88",
25
+ "@masterteam/components": "^0.0.186"
26
26
  },
27
27
  "sideEffects": false,
28
28
  "exports": {
@@ -60,7 +60,6 @@ interface DelegationRow {
60
60
  approval: DelegationApprovalInfo;
61
61
  cancellation: DelegationCancellationInfo;
62
62
  allowedActions: DelegationAllowedAction[];
63
- scopeSummary: DelegationDisplayValue;
64
63
  rowVersion: string;
65
64
  }
66
65
  interface DelegationPage<T> {
@@ -144,9 +143,8 @@ interface DelegationScopeCombinationRule {
144
143
  [extra: string]: unknown;
145
144
  }
146
145
  /**
147
- * `scope/options` now prefers backend-owned `hierarchy` for FE rendering.
148
- * Flat `grants[]` / `targets + operations + combinationRules` remain for
149
- * compatibility and diagnostics while older environments catch up.
146
+ * Legacy `scope/options` grouping kept only as a compatibility fallback. The
147
+ * current FE selector contract is `permissions`.
150
148
  */
151
149
  interface DelegationScopeHierarchyTarget {
152
150
  target: DelegationScopeTarget;
@@ -205,6 +203,29 @@ interface DelegationScopePermissionGroup {
205
203
  sortOrder?: number | null;
206
204
  levels?: DelegationScopeLevelNode[] | null;
207
205
  }
206
+ interface DelegationScopeViewOperation extends DelegationScopeAction {
207
+ selected?: boolean;
208
+ isAvailable?: boolean;
209
+ accessibilities?: DelegationScopeFact[] | null;
210
+ dataFilters?: DelegationScopeFact[] | null;
211
+ constraints?: DelegationScopeFact[] | null;
212
+ }
213
+ interface DelegationScopeViewModule extends Omit<DelegationScopeModuleNode, 'operations'> {
214
+ isAvailable?: boolean;
215
+ operations?: DelegationScopeViewOperation[] | null;
216
+ }
217
+ interface DelegationScopeViewLevel extends Omit<DelegationScopeLevelNode, 'modules' | 'operations'> {
218
+ isAvailable?: boolean;
219
+ operations?: DelegationScopeViewOperation[] | null;
220
+ modules?: DelegationScopeViewModule[] | null;
221
+ }
222
+ interface DelegationScopeViewTemplate extends Omit<DelegationScopePermissionGroup, 'levels'> {
223
+ isAvailable?: boolean;
224
+ levels?: DelegationScopeViewLevel[] | null;
225
+ }
226
+ interface DelegationScopeView {
227
+ templates?: DelegationScopeViewTemplate[] | null;
228
+ }
208
229
  interface DelegationAppAccessibility {
209
230
  accessibilityGroupId?: number | null;
210
231
  applicationKey: string;
@@ -255,6 +276,7 @@ interface DelegationStatusInfo {
255
276
  interface DelegationDetail {
256
277
  row: DelegationRow;
257
278
  scope: DelegationScopeSelection;
279
+ scopeView?: DelegationScopeView | null;
258
280
  status: DelegationStatusInfo;
259
281
  }
260
282
  interface DelegationDto {
@@ -406,7 +428,7 @@ declare class TopbarDelegationMenu implements OnInit {
406
428
  protected readonly executedBy: _angular_core.Signal<_masterteam_delegations.DelegationParty | null>;
407
429
  /** Per-instance guard; the persisted `facade.prompted()` guards across refresh. */
408
430
  private localPrompted;
409
- protected readonly mode: _angular_core.Signal<"candidates" | "active" | "hidden">;
431
+ protected readonly mode: _angular_core.Signal<"active" | "candidates" | "hidden">;
410
432
  constructor();
411
433
  ngOnInit(): void;
412
434
  /** Two-letter initials for a delegator avatar (matches the user-menu pattern). */
@@ -442,7 +464,7 @@ declare class DelegationMenuPanel {
442
464
  protected readonly hasCandidates: _angular_core.Signal<boolean>;
443
465
  protected readonly onBehalfOf: _angular_core.Signal<_masterteam_delegations.DelegationParty | null>;
444
466
  protected readonly executedBy: _angular_core.Signal<_masterteam_delegations.DelegationParty | null>;
445
- protected readonly mode: _angular_core.Signal<"candidates" | "active" | "hidden">;
467
+ protected readonly mode: _angular_core.Signal<"active" | "candidates" | "hidden">;
446
468
  /** Two-letter initials for a delegator avatar (matches the user-menu pattern). */
447
469
  protected initials(party: DelegationRow['delegator'] | null | undefined): string;
448
470
  protected start(row: DelegationRow, event: MouseEvent): void;
@@ -481,7 +503,6 @@ declare class StartSessionDialog {
481
503
  protected readonly bodyKey: _angular_core.Signal<"delegations.session.switchConfirmBody" | "delegations.session.startConfirmBody">;
482
504
  protected readonly confirmLabelKey: _angular_core.Signal<"delegations.action.switchSession" | "delegations.action.startSession">;
483
505
  protected readonly successMessageKey: _angular_core.Signal<"delegations.session.switched" | "delegations.session.started">;
484
- protected formatScopeSummary(summary: DelegationRow['scopeSummary']): string;
485
506
  protected userEntity(party: DelegationRow['delegator']): _masterteam_components_entities.EntityData;
486
507
  confirm(): void;
487
508
  cancel(): void;
@@ -570,10 +591,32 @@ declare class DelegationsList implements OnInit {
570
591
  readonly approvalTabLabelKey: _angular_core.InputSignalWithTransform<string, unknown>;
571
592
  readonly approvalEmptyStateKey: _angular_core.InputSignalWithTransform<string, unknown>;
572
593
  readonly approvalStatus: _angular_core.InputSignalWithTransform<DelegationEffectiveStatus, unknown>;
594
+ /**
595
+ * Route-driven mode (client self-service): the active tab is the `:tab` route
596
+ * segment and the open drawer is a `?view=`/`?edit=` query param, so tabs and
597
+ * drawers are deep-linkable + back-button aware. When false (admin/default),
598
+ * tabs and drawers are managed internally exactly as before.
599
+ */
600
+ readonly routed: _angular_core.InputSignalWithTransform<boolean, unknown>;
601
+ /** Bound from the `:tab` route param via `withComponentInputBinding()`. */
602
+ readonly tab: _angular_core.InputSignalWithTransform<DelegationTab | null, unknown>;
603
+ /** Bound from the `?view=<id>` query param (detail drawer). */
604
+ readonly view: _angular_core.InputSignalWithTransform<number | null, unknown>;
605
+ /** Back-compatible notification deep-link aliases for opening details. */
606
+ readonly selected: _angular_core.InputSignalWithTransform<number | null, unknown>;
607
+ readonly itemSelected: _angular_core.InputSignalWithTransform<number | null, unknown>;
608
+ readonly selectedItemId: _angular_core.InputSignalWithTransform<number | null, unknown>;
609
+ readonly selectedItem: _angular_core.InputSignalWithTransform<number | null, unknown>;
610
+ readonly itemId: _angular_core.InputSignalWithTransform<number | null, unknown>;
611
+ readonly delegationId: _angular_core.InputSignalWithTransform<number | null, unknown>;
612
+ /** Bound from the `?edit=<id>` query param (edit drawer). */
613
+ readonly edit: _angular_core.InputSignalWithTransform<number | null, unknown>;
573
614
  private readonly facade;
574
615
  private readonly location;
575
616
  private readonly modal;
576
617
  private readonly transloco;
618
+ private readonly router;
619
+ private readonly route;
577
620
  protected readonly breadcrumbItems: _angular_core.WritableSignal<({
578
621
  label: string;
579
622
  icon: string;
@@ -593,6 +636,7 @@ declare class DelegationsList implements OnInit {
593
636
  protected readonly rows: _angular_core.Signal<DelegationRow[]>;
594
637
  protected readonly tableRows: _angular_core.Signal<DelegationTableRow[]>;
595
638
  protected readonly emptyStateKey: _angular_core.Signal<string>;
639
+ private readonly detailQueryId;
596
640
  protected readonly tableActions: _angular_core.Signal<TableAction[]>;
597
641
  protected readonly rowActions: _angular_core.WritableSignal<TableAction[]>;
598
642
  /**
@@ -605,6 +649,11 @@ declare class DelegationsList implements OnInit {
605
649
  protected readonly tableColumns: _angular_core.WritableSignal<ColumnDef[]>;
606
650
  private readonly busyIds;
607
651
  private readonly weekdayKeys;
652
+ private detailRef;
653
+ private detailOpenId;
654
+ private editRef;
655
+ private editOpenId;
656
+ constructor();
608
657
  ngOnInit(): void;
609
658
  protected switchTab(tab: DelegationTab): void;
610
659
  protected goBack(): void;
@@ -613,15 +662,23 @@ declare class DelegationsList implements OnInit {
613
662
  protected has(row: DelegationRow, action: DelegationAllowedAction): boolean;
614
663
  protected formatDays(row: DelegationRow): string;
615
664
  protected getListedParty(row: DelegationRow): _masterteam_delegations.DelegationParty;
616
- private viewDetails;
665
+ private onView;
666
+ private onEdit;
667
+ private openDetailById;
617
668
  private openForm;
669
+ private syncDetailDrawer;
670
+ private syncEditDrawer;
671
+ private closeDetail;
672
+ private closeEdit;
673
+ private clearQuery;
674
+ private clearDetailQuery;
618
675
  private approve;
619
676
  private reject;
620
677
  private cancel;
621
678
  private startSession;
622
679
  private mark;
623
680
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<DelegationsList, never>;
624
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<DelegationsList, "mt-delegations-list", never, { "showBreadcrumb": { "alias": "showBreadcrumb"; "required": false; "isSignal": true; }; "showPageShell": { "alias": "showPageShell"; "required": false; "isSignal": true; }; "adminMode": { "alias": "adminMode"; "required": false; "isSignal": true; }; "surfaceTitleKey": { "alias": "surfaceTitleKey"; "required": false; "isSignal": true; }; "assignedTabLabelKey": { "alias": "assignedTabLabelKey"; "required": false; "isSignal": true; }; "assignedDecisionTab": { "alias": "assignedDecisionTab"; "required": false; "isSignal": true; }; "assignedEmptyStateKey": { "alias": "assignedEmptyStateKey"; "required": false; "isSignal": true; }; "assignedStatus": { "alias": "assignedStatus"; "required": false; "isSignal": true; }; "showApprovalTab": { "alias": "showApprovalTab"; "required": false; "isSignal": true; }; "approvalTabLabelKey": { "alias": "approvalTabLabelKey"; "required": false; "isSignal": true; }; "approvalEmptyStateKey": { "alias": "approvalEmptyStateKey"; "required": false; "isSignal": true; }; "approvalStatus": { "alias": "approvalStatus"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
681
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<DelegationsList, "mt-delegations-list", never, { "showBreadcrumb": { "alias": "showBreadcrumb"; "required": false; "isSignal": true; }; "showPageShell": { "alias": "showPageShell"; "required": false; "isSignal": true; }; "adminMode": { "alias": "adminMode"; "required": false; "isSignal": true; }; "surfaceTitleKey": { "alias": "surfaceTitleKey"; "required": false; "isSignal": true; }; "assignedTabLabelKey": { "alias": "assignedTabLabelKey"; "required": false; "isSignal": true; }; "assignedDecisionTab": { "alias": "assignedDecisionTab"; "required": false; "isSignal": true; }; "assignedEmptyStateKey": { "alias": "assignedEmptyStateKey"; "required": false; "isSignal": true; }; "assignedStatus": { "alias": "assignedStatus"; "required": false; "isSignal": true; }; "showApprovalTab": { "alias": "showApprovalTab"; "required": false; "isSignal": true; }; "approvalTabLabelKey": { "alias": "approvalTabLabelKey"; "required": false; "isSignal": true; }; "approvalEmptyStateKey": { "alias": "approvalEmptyStateKey"; "required": false; "isSignal": true; }; "approvalStatus": { "alias": "approvalStatus"; "required": false; "isSignal": true; }; "routed": { "alias": "routed"; "required": false; "isSignal": true; }; "tab": { "alias": "tab"; "required": false; "isSignal": true; }; "view": { "alias": "view"; "required": false; "isSignal": true; }; "selected": { "alias": "selected"; "required": false; "isSignal": true; }; "itemSelected": { "alias": "itemSelected"; "required": false; "isSignal": true; }; "selectedItemId": { "alias": "selectedItemId"; "required": false; "isSignal": true; }; "selectedItem": { "alias": "selectedItem"; "required": false; "isSignal": true; }; "itemId": { "alias": "itemId"; "required": false; "isSignal": true; }; "delegationId": { "alias": "delegationId"; "required": false; "isSignal": true; }; "edit": { "alias": "edit"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
625
682
  }
626
683
 
627
684
  interface DelegationFormUserValue {
@@ -687,8 +744,43 @@ declare class DelegationForm implements OnInit {
687
744
  }
688
745
 
689
746
  type DetailTab = 'overview' | 'scope';
747
+ type ScopeViewNode = {
748
+ kind: 'template';
749
+ key: string;
750
+ label: string;
751
+ fallbackKey?: string | null;
752
+ isAvailable: boolean;
753
+ depth: number;
754
+ children: ScopeViewNode[];
755
+ } | {
756
+ kind: 'level';
757
+ key: string;
758
+ label: string;
759
+ fallbackKey?: string | null;
760
+ isAvailable: boolean;
761
+ depth: number;
762
+ children: ScopeViewNode[];
763
+ } | {
764
+ kind: 'module';
765
+ key: string;
766
+ label: string;
767
+ fallbackKey?: string | null;
768
+ isAvailable: boolean;
769
+ depth: number;
770
+ children: ScopeViewNode[];
771
+ } | {
772
+ kind: 'operation';
773
+ key: string;
774
+ label: string;
775
+ fallbackKey?: string | null;
776
+ isAvailable: boolean;
777
+ isHighRisk: boolean;
778
+ depth: number;
779
+ };
690
780
  /**
691
- * Read-only drawer that shows the full `DelegationDetail` ({ row, scope, status }).
781
+ * Read-only drawer that shows `DelegationDetail` row/status plus saved scope
782
+ * from `scopeView`. The persisted `scope.grants` shape is not parsed for
783
+ * display; it remains a backend validation/persistence shape.
692
784
  */
693
785
  declare class DelegationDetailDrawer implements OnInit {
694
786
  readonly delegationId: _angular_core.InputSignal<number>;
@@ -705,13 +797,24 @@ declare class DelegationDetailDrawer implements OnInit {
705
797
  protected readonly isLoading: _angular_core.Signal<boolean>;
706
798
  protected readonly detail: _angular_core.Signal<_masterteam_delegations.DelegationDetail | null>;
707
799
  protected readonly row: _angular_core.Signal<_masterteam_delegations.DelegationRow | null>;
800
+ protected readonly scopeNodes: _angular_core.Signal<ScopeViewNode[]>;
801
+ protected readonly scopeVisibleNodes: _angular_core.Signal<ScopeViewNode[]>;
802
+ protected readonly selectedOperationCount: _angular_core.Signal<number>;
708
803
  ngOnInit(): void;
709
804
  protected formatSpecificDays(days: readonly number[] | null | undefined): string;
710
805
  protected approvalLabel(): string;
711
- protected getScopeTargetLabel(target: DelegationScopeTarget): string;
712
- protected getScopeActionLabel(action: DelegationScopeAction): string;
713
- protected formatScopeSummary(summary: DelegationDisplayValue | undefined): string;
714
806
  protected userEntity(party: DelegationParty, label?: string): _masterteam_components_entities.EntityData;
807
+ protected hasChildren(node: ScopeViewNode): boolean;
808
+ protected trackScopeNode(_index: number, node: ScopeViewNode): string;
809
+ private buildScopeViewTree;
810
+ private flattenScopeNodes;
811
+ private toTemplateNode;
812
+ private toLevelNodes;
813
+ private toModuleNode;
814
+ private toOperationNode;
815
+ private displayLabel;
816
+ private toArray;
817
+ private hasScopeChildren;
715
818
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<DelegationDetailDrawer, never>;
716
819
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<DelegationDetailDrawer, "mt-delegation-detail-drawer", never, { "delegationId": { "alias": "delegationId"; "required": true; "isSignal": true; }; "adminMode": { "alias": "adminMode"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
717
820
  }
@@ -723,7 +826,7 @@ interface DelegationScopeTreeNode {
723
826
  displayName?: DelegationDisplayValue;
724
827
  fallbackKey?: string | null;
725
828
  isHighRisk?: boolean;
726
- /** Present only on operation leaves the explicit grant to persist/preview. */
829
+ /** Present only on operation leaves: the explicit grant to persist/preview. */
727
830
  grant?: DelegationGrant;
728
831
  children?: DelegationScopeTreeNode[];
729
832
  }
@@ -1154,4 +1257,4 @@ declare class DelegationSessionFacade {
1154
1257
  }
1155
1258
 
1156
1259
  export { ApproveDelegation, CancelDelegation, ClearDelegationDetail, ClearScopePreview, CreateDelegationLegacy, CreateDelegationV2, DELEGATION_RELOAD_ON_SESSION_CHANGE, DelegationDetailDrawer, DelegationForm, DelegationMenuPanel, DelegationSessionActionKey, DelegationSessionFacade, DelegationSessionState, DelegationStatusChip, Delegations, DelegationsActionKey, DelegationsFacade, DelegationsList, DelegationsState, EndDelegationSession, GetActiveAssignedDelegations, GetAdminDelegations, GetApprovalDelegations, GetAssignedDelegations, GetDelegationDetail, GetMyDelegations, GetScopeOptions, LoadDelegationCandidates, MarkDelegationPrompted, PreviewScope, RejectDelegation, RejectDelegationDialog, ScopePicker, StartDelegationSession, StartSessionDialog, SwitchDelegationSession, TopbarDelegationMenu, UpdateDelegationLegacy, UpdateDelegationV2, appDelegationInterceptor };
1157
- export type { ActiveDelegationSession, AdminCreateDelegationV2Request, AdminUpdateDelegationV2Request, ApproveDelegationRequest, CreateDelegationLegacyRequest, CreateDelegationV2Request, DelegationAllowedAction, DelegationAppAccessibility, DelegationApprovalInfo, DelegationApprovalStatus, DelegationCancellationInfo, DelegationDayRuleMode, DelegationDetail, DelegationDisplayValue, DelegationDto, DelegationEffectiveStatus, DelegationGrant, DelegationListQuery, DelegationPage, DelegationParty, DelegationRow, DelegationScopeAction, DelegationScopeCombinationRule, DelegationScopeDeniedItem, DelegationScopeFact, DelegationScopeHierarchyGroup, DelegationScopeHierarchyTarget, DelegationScopeLevelNode, DelegationScopeModuleNode, DelegationScopeOptions, DelegationScopePermissionGroup, DelegationScopePreview, DelegationScopePreviewRequest, DelegationScopeSelection, DelegationScopeTarget, DelegationScopeWarning, DelegationSessionInvalidationReason, DelegationSessionStateModel, DelegationSortDirection, DelegationStatusInfo, DelegationsStateModel, RejectDelegationRequest, UpdateDelegationLegacyRequest, UpdateDelegationV2Request };
1260
+ export type { ActiveDelegationSession, AdminCreateDelegationV2Request, AdminUpdateDelegationV2Request, ApproveDelegationRequest, CreateDelegationLegacyRequest, CreateDelegationV2Request, DelegationAllowedAction, DelegationAppAccessibility, DelegationApprovalInfo, DelegationApprovalStatus, DelegationCancellationInfo, DelegationDayRuleMode, DelegationDetail, DelegationDisplayValue, DelegationDto, DelegationEffectiveStatus, DelegationGrant, DelegationListQuery, DelegationPage, DelegationParty, DelegationRow, DelegationScopeAction, DelegationScopeCombinationRule, DelegationScopeDeniedItem, DelegationScopeFact, DelegationScopeHierarchyGroup, DelegationScopeHierarchyTarget, DelegationScopeLevelNode, DelegationScopeModuleNode, DelegationScopeOptions, DelegationScopePermissionGroup, DelegationScopePreview, DelegationScopePreviewRequest, DelegationScopeSelection, DelegationScopeTarget, DelegationScopeView, DelegationScopeViewLevel, DelegationScopeViewModule, DelegationScopeViewOperation, DelegationScopeViewTemplate, DelegationScopeWarning, DelegationSessionInvalidationReason, DelegationSessionStateModel, DelegationSortDirection, DelegationStatusInfo, DelegationsStateModel, RejectDelegationRequest, UpdateDelegationLegacyRequest, UpdateDelegationV2Request };