@memberjunction/ng-entity-viewer 6.2.0-edge.5 → 6.2.0-edge.6
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/README.md +28 -0
- package/dist/lib/aggregate-setup-dialog/aggregate-setup-dialog.component.d.ts +48 -1
- package/dist/lib/aggregate-setup-dialog/aggregate-setup-dialog.component.d.ts.map +1 -1
- package/dist/lib/aggregate-setup-dialog/aggregate-setup-dialog.component.js +631 -279
- package/dist/lib/aggregate-setup-dialog/aggregate-setup-dialog.component.js.map +1 -1
- package/dist/lib/entity-cards/entity-cards.component.d.ts +2 -0
- package/dist/lib/entity-cards/entity-cards.component.d.ts.map +1 -1
- package/dist/lib/entity-cards/entity-cards.component.js +30 -2
- package/dist/lib/entity-cards/entity-cards.component.js.map +1 -1
- package/dist/lib/entity-data-grid/entity-data-grid.component.d.ts +64 -2
- package/dist/lib/entity-data-grid/entity-data-grid.component.d.ts.map +1 -1
- package/dist/lib/entity-data-grid/entity-data-grid.component.js +516 -187
- package/dist/lib/entity-data-grid/entity-data-grid.component.js.map +1 -1
- package/dist/lib/entity-record-detail-panel/entity-record-detail-panel.component.d.ts +2 -0
- package/dist/lib/entity-record-detail-panel/entity-record-detail-panel.component.d.ts.map +1 -1
- package/dist/lib/entity-record-detail-panel/entity-record-detail-panel.component.js +38 -4
- package/dist/lib/entity-record-detail-panel/entity-record-detail-panel.component.js.map +1 -1
- package/dist/lib/entity-viewer/entity-viewer.component.d.ts +39 -3
- package/dist/lib/entity-viewer/entity-viewer.component.d.ts.map +1 -1
- package/dist/lib/entity-viewer/entity-viewer.component.js +188 -49
- package/dist/lib/entity-viewer/entity-viewer.component.js.map +1 -1
- package/dist/lib/entity-viewer/view-property-chips.d.ts +17 -0
- package/dist/lib/entity-viewer/view-property-chips.d.ts.map +1 -0
- package/dist/lib/entity-viewer/view-property-chips.js +42 -0
- package/dist/lib/entity-viewer/view-property-chips.js.map +1 -0
- package/dist/lib/recycle-bin/recycle-bin-chip.component.d.ts.map +1 -1
- package/dist/lib/recycle-bin/recycle-bin-chip.component.js +5 -4
- package/dist/lib/recycle-bin/recycle-bin-chip.component.js.map +1 -1
- package/dist/lib/recycle-bin/recycle-bin.component.js +3 -3
- package/dist/lib/recycle-bin/recycle-bin.component.js.map +1 -1
- package/dist/lib/utils/record.util.d.ts +21 -1
- package/dist/lib/utils/record.util.d.ts.map +1 -1
- package/dist/lib/utils/record.util.js +108 -0
- package/dist/lib/utils/record.util.js.map +1 -1
- package/dist/lib/view-config-panel/view-config-panel.component.d.ts +378 -54
- package/dist/lib/view-config-panel/view-config-panel.component.d.ts.map +1 -1
- package/dist/lib/view-config-panel/view-config-panel.component.js +3837 -1010
- package/dist/lib/view-config-panel/view-config-panel.component.js.map +1 -1
- package/dist/lib/view-properties-editor/view-properties-editor.component.d.ts +52 -0
- package/dist/lib/view-properties-editor/view-properties-editor.component.d.ts.map +1 -0
- package/dist/lib/view-properties-editor/view-properties-editor.component.js +445 -0
- package/dist/lib/view-properties-editor/view-properties-editor.component.js.map +1 -0
- package/dist/lib/view-selector/view-selector.component.d.ts +22 -1
- package/dist/lib/view-selector/view-selector.component.d.ts.map +1 -1
- package/dist/lib/view-selector/view-selector.component.js +288 -149
- package/dist/lib/view-selector/view-selector.component.js.map +1 -1
- package/dist/lib/view-types/descriptors/calendar-view-type.d.ts +22 -0
- package/dist/lib/view-types/descriptors/calendar-view-type.d.ts.map +1 -0
- package/dist/lib/view-types/descriptors/calendar-view-type.js +38 -0
- package/dist/lib/view-types/descriptors/calendar-view-type.js.map +1 -0
- package/dist/lib/view-types/index.d.ts +3 -2
- package/dist/lib/view-types/index.d.ts.map +1 -1
- package/dist/lib/view-types/index.js +5 -2
- package/dist/lib/view-types/index.js.map +1 -1
- package/dist/lib/view-types/renderers/calendar-placement.d.ts +97 -0
- package/dist/lib/view-types/renderers/calendar-placement.d.ts.map +1 -0
- package/dist/lib/view-types/renderers/calendar-placement.js +145 -0
- package/dist/lib/view-types/renderers/calendar-placement.js.map +1 -0
- package/dist/lib/view-types/renderers/calendar-view-prop-sheet.component.d.ts +36 -0
- package/dist/lib/view-types/renderers/calendar-view-prop-sheet.component.d.ts.map +1 -0
- package/dist/lib/view-types/renderers/calendar-view-prop-sheet.component.js +167 -0
- package/dist/lib/view-types/renderers/calendar-view-prop-sheet.component.js.map +1 -0
- package/dist/lib/view-types/renderers/calendar-view-renderer.component.d.ts +107 -0
- package/dist/lib/view-types/renderers/calendar-view-renderer.component.d.ts.map +1 -0
- package/dist/lib/view-types/renderers/calendar-view-renderer.component.js +501 -0
- package/dist/lib/view-types/renderers/calendar-view-renderer.component.js.map +1 -0
- package/dist/lib/view-types/renderers/grid-view-renderer.component.d.ts +3 -1
- package/dist/lib/view-types/renderers/grid-view-renderer.component.d.ts.map +1 -1
- package/dist/lib/view-types/renderers/grid-view-renderer.component.js +12 -3
- package/dist/lib/view-types/renderers/grid-view-renderer.component.js.map +1 -1
- package/dist/lib/view-types/renderers/map-view-renderer.component.d.ts.map +1 -1
- package/dist/lib/view-types/renderers/map-view-renderer.component.js +3 -3
- package/dist/lib/view-types/renderers/map-view-renderer.component.js.map +1 -1
- package/dist/lib/view-workspace/view-workspace.component.d.ts +34 -1
- package/dist/lib/view-workspace/view-workspace.component.d.ts.map +1 -1
- package/dist/lib/view-workspace/view-workspace.component.js +177 -15
- package/dist/lib/view-workspace/view-workspace.component.js.map +1 -1
- package/dist/module.d.ts +35 -31
- package/dist/module.d.ts.map +1 -1
- package/dist/module.js +21 -3
- package/dist/module.js.map +1 -1
- package/dist/public-api.d.ts +5 -0
- package/dist/public-api.d.ts.map +1 -1
- package/dist/public-api.js +5 -0
- package/dist/public-api.js.map +1 -1
- package/package.json +22 -21
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { UserViewProperty, ViewPropertyValues } from '@memberjunction/core';
|
|
2
|
+
/** One read-only chip above the grid: a view property and the value this run gives it. */
|
|
3
|
+
export interface ViewPropertyChip {
|
|
4
|
+
Name: string;
|
|
5
|
+
/** What the chip shows as the value: the host's value, the default, "set by server", or "any". */
|
|
6
|
+
Value: string;
|
|
7
|
+
/** True for a property only the server may set. */
|
|
8
|
+
ServerSet: boolean;
|
|
9
|
+
Description: string | null;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* The chips for a view's properties. A property that does not allow override reads "set by
|
|
13
|
+
* server": the browser never sees its value. Any other shows the host's value, else its default,
|
|
14
|
+
* else "any".
|
|
15
|
+
*/
|
|
16
|
+
export declare function BuildViewPropertyChips(declared: readonly UserViewProperty[] | null | undefined, values: ViewPropertyValues | null | undefined): ViewPropertyChip[];
|
|
17
|
+
//# sourceMappingURL=view-property-chips.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"view-property-chips.d.ts","sourceRoot":"","sources":["../../../src/lib/entity-viewer/view-property-chips.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,gBAAgB,EAAqB,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAEhH,0FAA0F;AAC1F,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,kGAAkG;IAClG,KAAK,EAAE,MAAM,CAAC;IACd,mDAAmD;IACnD,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,SAAS,gBAAgB,EAAE,GAAG,IAAI,GAAG,SAAS,EAAE,MAAM,EAAE,kBAAkB,GAAG,IAAI,GAAG,SAAS,GAAG,gBAAgB,EAAE,CAOlK"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The chips for a view's properties. A property that does not allow override reads "set by
|
|
3
|
+
* server": the browser never sees its value. Any other shows the host's value, else its default,
|
|
4
|
+
* else "any".
|
|
5
|
+
*/
|
|
6
|
+
export function BuildViewPropertyChips(declared, values) {
|
|
7
|
+
return (declared ?? []).map(property => ({
|
|
8
|
+
Name: property.Name,
|
|
9
|
+
Value: chipValue(property, values),
|
|
10
|
+
ServerSet: property.AllowOverride === false,
|
|
11
|
+
Description: property.Description ?? null,
|
|
12
|
+
}));
|
|
13
|
+
}
|
|
14
|
+
function chipValue(property, values) {
|
|
15
|
+
if (property.AllowOverride === false) {
|
|
16
|
+
return 'set by server';
|
|
17
|
+
}
|
|
18
|
+
if (values && Object.prototype.hasOwnProperty.call(values, property.Name) && values[property.Name] !== undefined) {
|
|
19
|
+
return formatValue(values[property.Name]);
|
|
20
|
+
}
|
|
21
|
+
return property.Default ? `${describeDefault(property.Default)} (default)` : 'any';
|
|
22
|
+
}
|
|
23
|
+
function formatValue(value) {
|
|
24
|
+
if (value === null) {
|
|
25
|
+
return 'none';
|
|
26
|
+
}
|
|
27
|
+
return Array.isArray(value) ? value.map(v => String(v)).join(', ') : String(value);
|
|
28
|
+
}
|
|
29
|
+
/** `Today -30 days`, `Start of month -1 month`, or the fixed value. */
|
|
30
|
+
function describeDefault(def) {
|
|
31
|
+
if (!def.Token) {
|
|
32
|
+
return formatValue(def.Value ?? null);
|
|
33
|
+
}
|
|
34
|
+
const token = def.Token.replace('Context.', '').replace(/([a-z])([A-Z])/g, '$1 $2');
|
|
35
|
+
const label = token.charAt(0) + token.slice(1).toLowerCase();
|
|
36
|
+
if (!def.Offset) {
|
|
37
|
+
return label;
|
|
38
|
+
}
|
|
39
|
+
const { Amount, Unit } = def.Offset;
|
|
40
|
+
return `${label} ${Amount > 0 ? '+' : ''}${Amount} ${Unit}${Math.abs(Amount) === 1 ? '' : 's'}`;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=view-property-chips.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"view-property-chips.js","sourceRoot":"","sources":["../../../src/lib/entity-viewer/view-property-chips.ts"],"names":[],"mappings":"AAYA;;;;GAIG;AACH,MAAM,UAAU,sBAAsB,CAAC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AAuE;AACvE,SAAS,eAAe,CAAC,GAAoB;IAC3C,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC;QACf,OAAO,WAAW,CAAC,GAAG,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC;IACxC,CAAC;IACD,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC;IACpF,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;IAC7D,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC;QAChB,OAAO,KAAK,CAAC;IACf,CAAC;IACD,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,GAAG,CAAC,MAAM,CAAC;IACpC,OAAO,GAAG,KAAK,IAAI,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,MAAM,IAAI,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;AAClG,CAAC","sourcesContent":["import { PropertyDefault, UserViewProperty, ViewPropertyValue, ViewPropertyValues } from '@memberjunction/core';\n\n/** One read-only chip above the grid: a view property and the value this run gives it. */\nexport interface ViewPropertyChip {\n Name: string;\n /** What the chip shows as the value: the host's value, the default, \"set by server\", or \"any\". */\n Value: string;\n /** True for a property only the server may set. */\n ServerSet: boolean;\n Description: string | null;\n}\n\n/**\n * The chips for a view's properties. A property that does not allow override reads \"set by\n * server\": the browser never sees its value. Any other shows the host's value, else its default,\n * else \"any\".\n */\nexport function BuildViewPropertyChips(declared: readonly UserViewProperty[] | null | undefined, values: ViewPropertyValues | null | undefined): ViewPropertyChip[] {\n return (declared ?? []).map(property => ({\n Name: property.Name,\n Value: chipValue(property, values),\n ServerSet: property.AllowOverride === false,\n Description: property.Description ?? null,\n }));\n}\n\nfunction chipValue(property: UserViewProperty, values: ViewPropertyValues | null | undefined): string {\n if (property.AllowOverride === false) {\n return 'set by server';\n }\n if (values && Object.prototype.hasOwnProperty.call(values, property.Name) && values[property.Name] !== undefined) {\n return formatValue(values[property.Name]);\n }\n return property.Default ? `${describeDefault(property.Default)} (default)` : 'any';\n}\n\nfunction formatValue(value: ViewPropertyValue): string {\n if (value === null) {\n return 'none';\n }\n return Array.isArray(value) ? value.map(v => String(v)).join(', ') : String(value);\n}\n\n/** `Today -30 days`, `Start of month -1 month`, or the fixed value. */\nfunction describeDefault(def: PropertyDefault): string {\n if (!def.Token) {\n return formatValue(def.Value ?? null);\n }\n const token = def.Token.replace('Context.', '').replace(/([a-z])([A-Z])/g, '$1 $2');\n const label = token.charAt(0) + token.slice(1).toLowerCase();\n if (!def.Offset) {\n return label;\n }\n const { Amount, Unit } = def.Offset;\n return `${label} ${Amount > 0 ? '+' : ''}${Amount} ${Unit}${Math.abs(Amount) === 1 ? '' : 's'}`;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recycle-bin-chip.component.d.ts","sourceRoot":"","sources":["../../../src/lib/recycle-bin/recycle-bin-chip.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,iBAAiB,EACjB,YAAY,EAEZ,SAAS,EACT,MAAM,EAGP,MAAM,eAAe,CAAC;AACvB,OAAO,EAAkD,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAIhG,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EACL,2BAA2B,EAC3B,4BAA4B,EAC5B,2BAA2B,EAC3B,4BAA4B,EAC5B,6BAA6B,EAC7B,4BAA4B,EAC7B,MAAM,6BAA6B,CAAC;;AAErC;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,
|
|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,IAAI;IAM5B;;;OAGG;IACI,qBAAqB,CAAC,CAAC,EAAE,4BAA4B,GAAG,IAAI;IAM5D,oBAAoB,CAAC,CAAC,EAAE,2BAA2B,GAAG,IAAI;IAMjE;;;;OAIG;YACW,YAAY;yCAjHf,uBAAuB;2CAAvB,uBAAuB;CA6KnC"}
|
|
@@ -25,7 +25,7 @@ function RecycleBinChipComponent_Conditional_0_Template(rf, ctx) { if (rf & 1) {
|
|
|
25
25
|
i0.ɵɵadvance(5);
|
|
26
26
|
i0.ɵɵtextInterpolate(ctx_r1.DeletedCount);
|
|
27
27
|
i0.ɵɵadvance();
|
|
28
|
-
i0.ɵɵproperty("Visible", ctx_r1.PanelVisible)("EntityName", ctx_r1.EntityName)("ContextUser", ctx_r1.ContextUser);
|
|
28
|
+
i0.ɵɵproperty("Provider", ctx_r1.Provider)("Visible", ctx_r1.PanelVisible)("EntityName", ctx_r1.EntityName)("ContextUser", ctx_r1.ContextUser);
|
|
29
29
|
} }
|
|
30
30
|
/**
|
|
31
31
|
* Tiny composite that renders a Recycle Bin **chip button** (with live
|
|
@@ -207,8 +207,8 @@ export class RecycleBinChipComponent extends BaseAngularComponent {
|
|
|
207
207
|
this.cdr.markForCheck();
|
|
208
208
|
}
|
|
209
209
|
static ɵfac = function RecycleBinChipComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || RecycleBinChipComponent)(i0.ɵɵdirectiveInject(i0.ChangeDetectorRef)); };
|
|
210
|
-
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: RecycleBinChipComponent, selectors: [["mj-recycle-bin-chip"]], inputs: { EntityName: "EntityName", ContextUser: "ContextUser" }, outputs: { BeforeRecycleBinOpen: "BeforeRecycleBinOpen", AfterRecycleBinOpen: "AfterRecycleBinOpen", BeforeRecordRestore: "BeforeRecordRestore", AfterRecordRestore: "AfterRecordRestore", BeforeRestoreCommit: "BeforeRestoreCommit", AfterRestoreCommit: "AfterRestoreCommit" }, standalone: false, features: [i0.ɵɵInheritDefinitionFeature], decls: 1, vars: 1, consts: [["type", "button", 1, "rbc-chip", 3, "click"], ["aria-hidden", "true", 1, "fa-solid", "fa-trash-can-arrow-up"], [1, "rbc-chip-label"], [1, "rbc-chip-count"], [3, "Closed", "BeforeRecycleBinOpen", "AfterRecycleBinOpen", "BeforeRecordRestore", "AfterRecordRestore", "BeforeRestoreCommit", "AfterRestoreCommit", "Visible", "EntityName", "ContextUser"]], template: function RecycleBinChipComponent_Template(rf, ctx) { if (rf & 1) {
|
|
211
|
-
i0.ɵɵconditionalCreate(0, RecycleBinChipComponent_Conditional_0_Template, 7,
|
|
210
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: RecycleBinChipComponent, selectors: [["mj-recycle-bin-chip"]], inputs: { EntityName: "EntityName", ContextUser: "ContextUser" }, outputs: { BeforeRecycleBinOpen: "BeforeRecycleBinOpen", AfterRecycleBinOpen: "AfterRecycleBinOpen", BeforeRecordRestore: "BeforeRecordRestore", AfterRecordRestore: "AfterRecordRestore", BeforeRestoreCommit: "BeforeRestoreCommit", AfterRestoreCommit: "AfterRestoreCommit" }, standalone: false, features: [i0.ɵɵInheritDefinitionFeature], decls: 1, vars: 1, consts: [["type", "button", 1, "rbc-chip", 3, "click"], ["aria-hidden", "true", 1, "fa-solid", "fa-trash-can-arrow-up"], [1, "rbc-chip-label"], [1, "rbc-chip-count"], [3, "Closed", "BeforeRecycleBinOpen", "AfterRecycleBinOpen", "BeforeRecordRestore", "AfterRecordRestore", "BeforeRestoreCommit", "AfterRestoreCommit", "Provider", "Visible", "EntityName", "ContextUser"]], template: function RecycleBinChipComponent_Template(rf, ctx) { if (rf & 1) {
|
|
211
|
+
i0.ɵɵconditionalCreate(0, RecycleBinChipComponent_Conditional_0_Template, 7, 6);
|
|
212
212
|
} if (rf & 2) {
|
|
213
213
|
i0.ɵɵconditional(ctx.IsVisible ? 0 : -1);
|
|
214
214
|
} }, dependencies: [i1.RecycleBinComponent], styles: ["\n .rbc-chip {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n padding: 6px 11px;\n border-radius: 16px;\n font-size: 12px;\n font-weight: 500;\n background: color-mix(in srgb, var(--mj-status-info) 8%, var(--mj-bg-surface));\n color: color-mix(in srgb, var(--mj-status-info) 80%, var(--mj-text-secondary));\n border: 1px solid color-mix(in srgb, var(--mj-status-info) 25%, var(--mj-border-default));\n cursor: pointer;\n font-family: inherit;\n transition: background-color 0.1s, border-color 0.1s;\n }\n .rbc-chip:hover {\n background: color-mix(in srgb, var(--mj-status-info) 14%, var(--mj-bg-surface));\n border-color: var(--mj-status-info);\n }\n .rbc-chip-label {\n /* always show on wider screens; hide on narrow if needed */\n }\n .rbc-chip-count {\n background: var(--mj-status-info);\n color: var(--mj-text-inverse, #fff);\n border-radius: 10px;\n padding: 1px 7px;\n font-size: 10px;\n font-weight: 700;\n }\n "], encapsulation: 2, changeDetection: 0 });
|
|
@@ -227,6 +227,7 @@ export class RecycleBinChipComponent extends BaseAngularComponent {
|
|
|
227
227
|
</button>
|
|
228
228
|
|
|
229
229
|
<mj-recycle-bin
|
|
230
|
+
[Provider]="Provider"
|
|
230
231
|
[Visible]="PanelVisible"
|
|
231
232
|
[EntityName]="EntityName"
|
|
232
233
|
[ContextUser]="ContextUser"
|
|
@@ -257,5 +258,5 @@ export class RecycleBinChipComponent extends BaseAngularComponent {
|
|
|
257
258
|
}], AfterRestoreCommit: [{
|
|
258
259
|
type: Output
|
|
259
260
|
}] }); })();
|
|
260
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(RecycleBinChipComponent, { className: "RecycleBinChipComponent", filePath: "src/lib/recycle-bin/recycle-bin-chip.component.ts", lineNumber:
|
|
261
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(RecycleBinChipComponent, { className: "RecycleBinChipComponent", filePath: "src/lib/recycle-bin/recycle-bin-chip.component.ts", lineNumber: 115 }); })();
|
|
261
262
|
//# sourceMappingURL=recycle-bin-chip.component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recycle-bin-chip.component.js","sourceRoot":"","sources":["../../../src/lib/recycle-bin/recycle-bin-chip.component.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,uBAAuB,EAEvB,YAAY,EACZ,KAAK,EAGL,MAAM,EACN,iBAAiB,GAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,UAAU,EAA6B,OAAO,EAAY,MAAM,sBAAsB,CAAC;AAChG,OAAO,EAAW,WAAW,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAExE,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;;;;;IAwC/D,iCAGuG;IADrG,2LAAS,eAAQ,KAAC;IAElB,uBAAiE;IACjE,+BAA6B;IAAA,2BAAW;IAAA,iBAAO;IAC/C,+BAA6B;IAAA,YAAkB;IACjD,AADiD,iBAAO,EAC/C;IAET,yCAUsD;IAApD,AADA,AADA,AADA,AADA,AADA,AADA,qMAAU,sBAAe,KAAC,0NACF,wCAAiC,KAAC,wNACnC,oCAA6B,KAAC,wNAC9B,uCAAgC,KAAC,sNAClC,sCAA+B,KAAC,wNAC/B,uCAAgC,KAAC,sNAClC,mCAA4B,KAAC;IACrD,iBAAiB;;;;IAdc,eAAkB;IAAlB,yCAAkB;IAI/C,cAAwB;IAExB,AADA,AADA,6CAAwB,iCACC,mCACE;;AA1CnC;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAgEH,MAAM,OAAO,uBAAwB,SAAQ,oBAAoB;IA2C3C;IA1CpB;;;OAGG;IACK,WAAW,GAAkB,IAAI,CAAC;IAC1C,IACI,UAAU,CAAC,KAAoB;QACjC,IAAI,KAAK,KAAK,IAAI,CAAC,WAAW,EAAE,CAAC;YAC/B,IAAI,CAAC,WAAW,GAAG,K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QACvC,IAAI,CAAC,GAAG,CAAC,YAAY,EAAE,CAAC;IAC1B,CAAC;iHA5KU,uBAAuB;6DAAvB,uBAAuB;YA3DhC,+EAAiB;;YAAjB,wCAsBC;;;iFAqCQ,uBAAuB;cA/DnC,SAAS;6BACI,KAAK,YACP,qBAAqB,YACrB;;;;;;;;;;;;;;;;;;;;;;;;GAwBT,mBAiCgB,uBAAuB,CAAC,MAAM,iBAChC,iBAAiB,CAAC,IAAI;;kBAQpC,KAAK;;kBAeL,KAAK;;kBAIL,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kFA9BI,uBAAuB","sourcesContent":["import {\n Component,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n EventEmitter,\n Input,\n OnDestroy,\n OnInit,\n Output,\n ViewEncapsulation,\n} from '@angular/core';\nimport { BaseEntity, BaseEntityEvent, Metadata, RunView, UserInfo } from '@memberjunction/core';\nimport { MJEvent, MJEventType, MJGlobal } from '@memberjunction/global';\nimport { Subscription } from 'rxjs';\nimport { debounceTime, filter } from 'rxjs/operators';\nimport { BaseAngularComponent } from '@memberjunction/ng-base-types';\nimport {\n AfterRecordRestoreEventArgs,\n AfterRecycleBinOpenEventArgs,\n AfterRestoreCommitEventArgs,\n BeforeRecordRestoreEventArgs,\n BeforeRecycleBinOpenEventArgs,\n BeforeRestoreCommitEventArgs,\n} from './events/recycle-bin-events';\n\n/**\n * Tiny composite that renders a Recycle Bin **chip button** (with live\n * deleted-record count badge) and hosts the {@link RecycleBinComponent}\n * slide-in panel that opens when clicked.\n *\n * Designed to be dropped into any toolbar in three lines:\n *\n * @example\n * <mj-recycle-bin-chip\n * *ngIf=\"ShowRecycleBin\"\n * [EntityName]=\"effectiveEntity?.Name\">\n * </mj-recycle-bin-chip>\n *\n * The chip auto-hides itself when:\n * - No `EntityName` is provided\n * - The entity has `TrackRecordChanges = false`\n * - The user lacks `CanDelete` permission on the entity\n * - The deleted-record count is zero\n *\n * Each of those is the right behavior to avoid cluttering toolbars on\n * entities where the bin is irrelevant.\n *\n * Consumers who want to intercept any bin action can pass through the\n * standard cancelable Before/After events.\n */\n@Component({\n standalone: false,\n selector: 'mj-recycle-bin-chip',\n template: `\n @if (IsVisible) {\n <button class=\"rbc-chip\"\n type=\"button\"\n (click)=\"Toggle()\"\n [attr.title]=\"'Recycle Bin · ' + DeletedCount + ' deleted record' + (DeletedCount === 1 ? '' : 's')\">\n <i class=\"fa-solid fa-trash-can-arrow-up\" aria-hidden=\"true\"></i>\n <span class=\"rbc-chip-label\">Recycle Bin</span>\n <span class=\"rbc-chip-count\">{{ DeletedCount }}</span>\n </button>\n\n <mj-recycle-bin\n [Visible]=\"PanelVisible\"\n [EntityName]=\"EntityName\"\n [ContextUser]=\"ContextUser\"\n (Closed)=\"OnPanelClosed()\"\n (BeforeRecycleBinOpen)=\"BeforeRecycleBinOpen.emit($event)\"\n (AfterRecycleBinOpen)=\"OnAfterRecycleBinOpen($event)\"\n (BeforeRecordRestore)=\"BeforeRecordRestore.emit($event)\"\n (AfterRecordRestore)=\"AfterRecordRestore.emit($event)\"\n (BeforeRestoreCommit)=\"BeforeRestoreCommit.emit($event)\"\n (AfterRestoreCommit)=\"OnAfterRestoreCommit($event)\">\n </mj-recycle-bin>\n }\n `,\n styles: [`\n .rbc-chip {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n padding: 6px 11px;\n border-radius: 16px;\n font-size: 12px;\n font-weight: 500;\n background: color-mix(in srgb, var(--mj-status-info) 8%, var(--mj-bg-surface));\n color: color-mix(in srgb, var(--mj-status-info) 80%, var(--mj-text-secondary));\n border: 1px solid color-mix(in srgb, var(--mj-status-info) 25%, var(--mj-border-default));\n cursor: pointer;\n font-family: inherit;\n transition: background-color 0.1s, border-color 0.1s;\n }\n .rbc-chip:hover {\n background: color-mix(in srgb, var(--mj-status-info) 14%, var(--mj-bg-surface));\n border-color: var(--mj-status-info);\n }\n .rbc-chip-label {\n /* always show on wider screens; hide on narrow if needed */\n }\n .rbc-chip-count {\n background: var(--mj-status-info);\n color: var(--mj-text-inverse, #fff);\n border-radius: 10px;\n padding: 1px 7px;\n font-size: 10px;\n font-weight: 700;\n }\n `],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n})\nexport class RecycleBinChipComponent extends BaseAngularComponent implements OnInit, OnDestroy {\n /**\n * Entity name whose deleted records will be surfaced. When null/empty,\n * the chip hides itself entirely.\n */\n private _entityName: string | null = null;\n @Input()\n set EntityName(value: string | null) {\n if (value !== this._entityName) {\n this._entityName = value;\n if (this.isInitialized) this.refreshCount();\n }\n }\n get EntityName(): string | null {\n return this._entityName;\n }\n\n /**\n * Optional context user for permission checks. Falls back to\n * `this.ProviderToUse.CurrentUser` when omitted.\n */\n @Input() ContextUser: UserInfo | null = null;\n\n // ─── Re-emitted events from the inner panel ────────────────────\n\n @Output() BeforeRecycleBinOpen = new EventEmitter<BeforeRecycleBinOpenEventArgs>();\n @Output() AfterRecycleBinOpen = new EventEmitter<AfterRecycleBinOpenEventArgs>();\n @Output() BeforeRecordRestore = new EventEmitter<BeforeRecordRestoreEventArgs>();\n @Output() AfterRecordRestore = new EventEmitter<AfterRecordRestoreEventArgs>();\n @Output() BeforeRestoreCommit = new EventEmitter<BeforeRestoreCommitEventArgs>();\n @Output() AfterRestoreCommit = new EventEmitter<AfterRestoreCommitEventArgs>();\n\n // ─── Public template state ──────────────────────────────────────\n\n public DeletedCount = 0;\n public PanelVisible = false;\n public IsVisible = false;\n public CanDelete = false;\n public TracksChanges = false;\n\n private isInitialized = false;\n private deleteSub: Subscription | null = null;\n\n constructor(private cdr: ChangeDetectorRef) {\n super();}\n\n ngOnInit(): void {\n this.isInitialized = true;\n this.refreshCount();\n // A record of this entity deleted anywhere — its form in another tab, a grid row, or\n // another session — lands in the bin, so the badge recounts. Debounced: a burst of\n // deletes recounts once.\n this.deleteSub = MJGlobal.Instance.GetEventListener()\n .pipe(filter(event => this.isDeleteOfThisEntity(event)), debounceTime(300))\n .subscribe(() => this.refreshCount());\n }\n\n ngOnDestroy(): void {\n this.deleteSub?.unsubscribe();\n this.deleteSub = null;\n }\n\n /**\n * True for a delete of this chip's entity: a local `delete` (raised once the delete has\n * succeeded, so its Delete record change is already written) or a remote one (a\n * `remote-invalidate` whose action is `delete`).\n */\n private isDeleteOfThisEntity(event: MJEvent): boolean {\n if (!this._entityName || event.event !== MJEventType.ComponentEvent || event.eventCode !== BaseEntity.BaseEventCode) {\n return false;\n }\n const entityEvent = event.args as BaseEntityEvent | undefined;\n const isDelete = entityEvent?.type === 'delete'\n || (entityEvent?.type === 'remote-invalidate' && (entityEvent.payload as { action?: string } | null)?.action === 'delete');\n if (!isDelete) {\n return false;\n }\n const entityName = entityEvent?.baseEntity?.EntityInfo?.Name ?? entityEvent?.entityName;\n return !!entityName && entityName.trim().toLowerCase() === this._entityName.trim().toLowerCase();\n }\n\n public Toggle(): void {\n this.PanelVisible = !this.PanelVisible;\n this.cdr.markForCheck();\n }\n\n public OnPanelClosed(): void {\n this.PanelVisible = false;\n // Refresh count — a restore may have removed an entry from the bin\n this.refreshCount();\n }\n\n /**\n * After-events bubble through but we also use them to refresh the count\n * — restoring a record means it's no longer \"deleted\".\n */\n public OnAfterRecycleBinOpen(e: AfterRecycleBinOpenEventArgs): void {\n this.DeletedCount = e.deletedRecordCount;\n this.AfterRecycleBinOpen.emit(e);\n this.cdr.markForCheck();\n }\n\n public OnAfterRestoreCommit(e: AfterRestoreCommitEventArgs): void {\n if (e.success) this.DeletedCount = Math.max(0, this.DeletedCount - 1);\n this.AfterRestoreCommit.emit(e);\n this.cdr.markForCheck();\n }\n\n /**\n * Loads the deleted-record count and visibility flags. Called on init,\n * when EntityName changes, and after the panel closes (so a restore\n * decrements the badge).\n */\n private async refreshCount(): Promise<void> {\n this.IsVisible = false;\n this.DeletedCount = 0;\n\n if (!this._entityName) {\n this.cdr.markForCheck();\n return;\n }\n\n const md = this.ProviderToUse;\n const entityInfo = md.Entities.find(\n e => e.Name.trim().toLowerCase() === this._entityName!.trim().toLowerCase(),\n );\n if (!entityInfo) {\n this.cdr.markForCheck();\n return;\n }\n\n this.TracksChanges = !!entityInfo.TrackRecordChanges;\n if (!this.TracksChanges) {\n this.cdr.markForCheck();\n return;\n }\n\n const effectiveUser = this.ContextUser ?? md.CurrentUser;\n if (!effectiveUser) {\n this.cdr.markForCheck();\n return;\n }\n const perms = entityInfo.GetUserPermisions(effectiveUser);\n this.CanDelete = perms?.CanDelete ?? false;\n if (!this.CanDelete) {\n this.cdr.markForCheck();\n return;\n }\n\n // Cheap count query — just IDs, capped low\n try {\n const rv = RunView.FromMetadataProvider(this.ProviderToUse);\n const result = await rv.RunView<{ ID: string; RecordID: string }>({\n EntityName: 'MJ: Record Changes',\n Fields: ['ID', 'RecordID'],\n ExtraFilter: `EntityID='${entityInfo.ID}' AND Type='Delete'`,\n OrderBy: 'ChangedAt DESC',\n MaxRows: 500,\n ResultType: 'simple',\n }, this.ContextUser ?? undefined);\n\n if (result.Success) {\n // Distinct RecordIDs (a record might have been deleted, recreated, deleted again)\n const distinct = new Set(result.Results.map(r => r.RecordID));\n this.DeletedCount = distinct.size;\n }\n } catch {\n // Silently ignore — chip just won't show\n }\n\n this.IsVisible = this.DeletedCount > 0;\n this.cdr.markForCheck();\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"recycle-bin-chip.component.js","sourceRoot":"","sources":["../../../src/lib/recycle-bin/recycle-bin-chip.component.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,uBAAuB,EAEvB,YAAY,EACZ,KAAK,EAGL,MAAM,EACN,iBAAiB,GAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,UAAU,EAA6B,OAAO,EAAY,MAAM,sBAAsB,CAAC;AAChG,OAAO,EAAW,WAAW,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAExE,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,gBAAgB,C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ectionStrategy,\n ChangeDetectorRef,\n EventEmitter,\n Input,\n OnDestroy,\n OnInit,\n Output,\n ViewEncapsulation,\n} from '@angular/core';\nimport { BaseEntity, BaseEntityEvent, Metadata, RunView, UserInfo } from '@memberjunction/core';\nimport { MJEvent, MJEventType, MJGlobal } from '@memberjunction/global';\nimport { Subscription } from 'rxjs';\nimport { debounceTime, filter } from 'rxjs/operators';\nimport { BaseAngularComponent } from '@memberjunction/ng-base-types';\nimport {\n AfterRecordRestoreEventArgs,\n AfterRecycleBinOpenEventArgs,\n AfterRestoreCommitEventArgs,\n BeforeRecordRestoreEventArgs,\n BeforeRecycleBinOpenEventArgs,\n BeforeRestoreCommitEventArgs,\n} from './events/recycle-bin-events';\n\n/**\n * Tiny composite that renders a Recycle Bin **chip button** (with live\n * deleted-record count badge) and hosts the {@link RecycleBinComponent}\n * slide-in panel that opens when clicked.\n *\n * Designed to be dropped into any toolbar in three lines:\n *\n * @example\n * <mj-recycle-bin-chip\n * *ngIf=\"ShowRecycleBin\"\n * [EntityName]=\"effectiveEntity?.Name\">\n * </mj-recycle-bin-chip>\n *\n * The chip auto-hides itself when:\n * - No `EntityName` is provided\n * - The entity has `TrackRecordChanges = false`\n * - The user lacks `CanDelete` permission on the entity\n * - The deleted-record count is zero\n *\n * Each of those is the right behavior to avoid cluttering toolbars on\n * entities where the bin is irrelevant.\n *\n * Consumers who want to intercept any bin action can pass through the\n * standard cancelable Before/After events.\n */\n@Component({\n standalone: false,\n selector: 'mj-recycle-bin-chip',\n template: `\n @if (IsVisible) {\n <button class=\"rbc-chip\"\n type=\"button\"\n (click)=\"Toggle()\"\n [attr.title]=\"'Recycle Bin · ' + DeletedCount + ' deleted record' + (DeletedCount === 1 ? '' : 's')\">\n <i class=\"fa-solid fa-trash-can-arrow-up\" aria-hidden=\"true\"></i>\n <span class=\"rbc-chip-label\">Recycle Bin</span>\n <span class=\"rbc-chip-count\">{{ DeletedCount }}</span>\n </button>\n\n <mj-recycle-bin\n [Provider]=\"Provider\"\n [Visible]=\"PanelVisible\"\n [EntityName]=\"EntityName\"\n [ContextUser]=\"ContextUser\"\n (Closed)=\"OnPanelClosed()\"\n (BeforeRecycleBinOpen)=\"BeforeRecycleBinOpen.emit($event)\"\n (AfterRecycleBinOpen)=\"OnAfterRecycleBinOpen($event)\"\n (BeforeRecordRestore)=\"BeforeRecordRestore.emit($event)\"\n (AfterRecordRestore)=\"AfterRecordRestore.emit($event)\"\n (BeforeRestoreCommit)=\"BeforeRestoreCommit.emit($event)\"\n (AfterRestoreCommit)=\"OnAfterRestoreCommit($event)\">\n </mj-recycle-bin>\n }\n `,\n styles: [`\n .rbc-chip {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n padding: 6px 11px;\n border-radius: 16px;\n font-size: 12px;\n font-weight: 500;\n background: color-mix(in srgb, var(--mj-status-info) 8%, var(--mj-bg-surface));\n color: color-mix(in srgb, var(--mj-status-info) 80%, var(--mj-text-secondary));\n border: 1px solid color-mix(in srgb, var(--mj-status-info) 25%, var(--mj-border-default));\n cursor: pointer;\n font-family: inherit;\n transition: background-color 0.1s, border-color 0.1s;\n }\n .rbc-chip:hover {\n background: color-mix(in srgb, var(--mj-status-info) 14%, var(--mj-bg-surface));\n border-color: var(--mj-status-info);\n }\n .rbc-chip-label {\n /* always show on wider screens; hide on narrow if needed */\n }\n .rbc-chip-count {\n background: var(--mj-status-info);\n color: var(--mj-text-inverse, #fff);\n border-radius: 10px;\n padding: 1px 7px;\n font-size: 10px;\n font-weight: 700;\n }\n `],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n})\nexport class RecycleBinChipComponent extends BaseAngularComponent implements OnInit, OnDestroy {\n /**\n * Entity name whose deleted records will be surfaced. When null/empty,\n * the chip hides itself entirely.\n */\n private _entityName: string | null = null;\n @Input()\n set EntityName(value: string | null) {\n if (value !== this._entityName) {\n this._entityName = value;\n if (this.isInitialized) this.refreshCount();\n }\n }\n get EntityName(): string | null {\n return this._entityName;\n }\n\n /**\n * Optional context user for permission checks. Falls back to\n * `this.ProviderToUse.CurrentUser` when omitted.\n */\n @Input() ContextUser: UserInfo | null = null;\n\n // ─── Re-emitted events from the inner panel ────────────────────\n\n @Output() BeforeRecycleBinOpen = new EventEmitter<BeforeRecycleBinOpenEventArgs>();\n @Output() AfterRecycleBinOpen = new EventEmitter<AfterRecycleBinOpenEventArgs>();\n @Output() BeforeRecordRestore = new EventEmitter<BeforeRecordRestoreEventArgs>();\n @Output() AfterRecordRestore = new EventEmitter<AfterRecordRestoreEventArgs>();\n @Output() BeforeRestoreCommit = new EventEmitter<BeforeRestoreCommitEventArgs>();\n @Output() AfterRestoreCommit = new EventEmitter<AfterRestoreCommitEventArgs>();\n\n // ─── Public template state ──────────────────────────────────────\n\n public DeletedCount = 0;\n public PanelVisible = false;\n public IsVisible = false;\n public CanDelete = false;\n public TracksChanges = false;\n\n private isInitialized = false;\n private deleteSub: Subscription | null = null;\n\n constructor(private cdr: ChangeDetectorRef) {\n super();}\n\n ngOnInit(): void {\n this.isInitialized = true;\n this.refreshCount();\n // A record of this entity deleted anywhere — its form in another tab, a grid row, or\n // another session — lands in the bin, so the badge recounts. Debounced: a burst of\n // deletes recounts once.\n this.deleteSub = MJGlobal.Instance.GetEventListener()\n .pipe(filter(event => this.isDeleteOfThisEntity(event)), debounceTime(300))\n .subscribe(() => this.refreshCount());\n }\n\n ngOnDestroy(): void {\n this.deleteSub?.unsubscribe();\n this.deleteSub = null;\n }\n\n /**\n * True for a delete of this chip's entity: a local `delete` (raised once the delete has\n * succeeded, so its Delete record change is already written) or a remote one (a\n * `remote-invalidate` whose action is `delete`).\n */\n private isDeleteOfThisEntity(event: MJEvent): boolean {\n if (!this._entityName || event.event !== MJEventType.ComponentEvent || event.eventCode !== BaseEntity.BaseEventCode) {\n return false;\n }\n const entityEvent = event.args as BaseEntityEvent | undefined;\n const isDelete = entityEvent?.type === 'delete'\n || (entityEvent?.type === 'remote-invalidate' && (entityEvent.payload as { action?: string } | null)?.action === 'delete');\n if (!isDelete) {\n return false;\n }\n const entityName = entityEvent?.baseEntity?.EntityInfo?.Name ?? entityEvent?.entityName;\n return !!entityName && entityName.trim().toLowerCase() === this._entityName.trim().toLowerCase();\n }\n\n public Toggle(): void {\n this.PanelVisible = !this.PanelVisible;\n this.cdr.markForCheck();\n }\n\n public OnPanelClosed(): void {\n this.PanelVisible = false;\n // Refresh count — a restore may have removed an entry from the bin\n this.refreshCount();\n }\n\n /**\n * After-events bubble through but we also use them to refresh the count\n * — restoring a record means it's no longer \"deleted\".\n */\n public OnAfterRecycleBinOpen(e: AfterRecycleBinOpenEventArgs): void {\n this.DeletedCount = e.deletedRecordCount;\n this.AfterRecycleBinOpen.emit(e);\n this.cdr.markForCheck();\n }\n\n public OnAfterRestoreCommit(e: AfterRestoreCommitEventArgs): void {\n if (e.success) this.DeletedCount = Math.max(0, this.DeletedCount - 1);\n this.AfterRestoreCommit.emit(e);\n this.cdr.markForCheck();\n }\n\n /**\n * Loads the deleted-record count and visibility flags. Called on init,\n * when EntityName changes, and after the panel closes (so a restore\n * decrements the badge).\n */\n private async refreshCount(): Promise<void> {\n this.IsVisible = false;\n this.DeletedCount = 0;\n\n if (!this._entityName) {\n this.cdr.markForCheck();\n return;\n }\n\n const md = this.ProviderToUse;\n const entityInfo = md.Entities.find(\n e => e.Name.trim().toLowerCase() === this._entityName!.trim().toLowerCase(),\n );\n if (!entityInfo) {\n this.cdr.markForCheck();\n return;\n }\n\n this.TracksChanges = !!entityInfo.TrackRecordChanges;\n if (!this.TracksChanges) {\n this.cdr.markForCheck();\n return;\n }\n\n const effectiveUser = this.ContextUser ?? md.CurrentUser;\n if (!effectiveUser) {\n this.cdr.markForCheck();\n return;\n }\n const perms = entityInfo.GetUserPermisions(effectiveUser);\n this.CanDelete = perms?.CanDelete ?? false;\n if (!this.CanDelete) {\n this.cdr.markForCheck();\n return;\n }\n\n // Cheap count query — just IDs, capped low\n try {\n const rv = RunView.FromMetadataProvider(this.ProviderToUse);\n const result = await rv.RunView<{ ID: string; RecordID: string }>({\n EntityName: 'MJ: Record Changes',\n Fields: ['ID', 'RecordID'],\n ExtraFilter: `EntityID='${entityInfo.ID}' AND Type='Delete'`,\n OrderBy: 'ChangedAt DESC',\n MaxRows: 500,\n ResultType: 'simple',\n }, this.ContextUser ?? undefined);\n\n if (result.Success) {\n // Distinct RecordIDs (a record might have been deleted, recreated, deleted again)\n const distinct = new Set(result.Results.map(r => r.RecordID));\n this.DeletedCount = distinct.size;\n }\n } catch {\n // Silently ignore — chip just won't show\n }\n\n this.IsVisible = this.DeletedCount > 0;\n this.cdr.markForCheck();\n }\n}\n"]}
|
|
@@ -605,7 +605,7 @@ export class RecycleBinComponent extends BaseAngularComponent {
|
|
|
605
605
|
return this.GetUserDisplay(user);
|
|
606
606
|
}
|
|
607
607
|
static ɵfac = function RecycleBinComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || RecycleBinComponent)(i0.ɵɵdirectiveInject(i0.ChangeDetectorRef)); };
|
|
608
|
-
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: RecycleBinComponent, selectors: [["mj-recycle-bin"]], inputs: { Visible: "Visible", EntityName: "EntityName", ContextUser: "ContextUser", MaxRecords: "MaxRecords" }, outputs: { Closed: "Closed", BeforeRecycleBinOpen: "BeforeRecycleBinOpen", AfterRecycleBinOpen: "AfterRecycleBinOpen", BeforeRecordRestore: "BeforeRecordRestore", AfterRecordRestore: "AfterRecordRestore", BeforeRestoreCommit: "BeforeRestoreCommit", AfterRestoreCommit: "AfterRestoreCommit" }, standalone: false, features: [i0.ɵɵInheritDefinitionFeature], decls: 15, vars:
|
|
608
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: RecycleBinComponent, selectors: [["mj-recycle-bin"]], inputs: { Visible: "Visible", EntityName: "EntityName", ContextUser: "ContextUser", MaxRecords: "MaxRecords" }, outputs: { Closed: "Closed", BeforeRecycleBinOpen: "BeforeRecycleBinOpen", AfterRecycleBinOpen: "AfterRecycleBinOpen", BeforeRecordRestore: "BeforeRecordRestore", AfterRecordRestore: "AfterRecordRestore", BeforeRestoreCommit: "BeforeRestoreCommit", AfterRestoreCommit: "AfterRestoreCommit" }, standalone: false, features: [i0.ɵɵInheritDefinitionFeature], decls: 15, vars: 17, consts: [[3, "Closed", "Mode", "Title", "Visible", "Resizable", "MinWidthPx", "MaxWidthRatio"], [1, "rb-container"], [1, "rb-header"], [1, "rb-header-icon"], ["aria-hidden", "true", 1, "fa-solid", "fa-trash-can-arrow-up"], [1, "rb-header-text"], [1, "rb-header-title"], [1, "rb-header-subtitle"], ["Variant", "warning", "Icon", "fa-solid fa-lock", "Title", "Access denied", 3, "Message"], ["text", "Loading deleted records...", "size", "medium"], ["Variant", "error", "Icon", "fa-solid fa-triangle-exclamation", "Title", "Could not load deleted records", 3, "Message"], ["Icon", "fa-solid fa-trash-can", "Title", "Recycle Bin is empty", "Message", "No records have been deleted from this entity, or change tracking isn't enabled here."], [1, "rb-list"], [3, "RestoreConfirmed", "RestoreCancelled", "Provider", "Visible", "Mode", "RecordChange", "EntityName"], [1, "rb-card"], [1, "rb-card-info"], [1, "rb-card-name"], [1, "rb-card-fields"], [1, "rb-card-meta"], ["aria-hidden", "true", 1, "fa-solid", "fa-trash"], [1, "rb-card-actions"], ["type", "button", 1, "rb-btn", "rb-btn-restore", 3, "click", "disabled", "title"], ["aria-hidden", "true", 1, "fa-solid", "fa-rotate-left"], [1, "rb-card-field"]], template: function RecycleBinComponent_Template(rf, ctx) { if (rf & 1) {
|
|
609
609
|
i0.ɵɵelementStart(0, "mj-slide-panel", 0);
|
|
610
610
|
i0.ɵɵlistener("Closed", function RecycleBinComponent_Template_mj_slide_panel_Closed_0_listener() { return ctx.OnClose(); });
|
|
611
611
|
i0.ɵɵelementStart(1, "div", 1)(2, "div", 2)(3, "div", 3);
|
|
@@ -640,12 +640,12 @@ export class RecycleBinComponent extends BaseAngularComponent {
|
|
|
640
640
|
i0.ɵɵadvance();
|
|
641
641
|
i0.ɵɵconditional(!ctx.IsLoading && !ctx.LoadError && ctx.Entries.length > 0 ? 13 : -1);
|
|
642
642
|
i0.ɵɵadvance();
|
|
643
|
-
i0.ɵɵproperty("Visible", ctx.PreviewVisible)("Mode", "undelete")("RecordChange", (ctx.SelectedEntry == null ? null : ctx.SelectedEntry.RecordChange) ?? null)("EntityName", ctx.EntityName);
|
|
643
|
+
i0.ɵɵproperty("Provider", ctx.Provider)("Visible", ctx.PreviewVisible)("Mode", "undelete")("RecordChange", (ctx.SelectedEntry == null ? null : ctx.SelectedEntry.RecordChange) ?? null)("EntityName", ctx.EntityName);
|
|
644
644
|
} }, dependencies: [i1.LoadingComponent, i2.RestorePreviewPanelComponent, i3.MjSlidePanelComponent, i3.MJEmptyStateComponent], styles: ["/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n * Recycle Bin\n * Slide-in panel that lists hard-deleted records and offers re-create.\n * All colors use --mj-* design tokens.\n * \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\n.rb-container {\n padding: 18px 20px;\n display: flex;\n flex-direction: column;\n gap: 14px;\n}\n\n/* \u2500\u2500\u2500 Header \u2500\u2500\u2500 */\n\n.rb-header {\n display: flex;\n align-items: flex-start;\n gap: 14px;\n padding: 8px 0 14px;\n border-bottom: 1px solid var(--mj-border-subtle);\n}\n\n.rb-header-icon {\n width: 40px;\n height: 40px;\n border-radius: 9px;\n background: color-mix(in srgb, var(--mj-status-info) 12%, var(--mj-bg-surface));\n color: var(--mj-status-info);\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n font-size: 17px;\n}\n\n.rb-header-text { flex: 1; min-width: 0; }\n\n.rb-header-title {\n font-size: 16px;\n font-weight: 600;\n color: var(--mj-text-primary);\n margin-bottom: 2px;\n}\n\n.rb-header-subtitle {\n color: var(--mj-text-muted);\n font-size: 12px;\n}\n\n/* \u2500\u2500\u2500 List \u2500\u2500\u2500 */\n\n.rb-list {\n display: flex;\n flex-direction: column;\n gap: 10px;\n}\n\n/* \u2500\u2500\u2500 Card \u2500\u2500\u2500 */\n\n.rb-card {\n background: var(--mj-bg-surface);\n border: 1px solid var(--mj-border-default);\n border-radius: 10px;\n padding: 14px;\n display: grid;\n grid-template-columns: 1fr auto;\n gap: 14px;\n align-items: center;\n transition: border-color 0.15s;\n}\n\n.rb-card:hover {\n border-color: var(--mj-border-strong);\n}\n\n.rb-card-info { min-width: 0; }\n\n.rb-card-name {\n font-weight: 600;\n font-size: 14px;\n color: var(--mj-text-primary);\n margin-bottom: 5px;\n word-break: break-word;\n}\n\n.rb-card-fields {\n display: flex;\n flex-wrap: wrap;\n gap: 10px;\n margin-bottom: 6px;\n font-size: 12px;\n color: var(--mj-text-muted);\n}\n\n.rb-card-field strong {\n color: var(--mj-text-secondary);\n font-weight: 500;\n margin-right: 3px;\n}\n\n.rb-card-meta {\n display: flex;\n align-items: center;\n gap: 6px;\n color: var(--mj-text-muted);\n font-size: 11px;\n}\n\n.rb-card-meta i {\n color: var(--mj-text-disabled);\n}\n\n/* \u2500\u2500\u2500 Card actions \u2500\u2500\u2500 */\n\n.rb-card-actions {\n display: flex;\n gap: 8px;\n align-items: center;\n flex-shrink: 0;\n}\n\n.rb-btn {\n padding: 7px 14px;\n border-radius: 7px;\n font-size: 12px;\n font-weight: 600;\n cursor: pointer;\n border: 1px solid transparent;\n display: inline-flex;\n align-items: center;\n gap: 6px;\n font-family: inherit;\n background: var(--mj-bg-surface);\n transition: background-color 0.1s, color 0.1s, border-color 0.1s;\n}\n\n.rb-btn-restore {\n color: var(--mj-status-success);\n border-color: var(--mj-status-success);\n}\n\n.rb-btn-restore:hover:not(:disabled) {\n background: var(--mj-status-success);\n color: var(--mj-text-inverse, #fff);\n}\n\n.rb-btn-restore:disabled {\n color: var(--mj-text-disabled);\n border-color: var(--mj-border-default);\n background: var(--mj-bg-surface-sunken);\n cursor: not-allowed;\n}\n"], encapsulation: 2, changeDetection: 0 });
|
|
645
645
|
}
|
|
646
646
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(RecycleBinComponent, [{
|
|
647
647
|
type: Component,
|
|
648
|
-
args: [{ standalone: false, selector: 'mj-recycle-bin', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<mj-slide-panel\n [Mode]=\"'slide'\"\n [Title]=\"'Recycle Bin \u00B7 ' + (EntityName || '')\"\n [Visible]=\"Visible\"\n [Resizable]=\"true\"\n [MinWidthPx]=\"480\"\n [MaxWidthRatio]=\"0.6\"\n (Closed)=\"OnClose()\">\n\n <div class=\"rb-container\">\n\n <!-- Header -->\n <div class=\"rb-header\">\n <div class=\"rb-header-icon\">\n <i class=\"fa-solid fa-trash-can-arrow-up\" aria-hidden=\"true\"></i>\n </div>\n <div class=\"rb-header-text\">\n <div class=\"rb-header-title\">Recycle Bin</div>\n @if (EntityName) {\n <div class=\"rb-header-subtitle\">{{ HeaderSubtitle }}</div>\n }\n </div>\n </div>\n\n <!-- No-permission state -->\n @if (!IsLoading && LoadError && !HasAccess) {\n <mj-empty-state\n Variant=\"warning\"\n Icon=\"fa-solid fa-lock\"\n Title=\"Access denied\"\n [Message]=\"LoadError\" />\n }\n\n <!-- Loading -->\n @if (IsLoading) {\n <mj-loading text=\"Loading deleted records...\" size=\"medium\"></mj-loading>\n }\n\n <!-- Generic error -->\n @if (!IsLoading && LoadError && HasAccess) {\n <mj-empty-state\n Variant=\"error\"\n Icon=\"fa-solid fa-triangle-exclamation\"\n Title=\"Could not load deleted records\"\n [Message]=\"LoadError\" />\n }\n\n <!-- Empty state -->\n @if (!IsLoading && !LoadError && HasAccess && Entries.length === 0) {\n <mj-empty-state\n Icon=\"fa-solid fa-trash-can\"\n Title=\"Recycle Bin is empty\"\n Message=\"No records have been deleted from this entity, or change tracking isn't enabled here.\" />\n }\n\n <!-- Entries -->\n @if (!IsLoading && !LoadError && Entries.length > 0) {\n <div class=\"rb-list\">\n @for (entry of Entries; track entry.RecordChange.ID) {\n <div class=\"rb-card\">\n <div class=\"rb-card-info\">\n <div class=\"rb-card-name\">{{ entry.DisplaySummary }}</div>\n @if (entry.SupportingFields.length > 0) {\n <div class=\"rb-card-fields\">\n @for (sf of entry.SupportingFields; track sf.Name) {\n <span class=\"rb-card-field\">\n <strong>{{ sf.DisplayName }}:</strong> {{ sf.Value }}\n </span>\n }\n </div>\n }\n <div class=\"rb-card-meta\">\n <i class=\"fa-solid fa-trash\" aria-hidden=\"true\"></i>\n Deleted {{ formatTimestamp(entry.RecordChange.ChangedAt) }}\n @if (entry.RecordChange.User) {\n by {{ getUserDisplay(entry.RecordChange.User) }}\n }\n </div>\n </div>\n <div class=\"rb-card-actions\">\n <button class=\"rb-btn rb-btn-restore\"\n [disabled]=\"!CanCreate\"\n [title]=\"CanCreate ? 'Re-create this record from its snapshot' : 'You do not have Create permission for this entity'\"\n (click)=\"OnRestoreClicked(entry)\"\n type=\"button\">\n <i class=\"fa-solid fa-rotate-left\" aria-hidden=\"true\"></i>\n Restore\n </button>\n </div>\n </div>\n }\n </div>\n }\n\n </div>\n\n <!-- Restore preview slide-in (reused from ng-record-changes) -->\n <mj-restore-preview-panel\n [Visible]=\"PreviewVisible\"\n [Mode]=\"'undelete'\"\n [RecordChange]=\"SelectedEntry?.RecordChange ?? null\"\n [EntityName]=\"EntityName\"\n (RestoreConfirmed)=\"OnPreviewConfirmed($event)\"\n (RestoreCancelled)=\"OnPreviewCancelled()\">\n </mj-restore-preview-panel>\n\n</mj-slide-panel>\n", styles: ["/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n * Recycle Bin\n * Slide-in panel that lists hard-deleted records and offers re-create.\n * All colors use --mj-* design tokens.\n * \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\n.rb-container {\n padding: 18px 20px;\n display: flex;\n flex-direction: column;\n gap: 14px;\n}\n\n/* \u2500\u2500\u2500 Header \u2500\u2500\u2500 */\n\n.rb-header {\n display: flex;\n align-items: flex-start;\n gap: 14px;\n padding: 8px 0 14px;\n border-bottom: 1px solid var(--mj-border-subtle);\n}\n\n.rb-header-icon {\n width: 40px;\n height: 40px;\n border-radius: 9px;\n background: color-mix(in srgb, var(--mj-status-info) 12%, var(--mj-bg-surface));\n color: var(--mj-status-info);\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n font-size: 17px;\n}\n\n.rb-header-text { flex: 1; min-width: 0; }\n\n.rb-header-title {\n font-size: 16px;\n font-weight: 600;\n color: var(--mj-text-primary);\n margin-bottom: 2px;\n}\n\n.rb-header-subtitle {\n color: var(--mj-text-muted);\n font-size: 12px;\n}\n\n/* \u2500\u2500\u2500 List \u2500\u2500\u2500 */\n\n.rb-list {\n display: flex;\n flex-direction: column;\n gap: 10px;\n}\n\n/* \u2500\u2500\u2500 Card \u2500\u2500\u2500 */\n\n.rb-card {\n background: var(--mj-bg-surface);\n border: 1px solid var(--mj-border-default);\n border-radius: 10px;\n padding: 14px;\n display: grid;\n grid-template-columns: 1fr auto;\n gap: 14px;\n align-items: center;\n transition: border-color 0.15s;\n}\n\n.rb-card:hover {\n border-color: var(--mj-border-strong);\n}\n\n.rb-card-info { min-width: 0; }\n\n.rb-card-name {\n font-weight: 600;\n font-size: 14px;\n color: var(--mj-text-primary);\n margin-bottom: 5px;\n word-break: break-word;\n}\n\n.rb-card-fields {\n display: flex;\n flex-wrap: wrap;\n gap: 10px;\n margin-bottom: 6px;\n font-size: 12px;\n color: var(--mj-text-muted);\n}\n\n.rb-card-field strong {\n color: var(--mj-text-secondary);\n font-weight: 500;\n margin-right: 3px;\n}\n\n.rb-card-meta {\n display: flex;\n align-items: center;\n gap: 6px;\n color: var(--mj-text-muted);\n font-size: 11px;\n}\n\n.rb-card-meta i {\n color: var(--mj-text-disabled);\n}\n\n/* \u2500\u2500\u2500 Card actions \u2500\u2500\u2500 */\n\n.rb-card-actions {\n display: flex;\n gap: 8px;\n align-items: center;\n flex-shrink: 0;\n}\n\n.rb-btn {\n padding: 7px 14px;\n border-radius: 7px;\n font-size: 12px;\n font-weight: 600;\n cursor: pointer;\n border: 1px solid transparent;\n display: inline-flex;\n align-items: center;\n gap: 6px;\n font-family: inherit;\n background: var(--mj-bg-surface);\n transition: background-color 0.1s, color 0.1s, border-color 0.1s;\n}\n\n.rb-btn-restore {\n color: var(--mj-status-success);\n border-color: var(--mj-status-success);\n}\n\n.rb-btn-restore:hover:not(:disabled) {\n background: var(--mj-status-success);\n color: var(--mj-text-inverse, #fff);\n}\n\n.rb-btn-restore:disabled {\n color: var(--mj-text-disabled);\n border-color: var(--mj-border-default);\n background: var(--mj-bg-surface-sunken);\n cursor: not-allowed;\n}\n"] }]
|
|
648
|
+
args: [{ standalone: false, selector: 'mj-recycle-bin', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<mj-slide-panel\n [Mode]=\"'slide'\"\n [Title]=\"'Recycle Bin \u00B7 ' + (EntityName || '')\"\n [Visible]=\"Visible\"\n [Resizable]=\"true\"\n [MinWidthPx]=\"480\"\n [MaxWidthRatio]=\"0.6\"\n (Closed)=\"OnClose()\">\n\n <div class=\"rb-container\">\n\n <!-- Header -->\n <div class=\"rb-header\">\n <div class=\"rb-header-icon\">\n <i class=\"fa-solid fa-trash-can-arrow-up\" aria-hidden=\"true\"></i>\n </div>\n <div class=\"rb-header-text\">\n <div class=\"rb-header-title\">Recycle Bin</div>\n @if (EntityName) {\n <div class=\"rb-header-subtitle\">{{ HeaderSubtitle }}</div>\n }\n </div>\n </div>\n\n <!-- No-permission state -->\n @if (!IsLoading && LoadError && !HasAccess) {\n <mj-empty-state\n Variant=\"warning\"\n Icon=\"fa-solid fa-lock\"\n Title=\"Access denied\"\n [Message]=\"LoadError\" />\n }\n\n <!-- Loading -->\n @if (IsLoading) {\n <mj-loading text=\"Loading deleted records...\" size=\"medium\"></mj-loading>\n }\n\n <!-- Generic error -->\n @if (!IsLoading && LoadError && HasAccess) {\n <mj-empty-state\n Variant=\"error\"\n Icon=\"fa-solid fa-triangle-exclamation\"\n Title=\"Could not load deleted records\"\n [Message]=\"LoadError\" />\n }\n\n <!-- Empty state -->\n @if (!IsLoading && !LoadError && HasAccess && Entries.length === 0) {\n <mj-empty-state\n Icon=\"fa-solid fa-trash-can\"\n Title=\"Recycle Bin is empty\"\n Message=\"No records have been deleted from this entity, or change tracking isn't enabled here.\" />\n }\n\n <!-- Entries -->\n @if (!IsLoading && !LoadError && Entries.length > 0) {\n <div class=\"rb-list\">\n @for (entry of Entries; track entry.RecordChange.ID) {\n <div class=\"rb-card\">\n <div class=\"rb-card-info\">\n <div class=\"rb-card-name\">{{ entry.DisplaySummary }}</div>\n @if (entry.SupportingFields.length > 0) {\n <div class=\"rb-card-fields\">\n @for (sf of entry.SupportingFields; track sf.Name) {\n <span class=\"rb-card-field\">\n <strong>{{ sf.DisplayName }}:</strong> {{ sf.Value }}\n </span>\n }\n </div>\n }\n <div class=\"rb-card-meta\">\n <i class=\"fa-solid fa-trash\" aria-hidden=\"true\"></i>\n Deleted {{ formatTimestamp(entry.RecordChange.ChangedAt) }}\n @if (entry.RecordChange.User) {\n by {{ getUserDisplay(entry.RecordChange.User) }}\n }\n </div>\n </div>\n <div class=\"rb-card-actions\">\n <button class=\"rb-btn rb-btn-restore\"\n [disabled]=\"!CanCreate\"\n [title]=\"CanCreate ? 'Re-create this record from its snapshot' : 'You do not have Create permission for this entity'\"\n (click)=\"OnRestoreClicked(entry)\"\n type=\"button\">\n <i class=\"fa-solid fa-rotate-left\" aria-hidden=\"true\"></i>\n Restore\n </button>\n </div>\n </div>\n }\n </div>\n }\n\n </div>\n\n <!-- Restore preview slide-in (reused from ng-record-changes) -->\n <mj-restore-preview-panel\n [Provider]=\"Provider\"\n [Visible]=\"PreviewVisible\"\n [Mode]=\"'undelete'\"\n [RecordChange]=\"SelectedEntry?.RecordChange ?? null\"\n [EntityName]=\"EntityName\"\n (RestoreConfirmed)=\"OnPreviewConfirmed($event)\"\n (RestoreCancelled)=\"OnPreviewCancelled()\">\n </mj-restore-preview-panel>\n\n</mj-slide-panel>\n", styles: ["/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n * Recycle Bin\n * Slide-in panel that lists hard-deleted records and offers re-create.\n * All colors use --mj-* design tokens.\n * \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\n.rb-container {\n padding: 18px 20px;\n display: flex;\n flex-direction: column;\n gap: 14px;\n}\n\n/* \u2500\u2500\u2500 Header \u2500\u2500\u2500 */\n\n.rb-header {\n display: flex;\n align-items: flex-start;\n gap: 14px;\n padding: 8px 0 14px;\n border-bottom: 1px solid var(--mj-border-subtle);\n}\n\n.rb-header-icon {\n width: 40px;\n height: 40px;\n border-radius: 9px;\n background: color-mix(in srgb, var(--mj-status-info) 12%, var(--mj-bg-surface));\n color: var(--mj-status-info);\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n font-size: 17px;\n}\n\n.rb-header-text { flex: 1; min-width: 0; }\n\n.rb-header-title {\n font-size: 16px;\n font-weight: 600;\n color: var(--mj-text-primary);\n margin-bottom: 2px;\n}\n\n.rb-header-subtitle {\n color: var(--mj-text-muted);\n font-size: 12px;\n}\n\n/* \u2500\u2500\u2500 List \u2500\u2500\u2500 */\n\n.rb-list {\n display: flex;\n flex-direction: column;\n gap: 10px;\n}\n\n/* \u2500\u2500\u2500 Card \u2500\u2500\u2500 */\n\n.rb-card {\n background: var(--mj-bg-surface);\n border: 1px solid var(--mj-border-default);\n border-radius: 10px;\n padding: 14px;\n display: grid;\n grid-template-columns: 1fr auto;\n gap: 14px;\n align-items: center;\n transition: border-color 0.15s;\n}\n\n.rb-card:hover {\n border-color: var(--mj-border-strong);\n}\n\n.rb-card-info { min-width: 0; }\n\n.rb-card-name {\n font-weight: 600;\n font-size: 14px;\n color: var(--mj-text-primary);\n margin-bottom: 5px;\n word-break: break-word;\n}\n\n.rb-card-fields {\n display: flex;\n flex-wrap: wrap;\n gap: 10px;\n margin-bottom: 6px;\n font-size: 12px;\n color: var(--mj-text-muted);\n}\n\n.rb-card-field strong {\n color: var(--mj-text-secondary);\n font-weight: 500;\n margin-right: 3px;\n}\n\n.rb-card-meta {\n display: flex;\n align-items: center;\n gap: 6px;\n color: var(--mj-text-muted);\n font-size: 11px;\n}\n\n.rb-card-meta i {\n color: var(--mj-text-disabled);\n}\n\n/* \u2500\u2500\u2500 Card actions \u2500\u2500\u2500 */\n\n.rb-card-actions {\n display: flex;\n gap: 8px;\n align-items: center;\n flex-shrink: 0;\n}\n\n.rb-btn {\n padding: 7px 14px;\n border-radius: 7px;\n font-size: 12px;\n font-weight: 600;\n cursor: pointer;\n border: 1px solid transparent;\n display: inline-flex;\n align-items: center;\n gap: 6px;\n font-family: inherit;\n background: var(--mj-bg-surface);\n transition: background-color 0.1s, color 0.1s, border-color 0.1s;\n}\n\n.rb-btn-restore {\n color: var(--mj-status-success);\n border-color: var(--mj-status-success);\n}\n\n.rb-btn-restore:hover:not(:disabled) {\n background: var(--mj-status-success);\n color: var(--mj-text-inverse, #fff);\n}\n\n.rb-btn-restore:disabled {\n color: var(--mj-text-disabled);\n border-color: var(--mj-border-default);\n background: var(--mj-bg-surface-sunken);\n cursor: not-allowed;\n}\n"] }]
|
|
649
649
|
}], () => [{ type: i0.ChangeDetectorRef }], { Visible: [{
|
|
650
650
|
type: Input
|
|
651
651
|
}], EntityName: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recycle-bin.component.js","sourceRoot":"","sources":["../../../src/lib/recycle-bin/recycle-bin.component.ts","../../../src/lib/recycle-bin/recycle-bin.component.html"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,uBAAuB,EAEvB,YAAY,EACZ,KAAK,EAEL,MAAM,EACN,iBAAiB,GAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EAIL,OAAO,GAER,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;;;;;;;;ICC3D,8BAAgC;IAAA,YAAoB;IAAA,iBAAM;;;IAA1B,cAAoB;IAApB,2CAAoB;;;IAOxD,oCAI0B;;;IAAxB,0CAAqB;;;IAKvB,gCAAyE;;;IAKzE,qCAI0B;;;IAAxB,0CAAqB;;;IAKvB,qCAGoG;;;IAcpF,AADF,gCAA4B,aAClB;IAAA,YAAqB;IAAA,iBAAS;IAAC,YACzC;IAAA,iBAAO;;;IADG,eAAqB;IAArB,iDAAqB;IAAU,cACzC;IADyC,4CACzC;;;IAJJ,+BAA4B;IAC1B,2HAIC;IACH,iBAAM;;;IALJ,cAIC;IAJD,wCAIC;;;IAOD,YACF;;;;IADE,qFACF;;;;IAfF,AADF,AADF,+BAAqB,cACO,cACE;IAAA,YAA0B;IAAA,iBAAM;IAC1D,2GAAyC;IASzC,+BAA0B;IACxB,wBAAoD;IACpD,YACA;IAAA,gGAA+B;IAInC,AADE,iBAAM,EACF;IAEJ,AADF,+BAA6B,kBAKX;IADd,2NAAS,iCAAuB,KAAC;IAEjC,yBAA0D;IAC1D,0BACF;IAEJ,AADE,AADE,iBAAS,EACL,EACF;;;;IA5BwB,eAA0B;IAA1B,6CAA0B;IACpD,cAQC;IARD,+DAQC;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,AADF,AAHF,8BAA0B,aAGD,aACO;YAC1B,uBAAiE;YACnE,iBAAM;YAEJ,AADF,8BAA4B,aACG;YAAA,2BAAW;YAAA,iBAAM;YAC9C,qFAAkB;YAItB,AADE,iBAAM,EACF;YAGN,gGAA6C;YAS7C,8FAAiB;YAKjB,mGAA4C;YAS5C,mGAAqE;YAQrE,wFAAsD;YAsCxD,iBAAM;YAGN,qDAM4C;YAA1C,AADA,+IAAoB,8BAA0B,IAAC,4HAC3B,wBAAoB,IAAC;YAG7C,AAFE,iBAA2B,EAEZ;;YApGf,AADA,AADA,AADA,AADA,AADA,8BAAgB,yDAC+B,wBAC5B,mBACD,mBACA,sBACG;YAYf,eAEC;YAFD,yCAEC;YAKL,cAMC;YAND,4EAMC;YAGD,cAEC;YAFD,yCAEC;YAGD,cAMC;YAND,4EAMC;YAGD,cAKC;YALD,yGAKC;YAGD,cAoCC;YApCD,sFAoCC;YAMD,cAA0B;YAG1B,AADA,AADA,AADA,4CAA0B,oBACP,6FACiC,8BAC3B;;;iFDRhB,mBAAmB;cAR/B,SAAS;6BACI,KAAK,YACP,gBAAgB,mBAGT,uBAAuB,CAAC,MAAM,iBAChC,iBAAiB,CAAC,IAAI;;kBAUpC,KAAK;;kBAeL,KAAK;;kBAML,KAAK;;kBAQL,KAAK;;kBAKL,MAAM;;kBAON,MAAM;;kBAGN,MAAM;;kBAQN,MAAM;;kBAMN,MAAM;;kBAON,MAAM;;kBAGN,MAAM;;kFA5EI,mBAAmB","sourcesContent":["import {\n Component,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n EventEmitter,\n Input,\n OnInit,\n Output,\n ViewEncapsulation,\n} from '@angular/core';\nimport {\n EntityFieldInfo,\n EntityInfo,\n Metadata,\n RunView,\n UserInfo,\n} from '@memberjunction/core';\nimport { MJRecordChangeEntity } from '@memberjunction/core-entities';\nimport { BaseAngularComponent } from '@memberjunction/ng-base-types';\nimport { RestoreCommitEvent } from '@memberjunction/ng-record-changes';\nimport {\n AfterRecordRestoreEventArgs,\n AfterRecycleBinOpenEventArgs,\n AfterRestoreCommitEventArgs,\n BeforeRecordRestoreEventArgs,\n BeforeRecycleBinOpenEventArgs,\n BeforeRestoreCommitEventArgs,\n RecycleBinEntry,\n} from './events/recycle-bin-events';\n\n/**\n * Slide-in panel that lists all hard-deleted records for a single entity\n * and lets a user with `Delete` permission re-create any of them from its\n * historical RecordChange snapshot.\n *\n * ### When to use\n *\n * Surface this component from any entity-viewing context where the user\n * might need to restore a hard-deleted record. The {@link EntityViewerComponent},\n * {@link EntityDataGridComponent}, and {@link EntityCardsComponent}\n * already expose a `ShowRecycleBin` input (default `true`) that renders a\n * chip in their toolbar — you only need to use this component directly if\n * you're building a custom viewer.\n *\n * ### Permissions\n *\n * The chip / panel is gated on `entity.UserPermissions.CanDelete` —\n * rationale: there is no native \"undelete\" permission in MemberJunction,\n * but if a user has the higher-trust permission to *delete* records of an\n * entity, restoring deleted ones is well within scope. The actual\n * re-create action additionally requires `CanCreate`; without it the\n * Restore button on each card disables with a tooltip.\n *\n * ### Soft deletes vs hard deletes\n *\n * This component only surfaces *hard*-deleted records. Soft-deletes (e.g.,\n * `IsDeleted` flags, `Status='Inactive'`, etc.) leave the record visible\n * in normal entity views, so the standard Record Changes panel + restore\n * preview already handles them — no Recycle Bin needed.\n *\n * ### Cancelable Before/After event surface\n *\n * Every meaningful action emits a paired `before*` / `after*` event. The\n * `before*` event carries `cancel: boolean` so consumers can intercept\n * — useful for custom approval workflows, audit logging, or to take over\n * the actual restore execution entirely. See {@link BeforeRecordRestoreEventArgs}\n * and friends.\n *\n * @example Basic usage (rare — usually embedded by entity-viewer)\n * <mj-recycle-bin\n * [Visible]=\"showBin\"\n * [EntityName]=\"'Customers'\"\n * (Closed)=\"showBin = false\"\n * (BeforeRecordRestore)=\"auditRestore($event)\"\n * (AfterRestoreCommit)=\"onRestored($event)\">\n * </mj-recycle-bin>\n *\n * @example Intercepting a restore\n * onBeforeRecordRestore(e: BeforeRecordRestoreEventArgs) {\n * if (!myCustomApproval(e.entry)) {\n * e.cancel = true;\n * e.cancelReason = 'Awaiting compliance approval';\n * }\n * }\n */\n@Component({\n standalone: false,\n selector: 'mj-recycle-bin',\n templateUrl: './recycle-bin.component.html',\n styleUrls: ['./recycle-bin.component.css'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n})\nexport class RecycleBinComponent extends BaseAngularComponent implements OnInit {\n // ─── Inputs ─────────────────────────────────────────────────────\n\n /**\n * Controls panel visibility. Set to true to slide in (and trigger an\n * initial load); false to slide out.\n */\n private _visible = false;\n @Input()\n set Visible(value: boolean) {\n const wasVisible = this._visible;\n this._visible = value;\n if (value && !wasVisible && this.isInitialized) {\n this.LoadDeletedRecords();\n }\n }\n get Visible(): boolean {\n return this._visible;\n }\n\n /**\n * The name of the entity whose deleted records will be listed. Required.\n */\n @Input() EntityName: string | null = null;\n\n /**\n * Optional context user. When omitted, falls back to\n * {@link this.ProviderToUse.CurrentUser} per standard MJ conventions.\n */\n @Input() ContextUser: UserInfo | null = null;\n\n /**\n * Maximum number of deleted-record cards to load. Defaults to 200 — this\n * is a UI affordance, not a hard limit; consumers needing pagination\n * should listen to {@link AfterRecycleBinOpen} and surface their own UI\n * if `deletedRecordCount === MaxRecords`.\n */\n @Input() MaxRecords = 200;\n\n // ─── Outputs ────────────────────────────────────────────────────\n\n /** Fires when the user closes the panel. */\n @Output() Closed = new EventEmitter<void>();\n\n /**\n * Cancelable. Fires when {@link Visible} flips to true and the bin is\n * about to query for deleted records. Setting `cancel = true` aborts\n * the query (and the panel will show the empty state).\n */\n @Output() BeforeRecycleBinOpen = new EventEmitter<BeforeRecycleBinOpenEventArgs>();\n\n /** Fires after the deleted-record query completes. */\n @Output() AfterRecycleBinOpen = new EventEmitter<AfterRecycleBinOpenEventArgs>();\n\n /**\n * Cancelable. Fires when the user clicks Restore on a deleted-record\n * card, before the preview panel opens. Setting `cancel = true` skips\n * the preview entirely — useful for consumers that want to take over\n * the restore flow themselves.\n */\n @Output() BeforeRecordRestore = new EventEmitter<BeforeRecordRestoreEventArgs>();\n\n /**\n * Fires after the user closes the restore preview, with `success`\n * indicating whether the actual insert worked.\n */\n @Output() AfterRecordRestore = new EventEmitter<AfterRecordRestoreEventArgs>();\n\n /**\n * Cancelable. Fires after the user clicks Restore in the preview but\n * before the entity is inserted. Setting `cancel = true` aborts the\n * insert.\n */\n @Output() BeforeRestoreCommit = new EventEmitter<BeforeRestoreCommitEventArgs>();\n\n /** Fires after the insert completes (success or failure). */\n @Output() AfterRestoreCommit = new EventEmitter<AfterRestoreCommitEventArgs>();\n\n // ─── Public template state ──────────────────────────────────────\n\n public IsLoading = false;\n public LoadError: string | null = null;\n public Entries: RecycleBinEntry[] = [];\n\n /** The currently selected entry whose preview is open. */\n public SelectedEntry: RecycleBinEntry | null = null;\n public PreviewVisible = false;\n\n /** Permission flags (computed once when EntityName is set). */\n public CanDelete = false;\n public CanCreate = false;\n\n private isInitialized = false;\n private resolvedEntityInfo: EntityInfo | null = null;\n\n constructor(private cdr: ChangeDetectorRef) {\n super();}\n\n ngOnInit(): void {\n this.isInitialized = true;\n if (this.Visible) this.LoadDeletedRecords();\n }\n\n // ─── Derived state ──────────────────────────────────────────────\n\n public get HeaderSubtitle(): string {\n if (!this.EntityName) return '';\n const n = this.Entries.length;\n return `${n} record${n === 1 ? '' : 's'} have been deleted from ${this.EntityName}.`;\n }\n\n /**\n * The user has Delete permission and may browse the bin. The Restore\n * button on each card additionally requires {@link CanCreate}.\n */\n public get HasAccess(): boolean {\n return this.CanDelete;\n }\n\n // ─── Public actions ─────────────────────────────────────────────\n\n /**\n * Manually trigger a re-load — useful for consumers who want to refresh\n * after some external event (e.g., a delete happened and they want the\n * bin to re-populate immediately).\n */\n public async LoadDeletedRecords(): Promise<void> {\n if (!this.EntityName) {\n this.LoadError = 'EntityName is required';\n return;\n }\n\n // Resolve metadata + permissions\n const md = this.ProviderToUse;\n const entityInfo = md.Entities.find(\n e => e.Name.trim().toLowerCase() === this.EntityName!.trim().toLowerCase(),\n );\n if (!entityInfo) {\n this.LoadError = `Entity '${this.EntityName}' not found`;\n this.cdr.markForCheck();\n return;\n }\n this.resolvedEntityInfo = entityInfo;\n const effectiveUser = this.ContextUser ?? md.CurrentUser;\n if (effectiveUser) {\n const perms = entityInfo.GetUserPermisions(effectiveUser);\n this.CanDelete = perms?.CanDelete ?? false;\n this.CanCreate = perms?.CanCreate ?? false;\n } else {\n this.CanDelete = false;\n this.CanCreate = false;\n }\n\n if (!this.CanDelete) {\n this.Entries = [];\n this.LoadError = 'You do not have Delete permission for this entity.';\n this.cdr.markForCheck();\n return;\n }\n\n // Fire BeforeRecycleBinOpen — consumer may cancel\n const beforeArgs: BeforeRecycleBinOpenEventArgs = {\n bin: this,\n timestamp: new Date(),\n entityName: this.EntityName,\n cancel: false,\n _kind: 'beforeRecycleBinOpen',\n };\n this.BeforeRecycleBinOpen.emit(beforeArgs);\n if (beforeArgs.cancel) {\n this.LoadError = beforeArgs.cancelReason ?? 'Cancelled by host';\n this.cdr.markForCheck();\n return;\n }\n\n this.IsLoading = true;\n this.LoadError = null;\n this.Entries = [];\n this.cdr.markForCheck();\n\n try {\n const rv = RunView.FromMetadataProvider(this.ProviderToUse);\n // Get the most recent Delete change per RecordID. We over-fetch and\n // dedupe in JS — the data is small and SQL grouping with the latest\n // change per ID is awkward across dialects.\n const result = await rv.RunView<MJRecordChangeEntity>(\n {\n EntityName: 'MJ: Record Changes',\n ExtraFilter: `EntityID='${entityInfo.ID}' AND Type='Delete'`,\n OrderBy: 'ChangedAt DESC',\n MaxRows: this.MaxRecords * 2, // dedupe headroom\n ResultType: 'entity_object',\n },\n this.ContextUser ?? undefined,\n );\n\n if (!result.Success) {\n this.LoadError = result.ErrorMessage || 'Failed to load deleted records';\n } else {\n this.Entries = this.dedupeAndBuildEntries(result.Results, entityInfo);\n }\n } catch (e) {\n this.LoadError = e instanceof Error ? e.message : 'Unknown error';\n } finally {\n this.IsLoading = false;\n this.cdr.markForCheck();\n }\n\n // Fire AfterRecycleBinOpen\n this.AfterRecycleBinOpen.emit({\n bin: this,\n timestamp: new Date(),\n entityName: this.EntityName,\n deletedRecordCount: this.Entries.length,\n _kind: 'afterRecycleBinOpen',\n });\n }\n\n /**\n * User clicked Restore on a card — open the preview panel (unless a\n * BeforeRecordRestore handler cancelled).\n */\n public OnRestoreClicked(entry: RecycleBinEntry): void {\n if (!this.CanCreate) return; // gated in template too\n\n const beforeArgs: BeforeRecordRestoreEventArgs = {\n bin: this,\n timestamp: new Date(),\n entityName: this.EntityName ?? '',\n entry,\n cancel: false,\n _kind: 'beforeRecordRestore',\n };\n this.BeforeRecordRestore.emit(beforeArgs);\n if (beforeArgs.cancel) return;\n\n this.SelectedEntry = entry;\n this.PreviewVisible = true;\n this.cdr.markForCheck();\n }\n\n /**\n * Preview panel emitted RestoreConfirmed — perform the insert and emit\n * the matching after* events.\n */\n public async OnPreviewConfirmed(commit: RestoreCommitEvent): Promise<void> {\n if (!this.SelectedEntry || !this.resolvedEntityInfo) return;\n const entry = this.SelectedEntry;\n\n const beforeArgs: BeforeRestoreCommitEventArgs = {\n bin: this,\n timestamp: new Date(),\n entityName: this.EntityName ?? '',\n entry,\n fieldValues: commit.FieldValues,\n reason: commit.Reason,\n cancel: false,\n _kind: 'beforeRestoreCommit',\n };\n this.BeforeRestoreCommit.emit(beforeArgs);\n if (beforeArgs.cancel) {\n this.PreviewVisible = false;\n this.cdr.markForCheck();\n return;\n }\n\n let success = false;\n let errorMessage: string | undefined;\n let newRecordID: string | undefined;\n\n try {\n const md = this.ProviderToUse;\n const entity = await md.GetEntityObject(this.resolvedEntityInfo.Name, this.ContextUser ?? undefined);\n\n // Apply the snapshot fields, including the original primary key\n // (preserves any FK references that still point at this ID).\n for (const fv of commit.FieldValues) {\n entity.Set(fv.FieldName, fv.Value);\n }\n // Also re-apply the original primary key from the snapshot so dangling\n // FK references continue to work. Set() on a fresh entity treats this\n // as the new record's PK.\n try {\n const snapshotData = JSON.parse(entry.RecordChange.FullRecordJSON || '{}');\n for (const pk of this.resolvedEntityInfo.PrimaryKeys) {\n if (snapshotData[pk.Name] != null) {\n entity.Set(pk.Name, snapshotData[pk.Name]);\n }\n }\n } catch {\n // PK preservation is best-effort\n }\n\n entity.SetRestoreContext(commit.SourceChangeID, commit.Reason);\n\n try {\n success = await entity.Save();\n if (success) {\n newRecordID = entity.PrimaryKey.ToString();\n } else {\n errorMessage = entity.LatestResult?.CompleteMessage ?? 'Save returned false';\n }\n } finally {\n entity.ClearRestoreContext();\n }\n } catch (e) {\n success = false;\n errorMessage = e instanceof Error ? e.message : 'Unknown error';\n }\n\n this.AfterRestoreCommit.emit({\n bin: this,\n timestamp: new Date(),\n entityName: this.EntityName ?? '',\n entry,\n success,\n newRecordID,\n errorMessage,\n _kind: 'afterRestoreCommit',\n });\n\n this.AfterRecordRestore.emit({\n bin: this,\n timestamp: new Date(),\n entityName: this.EntityName ?? '',\n entry,\n success,\n errorMessage,\n _kind: 'afterRecordRestore',\n });\n\n if (success) {\n // Remove the restored entry from the list and close preview\n this.Entries = this.Entries.filter(e => e !== entry);\n }\n this.PreviewVisible = false;\n this.SelectedEntry = null;\n this.cdr.markForCheck();\n }\n\n public OnPreviewCancelled(): void {\n this.PreviewVisible = false;\n this.SelectedEntry = null;\n this.cdr.markForCheck();\n }\n\n public OnClose(): void {\n this._visible = false;\n this.cdr.markForCheck();\n this.Closed.emit();\n }\n\n // ─── Internal: build entries from raw RecordChange rows ─────────\n\n /**\n * Dedupes the raw delete-change rows: keeps only the most recent Delete\n * per RecordID (since a record could in principle have been recreated\n * and re-deleted). Builds the display fields heuristically by reading\n * the snapshot JSON.\n */\n private dedupeAndBuildEntries(\n rows: MJRecordChangeEntity[],\n entityInfo: EntityInfo,\n ): RecycleBinEntry[] {\n const seen = new Set<string>();\n const entries: RecycleBinEntry[] = [];\n\n for (const row of rows) {\n if (entries.length >= this.MaxRecords) break;\n if (seen.has(row.RecordID)) continue;\n seen.add(row.RecordID);\n\n const snapshot = this.parseSnapshot(row.FullRecordJSON);\n if (!snapshot) continue;\n\n const entry: RecycleBinEntry = {\n RecordChange: row,\n RecordID: row.RecordID,\n DisplaySummary: this.buildDisplaySummary(snapshot, entityInfo),\n SupportingFields: this.buildSupportingFields(snapshot, entityInfo),\n };\n entries.push(entry);\n }\n\n return entries;\n }\n\n /**\n * Builds the headline of the card. Prefers the entity's name field, then\n * any non-PK string field, then the RecordID itself as a last resort.\n */\n private buildDisplaySummary(snapshot: Record<string, unknown>, entityInfo: EntityInfo): string {\n const nameField = entityInfo.NameField;\n if (nameField && snapshot[nameField.Name] != null && snapshot[nameField.Name] !== '') {\n return String(snapshot[nameField.Name]);\n }\n // Fallback: first non-PK, non-empty string field\n for (const f of entityInfo.Fields) {\n if (f.IsPrimaryKey) continue;\n const v = snapshot[f.Name];\n if (typeof v === 'string' && v.trim().length > 0) return v;\n }\n // Last resort: every primary-key column's value (the entity is arbitrary and may be composite-keyed)\n const keyValues = entityInfo.PrimaryKeys\n .map((pk) => snapshot[pk.Name])\n .filter((v) => v != null && v !== '')\n .map((v) => String(v));\n return `Record ${keyValues.join(', ')}`;\n }\n\n /**\n * Picks up to 3 \"interesting\" fields from the snapshot to render as\n * supporting metadata under the headline. Heuristic: prefer fields that\n * are non-empty, non-PK, non-system, and have a display name.\n */\n private buildSupportingFields(\n snapshot: Record<string, unknown>,\n entityInfo: EntityInfo,\n ): Array<{ Name: string; DisplayName: string; Value: string }> {\n const out: Array<{ Name: string; DisplayName: string; Value: string }> = [];\n const nameFieldName = entityInfo.NameField?.Name;\n\n for (const f of entityInfo.Fields) {\n if (out.length >= 3) break;\n if (f.IsPrimaryKey) continue;\n if (f.Name.startsWith('__mj_')) continue;\n if (f.Name === nameFieldName) continue;\n\n const v = snapshot[f.Name];\n if (v == null || v === '') continue;\n\n out.push({\n Name: f.Name,\n DisplayName: f.DisplayNameOrName,\n Value: this.formatFieldValue(v, f),\n });\n }\n return out;\n }\n\n private formatFieldValue(value: unknown, _field: EntityFieldInfo): string {\n if (value == null) return '';\n if (typeof value === 'object') {\n try {\n return JSON.stringify(value);\n } catch {\n return String(value);\n }\n }\n return String(value);\n }\n\n private parseSnapshot(json: string | null | undefined): Record<string, unknown> | null {\n if (!json) return null;\n try {\n return JSON.parse(json) as Record<string, unknown>;\n } catch {\n return null;\n }\n }\n\n // ─── Display helpers (template) ─────────────────────────────────\n\n public FormatTimestamp(date: Date | string | null): string {\n if (!date) return '';\n return new Intl.DateTimeFormat('en-US', {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n hour: 'numeric',\n minute: '2-digit',\n hour12: true,\n }).format(new Date(date));\n }\n\n /** @deprecated Use {@link FormatTimestamp}. */\n public formatTimestamp(date: Date | string | null): string {\n return this.FormatTimestamp(date);\n }\n\n public GetUserDisplay(user: string | null): string {\n if (!user) return 'Unknown';\n if (user.includes('@')) return user.split('@')[0];\n return user;\n }\n\n /** @deprecated Use {@link GetUserDisplay}. */\n public getUserDisplay(user: string | null): string {\n return this.GetUserDisplay(user);\n }\n}\n","<mj-slide-panel\n [Mode]=\"'slide'\"\n [Title]=\"'Recycle Bin · ' + (EntityName || '')\"\n [Visible]=\"Visible\"\n [Resizable]=\"true\"\n [MinWidthPx]=\"480\"\n [MaxWidthRatio]=\"0.6\"\n (Closed)=\"OnClose()\">\n\n <div class=\"rb-container\">\n\n <!-- Header -->\n <div class=\"rb-header\">\n <div class=\"rb-header-icon\">\n <i class=\"fa-solid fa-trash-can-arrow-up\" aria-hidden=\"true\"></i>\n </div>\n <div class=\"rb-header-text\">\n <div class=\"rb-header-title\">Recycle Bin</div>\n @if (EntityName) {\n <div class=\"rb-header-subtitle\">{{ HeaderSubtitle }}</div>\n }\n </div>\n </div>\n\n <!-- No-permission state -->\n @if (!IsLoading && LoadError && !HasAccess) {\n <mj-empty-state\n Variant=\"warning\"\n Icon=\"fa-solid fa-lock\"\n Title=\"Access denied\"\n [Message]=\"LoadError\" />\n }\n\n <!-- Loading -->\n @if (IsLoading) {\n <mj-loading text=\"Loading deleted records...\" size=\"medium\"></mj-loading>\n }\n\n <!-- Generic error -->\n @if (!IsLoading && LoadError && HasAccess) {\n <mj-empty-state\n Variant=\"error\"\n Icon=\"fa-solid fa-triangle-exclamation\"\n Title=\"Could not load deleted records\"\n [Message]=\"LoadError\" />\n }\n\n <!-- Empty state -->\n @if (!IsLoading && !LoadError && HasAccess && Entries.length === 0) {\n <mj-empty-state\n Icon=\"fa-solid fa-trash-can\"\n Title=\"Recycle Bin is empty\"\n Message=\"No records have been deleted from this entity, or change tracking isn't enabled here.\" />\n }\n\n <!-- Entries -->\n @if (!IsLoading && !LoadError && Entries.length > 0) {\n <div class=\"rb-list\">\n @for (entry of Entries; track entry.RecordChange.ID) {\n <div class=\"rb-card\">\n <div class=\"rb-card-info\">\n <div class=\"rb-card-name\">{{ entry.DisplaySummary }}</div>\n @if (entry.SupportingFields.length > 0) {\n <div class=\"rb-card-fields\">\n @for (sf of entry.SupportingFields; track sf.Name) {\n <span class=\"rb-card-field\">\n <strong>{{ sf.DisplayName }}:</strong> {{ sf.Value }}\n </span>\n }\n </div>\n }\n <div class=\"rb-card-meta\">\n <i class=\"fa-solid fa-trash\" aria-hidden=\"true\"></i>\n Deleted {{ formatTimestamp(entry.RecordChange.ChangedAt) }}\n @if (entry.RecordChange.User) {\n by {{ getUserDisplay(entry.RecordChange.User) }}\n }\n </div>\n </div>\n <div class=\"rb-card-actions\">\n <button class=\"rb-btn rb-btn-restore\"\n [disabled]=\"!CanCreate\"\n [title]=\"CanCreate ? 'Re-create this record from its snapshot' : 'You do not have Create permission for this entity'\"\n (click)=\"OnRestoreClicked(entry)\"\n type=\"button\">\n <i class=\"fa-solid fa-rotate-left\" aria-hidden=\"true\"></i>\n Restore\n </button>\n </div>\n </div>\n }\n </div>\n }\n\n </div>\n\n <!-- Restore preview slide-in (reused from ng-record-changes) -->\n <mj-restore-preview-panel\n [Visible]=\"PreviewVisible\"\n [Mode]=\"'undelete'\"\n [RecordChange]=\"SelectedEntry?.RecordChange ?? null\"\n [EntityName]=\"EntityName\"\n (RestoreConfirmed)=\"OnPreviewConfirmed($event)\"\n (RestoreCancelled)=\"OnPreviewCancelled()\">\n </mj-restore-preview-panel>\n\n</mj-slide-panel>\n"]}
|
|
1
|
+
{"version":3,"file":"recycle-bin.component.js","sourceRoot":"","sources":["../../../src/lib/recycle-bin/recycle-bin.component.ts","../../../src/lib/recycle-bin/recycle-bin.component.html"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,uBAAuB,EAEvB,YAAY,EACZ,KAAK,EAEL,MAAM,EACN,iBAAiB,GAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EAIL,OAAO,GAER,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;;;;;;;;ICC3D,8BAAgC;IAAA,YAAoB;IAAA,iBAAM;;;IAA1B,cAAoB;IAApB,2CAAoB;;;IAOxD,oCAI0B;;;IAAxB,0CAAqB;;;IAKvB,gCAAyE;;;IAKzE,qCAI0B;;;IAAxB,0CAAqB;;;IAKvB,qCAGoG;;;IAcpF,AADF,gCAA4B,aAClB;IAAA,YAAqB;IAAA,iBAAS;IAAC,YACzC;IAAA,iBAAO;;;IADG,eAAqB;IAArB,iDAAqB;IAAU,cACzC;IADyC,4CACzC;;;IAJJ,+BAA4B;IAC1B,2HAIC;IACH,iBAAM;;;IALJ,cAIC;IAJD,wCAIC;;;IAOD,YACF;;;;IADE,qFACF;;;;IAfF,AADF,AADF,+BAAqB,cACO,cACE;IAAA,YAA0B;IAAA,iBAAM;IAC1D,2GAAyC;IASzC,+BAA0B;IACxB,wBAAoD;IACpD,YACA;IAAA,gGAA+B;IAInC,AADE,iBAAM,EACF;IAEJ,AADF,+BAA6B,kBAKX;IADd,2NAAS,iCAAuB,KAAC;IAEjC,yBAA0D;IAC1D,0BACF;IAEJ,AADE,AADE,iBAAS,EACL,EACF;;;;IA5BwB,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C7FhC,yCAOuB;YAArB,0GAAU,aAAS,IAAC;YAMhB,AADF,AAHF,8BAA0B,aAGD,aACO;YAC1B,uBAAiE;YACnE,iBAAM;YAEJ,AADF,8BAA4B,aACG;YAAA,2BAAW;YAAA,iBAAM;YAC9C,qFAAkB;YAItB,AADE,iBAAM,EACF;YAGN,gGAA6C;YAS7C,8FAAiB;YAKjB,mGAA4C;YAS5C,mGAAqE;YAQrE,wFAAsD;YAsCxD,iBAAM;YAGN,qDAO4C;YAA1C,AADA,+IAAoB,8BAA0B,IAAC,4HAC3B,wBAAoB,IAAC;YAG7C,AAFE,iBAA2B,EAEZ;;YArGf,AADA,AADA,AADA,AADA,AADA,8BAAgB,yDAC+B,wBAC5B,mBACD,mBACA,sBACG;YAYf,eAEC;YAFD,yCAEC;YAKL,cAMC;YAND,4EAMC;YAGD,cAEC;YAFD,yCAEC;YAGD,cAMC;YAND,4EAMC;YAGD,cAKC;YALD,yGAKC;YAGD,cAoCC;YApCD,sFAoCC;YAMD,cAAqB;YAIrB,AADA,AADA,AADA,AADA,uCAAqB,+BACK,oBACP,6FACiC,8BAC3B;;;iFDThB,mBAAmB;cAR/B,SAAS;6BACI,KAAK,YACP,gBAAgB,mBAGT,uBAAuB,CAAC,MAAM,iBAChC,iBAAiB,CAAC,IAAI;;kBAUpC,KAAK;;kBAeL,KAAK;;kBAML,KAAK;;kBAQL,KAAK;;kBAKL,MAAM;;kBAON,MAAM;;kBAGN,MAAM;;kBAQN,MAAM;;kBAMN,MAAM;;kBAON,MAAM;;kBAGN,MAAM;;kFA5EI,mBAAmB","sourcesContent":["import {\n Component,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n EventEmitter,\n Input,\n OnInit,\n Output,\n ViewEncapsulation,\n} from '@angular/core';\nimport {\n EntityFieldInfo,\n EntityInfo,\n Metadata,\n RunView,\n UserInfo,\n} from '@memberjunction/core';\nimport { MJRecordChangeEntity } from '@memberjunction/core-entities';\nimport { BaseAngularComponent } from '@memberjunction/ng-base-types';\nimport { RestoreCommitEvent } from '@memberjunction/ng-record-changes';\nimport {\n AfterRecordRestoreEventArgs,\n AfterRecycleBinOpenEventArgs,\n AfterRestoreCommitEventArgs,\n BeforeRecordRestoreEventArgs,\n BeforeRecycleBinOpenEventArgs,\n BeforeRestoreCommitEventArgs,\n RecycleBinEntry,\n} from './events/recycle-bin-events';\n\n/**\n * Slide-in panel that lists all hard-deleted records for a single entity\n * and lets a user with `Delete` permission re-create any of them from its\n * historical RecordChange snapshot.\n *\n * ### When to use\n *\n * Surface this component from any entity-viewing context where the user\n * might need to restore a hard-deleted record. The {@link EntityViewerComponent},\n * {@link EntityDataGridComponent}, and {@link EntityCardsComponent}\n * already expose a `ShowRecycleBin` input (default `true`) that renders a\n * chip in their toolbar — you only need to use this component directly if\n * you're building a custom viewer.\n *\n * ### Permissions\n *\n * The chip / panel is gated on `entity.UserPermissions.CanDelete` —\n * rationale: there is no native \"undelete\" permission in MemberJunction,\n * but if a user has the higher-trust permission to *delete* records of an\n * entity, restoring deleted ones is well within scope. The actual\n * re-create action additionally requires `CanCreate`; without it the\n * Restore button on each card disables with a tooltip.\n *\n * ### Soft deletes vs hard deletes\n *\n * This component only surfaces *hard*-deleted records. Soft-deletes (e.g.,\n * `IsDeleted` flags, `Status='Inactive'`, etc.) leave the record visible\n * in normal entity views, so the standard Record Changes panel + restore\n * preview already handles them — no Recycle Bin needed.\n *\n * ### Cancelable Before/After event surface\n *\n * Every meaningful action emits a paired `before*` / `after*` event. The\n * `before*` event carries `cancel: boolean` so consumers can intercept\n * — useful for custom approval workflows, audit logging, or to take over\n * the actual restore execution entirely. See {@link BeforeRecordRestoreEventArgs}\n * and friends.\n *\n * @example Basic usage (rare — usually embedded by entity-viewer)\n * <mj-recycle-bin\n * [Visible]=\"showBin\"\n * [EntityName]=\"'Customers'\"\n * (Closed)=\"showBin = false\"\n * (BeforeRecordRestore)=\"auditRestore($event)\"\n * (AfterRestoreCommit)=\"onRestored($event)\">\n * </mj-recycle-bin>\n *\n * @example Intercepting a restore\n * onBeforeRecordRestore(e: BeforeRecordRestoreEventArgs) {\n * if (!myCustomApproval(e.entry)) {\n * e.cancel = true;\n * e.cancelReason = 'Awaiting compliance approval';\n * }\n * }\n */\n@Component({\n standalone: false,\n selector: 'mj-recycle-bin',\n templateUrl: './recycle-bin.component.html',\n styleUrls: ['./recycle-bin.component.css'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n})\nexport class RecycleBinComponent extends BaseAngularComponent implements OnInit {\n // ─── Inputs ─────────────────────────────────────────────────────\n\n /**\n * Controls panel visibility. Set to true to slide in (and trigger an\n * initial load); false to slide out.\n */\n private _visible = false;\n @Input()\n set Visible(value: boolean) {\n const wasVisible = this._visible;\n this._visible = value;\n if (value && !wasVisible && this.isInitialized) {\n this.LoadDeletedRecords();\n }\n }\n get Visible(): boolean {\n return this._visible;\n }\n\n /**\n * The name of the entity whose deleted records will be listed. Required.\n */\n @Input() EntityName: string | null = null;\n\n /**\n * Optional context user. When omitted, falls back to\n * {@link this.ProviderToUse.CurrentUser} per standard MJ conventions.\n */\n @Input() ContextUser: UserInfo | null = null;\n\n /**\n * Maximum number of deleted-record cards to load. Defaults to 200 — this\n * is a UI affordance, not a hard limit; consumers needing pagination\n * should listen to {@link AfterRecycleBinOpen} and surface their own UI\n * if `deletedRecordCount === MaxRecords`.\n */\n @Input() MaxRecords = 200;\n\n // ─── Outputs ────────────────────────────────────────────────────\n\n /** Fires when the user closes the panel. */\n @Output() Closed = new EventEmitter<void>();\n\n /**\n * Cancelable. Fires when {@link Visible} flips to true and the bin is\n * about to query for deleted records. Setting `cancel = true` aborts\n * the query (and the panel will show the empty state).\n */\n @Output() BeforeRecycleBinOpen = new EventEmitter<BeforeRecycleBinOpenEventArgs>();\n\n /** Fires after the deleted-record query completes. */\n @Output() AfterRecycleBinOpen = new EventEmitter<AfterRecycleBinOpenEventArgs>();\n\n /**\n * Cancelable. Fires when the user clicks Restore on a deleted-record\n * card, before the preview panel opens. Setting `cancel = true` skips\n * the preview entirely — useful for consumers that want to take over\n * the restore flow themselves.\n */\n @Output() BeforeRecordRestore = new EventEmitter<BeforeRecordRestoreEventArgs>();\n\n /**\n * Fires after the user closes the restore preview, with `success`\n * indicating whether the actual insert worked.\n */\n @Output() AfterRecordRestore = new EventEmitter<AfterRecordRestoreEventArgs>();\n\n /**\n * Cancelable. Fires after the user clicks Restore in the preview but\n * before the entity is inserted. Setting `cancel = true` aborts the\n * insert.\n */\n @Output() BeforeRestoreCommit = new EventEmitter<BeforeRestoreCommitEventArgs>();\n\n /** Fires after the insert completes (success or failure). */\n @Output() AfterRestoreCommit = new EventEmitter<AfterRestoreCommitEventArgs>();\n\n // ─── Public template state ──────────────────────────────────────\n\n public IsLoading = false;\n public LoadError: string | null = null;\n public Entries: RecycleBinEntry[] = [];\n\n /** The currently selected entry whose preview is open. */\n public SelectedEntry: RecycleBinEntry | null = null;\n public PreviewVisible = false;\n\n /** Permission flags (computed once when EntityName is set). */\n public CanDelete = false;\n public CanCreate = false;\n\n private isInitialized = false;\n private resolvedEntityInfo: EntityInfo | null = null;\n\n constructor(private cdr: ChangeDetectorRef) {\n super();}\n\n ngOnInit(): void {\n this.isInitialized = true;\n if (this.Visible) this.LoadDeletedRecords();\n }\n\n // ─── Derived state ──────────────────────────────────────────────\n\n public get HeaderSubtitle(): string {\n if (!this.EntityName) return '';\n const n = this.Entries.length;\n return `${n} record${n === 1 ? '' : 's'} have been deleted from ${this.EntityName}.`;\n }\n\n /**\n * The user has Delete permission and may browse the bin. The Restore\n * button on each card additionally requires {@link CanCreate}.\n */\n public get HasAccess(): boolean {\n return this.CanDelete;\n }\n\n // ─── Public actions ─────────────────────────────────────────────\n\n /**\n * Manually trigger a re-load — useful for consumers who want to refresh\n * after some external event (e.g., a delete happened and they want the\n * bin to re-populate immediately).\n */\n public async LoadDeletedRecords(): Promise<void> {\n if (!this.EntityName) {\n this.LoadError = 'EntityName is required';\n return;\n }\n\n // Resolve metadata + permissions\n const md = this.ProviderToUse;\n const entityInfo = md.Entities.find(\n e => e.Name.trim().toLowerCase() === this.EntityName!.trim().toLowerCase(),\n );\n if (!entityInfo) {\n this.LoadError = `Entity '${this.EntityName}' not found`;\n this.cdr.markForCheck();\n return;\n }\n this.resolvedEntityInfo = entityInfo;\n const effectiveUser = this.ContextUser ?? md.CurrentUser;\n if (effectiveUser) {\n const perms = entityInfo.GetUserPermisions(effectiveUser);\n this.CanDelete = perms?.CanDelete ?? false;\n this.CanCreate = perms?.CanCreate ?? false;\n } else {\n this.CanDelete = false;\n this.CanCreate = false;\n }\n\n if (!this.CanDelete) {\n this.Entries = [];\n this.LoadError = 'You do not have Delete permission for this entity.';\n this.cdr.markForCheck();\n return;\n }\n\n // Fire BeforeRecycleBinOpen — consumer may cancel\n const beforeArgs: BeforeRecycleBinOpenEventArgs = {\n bin: this,\n timestamp: new Date(),\n entityName: this.EntityName,\n cancel: false,\n _kind: 'beforeRecycleBinOpen',\n };\n this.BeforeRecycleBinOpen.emit(beforeArgs);\n if (beforeArgs.cancel) {\n this.LoadError = beforeArgs.cancelReason ?? 'Cancelled by host';\n this.cdr.markForCheck();\n return;\n }\n\n this.IsLoading = true;\n this.LoadError = null;\n this.Entries = [];\n this.cdr.markForCheck();\n\n try {\n const rv = RunView.FromMetadataProvider(this.ProviderToUse);\n // Get the most recent Delete change per RecordID. We over-fetch and\n // dedupe in JS — the data is small and SQL grouping with the latest\n // change per ID is awkward across dialects.\n const result = await rv.RunView<MJRecordChangeEntity>(\n {\n EntityName: 'MJ: Record Changes',\n ExtraFilter: `EntityID='${entityInfo.ID}' AND Type='Delete'`,\n OrderBy: 'ChangedAt DESC',\n MaxRows: this.MaxRecords * 2, // dedupe headroom\n ResultType: 'entity_object',\n },\n this.ContextUser ?? undefined,\n );\n\n if (!result.Success) {\n this.LoadError = result.ErrorMessage || 'Failed to load deleted records';\n } else {\n this.Entries = this.dedupeAndBuildEntries(result.Results, entityInfo);\n }\n } catch (e) {\n this.LoadError = e instanceof Error ? e.message : 'Unknown error';\n } finally {\n this.IsLoading = false;\n this.cdr.markForCheck();\n }\n\n // Fire AfterRecycleBinOpen\n this.AfterRecycleBinOpen.emit({\n bin: this,\n timestamp: new Date(),\n entityName: this.EntityName,\n deletedRecordCount: this.Entries.length,\n _kind: 'afterRecycleBinOpen',\n });\n }\n\n /**\n * User clicked Restore on a card — open the preview panel (unless a\n * BeforeRecordRestore handler cancelled).\n */\n public OnRestoreClicked(entry: RecycleBinEntry): void {\n if (!this.CanCreate) return; // gated in template too\n\n const beforeArgs: BeforeRecordRestoreEventArgs = {\n bin: this,\n timestamp: new Date(),\n entityName: this.EntityName ?? '',\n entry,\n cancel: false,\n _kind: 'beforeRecordRestore',\n };\n this.BeforeRecordRestore.emit(beforeArgs);\n if (beforeArgs.cancel) return;\n\n this.SelectedEntry = entry;\n this.PreviewVisible = true;\n this.cdr.markForCheck();\n }\n\n /**\n * Preview panel emitted RestoreConfirmed — perform the insert and emit\n * the matching after* events.\n */\n public async OnPreviewConfirmed(commit: RestoreCommitEvent): Promise<void> {\n if (!this.SelectedEntry || !this.resolvedEntityInfo) return;\n const entry = this.SelectedEntry;\n\n const beforeArgs: BeforeRestoreCommitEventArgs = {\n bin: this,\n timestamp: new Date(),\n entityName: this.EntityName ?? '',\n entry,\n fieldValues: commit.FieldValues,\n reason: commit.Reason,\n cancel: false,\n _kind: 'beforeRestoreCommit',\n };\n this.BeforeRestoreCommit.emit(beforeArgs);\n if (beforeArgs.cancel) {\n this.PreviewVisible = false;\n this.cdr.markForCheck();\n return;\n }\n\n let success = false;\n let errorMessage: string | undefined;\n let newRecordID: string | undefined;\n\n try {\n const md = this.ProviderToUse;\n const entity = await md.GetEntityObject(this.resolvedEntityInfo.Name, this.ContextUser ?? undefined);\n\n // Apply the snapshot fields, including the original primary key\n // (preserves any FK references that still point at this ID).\n for (const fv of commit.FieldValues) {\n entity.Set(fv.FieldName, fv.Value);\n }\n // Also re-apply the original primary key from the snapshot so dangling\n // FK references continue to work. Set() on a fresh entity treats this\n // as the new record's PK.\n try {\n const snapshotData = JSON.parse(entry.RecordChange.FullRecordJSON || '{}');\n for (const pk of this.resolvedEntityInfo.PrimaryKeys) {\n if (snapshotData[pk.Name] != null) {\n entity.Set(pk.Name, snapshotData[pk.Name]);\n }\n }\n } catch {\n // PK preservation is best-effort\n }\n\n entity.SetRestoreContext(commit.SourceChangeID, commit.Reason);\n\n try {\n success = await entity.Save();\n if (success) {\n newRecordID = entity.PrimaryKey.ToString();\n } else {\n errorMessage = entity.LatestResult?.CompleteMessage ?? 'Save returned false';\n }\n } finally {\n entity.ClearRestoreContext();\n }\n } catch (e) {\n success = false;\n errorMessage = e instanceof Error ? e.message : 'Unknown error';\n }\n\n this.AfterRestoreCommit.emit({\n bin: this,\n timestamp: new Date(),\n entityName: this.EntityName ?? '',\n entry,\n success,\n newRecordID,\n errorMessage,\n _kind: 'afterRestoreCommit',\n });\n\n this.AfterRecordRestore.emit({\n bin: this,\n timestamp: new Date(),\n entityName: this.EntityName ?? '',\n entry,\n success,\n errorMessage,\n _kind: 'afterRecordRestore',\n });\n\n if (success) {\n // Remove the restored entry from the list and close preview\n this.Entries = this.Entries.filter(e => e !== entry);\n }\n this.PreviewVisible = false;\n this.SelectedEntry = null;\n this.cdr.markForCheck();\n }\n\n public OnPreviewCancelled(): void {\n this.PreviewVisible = false;\n this.SelectedEntry = null;\n this.cdr.markForCheck();\n }\n\n public OnClose(): void {\n this._visible = false;\n this.cdr.markForCheck();\n this.Closed.emit();\n }\n\n // ─── Internal: build entries from raw RecordChange rows ─────────\n\n /**\n * Dedupes the raw delete-change rows: keeps only the most recent Delete\n * per RecordID (since a record could in principle have been recreated\n * and re-deleted). Builds the display fields heuristically by reading\n * the snapshot JSON.\n */\n private dedupeAndBuildEntries(\n rows: MJRecordChangeEntity[],\n entityInfo: EntityInfo,\n ): RecycleBinEntry[] {\n const seen = new Set<string>();\n const entries: RecycleBinEntry[] = [];\n\n for (const row of rows) {\n if (entries.length >= this.MaxRecords) break;\n if (seen.has(row.RecordID)) continue;\n seen.add(row.RecordID);\n\n const snapshot = this.parseSnapshot(row.FullRecordJSON);\n if (!snapshot) continue;\n\n const entry: RecycleBinEntry = {\n RecordChange: row,\n RecordID: row.RecordID,\n DisplaySummary: this.buildDisplaySummary(snapshot, entityInfo),\n SupportingFields: this.buildSupportingFields(snapshot, entityInfo),\n };\n entries.push(entry);\n }\n\n return entries;\n }\n\n /**\n * Builds the headline of the card. Prefers the entity's name field, then\n * any non-PK string field, then the RecordID itself as a last resort.\n */\n private buildDisplaySummary(snapshot: Record<string, unknown>, entityInfo: EntityInfo): string {\n const nameField = entityInfo.NameField;\n if (nameField && snapshot[nameField.Name] != null && snapshot[nameField.Name] !== '') {\n return String(snapshot[nameField.Name]);\n }\n // Fallback: first non-PK, non-empty string field\n for (const f of entityInfo.Fields) {\n if (f.IsPrimaryKey) continue;\n const v = snapshot[f.Name];\n if (typeof v === 'string' && v.trim().length > 0) return v;\n }\n // Last resort: every primary-key column's value (the entity is arbitrary and may be composite-keyed)\n const keyValues = entityInfo.PrimaryKeys\n .map((pk) => snapshot[pk.Name])\n .filter((v) => v != null && v !== '')\n .map((v) => String(v));\n return `Record ${keyValues.join(', ')}`;\n }\n\n /**\n * Picks up to 3 \"interesting\" fields from the snapshot to render as\n * supporting metadata under the headline. Heuristic: prefer fields that\n * are non-empty, non-PK, non-system, and have a display name.\n */\n private buildSupportingFields(\n snapshot: Record<string, unknown>,\n entityInfo: EntityInfo,\n ): Array<{ Name: string; DisplayName: string; Value: string }> {\n const out: Array<{ Name: string; DisplayName: string; Value: string }> = [];\n const nameFieldName = entityInfo.NameField?.Name;\n\n for (const f of entityInfo.Fields) {\n if (out.length >= 3) break;\n if (f.IsPrimaryKey) continue;\n if (f.Name.startsWith('__mj_')) continue;\n if (f.Name === nameFieldName) continue;\n\n const v = snapshot[f.Name];\n if (v == null || v === '') continue;\n\n out.push({\n Name: f.Name,\n DisplayName: f.DisplayNameOrName,\n Value: this.formatFieldValue(v, f),\n });\n }\n return out;\n }\n\n private formatFieldValue(value: unknown, _field: EntityFieldInfo): string {\n if (value == null) return '';\n if (typeof value === 'object') {\n try {\n return JSON.stringify(value);\n } catch {\n return String(value);\n }\n }\n return String(value);\n }\n\n private parseSnapshot(json: string | null | undefined): Record<string, unknown> | null {\n if (!json) return null;\n try {\n return JSON.parse(json) as Record<string, unknown>;\n } catch {\n return null;\n }\n }\n\n // ─── Display helpers (template) ─────────────────────────────────\n\n public FormatTimestamp(date: Date | string | null): string {\n if (!date) return '';\n return new Intl.DateTimeFormat('en-US', {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n hour: 'numeric',\n minute: '2-digit',\n hour12: true,\n }).format(new Date(date));\n }\n\n /** @deprecated Use {@link FormatTimestamp}. */\n public formatTimestamp(date: Date | string | null): string {\n return this.FormatTimestamp(date);\n }\n\n public GetUserDisplay(user: string | null): string {\n if (!user) return 'Unknown';\n if (user.includes('@')) return user.split('@')[0];\n return user;\n }\n\n /** @deprecated Use {@link GetUserDisplay}. */\n public getUserDisplay(user: string | null): string {\n return this.GetUserDisplay(user);\n }\n}\n","<mj-slide-panel\n [Mode]=\"'slide'\"\n [Title]=\"'Recycle Bin · ' + (EntityName || '')\"\n [Visible]=\"Visible\"\n [Resizable]=\"true\"\n [MinWidthPx]=\"480\"\n [MaxWidthRatio]=\"0.6\"\n (Closed)=\"OnClose()\">\n\n <div class=\"rb-container\">\n\n <!-- Header -->\n <div class=\"rb-header\">\n <div class=\"rb-header-icon\">\n <i class=\"fa-solid fa-trash-can-arrow-up\" aria-hidden=\"true\"></i>\n </div>\n <div class=\"rb-header-text\">\n <div class=\"rb-header-title\">Recycle Bin</div>\n @if (EntityName) {\n <div class=\"rb-header-subtitle\">{{ HeaderSubtitle }}</div>\n }\n </div>\n </div>\n\n <!-- No-permission state -->\n @if (!IsLoading && LoadError && !HasAccess) {\n <mj-empty-state\n Variant=\"warning\"\n Icon=\"fa-solid fa-lock\"\n Title=\"Access denied\"\n [Message]=\"LoadError\" />\n }\n\n <!-- Loading -->\n @if (IsLoading) {\n <mj-loading text=\"Loading deleted records...\" size=\"medium\"></mj-loading>\n }\n\n <!-- Generic error -->\n @if (!IsLoading && LoadError && HasAccess) {\n <mj-empty-state\n Variant=\"error\"\n Icon=\"fa-solid fa-triangle-exclamation\"\n Title=\"Could not load deleted records\"\n [Message]=\"LoadError\" />\n }\n\n <!-- Empty state -->\n @if (!IsLoading && !LoadError && HasAccess && Entries.length === 0) {\n <mj-empty-state\n Icon=\"fa-solid fa-trash-can\"\n Title=\"Recycle Bin is empty\"\n Message=\"No records have been deleted from this entity, or change tracking isn't enabled here.\" />\n }\n\n <!-- Entries -->\n @if (!IsLoading && !LoadError && Entries.length > 0) {\n <div class=\"rb-list\">\n @for (entry of Entries; track entry.RecordChange.ID) {\n <div class=\"rb-card\">\n <div class=\"rb-card-info\">\n <div class=\"rb-card-name\">{{ entry.DisplaySummary }}</div>\n @if (entry.SupportingFields.length > 0) {\n <div class=\"rb-card-fields\">\n @for (sf of entry.SupportingFields; track sf.Name) {\n <span class=\"rb-card-field\">\n <strong>{{ sf.DisplayName }}:</strong> {{ sf.Value }}\n </span>\n }\n </div>\n }\n <div class=\"rb-card-meta\">\n <i class=\"fa-solid fa-trash\" aria-hidden=\"true\"></i>\n Deleted {{ formatTimestamp(entry.RecordChange.ChangedAt) }}\n @if (entry.RecordChange.User) {\n by {{ getUserDisplay(entry.RecordChange.User) }}\n }\n </div>\n </div>\n <div class=\"rb-card-actions\">\n <button class=\"rb-btn rb-btn-restore\"\n [disabled]=\"!CanCreate\"\n [title]=\"CanCreate ? 'Re-create this record from its snapshot' : 'You do not have Create permission for this entity'\"\n (click)=\"OnRestoreClicked(entry)\"\n type=\"button\">\n <i class=\"fa-solid fa-rotate-left\" aria-hidden=\"true\"></i>\n Restore\n </button>\n </div>\n </div>\n }\n </div>\n }\n\n </div>\n\n <!-- Restore preview slide-in (reused from ng-record-changes) -->\n <mj-restore-preview-panel\n [Provider]=\"Provider\"\n [Visible]=\"PreviewVisible\"\n [Mode]=\"'undelete'\"\n [RecordChange]=\"SelectedEntry?.RecordChange ?? null\"\n [EntityName]=\"EntityName\"\n (RestoreConfirmed)=\"OnPreviewConfirmed($event)\"\n (RestoreCancelled)=\"OnPreviewCancelled()\">\n </mj-restore-preview-panel>\n\n</mj-slide-panel>\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EntityInfo, CompositeKey } from '@memberjunction/core';
|
|
1
|
+
import { EntityInfo, EntityFieldInfo, CompositeKey, IMetadataProvider } from '@memberjunction/core';
|
|
2
2
|
import { ViewGridState } from '../types';
|
|
3
3
|
/**
|
|
4
4
|
* Build a CompositeKey from a plain record using EntityInfo PK fields.
|
|
@@ -46,4 +46,24 @@ export declare function canonicalizeColumnFields<T extends {
|
|
|
46
46
|
export declare function ComputeFieldsList(entityInfo: EntityInfo, gridState?: ViewGridState | null, hostColumnFields?: readonly string[] | null): string[];
|
|
47
47
|
/** @deprecated Use {@link ComputeFieldsList}. */
|
|
48
48
|
export declare function computeFieldsList(entityInfo: EntityInfo, gridState?: ViewGridState | null, hostColumnFields?: readonly string[] | null): string[];
|
|
49
|
+
/**
|
|
50
|
+
* Resolves the target `EntityInfo` for a polymorphic FK field (`field.EntityIDFieldName`)
|
|
51
|
+
* on a plain record or `BaseEntity`-like map. Strictly relies on the hard metadata link
|
|
52
|
+
* `field.EntityIDFieldName` — never falls back to field-name heuristics.
|
|
53
|
+
*/
|
|
54
|
+
export declare function ResolvePolymorphicTargetEntity(record: Record<string, unknown>, field: EntityFieldInfo, provider: IMetadataProvider | null | undefined): EntityInfo | undefined;
|
|
55
|
+
/**
|
|
56
|
+
* Builds a `CompositeKey` for a polymorphic `RecordID` value against `targetEntity`,
|
|
57
|
+
* supporting both single-column bare values and `Field1|Val1||Field2|Val2` segments.
|
|
58
|
+
*/
|
|
59
|
+
export declare function BuildPolymorphicCompositeKey(rawRecordId: unknown, targetEntity: EntityInfo): CompositeKey | null;
|
|
60
|
+
/**
|
|
61
|
+
* Stable lookup key for a resolved polymorphic record name in a view's cache map.
|
|
62
|
+
*/
|
|
63
|
+
export declare function PolymorphicCacheKey(entityName: string, key: CompositeKey): string;
|
|
64
|
+
/**
|
|
65
|
+
* Batch-resolves human-readable record names for all polymorphic FK fields (`EntityIDFieldName`)
|
|
66
|
+
* across a page of records using a single `provider.GetEntityRecordNames(...)` call.
|
|
67
|
+
*/
|
|
68
|
+
export declare function BatchResolvePolymorphicRecordNames(records: readonly Record<string, unknown>[], entityInfo: EntityInfo | null | undefined, provider: IMetadataProvider | null | undefined, existingCache?: Map<string, string>): Promise<Map<string, string>>;
|
|
49
69
|
//# sourceMappingURL=record.util.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record.util.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/record.util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"record.util.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/record.util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,YAAY,EAAyB,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC3H,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,UAAU,EAAE,UAAU,GAAG,YAAY,CAEvG;AAED,iDAAiD;AACjD,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,UAAU,EAAE,UAAU,GAAG,YAAY,CAEvG;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE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