@memberjunction/ng-list-management 5.34.1 → 5.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +179 -85
- package/dist/lib/components/audience-source-picker/audience-source-picker.component.d.ts +74 -0
- package/dist/lib/components/audience-source-picker/audience-source-picker.component.d.ts.map +1 -0
- package/dist/lib/components/audience-source-picker/audience-source-picker.component.js +396 -0
- package/dist/lib/components/audience-source-picker/audience-source-picker.component.js.map +1 -0
- package/dist/lib/components/audience-source-summary/audience-source-summary.component.d.ts +34 -0
- package/dist/lib/components/audience-source-summary/audience-source-summary.component.d.ts.map +1 -0
- package/dist/lib/components/audience-source-summary/audience-source-summary.component.js +136 -0
- package/dist/lib/components/audience-source-summary/audience-source-summary.component.js.map +1 -0
- package/dist/lib/components/list-audit-log/list-audit-log.component.d.ts +55 -0
- package/dist/lib/components/list-audit-log/list-audit-log.component.d.ts.map +1 -0
- package/dist/lib/components/list-audit-log/list-audit-log.component.js +280 -0
- package/dist/lib/components/list-audit-log/list-audit-log.component.js.map +1 -0
- package/dist/lib/components/list-delta-confirm/list-delta-confirm.component.d.ts +64 -0
- package/dist/lib/components/list-delta-confirm/list-delta-confirm.component.d.ts.map +1 -0
- package/dist/lib/components/list-delta-confirm/list-delta-confirm.component.js +323 -0
- package/dist/lib/components/list-delta-confirm/list-delta-confirm.component.js.map +1 -0
- package/dist/lib/components/list-invitations/list-invitations.component.d.ts +60 -0
- package/dist/lib/components/list-invitations/list-invitations.component.d.ts.map +1 -0
- package/dist/lib/components/list-invitations/list-invitations.component.js +367 -0
- package/dist/lib/components/list-invitations/list-invitations.component.js.map +1 -0
- package/dist/lib/components/list-management-dialog/list-management-dialog.component.d.ts.map +1 -1
- package/dist/lib/components/list-management-dialog/list-management-dialog.component.js +0 -4
- package/dist/lib/components/list-management-dialog/list-management-dialog.component.js.map +1 -1
- package/dist/lib/components/list-share-dialog/list-share-dialog.component.d.ts +18 -1
- package/dist/lib/components/list-share-dialog/list-share-dialog.component.d.ts.map +1 -1
- package/dist/lib/components/list-share-dialog/list-share-dialog.component.js +115 -66
- package/dist/lib/components/list-share-dialog/list-share-dialog.component.js.map +1 -1
- package/dist/lib/components/list-stats/list-stats.component.d.ts +52 -0
- package/dist/lib/components/list-stats/list-stats.component.d.ts.map +1 -0
- package/dist/lib/components/list-stats/list-stats.component.js +283 -0
- package/dist/lib/components/list-stats/list-stats.component.js.map +1 -0
- package/dist/lib/components/save-view-as-list-dialog/save-view-as-list-dialog.component.d.ts +68 -0
- package/dist/lib/components/save-view-as-list-dialog/save-view-as-list-dialog.component.d.ts.map +1 -0
- package/dist/lib/components/save-view-as-list-dialog/save-view-as-list-dialog.component.js +316 -0
- package/dist/lib/components/save-view-as-list-dialog/save-view-as-list-dialog.component.js.map +1 -0
- package/dist/lib/components/shared-with-me/shared-with-me.component.d.ts +47 -0
- package/dist/lib/components/shared-with-me/shared-with-me.component.d.ts.map +1 -0
- package/dist/lib/components/shared-with-me/shared-with-me.component.js +231 -0
- package/dist/lib/components/shared-with-me/shared-with-me.component.js.map +1 -0
- package/dist/lib/components/tag-chips/tag-chips.component.d.ts +85 -0
- package/dist/lib/components/tag-chips/tag-chips.component.d.ts.map +1 -0
- package/dist/lib/components/tag-chips/tag-chips.component.js +392 -0
- package/dist/lib/components/tag-chips/tag-chips.component.js.map +1 -0
- package/dist/lib/models/list-sharing.models.d.ts +5 -0
- package/dist/lib/models/list-sharing.models.d.ts.map +1 -1
- package/dist/lib/models/list-sharing.models.js.map +1 -1
- package/dist/lib/module.d.ts +17 -8
- package/dist/lib/module.d.ts.map +1 -1
- package/dist/lib/module.js +51 -6
- package/dist/lib/module.js.map +1 -1
- package/dist/lib/services/list-management.service.d.ts.map +1 -1
- package/dist/lib/services/list-management.service.js +0 -9
- package/dist/lib/services/list-management.service.js.map +1 -1
- package/dist/lib/services/list-sharing.service.d.ts +8 -3
- package/dist/lib/services/list-sharing.service.d.ts.map +1 -1
- package/dist/lib/services/list-sharing.service.js +33 -15
- package/dist/lib/services/list-sharing.service.js.map +1 -1
- package/dist/public-api.d.ts +9 -0
- package/dist/public-api.d.ts.map +1 -1
- package/dist/public-api.js +9 -0
- package/dist/public-api.js.map +1 -1
- package/package.json +13 -11
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { EventEmitter, OnInit } from '@angular/core';
|
|
2
|
+
import { BaseAngularComponent } from '@memberjunction/ng-base-types';
|
|
3
|
+
import { MJListCategoryEntity } from '@memberjunction/core-entities';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
/**
|
|
6
|
+
* Form payload emitted when the user clicks Save. The parent component is
|
|
7
|
+
* responsible for calling `GraphQLListsClient.MaterializeFromView` with these
|
|
8
|
+
* options — we keep the dialog generic so it doesn't have to know about the
|
|
9
|
+
* GraphQL transport.
|
|
10
|
+
*/
|
|
11
|
+
export interface SaveViewAsListResult {
|
|
12
|
+
ListName: string;
|
|
13
|
+
Description?: string;
|
|
14
|
+
CategoryId?: string;
|
|
15
|
+
RememberLineage: boolean;
|
|
16
|
+
UseSnapshot: boolean;
|
|
17
|
+
RefreshMode: 'Additive' | 'Sync';
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Dialog for materializing a User View into a new static List. Matches
|
|
21
|
+
* mockup `09-save-view-as-list.html`: name + description + category, then
|
|
22
|
+
* a radio group for source-lineage (remember vs one-time snapshot), then a
|
|
23
|
+
* "freeze filter" checkbox that maps to `UseSnapshot` on the list.
|
|
24
|
+
*
|
|
25
|
+
* The dialog is reusable — pass `ViewId` + `ViewName` + the displayed
|
|
26
|
+
* record count and listen for `Save` / `Cancel`. Multi-provider safe via
|
|
27
|
+
* `BaseAngularComponent.ProviderToUse`.
|
|
28
|
+
*/
|
|
29
|
+
export declare class SaveViewAsListDialogComponent extends BaseAngularComponent implements OnInit {
|
|
30
|
+
private readonly cdr;
|
|
31
|
+
/** Visibility toggle, getter/setter so opening resets the form. */
|
|
32
|
+
get Visible(): boolean;
|
|
33
|
+
set Visible(value: boolean);
|
|
34
|
+
private _visible;
|
|
35
|
+
/** Required — the User View we're materializing from. */
|
|
36
|
+
ViewId: string | null;
|
|
37
|
+
/** Display name of the source view (shown in the info banner + default list name). */
|
|
38
|
+
ViewName: string | null;
|
|
39
|
+
/** Optional — record count shown in the button label + info banner. */
|
|
40
|
+
RecordCount: number | null;
|
|
41
|
+
Save: EventEmitter<SaveViewAsListResult>;
|
|
42
|
+
Cancel: EventEmitter<void>;
|
|
43
|
+
listName: string;
|
|
44
|
+
description: string;
|
|
45
|
+
categoryId: string | null;
|
|
46
|
+
rememberLineage: boolean;
|
|
47
|
+
useSnapshot: boolean;
|
|
48
|
+
refreshMode: 'Additive' | 'Sync';
|
|
49
|
+
categories: MJListCategoryEntity[];
|
|
50
|
+
loadingCategories: boolean;
|
|
51
|
+
submitting: boolean;
|
|
52
|
+
ngOnInit(): Promise<void>;
|
|
53
|
+
OnSave(): void;
|
|
54
|
+
OnCancel(): void;
|
|
55
|
+
OnLineageChange(remember: boolean): void;
|
|
56
|
+
get canSave(): boolean;
|
|
57
|
+
get confirmButtonLabel(): string;
|
|
58
|
+
/**
|
|
59
|
+
* Load list categories for the category dropdown. Multi-provider safe.
|
|
60
|
+
* Failures degrade gracefully — the dropdown just shows "Uncategorized"
|
|
61
|
+
* and we log so the user can troubleshoot.
|
|
62
|
+
*/
|
|
63
|
+
private loadCategories;
|
|
64
|
+
private resetForm;
|
|
65
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SaveViewAsListDialogComponent, never>;
|
|
66
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SaveViewAsListDialogComponent, "mj-save-view-as-list-dialog", never, { "Visible": { "alias": "Visible"; "required": false; }; "ViewId": { "alias": "ViewId"; "required": false; }; "ViewName": { "alias": "ViewName"; "required": false; }; "RecordCount": { "alias": "RecordCount"; "required": false; }; }, { "Save": "Save"; "Cancel": "Cancel"; }, never, never, false, never>;
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=save-view-as-list-dialog.component.d.ts.map
|
package/dist/lib/components/save-view-as-list-dialog/save-view-as-list-dialog.component.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"save-view-as-list-dialog.component.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/save-view-as-list-dialog/save-view-as-list-dialog.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyD,YAAY,EAAS,MAAM,EAAkB,MAAM,eAAe,CAAC;AAEnI,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAErE,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;;AAErE;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,OAAO,CAAC;IACzB,WAAW,EAAE,OAAO,CAAC;IACrB,WAAW,EAAE,UAAU,GAAG,MAAM,CAAC;CAClC;AAED;;;;;;;;;GASG;AACH,qBAOa,6BAA8B,SAAQ,oBAAqB,YAAW,MAAM;IACvF,OAAO,CAAC,QAAQ,CAAC,GAAG,CAA6B;IAEjD,mEAAmE;IACnE,IACI,OAAO,IAAI,OAAO,CAErB;IACD,IAAI,OAAO,CAAC,KAAK,EAAE,OAAO,EAGzB;IACD,OAAO,CAAC,QAAQ,CAAS;IAEzB,yDAAyD;IAChD,MAAM,EAAE,MAAM,GAAG,IAAI,CAAQ;IAEtC,sFAAsF;IAC7E,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAQ;IAExC,uEAAuE;IAC9D,WAAW,EAAE,MAAM,GAAG,IAAI,CAAQ;IAEjC,IAAI,qCAA4C;IAChD,MAAM,qBAA4B;IAErC,QAAQ,SAAM;IACd,WAAW,SAAM;IACjB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAQ;IACjC,eAAe,UAAQ;IACvB,WAAW,UAAQ;IACnB,WAAW,EAAE,UAAU,GAAG,MAAM,CAAc;IAE9C,UAAU,EAAE,oBAAoB,EAAE,CAAM;IACxC,iBAAiB,UAAS;IAC1B,UAAU,UAAS;IAEpB,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAIxB,MAAM,IAAI,IAAI;IAed,QAAQ,IAAI,IAAI;IAIhB,eAAe,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI;IAO/C,IAAW,OAAO,IAAI,OAAO,CAE5B;IAED,IAAW,kBAAkB,IAAI,MAAM,CAItC;IAED;;;;OAIG;YACW,cAAc;IAkB5B,OAAO,CAAC,SAAS;yCApGN,6BAA6B;2CAA7B,6BAA6B;CA6GzC"}
|
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, Input, Output, inject } from '@angular/core';
|
|
2
|
+
import { BaseAngularComponent } from '@memberjunction/ng-base-types';
|
|
3
|
+
import { RunView } from '@memberjunction/core';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
import * as i1 from "@angular/forms";
|
|
6
|
+
import * as i2 from "@memberjunction/ng-ui-components";
|
|
7
|
+
const _forTrack0 = ($index, $item) => $item.ID;
|
|
8
|
+
function SaveViewAsListDialogComponent_Conditional_0_Conditional_6_Template(rf, ctx) { if (rf & 1) {
|
|
9
|
+
i0.ɵɵelementStart(0, "strong");
|
|
10
|
+
i0.ɵɵtext(1);
|
|
11
|
+
i0.ɵɵelementEnd();
|
|
12
|
+
} if (rf & 2) {
|
|
13
|
+
const ctx_r1 = i0.ɵɵnextContext(2);
|
|
14
|
+
i0.ɵɵadvance();
|
|
15
|
+
i0.ɵɵtextInterpolate1("", ctx_r1.RecordCount, " records");
|
|
16
|
+
} }
|
|
17
|
+
function SaveViewAsListDialogComponent_Conditional_0_Conditional_7_Template(rf, ctx) { if (rf & 1) {
|
|
18
|
+
i0.ɵɵelementStart(0, "strong");
|
|
19
|
+
i0.ɵɵtext(1, "view results");
|
|
20
|
+
i0.ɵɵelementEnd();
|
|
21
|
+
} }
|
|
22
|
+
function SaveViewAsListDialogComponent_Conditional_0_Conditional_8_Template(rf, ctx) { if (rf & 1) {
|
|
23
|
+
i0.ɵɵtext(0, " from ");
|
|
24
|
+
i0.ɵɵelementStart(1, "strong");
|
|
25
|
+
i0.ɵɵtext(2);
|
|
26
|
+
i0.ɵɵelementEnd();
|
|
27
|
+
} if (rf & 2) {
|
|
28
|
+
const ctx_r1 = i0.ɵɵnextContext(2);
|
|
29
|
+
i0.ɵɵadvance(2);
|
|
30
|
+
i0.ɵɵtextInterpolate(ctx_r1.ViewName);
|
|
31
|
+
} }
|
|
32
|
+
function SaveViewAsListDialogComponent_Conditional_0_For_25_Template(rf, ctx) { if (rf & 1) {
|
|
33
|
+
i0.ɵɵelementStart(0, "option", 12);
|
|
34
|
+
i0.ɵɵtext(1);
|
|
35
|
+
i0.ɵɵelementEnd();
|
|
36
|
+
} if (rf & 2) {
|
|
37
|
+
const cat_r3 = ctx.$implicit;
|
|
38
|
+
i0.ɵɵproperty("ngValue", cat_r3.ID);
|
|
39
|
+
i0.ɵɵadvance();
|
|
40
|
+
i0.ɵɵtextInterpolate(cat_r3.Name);
|
|
41
|
+
} }
|
|
42
|
+
function SaveViewAsListDialogComponent_Conditional_0_Conditional_50_Template(rf, ctx) { if (rf & 1) {
|
|
43
|
+
const _r4 = i0.ɵɵgetCurrentView();
|
|
44
|
+
i0.ɵɵelementStart(0, "div", 23)(1, "input", 24);
|
|
45
|
+
i0.ɵɵtwoWayListener("ngModelChange", function SaveViewAsListDialogComponent_Conditional_0_Conditional_50_Template_input_ngModelChange_1_listener($event) { i0.ɵɵrestoreView(_r4); const ctx_r1 = i0.ɵɵnextContext(2); i0.ɵɵtwoWayBindingSet(ctx_r1.useSnapshot, $event) || (ctx_r1.useSnapshot = $event); return i0.ɵɵresetView($event); });
|
|
46
|
+
i0.ɵɵelementEnd();
|
|
47
|
+
i0.ɵɵelementStart(2, "label", 25);
|
|
48
|
+
i0.ɵɵtext(3, " Freeze filter at current value ");
|
|
49
|
+
i0.ɵɵelementStart(4, "span", 26);
|
|
50
|
+
i0.ɵɵtext(5, " (");
|
|
51
|
+
i0.ɵɵelementStart(6, "code");
|
|
52
|
+
i0.ɵɵtext(7, "UseSnapshot = true");
|
|
53
|
+
i0.ɵɵelementEnd();
|
|
54
|
+
i0.ɵɵtext(8, ") \u2014 refresh re-runs the saved filter, even if the view is later edited ");
|
|
55
|
+
i0.ɵɵelementEnd()()();
|
|
56
|
+
i0.ɵɵelementStart(9, "div", 5)(10, "label", 27);
|
|
57
|
+
i0.ɵɵtext(11, "Default refresh mode");
|
|
58
|
+
i0.ɵɵelementEnd();
|
|
59
|
+
i0.ɵɵelementStart(12, "select", 28);
|
|
60
|
+
i0.ɵɵtwoWayListener("ngModelChange", function SaveViewAsListDialogComponent_Conditional_0_Conditional_50_Template_select_ngModelChange_12_listener($event) { i0.ɵɵrestoreView(_r4); const ctx_r1 = i0.ɵɵnextContext(2); i0.ɵɵtwoWayBindingSet(ctx_r1.refreshMode, $event) || (ctx_r1.refreshMode = $event); return i0.ɵɵresetView($event); });
|
|
61
|
+
i0.ɵɵelementStart(13, "option", 29);
|
|
62
|
+
i0.ɵɵtext(14, "Additive \u2014 only adds new records on refresh");
|
|
63
|
+
i0.ɵɵelementEnd();
|
|
64
|
+
i0.ɵɵelementStart(15, "option", 30);
|
|
65
|
+
i0.ɵɵtext(16, "Sync \u2014 reconciles in both directions (may remove records)");
|
|
66
|
+
i0.ɵɵelementEnd()()();
|
|
67
|
+
} if (rf & 2) {
|
|
68
|
+
const ctx_r1 = i0.ɵɵnextContext(2);
|
|
69
|
+
i0.ɵɵadvance();
|
|
70
|
+
i0.ɵɵtwoWayProperty("ngModel", ctx_r1.useSnapshot);
|
|
71
|
+
i0.ɵɵadvance(11);
|
|
72
|
+
i0.ɵɵtwoWayProperty("ngModel", ctx_r1.refreshMode);
|
|
73
|
+
} }
|
|
74
|
+
function SaveViewAsListDialogComponent_Conditional_0_Template(rf, ctx) { if (rf & 1) {
|
|
75
|
+
const _r1 = i0.ɵɵgetCurrentView();
|
|
76
|
+
i0.ɵɵelementStart(0, "mj-dialog", 1);
|
|
77
|
+
i0.ɵɵlistener("Close", function SaveViewAsListDialogComponent_Conditional_0_Template_mj_dialog_Close_0_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.OnCancel()); });
|
|
78
|
+
i0.ɵɵelementStart(1, "form", 2);
|
|
79
|
+
i0.ɵɵlistener("submit", function SaveViewAsListDialogComponent_Conditional_0_Template_form_submit_1_listener($event) { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); $event.preventDefault(); return i0.ɵɵresetView(ctx_r1.OnSave()); });
|
|
80
|
+
i0.ɵɵelementStart(2, "div", 3);
|
|
81
|
+
i0.ɵɵelement(3, "i", 4);
|
|
82
|
+
i0.ɵɵelementStart(4, "div");
|
|
83
|
+
i0.ɵɵtext(5, " Materializes ");
|
|
84
|
+
i0.ɵɵconditionalCreate(6, SaveViewAsListDialogComponent_Conditional_0_Conditional_6_Template, 2, 1, "strong")(7, SaveViewAsListDialogComponent_Conditional_0_Conditional_7_Template, 2, 0, "strong");
|
|
85
|
+
i0.ɵɵconditionalCreate(8, SaveViewAsListDialogComponent_Conditional_0_Conditional_8_Template, 3, 1);
|
|
86
|
+
i0.ɵɵtext(9, " into a static List. The list can be refreshed from this view later if you keep lineage on. ");
|
|
87
|
+
i0.ɵɵelementEnd()();
|
|
88
|
+
i0.ɵɵelementStart(10, "div", 5)(11, "label", 6);
|
|
89
|
+
i0.ɵɵtext(12, "List name");
|
|
90
|
+
i0.ɵɵelementEnd();
|
|
91
|
+
i0.ɵɵelementStart(13, "input", 7);
|
|
92
|
+
i0.ɵɵtwoWayListener("ngModelChange", function SaveViewAsListDialogComponent_Conditional_0_Template_input_ngModelChange_13_listener($event) { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); i0.ɵɵtwoWayBindingSet(ctx_r1.listName, $event) || (ctx_r1.listName = $event); return i0.ɵɵresetView($event); });
|
|
93
|
+
i0.ɵɵelementEnd()();
|
|
94
|
+
i0.ɵɵelementStart(14, "div", 5)(15, "label", 8);
|
|
95
|
+
i0.ɵɵtext(16, "Description");
|
|
96
|
+
i0.ɵɵelementEnd();
|
|
97
|
+
i0.ɵɵelementStart(17, "textarea", 9);
|
|
98
|
+
i0.ɵɵtwoWayListener("ngModelChange", function SaveViewAsListDialogComponent_Conditional_0_Template_textarea_ngModelChange_17_listener($event) { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); i0.ɵɵtwoWayBindingSet(ctx_r1.description, $event) || (ctx_r1.description = $event); return i0.ɵɵresetView($event); });
|
|
99
|
+
i0.ɵɵelementEnd()();
|
|
100
|
+
i0.ɵɵelementStart(18, "div", 5)(19, "label", 10);
|
|
101
|
+
i0.ɵɵtext(20, "Category");
|
|
102
|
+
i0.ɵɵelementEnd();
|
|
103
|
+
i0.ɵɵelementStart(21, "select", 11);
|
|
104
|
+
i0.ɵɵtwoWayListener("ngModelChange", function SaveViewAsListDialogComponent_Conditional_0_Template_select_ngModelChange_21_listener($event) { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); i0.ɵɵtwoWayBindingSet(ctx_r1.categoryId, $event) || (ctx_r1.categoryId = $event); return i0.ɵɵresetView($event); });
|
|
105
|
+
i0.ɵɵelementStart(22, "option", 12);
|
|
106
|
+
i0.ɵɵtext(23, "(uncategorized)");
|
|
107
|
+
i0.ɵɵelementEnd();
|
|
108
|
+
i0.ɵɵrepeaterCreate(24, SaveViewAsListDialogComponent_Conditional_0_For_25_Template, 2, 2, "option", 12, _forTrack0);
|
|
109
|
+
i0.ɵɵelementEnd()();
|
|
110
|
+
i0.ɵɵelement(26, "div", 13);
|
|
111
|
+
i0.ɵɵelementStart(27, "div", 14)(28, "div", 15);
|
|
112
|
+
i0.ɵɵtext(29, "Source lineage");
|
|
113
|
+
i0.ɵɵelementEnd();
|
|
114
|
+
i0.ɵɵelementStart(30, "label", 16)(31, "input", 17);
|
|
115
|
+
i0.ɵɵlistener("change", function SaveViewAsListDialogComponent_Conditional_0_Template_input_change_31_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.OnLineageChange(true)); });
|
|
116
|
+
i0.ɵɵelementEnd();
|
|
117
|
+
i0.ɵɵelementStart(32, "div")(33, "div", 18);
|
|
118
|
+
i0.ɵɵtext(34, "Remember source view (recommended)");
|
|
119
|
+
i0.ɵɵelementEnd();
|
|
120
|
+
i0.ɵɵelementStart(35, "div", 19);
|
|
121
|
+
i0.ɵɵtext(36, " Stores ");
|
|
122
|
+
i0.ɵɵelementStart(37, "code");
|
|
123
|
+
i0.ɵɵtext(38, "SourceViewID");
|
|
124
|
+
i0.ɵɵelementEnd();
|
|
125
|
+
i0.ɵɵtext(39, " and (optionally) the current filter. Enables ");
|
|
126
|
+
i0.ɵɵelementStart(40, "strong");
|
|
127
|
+
i0.ɵɵtext(41, "Refresh from source");
|
|
128
|
+
i0.ɵɵelementEnd();
|
|
129
|
+
i0.ɵɵtext(42, " later. You'll choose Additive or Sync each refresh. ");
|
|
130
|
+
i0.ɵɵelementEnd()()();
|
|
131
|
+
i0.ɵɵelementStart(43, "label", 16)(44, "input", 17);
|
|
132
|
+
i0.ɵɵlistener("change", function SaveViewAsListDialogComponent_Conditional_0_Template_input_change_44_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.OnLineageChange(false)); });
|
|
133
|
+
i0.ɵɵelementEnd();
|
|
134
|
+
i0.ɵɵelementStart(45, "div")(46, "div", 18);
|
|
135
|
+
i0.ɵɵtext(47, "One-time snapshot");
|
|
136
|
+
i0.ɵɵelementEnd();
|
|
137
|
+
i0.ɵɵelementStart(48, "div", 19);
|
|
138
|
+
i0.ɵɵtext(49, " No lineage stored. List is fully static; later changes to the view do not propagate. ");
|
|
139
|
+
i0.ɵɵelementEnd()()()();
|
|
140
|
+
i0.ɵɵconditionalCreate(50, SaveViewAsListDialogComponent_Conditional_0_Conditional_50_Template, 17, 2);
|
|
141
|
+
i0.ɵɵelementEnd();
|
|
142
|
+
i0.ɵɵelementStart(51, "mj-dialog-actions")(52, "button", 20);
|
|
143
|
+
i0.ɵɵlistener("click", function SaveViewAsListDialogComponent_Conditional_0_Template_button_click_52_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.OnSave()); });
|
|
144
|
+
i0.ɵɵelement(53, "i", 21);
|
|
145
|
+
i0.ɵɵtext(54);
|
|
146
|
+
i0.ɵɵelementEnd();
|
|
147
|
+
i0.ɵɵelementStart(55, "button", 22);
|
|
148
|
+
i0.ɵɵlistener("click", function SaveViewAsListDialogComponent_Conditional_0_Template_button_click_55_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.OnCancel()); });
|
|
149
|
+
i0.ɵɵtext(56, "Cancel");
|
|
150
|
+
i0.ɵɵelementEnd()()();
|
|
151
|
+
} if (rf & 2) {
|
|
152
|
+
const ctx_r1 = i0.ɵɵnextContext();
|
|
153
|
+
i0.ɵɵproperty("Visible", true)("Width", 560);
|
|
154
|
+
i0.ɵɵadvance(6);
|
|
155
|
+
i0.ɵɵconditional(ctx_r1.RecordCount != null ? 6 : 7);
|
|
156
|
+
i0.ɵɵadvance(2);
|
|
157
|
+
i0.ɵɵconditional(ctx_r1.ViewName ? 8 : -1);
|
|
158
|
+
i0.ɵɵadvance(5);
|
|
159
|
+
i0.ɵɵtwoWayProperty("ngModel", ctx_r1.listName);
|
|
160
|
+
i0.ɵɵadvance(4);
|
|
161
|
+
i0.ɵɵtwoWayProperty("ngModel", ctx_r1.description);
|
|
162
|
+
i0.ɵɵadvance(4);
|
|
163
|
+
i0.ɵɵtwoWayProperty("ngModel", ctx_r1.categoryId);
|
|
164
|
+
i0.ɵɵproperty("disabled", ctx_r1.loadingCategories);
|
|
165
|
+
i0.ɵɵadvance();
|
|
166
|
+
i0.ɵɵproperty("ngValue", null);
|
|
167
|
+
i0.ɵɵadvance(2);
|
|
168
|
+
i0.ɵɵrepeater(ctx_r1.categories);
|
|
169
|
+
i0.ɵɵadvance(6);
|
|
170
|
+
i0.ɵɵclassProp("lineage-option--selected", ctx_r1.rememberLineage);
|
|
171
|
+
i0.ɵɵadvance();
|
|
172
|
+
i0.ɵɵproperty("checked", ctx_r1.rememberLineage);
|
|
173
|
+
i0.ɵɵadvance(12);
|
|
174
|
+
i0.ɵɵclassProp("lineage-option--selected", !ctx_r1.rememberLineage);
|
|
175
|
+
i0.ɵɵadvance();
|
|
176
|
+
i0.ɵɵproperty("checked", !ctx_r1.rememberLineage);
|
|
177
|
+
i0.ɵɵadvance(6);
|
|
178
|
+
i0.ɵɵconditional(ctx_r1.rememberLineage ? 50 : -1);
|
|
179
|
+
i0.ɵɵadvance(2);
|
|
180
|
+
i0.ɵɵproperty("disabled", !ctx_r1.canSave);
|
|
181
|
+
i0.ɵɵadvance(2);
|
|
182
|
+
i0.ɵɵtextInterpolate1(" ", ctx_r1.confirmButtonLabel, " ");
|
|
183
|
+
} }
|
|
184
|
+
/**
|
|
185
|
+
* Dialog for materializing a User View into a new static List. Matches
|
|
186
|
+
* mockup `09-save-view-as-list.html`: name + description + category, then
|
|
187
|
+
* a radio group for source-lineage (remember vs one-time snapshot), then a
|
|
188
|
+
* "freeze filter" checkbox that maps to `UseSnapshot` on the list.
|
|
189
|
+
*
|
|
190
|
+
* The dialog is reusable — pass `ViewId` + `ViewName` + the displayed
|
|
191
|
+
* record count and listen for `Save` / `Cancel`. Multi-provider safe via
|
|
192
|
+
* `BaseAngularComponent.ProviderToUse`.
|
|
193
|
+
*/
|
|
194
|
+
export class SaveViewAsListDialogComponent extends BaseAngularComponent {
|
|
195
|
+
cdr = inject(ChangeDetectorRef);
|
|
196
|
+
/** Visibility toggle, getter/setter so opening resets the form. */
|
|
197
|
+
get Visible() {
|
|
198
|
+
return this._visible;
|
|
199
|
+
}
|
|
200
|
+
set Visible(value) {
|
|
201
|
+
if (value && !this._visible)
|
|
202
|
+
this.resetForm();
|
|
203
|
+
this._visible = value;
|
|
204
|
+
}
|
|
205
|
+
_visible = false;
|
|
206
|
+
/** Required — the User View we're materializing from. */
|
|
207
|
+
ViewId = null;
|
|
208
|
+
/** Display name of the source view (shown in the info banner + default list name). */
|
|
209
|
+
ViewName = null;
|
|
210
|
+
/** Optional — record count shown in the button label + info banner. */
|
|
211
|
+
RecordCount = null;
|
|
212
|
+
Save = new EventEmitter();
|
|
213
|
+
Cancel = new EventEmitter();
|
|
214
|
+
listName = '';
|
|
215
|
+
description = '';
|
|
216
|
+
categoryId = null;
|
|
217
|
+
rememberLineage = true;
|
|
218
|
+
useSnapshot = true;
|
|
219
|
+
refreshMode = 'Additive';
|
|
220
|
+
categories = [];
|
|
221
|
+
loadingCategories = false;
|
|
222
|
+
submitting = false;
|
|
223
|
+
async ngOnInit() {
|
|
224
|
+
await this.loadCategories();
|
|
225
|
+
}
|
|
226
|
+
OnSave() {
|
|
227
|
+
if (!this.canSave)
|
|
228
|
+
return;
|
|
229
|
+
this.submitting = true;
|
|
230
|
+
const payload = {
|
|
231
|
+
ListName: this.listName.trim(),
|
|
232
|
+
Description: this.description.trim() || undefined,
|
|
233
|
+
CategoryId: this.categoryId ?? undefined,
|
|
234
|
+
RememberLineage: this.rememberLineage,
|
|
235
|
+
// UseSnapshot only meaningful when lineage is remembered.
|
|
236
|
+
UseSnapshot: this.rememberLineage && this.useSnapshot,
|
|
237
|
+
RefreshMode: this.refreshMode,
|
|
238
|
+
};
|
|
239
|
+
this.Save.emit(payload);
|
|
240
|
+
}
|
|
241
|
+
OnCancel() {
|
|
242
|
+
this.Cancel.emit();
|
|
243
|
+
}
|
|
244
|
+
OnLineageChange(remember) {
|
|
245
|
+
this.rememberLineage = remember;
|
|
246
|
+
// If lineage is off, snapshot has no meaning — keep the checkbox state
|
|
247
|
+
// intact so re-enabling lineage restores it, but the emitted payload
|
|
248
|
+
// forces UseSnapshot=false (see `OnSave`).
|
|
249
|
+
}
|
|
250
|
+
get canSave() {
|
|
251
|
+
return !!this.ViewId && this.listName.trim().length > 0 && !this.submitting;
|
|
252
|
+
}
|
|
253
|
+
get confirmButtonLabel() {
|
|
254
|
+
if (this.submitting)
|
|
255
|
+
return 'Saving...';
|
|
256
|
+
if (this.RecordCount != null)
|
|
257
|
+
return `Save List (${this.RecordCount} records)`;
|
|
258
|
+
return 'Save List';
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Load list categories for the category dropdown. Multi-provider safe.
|
|
262
|
+
* Failures degrade gracefully — the dropdown just shows "Uncategorized"
|
|
263
|
+
* and we log so the user can troubleshoot.
|
|
264
|
+
*/
|
|
265
|
+
async loadCategories() {
|
|
266
|
+
this.loadingCategories = true;
|
|
267
|
+
try {
|
|
268
|
+
const rv = RunView.FromMetadataProvider(this.ProviderToUse);
|
|
269
|
+
const result = await rv.RunView({
|
|
270
|
+
EntityName: 'MJ: List Categories',
|
|
271
|
+
OrderBy: 'Name ASC',
|
|
272
|
+
ResultType: 'entity_object',
|
|
273
|
+
});
|
|
274
|
+
if (result.Success) {
|
|
275
|
+
this.categories = result.Results ?? [];
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
finally {
|
|
279
|
+
this.loadingCategories = false;
|
|
280
|
+
this.cdr.markForCheck();
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
resetForm() {
|
|
284
|
+
this.listName = this.ViewName ? `${this.ViewName} — Snapshot ${new Date().toISOString().slice(0, 10)}` : '';
|
|
285
|
+
this.description = '';
|
|
286
|
+
this.categoryId = null;
|
|
287
|
+
this.rememberLineage = true;
|
|
288
|
+
this.useSnapshot = true;
|
|
289
|
+
this.refreshMode = 'Additive';
|
|
290
|
+
this.submitting = false;
|
|
291
|
+
}
|
|
292
|
+
static ɵfac = /*@__PURE__*/ (() => { let ɵSaveViewAsListDialogComponent_BaseFactory; return function SaveViewAsListDialogComponent_Factory(__ngFactoryType__) { return (ɵSaveViewAsListDialogComponent_BaseFactory || (ɵSaveViewAsListDialogComponent_BaseFactory = i0.ɵɵgetInheritedFactory(SaveViewAsListDialogComponent)))(__ngFactoryType__ || SaveViewAsListDialogComponent); }; })();
|
|
293
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SaveViewAsListDialogComponent, selectors: [["mj-save-view-as-list-dialog"]], inputs: { Visible: "Visible", ViewId: "ViewId", ViewName: "ViewName", RecordCount: "RecordCount" }, outputs: { Save: "Save", Cancel: "Cancel" }, standalone: false, features: [i0.ɵɵInheritDefinitionFeature], decls: 1, vars: 1, consts: [["Title", "Save View Results as List", 3, "Visible", "Width"], ["Title", "Save View Results as List", 3, "Close", "Visible", "Width"], [1, "save-view-form", 3, "submit"], [1, "info-banner"], [1, "fa-solid", "fa-circle-info"], [1, "field"], ["for", "save-view-list-name", 1, "field__label"], ["id", "save-view-list-name", "name", "listName", "required", "", "autofocus", "", 1, "mj-input", 3, "ngModelChange", "ngModel"], ["for", "save-view-description", 1, "field__label"], ["id", "save-view-description", "name", "description", "rows", "2", 1, "mj-input", 3, "ngModelChange", "ngModel"], ["for", "save-view-category", 1, "field__label"], ["id", "save-view-category", "name", "categoryId", 1, "mj-input", "mj-select", 3, "ngModelChange", "ngModel", "disabled"], [3, "ngValue"], [1, "divider"], [1, "lineage-section"], [1, "field__label"], [1, "lineage-option"], ["type", "radio", "name", "lineage", 3, "change", "checked"], [1, "lineage-option__title"], [1, "lineage-option__desc"], ["mjButton", "", "variant", "primary", "type", "button", 3, "click", "disabled"], [1, "fa-solid", "fa-check"], ["mjButton", "", "variant", "outline", "type", "button", 3, "click"], [1, "field--inline"], ["id", "save-view-freeze", "type", "checkbox", "name", "useSnapshot", 3, "ngModelChange", "ngModel"], ["for", "save-view-freeze"], [1, "muted"], ["for", "save-view-mode", 1, "field__label"], ["id", "save-view-mode", "name", "refreshMode", 1, "mj-input", "mj-select", 3, "ngModelChange", "ngModel"], ["value", "Additive"], ["value", "Sync"]], template: function SaveViewAsListDialogComponent_Template(rf, ctx) { if (rf & 1) {
|
|
294
|
+
i0.ɵɵconditionalCreate(0, SaveViewAsListDialogComponent_Conditional_0_Template, 57, 18, "mj-dialog", 0);
|
|
295
|
+
} if (rf & 2) {
|
|
296
|
+
i0.ɵɵconditional(ctx.Visible ? 0 : -1);
|
|
297
|
+
} }, dependencies: [i1.ɵNgNoValidate, i1.NgSelectOption, i1.ɵNgSelectMultipleOption, i1.DefaultValueAccessor, i1.CheckboxControlValueAccessor, i1.SelectControlValueAccessor, i1.NgControlStatus, i1.NgControlStatusGroup, i1.RequiredValidator, i1.NgModel, i1.NgForm, i2.MJButtonDirective, i2.MJDialogComponent, i2.MJDialogActionsComponent], styles: ["[_nghost-%COMP%] {\n display: contents;\n}\n\n.save-view-form[_ngcontent-%COMP%] {\n padding: 16px 20px 8px;\n display: flex;\n flex-direction: column;\n gap: 14px;\n color: var(--mj-text-primary);\n font-size: 13px;\n}\n\n.info-banner[_ngcontent-%COMP%] {\n display: flex;\n gap: 10px;\n padding: 10px 12px;\n background: var(--mj-status-info-bg);\n border: 1px solid var(--mj-status-info-border);\n color: var(--mj-status-info-text);\n border-radius: 8px;\n font-size: 12.5px;\n line-height: 1.5;\n}\n\n.field[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n gap: 6px;\n}\n\n.field__label[_ngcontent-%COMP%] {\n font-size: 11px;\n letter-spacing: 0.04em;\n text-transform: uppercase;\n color: var(--mj-text-muted);\n}\n\n.field--inline[_ngcontent-%COMP%] {\n display: flex;\n align-items: flex-start;\n gap: 10px;\n font-size: 12.5px;\n}\n\n.field--inline[_ngcontent-%COMP%] input[type='checkbox'][_ngcontent-%COMP%] {\n margin-top: 3px;\n cursor: pointer;\n}\n\n.divider[_ngcontent-%COMP%] {\n height: 1px;\n background: var(--mj-border-default);\n margin: 4px 0;\n}\n\n.lineage-section[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n\n.lineage-option[_ngcontent-%COMP%] {\n display: flex;\n align-items: flex-start;\n gap: 10px;\n padding: 10px;\n border: 1px solid var(--mj-border-default);\n border-radius: 8px;\n cursor: pointer;\n background: var(--mj-bg-surface);\n}\n\n.lineage-option--selected[_ngcontent-%COMP%] {\n border-color: var(--mj-brand-primary);\n background: color-mix(in srgb, var(--mj-brand-primary) 6%, var(--mj-bg-surface));\n}\n\n.lineage-option[_ngcontent-%COMP%] input[type='radio'][_ngcontent-%COMP%] {\n margin-top: 3px;\n cursor: pointer;\n}\n\n.lineage-option__title[_ngcontent-%COMP%] {\n font-weight: 600;\n font-size: 13px;\n}\n\n.lineage-option__desc[_ngcontent-%COMP%] {\n font-size: 12px;\n color: var(--mj-text-muted);\n margin-top: 2px;\n line-height: 1.5;\n}\n\n.muted[_ngcontent-%COMP%] {\n color: var(--mj-text-muted);\n}"], changeDetection: 0 });
|
|
298
|
+
}
|
|
299
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SaveViewAsListDialogComponent, [{
|
|
300
|
+
type: Component,
|
|
301
|
+
args: [{ standalone: false, selector: 'mj-save-view-as-list-dialog', changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (Visible) {\n <mj-dialog\n [Visible]=\"true\"\n [Width]=\"560\"\n Title=\"Save View Results as List\"\n (Close)=\"OnCancel()\">\n <form class=\"save-view-form\" (submit)=\"$event.preventDefault(); OnSave()\">\n <div class=\"info-banner\">\n <i class=\"fa-solid fa-circle-info\"></i>\n <div>\n Materializes\n @if (RecordCount != null) {\n <strong>{{ RecordCount }} records</strong>\n } @else {\n <strong>view results</strong>\n }\n @if (ViewName) {\n from <strong>{{ ViewName }}</strong>\n }\n into a static List. The list can be refreshed from this view later if you keep lineage on.\n </div>\n </div>\n\n <div class=\"field\">\n <label class=\"field__label\" for=\"save-view-list-name\">List name</label>\n <input\n id=\"save-view-list-name\"\n class=\"mj-input\"\n [(ngModel)]=\"listName\"\n name=\"listName\"\n required\n autofocus />\n </div>\n\n <div class=\"field\">\n <label class=\"field__label\" for=\"save-view-description\">Description</label>\n <textarea\n id=\"save-view-description\"\n class=\"mj-input\"\n [(ngModel)]=\"description\"\n name=\"description\"\n rows=\"2\"></textarea>\n </div>\n\n <div class=\"field\">\n <label class=\"field__label\" for=\"save-view-category\">Category</label>\n <select\n id=\"save-view-category\"\n class=\"mj-input mj-select\"\n [(ngModel)]=\"categoryId\"\n name=\"categoryId\"\n [disabled]=\"loadingCategories\">\n <option [ngValue]=\"null\">(uncategorized)</option>\n @for (cat of categories; track cat.ID) {\n <option [ngValue]=\"cat.ID\">{{ cat.Name }}</option>\n }\n </select>\n </div>\n\n <div class=\"divider\"></div>\n\n <div class=\"lineage-section\">\n <div class=\"field__label\">Source lineage</div>\n <label class=\"lineage-option\" [class.lineage-option--selected]=\"rememberLineage\">\n <input\n type=\"radio\"\n name=\"lineage\"\n [checked]=\"rememberLineage\"\n (change)=\"OnLineageChange(true)\" />\n <div>\n <div class=\"lineage-option__title\">Remember source view (recommended)</div>\n <div class=\"lineage-option__desc\">\n Stores <code>SourceViewID</code> and (optionally) the current filter. Enables\n <strong>Refresh from source</strong> later. You'll choose Additive or Sync each refresh.\n </div>\n </div>\n </label>\n <label class=\"lineage-option\" [class.lineage-option--selected]=\"!rememberLineage\">\n <input\n type=\"radio\"\n name=\"lineage\"\n [checked]=\"!rememberLineage\"\n (change)=\"OnLineageChange(false)\" />\n <div>\n <div class=\"lineage-option__title\">One-time snapshot</div>\n <div class=\"lineage-option__desc\">\n No lineage stored. List is fully static; later changes to the view do not propagate.\n </div>\n </div>\n </label>\n </div>\n\n @if (rememberLineage) {\n <div class=\"field--inline\">\n <input\n id=\"save-view-freeze\"\n type=\"checkbox\"\n [(ngModel)]=\"useSnapshot\"\n name=\"useSnapshot\" />\n <label for=\"save-view-freeze\">\n Freeze filter at current value\n <span class=\"muted\">\n (<code>UseSnapshot = true</code>) \u2014 refresh re-runs the saved filter, even if the view is later edited\n </span>\n </label>\n </div>\n\n <div class=\"field\">\n <label class=\"field__label\" for=\"save-view-mode\">Default refresh mode</label>\n <select\n id=\"save-view-mode\"\n class=\"mj-input mj-select\"\n [(ngModel)]=\"refreshMode\"\n name=\"refreshMode\">\n <option value=\"Additive\">Additive \u2014 only adds new records on refresh</option>\n <option value=\"Sync\">Sync \u2014 reconciles in both directions (may remove records)</option>\n </select>\n </div>\n }\n </form>\n\n <mj-dialog-actions>\n <button mjButton variant=\"primary\" type=\"button\" [disabled]=\"!canSave\" (click)=\"OnSave()\">\n <i class=\"fa-solid fa-check\"></i>\n {{ confirmButtonLabel }}\n </button>\n <button mjButton variant=\"outline\" type=\"button\" (click)=\"OnCancel()\">Cancel</button>\n </mj-dialog-actions>\n </mj-dialog>\n}\n", styles: [":host {\n display: contents;\n}\n\n.save-view-form {\n padding: 16px 20px 8px;\n display: flex;\n flex-direction: column;\n gap: 14px;\n color: var(--mj-text-primary);\n font-size: 13px;\n}\n\n.info-banner {\n display: flex;\n gap: 10px;\n padding: 10px 12px;\n background: var(--mj-status-info-bg);\n border: 1px solid var(--mj-status-info-border);\n color: var(--mj-status-info-text);\n border-radius: 8px;\n font-size: 12.5px;\n line-height: 1.5;\n}\n\n.field {\n display: flex;\n flex-direction: column;\n gap: 6px;\n}\n\n.field__label {\n font-size: 11px;\n letter-spacing: 0.04em;\n text-transform: uppercase;\n color: var(--mj-text-muted);\n}\n\n.field--inline {\n display: flex;\n align-items: flex-start;\n gap: 10px;\n font-size: 12.5px;\n}\n\n.field--inline input[type='checkbox'] {\n margin-top: 3px;\n cursor: pointer;\n}\n\n.divider {\n height: 1px;\n background: var(--mj-border-default);\n margin: 4px 0;\n}\n\n.lineage-section {\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n\n.lineage-option {\n display: flex;\n align-items: flex-start;\n gap: 10px;\n padding: 10px;\n border: 1px solid var(--mj-border-default);\n border-radius: 8px;\n cursor: pointer;\n background: var(--mj-bg-surface);\n}\n\n.lineage-option--selected {\n border-color: var(--mj-brand-primary);\n background: color-mix(in srgb, var(--mj-brand-primary) 6%, var(--mj-bg-surface));\n}\n\n.lineage-option input[type='radio'] {\n margin-top: 3px;\n cursor: pointer;\n}\n\n.lineage-option__title {\n font-weight: 600;\n font-size: 13px;\n}\n\n.lineage-option__desc {\n font-size: 12px;\n color: var(--mj-text-muted);\n margin-top: 2px;\n line-height: 1.5;\n}\n\n.muted {\n color: var(--mj-text-muted);\n}\n"] }]
|
|
302
|
+
}], null, { Visible: [{
|
|
303
|
+
type: Input
|
|
304
|
+
}], ViewId: [{
|
|
305
|
+
type: Input
|
|
306
|
+
}], ViewName: [{
|
|
307
|
+
type: Input
|
|
308
|
+
}], RecordCount: [{
|
|
309
|
+
type: Input
|
|
310
|
+
}], Save: [{
|
|
311
|
+
type: Output
|
|
312
|
+
}], Cancel: [{
|
|
313
|
+
type: Output
|
|
314
|
+
}] }); })();
|
|
315
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SaveViewAsListDialogComponent, { className: "SaveViewAsListDialogComponent", filePath: "src/lib/components/save-view-as-list-dialog/save-view-as-list-dialog.component.ts", lineNumber: 39 }); })();
|
|
316
|
+
//# sourceMappingURL=save-view-as-list-dialog.component.js.map
|
package/dist/lib/components/save-view-as-list-dialog/save-view-as-list-dialog.component.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"save-view-as-list-dialog.component.js","sourceRoot":"","sources":["../../../../src/lib/components/save-view-as-list-dialog/save-view-as-list-dialog.component.ts","../../../../src/lib/components/save-view-as-list-dialog/save-view-as-list-dialog.component.html"],"names":[],"mappings":"AA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6BAA6B,mBAGtB,uBAAuB,CAAC,MAAM;;kBAM9C,KAAK;;kBAWL,KAAK;;kBAGL,KAAK;;kBAGL,KAAK;;kBAEL,MAAM;;kBACN,MAAM;;kFAxBI,6BAA6B","sourcesContent":["import { ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, Input, OnInit, Output, inject } from '@angular/core';\n\nimport { BaseAngularComponent } from '@memberjunction/ng-base-types';\nimport { RunView } from '@memberjunction/core';\nimport { MJListCategoryEntity } from '@memberjunction/core-entities';\n\n/**\n * Form payload emitted when the user clicks Save. The parent component is\n * responsible for calling `GraphQLListsClient.MaterializeFromView` with these\n * options — we keep the dialog generic so it doesn't have to know about the\n * GraphQL transport.\n */\nexport interface SaveViewAsListResult {\n ListName: string;\n Description?: string;\n CategoryId?: string;\n RememberLineage: boolean;\n UseSnapshot: boolean;\n RefreshMode: 'Additive' | 'Sync';\n}\n\n/**\n * Dialog for materializing a User View into a new static List. Matches\n * mockup `09-save-view-as-list.html`: name + description + category, then\n * a radio group for source-lineage (remember vs one-time snapshot), then a\n * \"freeze filter\" checkbox that maps to `UseSnapshot` on the list.\n *\n * The dialog is reusable — pass `ViewId` + `ViewName` + the displayed\n * record count and listen for `Save` / `Cancel`. Multi-provider safe via\n * `BaseAngularComponent.ProviderToUse`.\n */\n@Component({\n standalone: false,\n selector: 'mj-save-view-as-list-dialog',\n templateUrl: './save-view-as-list-dialog.component.html',\n styleUrls: ['./save-view-as-list-dialog.component.css'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SaveViewAsListDialogComponent extends BaseAngularComponent implements OnInit {\n private readonly cdr = inject(ChangeDetectorRef);\n\n /** Visibility toggle, getter/setter so opening resets the form. */\n @Input()\n get Visible(): boolean {\n return this._visible;\n }\n set Visible(value: boolean) {\n if (value && !this._visible) this.resetForm();\n this._visible = value;\n }\n private _visible = false;\n\n /** Required — the User View we're materializing from. */\n @Input() ViewId: string | null = null;\n\n /** Display name of the source view (shown in the info banner + default list name). */\n @Input() ViewName: string | null = null;\n\n /** Optional — record count shown in the button label + info banner. */\n @Input() RecordCount: number | null = null;\n\n @Output() Save = new EventEmitter<SaveViewAsListResult>();\n @Output() Cancel = new EventEmitter<void>();\n\n public listName = '';\n public description = '';\n public categoryId: string | null = null;\n public rememberLineage = true;\n public useSnapshot = true;\n public refreshMode: 'Additive' | 'Sync' = 'Additive';\n\n public categories: MJListCategoryEntity[] = [];\n public loadingCategories = false;\n public submitting = false;\n\n async ngOnInit(): Promise<void> {\n await this.loadCategories();\n }\n\n public OnSave(): void {\n if (!this.canSave) return;\n this.submitting = true;\n const payload: SaveViewAsListResult = {\n ListName: this.listName.trim(),\n Description: this.description.trim() || undefined,\n CategoryId: this.categoryId ?? undefined,\n RememberLineage: this.rememberLineage,\n // UseSnapshot only meaningful when lineage is remembered.\n UseSnapshot: this.rememberLineage && this.useSnapshot,\n RefreshMode: this.refreshMode,\n };\n this.Save.emit(payload);\n }\n\n public OnCancel(): void {\n this.Cancel.emit();\n }\n\n public OnLineageChange(remember: boolean): void {\n this.rememberLineage = remember;\n // If lineage is off, snapshot has no meaning — keep the checkbox state\n // intact so re-enabling lineage restores it, but the emitted payload\n // forces UseSnapshot=false (see `OnSave`).\n }\n\n public get canSave(): boolean {\n return !!this.ViewId && this.listName.trim().length > 0 && !this.submitting;\n }\n\n public get confirmButtonLabel(): string {\n if (this.submitting) return 'Saving...';\n if (this.RecordCount != null) return `Save List (${this.RecordCount} records)`;\n return 'Save List';\n }\n\n /**\n * Load list categories for the category dropdown. Multi-provider safe.\n * Failures degrade gracefully — the dropdown just shows \"Uncategorized\"\n * and we log so the user can troubleshoot.\n */\n private async loadCategories(): Promise<void> {\n this.loadingCategories = true;\n try {\n const rv = RunView.FromMetadataProvider(this.ProviderToUse);\n const result = await rv.RunView<MJListCategoryEntity>({\n EntityName: 'MJ: List Categories',\n OrderBy: 'Name ASC',\n ResultType: 'entity_object',\n });\n if (result.Success) {\n this.categories = result.Results ?? [];\n }\n } finally {\n this.loadingCategories = false;\n this.cdr.markForCheck();\n }\n }\n\n private resetForm(): void {\n this.listName = this.ViewName ? `${this.ViewName} — Snapshot ${new Date().toISOString().slice(0, 10)}` : '';\n this.description = '';\n this.categoryId = null;\n this.rememberLineage = true;\n this.useSnapshot = true;\n this.refreshMode = 'Additive';\n this.submitting = false;\n }\n}\n","@if (Visible) {\n <mj-dialog\n [Visible]=\"true\"\n [Width]=\"560\"\n Title=\"Save View Results as List\"\n (Close)=\"OnCancel()\">\n <form class=\"save-view-form\" (submit)=\"$event.preventDefault(); OnSave()\">\n <div class=\"info-banner\">\n <i class=\"fa-solid fa-circle-info\"></i>\n <div>\n Materializes\n @if (RecordCount != null) {\n <strong>{{ RecordCount }} records</strong>\n } @else {\n <strong>view results</strong>\n }\n @if (ViewName) {\n from <strong>{{ ViewName }}</strong>\n }\n into a static List. The list can be refreshed from this view later if you keep lineage on.\n </div>\n </div>\n\n <div class=\"field\">\n <label class=\"field__label\" for=\"save-view-list-name\">List name</label>\n <input\n id=\"save-view-list-name\"\n class=\"mj-input\"\n [(ngModel)]=\"listName\"\n name=\"listName\"\n required\n autofocus />\n </div>\n\n <div class=\"field\">\n <label class=\"field__label\" for=\"save-view-description\">Description</label>\n <textarea\n id=\"save-view-description\"\n class=\"mj-input\"\n [(ngModel)]=\"description\"\n name=\"description\"\n rows=\"2\"></textarea>\n </div>\n\n <div class=\"field\">\n <label class=\"field__label\" for=\"save-view-category\">Category</label>\n <select\n id=\"save-view-category\"\n class=\"mj-input mj-select\"\n [(ngModel)]=\"categoryId\"\n name=\"categoryId\"\n [disabled]=\"loadingCategories\">\n <option [ngValue]=\"null\">(uncategorized)</option>\n @for (cat of categories; track cat.ID) {\n <option [ngValue]=\"cat.ID\">{{ cat.Name }}</option>\n }\n </select>\n </div>\n\n <div class=\"divider\"></div>\n\n <div class=\"lineage-section\">\n <div class=\"field__label\">Source lineage</div>\n <label class=\"lineage-option\" [class.lineage-option--selected]=\"rememberLineage\">\n <input\n type=\"radio\"\n name=\"lineage\"\n [checked]=\"rememberLineage\"\n (change)=\"OnLineageChange(true)\" />\n <div>\n <div class=\"lineage-option__title\">Remember source view (recommended)</div>\n <div class=\"lineage-option__desc\">\n Stores <code>SourceViewID</code> and (optionally) the current filter. Enables\n <strong>Refresh from source</strong> later. You'll choose Additive or Sync each refresh.\n </div>\n </div>\n </label>\n <label class=\"lineage-option\" [class.lineage-option--selected]=\"!rememberLineage\">\n <input\n type=\"radio\"\n name=\"lineage\"\n [checked]=\"!rememberLineage\"\n (change)=\"OnLineageChange(false)\" />\n <div>\n <div class=\"lineage-option__title\">One-time snapshot</div>\n <div class=\"lineage-option__desc\">\n No lineage stored. List is fully static; later changes to the view do not propagate.\n </div>\n </div>\n </label>\n </div>\n\n @if (rememberLineage) {\n <div class=\"field--inline\">\n <input\n id=\"save-view-freeze\"\n type=\"checkbox\"\n [(ngModel)]=\"useSnapshot\"\n name=\"useSnapshot\" />\n <label for=\"save-view-freeze\">\n Freeze filter at current value\n <span class=\"muted\">\n (<code>UseSnapshot = true</code>) — refresh re-runs the saved filter, even if the view is later edited\n </span>\n </label>\n </div>\n\n <div class=\"field\">\n <label class=\"field__label\" for=\"save-view-mode\">Default refresh mode</label>\n <select\n id=\"save-view-mode\"\n class=\"mj-input mj-select\"\n [(ngModel)]=\"refreshMode\"\n name=\"refreshMode\">\n <option value=\"Additive\">Additive — only adds new records on refresh</option>\n <option value=\"Sync\">Sync — reconciles in both directions (may remove records)</option>\n </select>\n </div>\n }\n </form>\n\n <mj-dialog-actions>\n <button mjButton variant=\"primary\" type=\"button\" [disabled]=\"!canSave\" (click)=\"OnSave()\">\n <i class=\"fa-solid fa-check\"></i>\n {{ confirmButtonLabel }}\n </button>\n <button mjButton variant=\"outline\" type=\"button\" (click)=\"OnCancel()\">Cancel</button>\n </mj-dialog-actions>\n </mj-dialog>\n}\n"]}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { EventEmitter, OnInit } from '@angular/core';
|
|
2
|
+
import { BaseAngularComponent } from '@memberjunction/ng-base-types';
|
|
3
|
+
import type { SharedListSummary, SharePermissionLevel } from '@memberjunction/lists-base';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
/**
|
|
6
|
+
* "Shared With Me" view (mockup 17). Lists every `MJ: List` the current
|
|
7
|
+
* user has direct-share access to, plus a permission badge per row.
|
|
8
|
+
*
|
|
9
|
+
* Drop into the Lists app as a tab/resource. Click events bubble up via
|
|
10
|
+
* `OpenList` so the host app can route through its own navigation
|
|
11
|
+
* (NavigationService etc.) — keeps this component framework-agnostic.
|
|
12
|
+
*/
|
|
13
|
+
export declare class ListsSharedWithMeComponent extends BaseAngularComponent implements OnInit {
|
|
14
|
+
private readonly cdr;
|
|
15
|
+
/** Emitted when the user clicks a card. Host wires this to navigation.
|
|
16
|
+
* Includes ListName so the host can open a properly-titled tab without
|
|
17
|
+
* a second fetch. */
|
|
18
|
+
OpenList: EventEmitter<{
|
|
19
|
+
ListID: string;
|
|
20
|
+
ListName: string;
|
|
21
|
+
}>;
|
|
22
|
+
/** Permission-level filter (empty = "All Permissions"). */
|
|
23
|
+
filterLevel: SharePermissionLevel | '';
|
|
24
|
+
/** Free-text filter on list name. */
|
|
25
|
+
filterText: string;
|
|
26
|
+
loading: boolean;
|
|
27
|
+
errorMessage: string | null;
|
|
28
|
+
private allShares;
|
|
29
|
+
ngOnInit(): Promise<void>;
|
|
30
|
+
get visibleShares(): SharedListSummary[];
|
|
31
|
+
OnFilterChange(): void;
|
|
32
|
+
OnCardClick(listId: string): void;
|
|
33
|
+
Refresh(): Promise<void>;
|
|
34
|
+
/**
|
|
35
|
+
* Friendly-format the "shared at" timestamp into a relative phrase
|
|
36
|
+
* ("3d ago", "2w ago"). Matches the mockup; falls back to absolute on
|
|
37
|
+
* older entries.
|
|
38
|
+
*/
|
|
39
|
+
formatRelative(date: Date): string;
|
|
40
|
+
/** Badge variant class for the permission-level chip. */
|
|
41
|
+
badgeClass(level: SharePermissionLevel): string;
|
|
42
|
+
badgeLabel(level: SharePermissionLevel): string;
|
|
43
|
+
private loadShares;
|
|
44
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ListsSharedWithMeComponent, never>;
|
|
45
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ListsSharedWithMeComponent, "mj-lists-shared-with-me", never, {}, { "OpenList": "OpenList"; }, never, never, false, never>;
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=shared-with-me.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared-with-me.component.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/shared-with-me/shared-with-me.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyD,YAAY,EAAE,MAAM,EAAkB,MAAM,eAAe,CAAC;AAE5H,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAErE,OAAO,KAAK,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;;AAE1F;;;;;;;GAOG;AACH,qBAOa,0BAA2B,SAAQ,oBAAqB,YAAW,MAAM;IACpF,OAAO,CAAC,QAAQ,CAAC,GAAG,CAA6B;IAEjD;;0BAEsB;IACZ,QAAQ;gBAA8B,MAAM;kBAAY,MAAM;OAAM;IAE9E,2DAA2D;IACpD,WAAW,EAAE,oBAAoB,GAAG,EAAE,CAAM;IAEnD,qCAAqC;IAC9B,UAAU,SAAM;IAEhB,OAAO,UAAS;IAChB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAQ;IAC1C,OAAO,CAAC,SAAS,CAA2B;IAEtC,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAI/B,IAAW,aAAa,IAAI,iBAAiB,EAAE,CAO9C;IAEM,cAAc,IAAI,IAAI;IAItB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAK3B,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAIrC;;;;OAIG;IACI,cAAc,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM;IAiBzC,yDAAyD;IAClD,UAAU,CAAC,KAAK,EAAE,oBAAoB,GAAG,MAAM;IAW/C,UAAU,CAAC,KAAK,EAAE,oBAAoB,GAAG,MAAM;YAWxC,UAAU;yCAzFb,0BAA0B;2CAA1B,0BAA0B;CAyGtC"}
|