@memberjunction/ng-resource-permissions 5.29.0 → 5.30.0
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/dist/lib/mj-resource-permission-share-adapter.d.ts +23 -0
- package/dist/lib/mj-resource-permission-share-adapter.d.ts.map +1 -0
- package/dist/lib/mj-resource-permission-share-adapter.js +81 -0
- package/dist/lib/mj-resource-permission-share-adapter.js.map +1 -0
- package/dist/lib/resource-permissions.component.js +4 -4
- package/dist/lib/resource-permissions.component.js.map +1 -1
- package/dist/lib/resource-share-adapter.d.ts +78 -0
- package/dist/lib/resource-share-adapter.d.ts.map +1 -0
- package/dist/lib/resource-share-adapter.js +6 -0
- package/dist/lib/resource-share-adapter.js.map +1 -0
- package/dist/lib/resource-share-dialog.component.d.ts +51 -0
- package/dist/lib/resource-share-dialog.component.d.ts.map +1 -0
- package/dist/lib/resource-share-dialog.component.js +458 -0
- package/dist/lib/resource-share-dialog.component.js.map +1 -0
- package/dist/lib/user-sharing-center.component.d.ts +105 -0
- package/dist/lib/user-sharing-center.component.d.ts.map +1 -0
- package/dist/lib/user-sharing-center.component.js +536 -0
- package/dist/lib/user-sharing-center.component.js.map +1 -0
- package/dist/module.d.ts +9 -8
- package/dist/module.d.ts.map +1 -1
- package/dist/module.js +19 -8
- package/dist/module.js.map +1 -1
- package/dist/public-api.d.ts +4 -0
- package/dist/public-api.d.ts.map +1 -1
- package/dist/public-api.js +4 -0
- package/dist/public-api.js.map +1 -1
- package/package.json +10 -10
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { EventEmitter, OnInit } from '@angular/core';
|
|
2
|
+
import { NormalizedPermission, PermissionAction } from '@memberjunction/core';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/** Which tab the Sharing Center is currently displaying. */
|
|
5
|
+
export type SharingCenterTab = 'shared-with-me' | 'shared-by-me';
|
|
6
|
+
/**
|
|
7
|
+
* One collapsible domain section rendered by {@link UserSharingCenterComponent}.
|
|
8
|
+
* Exported because consumers occasionally want to render their own custom layout
|
|
9
|
+
* around the same shape.
|
|
10
|
+
*/
|
|
11
|
+
export interface SharingCenterDomainGroup {
|
|
12
|
+
DomainName: string;
|
|
13
|
+
Icon: string;
|
|
14
|
+
Rows: NormalizedPermission[];
|
|
15
|
+
Expanded: boolean;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Default domain → entity-name mapping used by the Sharing Center to load and
|
|
19
|
+
* delete the underlying permission record on Revoke. Apps with custom permission
|
|
20
|
+
* domains can pass a replacement function via `SharingEntityResolver`.
|
|
21
|
+
*/
|
|
22
|
+
export declare const DefaultSharingEntityResolver: (domainName: string) => string | null;
|
|
23
|
+
/**
|
|
24
|
+
* **Generic, framework-agnostic Sharing Center.** Renders two tabs:
|
|
25
|
+
*
|
|
26
|
+
* - **Shared with me** — every resource the current user has direct (non-role)
|
|
27
|
+
* access to, grouped by permission domain. Each row is clickable and emits
|
|
28
|
+
* `ResourceClicked` so the embedding app can route to the resource. The Generic
|
|
29
|
+
* component never imports Angular Router / NavigationService — the parent
|
|
30
|
+
* decides how to navigate.
|
|
31
|
+
*
|
|
32
|
+
* - **Shared by me** — every permission record where the current user is the
|
|
33
|
+
* grantor. Each row has a Revoke button that deletes the underlying permission
|
|
34
|
+
* record through `Metadata.GetEntityObject().Delete()` (so audit captures the
|
|
35
|
+
* revoke and BaseEntity event-driven cache invalidation runs).
|
|
36
|
+
*
|
|
37
|
+
* Inputs / Outputs are designed so the component drops cleanly into a dialog,
|
|
38
|
+
* a side panel, an embedded widget, or a full-page route.
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```html
|
|
42
|
+
* <mj-user-sharing-center
|
|
43
|
+
* [ActiveTab]="tab"
|
|
44
|
+
* (ActiveTabChange)="tab = $event"
|
|
45
|
+
* (ResourceClicked)="OnResourceClicked($event)"
|
|
46
|
+
* (CloseRequested)="dialogRef.Close()">
|
|
47
|
+
* </mj-user-sharing-center>
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
export declare class UserSharingCenterComponent implements OnInit {
|
|
51
|
+
private readonly cdr;
|
|
52
|
+
private readonly dialogService;
|
|
53
|
+
/** Which tab is shown initially. Two-way bindable via `ActiveTabChange`. */
|
|
54
|
+
ActiveTab: SharingCenterTab;
|
|
55
|
+
/**
|
|
56
|
+
* When true, the close button is rendered in the tab strip. Hide it when the
|
|
57
|
+
* embedding container provides its own close affordance.
|
|
58
|
+
*/
|
|
59
|
+
ShowCloseButton: boolean;
|
|
60
|
+
/** Title text displayed in the confirm-revoke dialog. */
|
|
61
|
+
RevokeConfirmTitle: string;
|
|
62
|
+
/**
|
|
63
|
+
* Maps a permission domain name (e.g. `"Dashboard Permissions"`) to the entity
|
|
64
|
+
* name used to load and delete the underlying record on Revoke. Replace to add
|
|
65
|
+
* support for custom domains. Defaults to {@link DefaultSharingEntityResolver}.
|
|
66
|
+
*/
|
|
67
|
+
SharingEntityResolver: (domainName: string) => string | null;
|
|
68
|
+
/** Two-way binding partner for `ActiveTab`. */
|
|
69
|
+
ActiveTabChange: EventEmitter<SharingCenterTab>;
|
|
70
|
+
/** Fired when a row in the "Shared with me" tab is clicked. */
|
|
71
|
+
ResourceClicked: EventEmitter<NormalizedPermission>;
|
|
72
|
+
/** Fired when the user clicks the close button. Parent should close the host dialog/panel. */
|
|
73
|
+
CloseRequested: EventEmitter<void>;
|
|
74
|
+
/** Fired after a permission has been successfully revoked. */
|
|
75
|
+
PermissionRevoked: EventEmitter<NormalizedPermission>;
|
|
76
|
+
/** Fired whenever an error is shown to the user. Useful for parent telemetry. */
|
|
77
|
+
ErrorOccurred: EventEmitter<string>;
|
|
78
|
+
SharedWithMe: SharingCenterDomainGroup[];
|
|
79
|
+
SharedByMe: SharingCenterDomainGroup[];
|
|
80
|
+
IsLoadingWithMe: boolean;
|
|
81
|
+
IsLoadingByMe: boolean;
|
|
82
|
+
ErrorMessage: string | null;
|
|
83
|
+
ngOnInit(): Promise<void>;
|
|
84
|
+
/** Switch to a tab and load its data if not already loaded. */
|
|
85
|
+
SwitchTab(tab: SharingCenterTab): Promise<void>;
|
|
86
|
+
/** Force-refresh the currently active tab. */
|
|
87
|
+
Refresh(): Promise<void>;
|
|
88
|
+
OnTabClick(tab: SharingCenterTab): Promise<void>;
|
|
89
|
+
OnRowClick(row: NormalizedPermission): void;
|
|
90
|
+
OnClose(): void;
|
|
91
|
+
OnRevoke(row: NormalizedPermission, event: Event): Promise<void>;
|
|
92
|
+
ToggleGroup(group: SharingCenterDomainGroup): void;
|
|
93
|
+
ActionsLabel(actions: PermissionAction[]): string;
|
|
94
|
+
TrackByDomain(_idx: number, g: SharingCenterDomainGroup): string;
|
|
95
|
+
TrackByRow(_idx: number, r: NormalizedPermission): string;
|
|
96
|
+
private loadTab;
|
|
97
|
+
private loadSharedWithMe;
|
|
98
|
+
private loadSharedByMe;
|
|
99
|
+
private groupByDomain;
|
|
100
|
+
private setError;
|
|
101
|
+
private confirmRevoke;
|
|
102
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<UserSharingCenterComponent, never>;
|
|
103
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<UserSharingCenterComponent, "mj-user-sharing-center", never, { "ActiveTab": { "alias": "ActiveTab"; "required": false; }; "ShowCloseButton": { "alias": "ShowCloseButton"; "required": false; }; "RevokeConfirmTitle": { "alias": "RevokeConfirmTitle"; "required": false; }; "SharingEntityResolver": { "alias": "SharingEntityResolver"; "required": false; }; }, { "ActiveTabChange": "ActiveTabChange"; "ResourceClicked": "ResourceClicked"; "CloseRequested": "CloseRequested"; "PermissionRevoked": "PermissionRevoked"; "ErrorOccurred": "ErrorOccurred"; }, never, never, true, never>;
|
|
104
|
+
}
|
|
105
|
+
//# sourceMappingURL=user-sharing-center.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-sharing-center.component.d.ts","sourceRoot":"","sources":["../../src/lib/user-sharing-center.component.ts"],"names":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