@memberjunction/ng-record-process-studio 6.2.0-edge.4 → 6.2.0-edge.5

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.
@@ -46,6 +46,13 @@ export declare class RecordProcessEditorComponent extends BaseAngularComponent i
46
46
  DriverClass: string;
47
47
  Context: EntityActionUXContext;
48
48
  } | null;
49
+ /**
50
+ * Whether `entity` is the record's stored target entity. The picker marks it with [selected] on its option:
51
+ * a [value] on the <select> runs before @for creates the options, so the first entity would show.
52
+ */
53
+ IsSavedEntity(entity: EntityInfo): boolean;
54
+ /** Whether the entity picker lists the record's stored entity; when it does not, the placeholder is selected. */
55
+ get SavedEntityListed(): boolean;
49
56
  get CanSave(): boolean;
50
57
  get CanPreview(): boolean;
51
58
  ngOnInit(): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"record-process-editor.component.d.ts","sourceRoot":"","sources":["../../../src/lib/record-process-editor/record-process-editor.component.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAyD,YAAY,EAAS,MAAM,EAAkB,MAAM,eAAe,CAAC;AACnI,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAiB,KAAK,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC1E,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAA2D,KAAK,qBAAqB,EAAE,KAAK,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAErK,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,mCAAmC,CAAC;;AAKzE,qBA+Ha,4BAA6B,SAAQ,oBAAqB,YAAW,MAAM;IACpF,OAAO,CAAC,GAAG,CAA6B;IAExC,6FAA6F;IACpF,MAAM,EAAE,qBAAqB,GAAG,IAAI,CAAQ;IACrD,wEAAwE;IAC/D,eA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AAa,CAAC,OAAO,EAAE,YAAY,GAAG,IAAI;IAM1C,6CAA6C;IAC7C,aAAa,CAAC,OAAO,EAAE,YAAY,GAAG,IAAI;IAI1C,2BAA2B,CAAC,IAAI,EAAE,eAAe,GAAG,IAAI;IAQxD,2DAA2D;IAC3D,2BAA2B,CAAC,IAAI,EAAE,eAAe,GAAG,IAAI;IAIxD,qDAAqD;IAC/C,IAAI,IAAI,OAAO,CAAC,OAAO,CAAC;IAmB9B,4FAA4F;IACtF,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAwB9B,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,IAAI;IAKlD,6CAA6C;IAC7C,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,IAAI;IAIlD,MAAM,IAAI,IAAI;IAEd,OAAO,CAAC,iBAAiB;yCA5LhB,4BAA4B;2CAA5B,4BAA4B;CA+LxC"}
1
+ {"version":3,"file":"record-process-editor.component.d.ts","sourceRoot":"","sources":["../../../src/lib/record-process-editor/record-process-editor.component.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAyD,YAAY,EAAS,MAAM,EAAkB,MAAM,eAAe,CAAC;AACnI,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAA6B,KAAK,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtF,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAA2D,KAAK,qBAAqB,EAAE,KAAK,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAErK,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,mCAAmC,CAAC;;AAKzE,qBA+Ha,4BAA6B,SAAQ,oBAAqB,YAAW,MAAM;IACpF,OAAO,CAAC,GAAG,CAA6B;IAExC,6FAA6F;IACpF,MAAM,EAAE,qBAAqB,GAAG,IAA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K,EAAE,KAAK,GAAG,IAAI;IAI5G,cAAc,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IAOlC,8CAA8C;IAC9C,cAAc,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IAIlC,aAAa,CAAC,OAAO,EAAE,YAAY,GAAG,IAAI;IAM1C,6CAA6C;IAC7C,aAAa,CAAC,OAAO,EAAE,YAAY,GAAG,IAAI;IAI1C,2BAA2B,CAAC,IAAI,EAAE,eAAe,GAAG,IAAI;IAQxD,2DAA2D;IAC3D,2BAA2B,CAAC,IAAI,EAAE,eAAe,GAAG,IAAI;IAIxD,qDAAqD;IAC/C,IAAI,IAAI,OAAO,CAAC,OAAO,CAAC;IAmB9B,4FAA4F;IACtF,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAwB9B,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,IAAI;IAKlD,6CAA6C;IAC7C,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,IAAI;IAIlD,MAAM,IAAI,IAAI;IAEd,OAAO,CAAC,iBAAiB;yCAzMhB,4BAA4B;2CAA5B,4BAA4B;CA4MxC"}
@@ -10,7 +10,7 @@
10
10
  */
11
11
  import { ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, Input, Output, inject } from '@angular/core';
12
12
  import { BaseAngularComponent } from '@memberjunction/ng-base-types';
13
- import { SafeJSONParse } from '@memberjunction/global';
13
+ import { SafeJSONParse, UUIDsEqual } from '@memberjunction/global';
14
14
  import { FieldRulesBuilderComponent, EntityActionUXHostComponent } from '@memberjunction/ng-entity-action-ux';
15
15
  import { MJButtonDirective } from '@memberjunction/ng-ui-components';
16
16
  import { FeaturePipelineBuilderComponent } from '../feature-pipeline-builder/feature-pipeline-builder.component';
@@ -23,12 +23,13 @@ function RecordProcessEditorComponent_Conditional_0_Template(rf, ctx) { if (rf &
23
23
  i0.ɵɵelementEnd();
24
24
  } }
25
25
  function RecordProcessEditorComponent_Conditional_1_For_40_Template(rf, ctx) { if (rf & 1) {
26
- i0.ɵɵelementStart(0, "option", 17);
26
+ i0.ɵɵelementStart(0, "option", 18);
27
27
  i0.ɵɵtext(1);
28
28
  i0.ɵɵelementEnd();
29
29
  } if (rf & 2) {
30
30
  const e_r3 = ctx.$implicit;
31
- i0.ɵɵproperty("value", e_r3.ID);
31
+ const ctx_r1 = i0.ɵɵnextContext(2);
32
+ i0.ɵɵproperty("value", e_r3.ID)("selected", ctx_r1.IsSavedEntity(e_r3));
32
33
  i0.ɵɵadvance();
33
34
  i0.ɵɵtextInterpolate(e_r3.DisplayName || e_r3.Name);
34
35
  } }
@@ -36,10 +37,10 @@ function RecordProcessEditorComponent_Conditional_1_Conditional_59_Template(rf,
36
37
  const _r4 = i0.ɵɵgetCurrentView();
37
38
  i0.ɵɵelementStart(0, "div", 13)(1, "label");
38
39
  i0.ɵɵtext(2, "Filter ");
39
- i0.ɵɵelementStart(3, "span", 25);
40
+ i0.ɵɵelementStart(3, "span", 26);
40
41
  i0.ɵɵtext(4, "\u2014 overridden by the grid selection at run time");
41
42
  i0.ɵɵelementEnd()();
42
- i0.ɵɵelementStart(5, "input", 26);
43
+ i0.ɵɵelementStart(5, "input", 27);
43
44
  i0.ɵɵlistener("input", function RecordProcessEditorComponent_Conditional_1_Conditional_59_Template_input_input_5_listener($event) { i0.ɵɵrestoreView(_r4); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.set("ScopeFilter", $event)); });
44
45
  i0.ɵɵelementEnd()();
45
46
  } if (rf & 2) {
@@ -48,13 +49,13 @@ function RecordProcessEditorComponent_Conditional_1_Conditional_59_Template(rf,
48
49
  i0.ɵɵproperty("value", ctx_r1.Record.ScopeFilter || "");
49
50
  } }
50
51
  function RecordProcessEditorComponent_Conditional_1_Conditional_60_Conditional_6_Template(rf, ctx) { if (rf & 1) {
51
- i0.ɵɵelementStart(0, "span", 27);
52
+ i0.ɵɵelementStart(0, "span", 28);
52
53
  i0.ɵɵtext(1, "choose an entity first");
53
54
  i0.ɵɵelementEnd();
54
55
  } }
55
56
  function RecordProcessEditorComponent_Conditional_1_Conditional_60_Conditional_7_Template(rf, ctx) { if (rf & 1) {
56
57
  const _r5 = i0.ɵɵgetCurrentView();
57
- i0.ɵɵelementStart(0, "mj-field-rules-builder", 29);
58
+ i0.ɵɵelementStart(0, "mj-field-rules-builder", 30);
58
59
  i0.ɵɵlistener("ValueChange", function RecordProcessEditorComponent_Conditional_1_Conditional_60_Conditional_7_Template_mj_field_rules_builder_ValueChange_0_listener($event) { i0.ɵɵrestoreView(_r5); const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.onRulesChange($event)); })("ValidChange", function RecordProcessEditorComponent_Conditional_1_Conditional_60_Conditional_7_Template_mj_field_rules_builder_ValidChange_0_listener($event) { i0.ɵɵrestoreView(_r5); const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.RulesValid = $event); });
59
60
  i0.ɵɵelementEnd();
60
61
  } if (rf & 2) {
@@ -68,9 +69,9 @@ function RecordProcessEditorComponent_Conditional_1_Conditional_60_Template(rf,
68
69
  i0.ɵɵelementStart(4, "h3");
69
70
  i0.ɵɵtext(5, "Rules");
70
71
  i0.ɵɵelementEnd();
71
- i0.ɵɵconditionalCreate(6, RecordProcessEditorComponent_Conditional_1_Conditional_60_Conditional_6_Template, 2, 0, "span", 27);
72
+ i0.ɵɵconditionalCreate(6, RecordProcessEditorComponent_Conditional_1_Conditional_60_Conditional_6_Template, 2, 0, "span", 28);
72
73
  i0.ɵɵelementEnd();
73
- i0.ɵɵconditionalCreate(7, RecordProcessEditorComponent_Conditional_1_Conditional_60_Conditional_7_Template, 1, 3, "mj-field-rules-builder", 28);
74
+ i0.ɵɵconditionalCreate(7, RecordProcessEditorComponent_Conditional_1_Conditional_60_Conditional_7_Template, 1, 3, "mj-field-rules-builder", 29);
74
75
  i0.ɵɵelementEnd();
75
76
  } if (rf & 2) {
76
77
  const ctx_r1 = i0.ɵɵnextContext(2);
@@ -80,13 +81,13 @@ function RecordProcessEditorComponent_Conditional_1_Conditional_60_Template(rf,
80
81
  i0.ɵɵconditional(ctx_r1.SelectedEntityName ? 7 : -1);
81
82
  } }
82
83
  function RecordProcessEditorComponent_Conditional_1_Conditional_61_Conditional_6_Template(rf, ctx) { if (rf & 1) {
83
- i0.ɵɵelementStart(0, "span", 27);
84
+ i0.ɵɵelementStart(0, "span", 28);
84
85
  i0.ɵɵtext(1, "choose an entity first");
85
86
  i0.ɵɵelementEnd();
86
87
  } }
87
88
  function RecordProcessEditorComponent_Conditional_1_Conditional_61_Conditional_7_Template(rf, ctx) { if (rf & 1) {
88
89
  const _r6 = i0.ɵɵgetCurrentView();
89
- i0.ɵɵelementStart(0, "mj-feature-pipeline-builder", 31);
90
+ i0.ɵɵelementStart(0, "mj-feature-pipeline-builder", 32);
90
91
  i0.ɵɵlistener("ValidChange", function RecordProcessEditorComponent_Conditional_1_Conditional_61_Conditional_7_Template_mj_feature_pipeline_builder_ValidChange_0_listener($event) { i0.ɵɵrestoreView(_r6); const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.FeaturePipelineValid = $event); })("SpecChange", function RecordProcessEditorComponent_Conditional_1_Conditional_61_Conditional_7_Template_mj_feature_pipeline_builder_SpecChange_0_listener($event) { i0.ɵɵrestoreView(_r6); const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.onFeaturePipelineSpecChange($event)); });
91
92
  i0.ɵɵelementEnd();
92
93
  } if (rf & 2) {
@@ -100,9 +101,9 @@ function RecordProcessEditorComponent_Conditional_1_Conditional_61_Template(rf,
100
101
  i0.ɵɵelementStart(4, "h3");
101
102
  i0.ɵɵtext(5, "Feature Pipeline Configuration");
102
103
  i0.ɵɵelementEnd();
103
- i0.ɵɵconditionalCreate(6, RecordProcessEditorComponent_Conditional_1_Conditional_61_Conditional_6_Template, 2, 0, "span", 27);
104
+ i0.ɵɵconditionalCreate(6, RecordProcessEditorComponent_Conditional_1_Conditional_61_Conditional_6_Template, 2, 0, "span", 28);
104
105
  i0.ɵɵelementEnd();
105
- i0.ɵɵconditionalCreate(7, RecordProcessEditorComponent_Conditional_1_Conditional_61_Conditional_7_Template, 1, 2, "mj-feature-pipeline-builder", 30);
106
+ i0.ɵɵconditionalCreate(7, RecordProcessEditorComponent_Conditional_1_Conditional_61_Conditional_7_Template, 1, 2, "mj-feature-pipeline-builder", 31);
106
107
  i0.ɵɵelementEnd();
107
108
  } if (rf & 2) {
108
109
  const ctx_r1 = i0.ɵɵnextContext(2);
@@ -112,8 +113,8 @@ function RecordProcessEditorComponent_Conditional_1_Conditional_61_Template(rf,
112
113
  i0.ɵɵconditional(ctx_r1.SelectedEntityName ? 7 : -1);
113
114
  } }
114
115
  function RecordProcessEditorComponent_Conditional_1_Conditional_62_Conditional_9_Template(rf, ctx) { if (rf & 1) {
115
- i0.ɵɵelementStart(0, "span", 37);
116
- i0.ɵɵelement(1, "i", 38);
116
+ i0.ɵɵelementStart(0, "span", 38);
117
+ i0.ɵɵelement(1, "i", 39);
117
118
  i0.ɵɵtext(2);
118
119
  i0.ɵɵelementEnd();
119
120
  } if (rf & 2) {
@@ -123,21 +124,21 @@ function RecordProcessEditorComponent_Conditional_1_Conditional_62_Conditional_9
123
124
  } }
124
125
  function RecordProcessEditorComponent_Conditional_1_Conditional_62_Template(rf, ctx) { if (rf & 1) {
125
126
  const _r7 = i0.ɵɵgetCurrentView();
126
- i0.ɵɵelementStart(0, "div", 23)(1, "button", 32);
127
+ i0.ɵɵelementStart(0, "div", 24)(1, "button", 33);
127
128
  i0.ɵɵlistener("click", function RecordProcessEditorComponent_Conditional_1_Conditional_62_Template_button_click_1_listener() { i0.ɵɵrestoreView(_r7); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.Save()); });
128
- i0.ɵɵelement(2, "i", 33);
129
+ i0.ɵɵelement(2, "i", 34);
129
130
  i0.ɵɵtext(3, " Save ");
130
131
  i0.ɵɵelementEnd();
131
- i0.ɵɵelementStart(4, "button", 34);
132
+ i0.ɵɵelementStart(4, "button", 35);
132
133
  i0.ɵɵlistener("click", function RecordProcessEditorComponent_Conditional_1_Conditional_62_Template_button_click_4_listener() { i0.ɵɵrestoreView(_r7); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.Preview()); });
133
- i0.ɵɵelement(5, "i", 35);
134
+ i0.ɵɵelement(5, "i", 36);
134
135
  i0.ɵɵtext(6, " Preview changes");
135
136
  i0.ɵɵelementEnd();
136
- i0.ɵɵelementStart(7, "button", 36);
137
+ i0.ɵɵelementStart(7, "button", 37);
137
138
  i0.ɵɵlistener("click", function RecordProcessEditorComponent_Conditional_1_Conditional_62_Template_button_click_7_listener() { i0.ɵɵrestoreView(_r7); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.Cancel()); });
138
139
  i0.ɵɵtext(8, "Cancel");
139
140
  i0.ɵɵelementEnd();
140
- i0.ɵɵconditionalCreate(9, RecordProcessEditorComponent_Conditional_1_Conditional_62_Conditional_9_Template, 3, 1, "span", 37);
141
+ i0.ɵɵconditionalCreate(9, RecordProcessEditorComponent_Conditional_1_Conditional_62_Conditional_9_Template, 3, 1, "span", 38);
141
142
  i0.ɵɵelementEnd();
142
143
  } if (rf & 2) {
143
144
  const ctx_r1 = i0.ɵɵnextContext(2);
@@ -152,7 +153,7 @@ function RecordProcessEditorComponent_Conditional_1_Conditional_62_Template(rf,
152
153
  } }
153
154
  function RecordProcessEditorComponent_Conditional_1_Conditional_63_Template(rf, ctx) { if (rf & 1) {
154
155
  const _r8 = i0.ɵɵgetCurrentView();
155
- i0.ɵɵelementStart(0, "mj-entity-action-ux-host", 39);
156
+ i0.ɵɵelementStart(0, "mj-entity-action-ux-host", 40);
156
157
  i0.ɵɵlistener("Completed", function RecordProcessEditorComponent_Conditional_1_Conditional_63_Template_mj_entity_action_ux_host_Completed_0_listener($event) { i0.ɵɵrestoreView(_r8); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.onPreviewDone($event)); })("Cancelled", function RecordProcessEditorComponent_Conditional_1_Conditional_63_Template_mj_entity_action_ux_host_Cancelled_0_listener() { i0.ɵɵrestoreView(_r8); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.PreviewDriver = null); });
157
158
  i0.ɵɵelementEnd();
158
159
  } if (rf & 2) {
@@ -202,25 +203,25 @@ function RecordProcessEditorComponent_Conditional_1_Template(rf, ctx) { if (rf &
202
203
  i0.ɵɵelementStart(32, "div", 15)(33, "div", 7)(34, "label");
203
204
  i0.ɵɵtext(35, "Entity");
204
205
  i0.ɵɵelementEnd();
205
- i0.ɵɵelementStart(36, "select", 9);
206
+ i0.ɵɵelementStart(36, "select", 16);
206
207
  i0.ɵɵlistener("change", function RecordProcessEditorComponent_Conditional_1_Template_select_change_36_listener($event) { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onEntityChange($event)); });
207
- i0.ɵɵelementStart(37, "option", 16);
208
+ i0.ɵɵelementStart(37, "option", 17);
208
209
  i0.ɵɵtext(38, "\u2014 choose an entity \u2014");
209
210
  i0.ɵɵelementEnd();
210
- i0.ɵɵrepeaterCreate(39, RecordProcessEditorComponent_Conditional_1_For_40_Template, 2, 2, "option", 17, _forTrack0);
211
+ i0.ɵɵrepeaterCreate(39, RecordProcessEditorComponent_Conditional_1_For_40_Template, 2, 3, "option", 18, _forTrack0);
211
212
  i0.ɵɵelementEnd()();
212
213
  i0.ɵɵelementStart(41, "div", 7)(42, "label");
213
214
  i0.ɵɵtext(43, "Default scope");
214
215
  i0.ɵɵelementEnd();
215
216
  i0.ɵɵelementStart(44, "select", 9);
216
217
  i0.ɵɵlistener("change", function RecordProcessEditorComponent_Conditional_1_Template_select_change_44_listener($event) { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.set("ScopeType", $event)); });
217
- i0.ɵɵelementStart(45, "option", 18);
218
+ i0.ɵɵelementStart(45, "option", 19);
218
219
  i0.ɵɵtext(46, "Filter");
219
220
  i0.ɵɵelementEnd();
220
- i0.ɵɵelementStart(47, "option", 19);
221
+ i0.ɵɵelementStart(47, "option", 20);
221
222
  i0.ɵɵtext(48, "A view");
222
223
  i0.ɵɵelementEnd();
223
- i0.ɵɵelementStart(49, "option", 20);
224
+ i0.ɵɵelementStart(49, "option", 21);
224
225
  i0.ɵɵtext(50, "A list");
225
226
  i0.ɵɵelementEnd()()();
226
227
  i0.ɵɵelementStart(51, "div", 7)(52, "label");
@@ -228,19 +229,19 @@ function RecordProcessEditorComponent_Conditional_1_Template(rf, ctx) { if (rf &
228
229
  i0.ɵɵelementEnd();
229
230
  i0.ɵɵelementStart(54, "select", 9);
230
231
  i0.ɵɵlistener("change", function RecordProcessEditorComponent_Conditional_1_Template_select_change_54_listener($event) { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.set("WorkType", $event)); });
231
- i0.ɵɵelementStart(55, "option", 21);
232
+ i0.ɵɵelementStart(55, "option", 22);
232
233
  i0.ɵɵtext(56, "Field Rules");
233
234
  i0.ɵɵelementEnd();
234
- i0.ɵɵelementStart(57, "option", 22);
235
+ i0.ɵɵelementStart(57, "option", 23);
235
236
  i0.ɵɵtext(58, "Feature Pipeline (Infer)");
236
237
  i0.ɵɵelementEnd()()()();
237
238
  i0.ɵɵconditionalCreate(59, RecordProcessEditorComponent_Conditional_1_Conditional_59_Template, 6, 1, "div", 13);
238
239
  i0.ɵɵelementEnd();
239
240
  i0.ɵɵconditionalCreate(60, RecordProcessEditorComponent_Conditional_1_Conditional_60_Template, 8, 2, "section", 3);
240
241
  i0.ɵɵconditionalCreate(61, RecordProcessEditorComponent_Conditional_1_Conditional_61_Template, 8, 2, "section", 3);
241
- i0.ɵɵconditionalCreate(62, RecordProcessEditorComponent_Conditional_1_Conditional_62_Template, 10, 9, "div", 23);
242
+ i0.ɵɵconditionalCreate(62, RecordProcessEditorComponent_Conditional_1_Conditional_62_Template, 10, 9, "div", 24);
242
243
  i0.ɵɵelementEnd();
243
- i0.ɵɵconditionalCreate(63, RecordProcessEditorComponent_Conditional_1_Conditional_63_Template, 1, 2, "mj-entity-action-ux-host", 24);
244
+ i0.ɵɵconditionalCreate(63, RecordProcessEditorComponent_Conditional_1_Conditional_63_Template, 1, 2, "mj-entity-action-ux-host", 25);
244
245
  } if (rf & 2) {
245
246
  const ctx_r1 = i0.ɵɵnextContext();
246
247
  i0.ɵɵadvance(11);
@@ -249,9 +250,9 @@ function RecordProcessEditorComponent_Conditional_1_Template(rf, ctx) { if (rf &
249
250
  i0.ɵɵproperty("value", ctx_r1.Record.Status || "Active");
250
251
  i0.ɵɵadvance(10);
251
252
  i0.ɵɵproperty("value", ctx_r1.Record.Description || "");
252
- i0.ɵɵadvance(11);
253
- i0.ɵɵproperty("value", ctx_r1.Record.EntityID || "");
254
- i0.ɵɵadvance(3);
253
+ i0.ɵɵadvance(12);
254
+ i0.ɵɵproperty("selected", !ctx_r1.SavedEntityListed);
255
+ i0.ɵɵadvance(2);
255
256
  i0.ɵɵrepeater(ctx_r1.Entities);
256
257
  i0.ɵɵadvance(5);
257
258
  i0.ɵɵproperty("value", ctx_r1.Record.ScopeType || "Filter");
@@ -295,6 +296,17 @@ export class RecordProcessEditorComponent extends BaseAngularComponent {
295
296
  Saving = false;
296
297
  ErrorMessage = '';
297
298
  PreviewDriver = null;
299
+ /**
300
+ * Whether `entity` is the record's stored target entity. The picker marks it with [selected] on its option:
301
+ * a [value] on the <select> runs before @for creates the options, so the first entity would show.
302
+ */
303
+ IsSavedEntity(entity) {
304
+ return !!this.Record?.EntityID && UUIDsEqual(entity.ID, this.Record.EntityID);
305
+ }
306
+ /** Whether the entity picker lists the record's stored entity; when it does not, the placeholder is selected. */
307
+ get SavedEntityListed() {
308
+ return this.Entities.some((e) => this.IsSavedEntity(e));
309
+ }
298
310
  get CanSave() {
299
311
  if (!this.Record?.Name || !this.Record?.EntityID)
300
312
  return false;
@@ -475,7 +487,7 @@ export class RecordProcessEditorComponent extends BaseAngularComponent {
475
487
  this.SelectedEntityName = this.Record?.EntityID ? (this.ProviderToUse.EntityByID(this.Record.EntityID)?.Name ?? '') : '';
476
488
  }
477
489
  static ɵfac = /*@__PURE__*/ (() => { let ɵRecordProcessEditorComponent_BaseFactory; return function RecordProcessEditorComponent_Factory(__ngFactoryType__) { return (ɵRecordProcessEditorComponent_BaseFactory || (ɵRecordProcessEditorComponent_BaseFactory = i0.ɵɵgetInheritedFactory(RecordProcessEditorComponent)))(__ngFactoryType__ || RecordProcessEditorComponent); }; })();
478
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: RecordProcessEditorComponent, selectors: [["mj-record-process-editor"]], inputs: { Record: "Record", RecordProcessID: "RecordProcessID", DefaultEntityID: "DefaultEntityID", DefaultWorkType: "DefaultWorkType", DefaultCategoryID: "DefaultCategoryID", ShowToolbar: "ShowToolbar" }, outputs: { Saved: "Saved", Cancelled: "Cancelled" }, features: [i0.ɵɵInheritDefinitionFeature], decls: 2, vars: 1, consts: [[1, "rpe-loading"], [1, "fa-solid", "fa-circle-notch", "fa-spin"], [1, "rpe"], [1, "rpe-sec"], [1, "rpe-sec-h"], [1, "num"], [1, "rpe-grid2"], [1, "field"], ["placeholder", "e.g. Mark idle prompts for review", 1, "mj-input", 3, "input", "value"], [1, "mj-input", 3, "change", "value"], ["value", "Draft"], ["value", "Active"], ["value", "Disabled"], [1, "field", "rpe-mt"], ["placeholder", "What does this process do?", 1, "mj-input", 3, "input", "value"], [1, "rpe-grid3"], ["value", "", "disabled", ""], [3, "value"], ["value", "Filter"], ["value", "View"], ["value", "List"], ["value", "FieldRules"], ["value", "Infer"], [1, "rpe-bar"], [3, "DriverClass", "Context"], [1, "muted"], ["placeholder", "e.g. Status = 'Active'", 1, "mj-input", "mono", 3, "input", "value"], [1, "muted", "rpe-h-note"], [3, "EntityName", "Value", "Provider"], [3, "ValueChange", "ValidChange", "EntityName", "Value", "Provider"], [3, "Record", "EntityID"], [3, "ValidChange", "SpecChange", "Record", "EntityID"], ["mjButton", "", "variant", "primary", 3, "click", "disabled"], [1, "fa-solid"], ["mjButton", "", 3, "click", "disabled"], [1, "fa-solid", "fa-flask"], ["mjButton", "", "variant", "flat", 3, "click"], [1, "rpe-err"], [1, "fa-solid", "fa-triangle-exclamation"], [3, "Completed", "Cancelled", "DriverClass", "Context"]], template: function RecordProcessEditorComponent_Template(rf, ctx) { if (rf & 1) {
490
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: RecordProcessEditorComponent, selectors: [["mj-record-process-editor"]], inputs: { Record: "Record", RecordProcessID: "RecordProcessID", DefaultEntityID: "DefaultEntityID", DefaultWorkType: "DefaultWorkType", DefaultCategoryID: "DefaultCategoryID", ShowToolbar: "ShowToolbar" }, outputs: { Saved: "Saved", Cancelled: "Cancelled" }, features: [i0.ɵɵInheritDefinitionFeature], decls: 2, vars: 1, consts: [[1, "rpe-loading"], [1, "fa-solid", "fa-circle-notch", "fa-spin"], [1, "rpe"], [1, "rpe-sec"], [1, "rpe-sec-h"], [1, "num"], [1, "rpe-grid2"], [1, "field"], ["placeholder", "e.g. Mark idle prompts for review", 1, "mj-input", 3, "input", "value"], [1, "mj-input", 3, "change", "value"], ["value", "Draft"], ["value", "Active"], ["value", "Disabled"], [1, "field", "rpe-mt"], ["placeholder", "What does this process do?", 1, "mj-input", 3, "input", "value"], [1, "rpe-grid3"], [1, "mj-input", 3, "change"], ["value", "", "disabled", "", 3, "selected"], [3, "value", "selected"], ["value", "Filter"], ["value", "View"], ["value", "List"], ["value", "FieldRules"], ["value", "Infer"], [1, "rpe-bar"], [3, "DriverClass", "Context"], [1, "muted"], ["placeholder", "e.g. Status = 'Active'", 1, "mj-input", "mono", 3, "input", "value"], [1, "muted", "rpe-h-note"], [3, "EntityName", "Value", "Provider"], [3, "ValueChange", "ValidChange", "EntityName", "Value", "Provider"], [3, "Record", "EntityID"], [3, "ValidChange", "SpecChange", "Record", "EntityID"], ["mjButton", "", "variant", "primary", 3, "click", "disabled"], [1, "fa-solid"], ["mjButton", "", 3, "click", "disabled"], [1, "fa-solid", "fa-flask"], ["mjButton", "", "variant", "flat", 3, "click"], [1, "rpe-err"], [1, "fa-solid", "fa-triangle-exclamation"], [3, "Completed", "Cancelled", "DriverClass", "Context"]], template: function RecordProcessEditorComponent_Template(rf, ctx) { if (rf & 1) {
479
491
  i0.ɵɵconditionalCreate(0, RecordProcessEditorComponent_Conditional_0_Template, 3, 0, "div", 0)(1, RecordProcessEditorComponent_Conditional_1_Template, 64, 11);
480
492
  } if (rf & 2) {
481
493
  i0.ɵɵconditional(!ctx.Record ? 0 : 1);
@@ -508,9 +520,9 @@ export class RecordProcessEditorComponent extends BaseAngularComponent {
508
520
  <div class="rpe-sec-h"><span class="num">2</span><h3>What it acts on</h3></div>
509
521
  <div class="rpe-grid3">
510
522
  <div class="field"><label>Entity</label>
511
- <select class="mj-input" [value]="Record.EntityID || ''" (change)="onEntityChange($event)">
512
- <option value="" disabled>— choose an entity —</option>
513
- @for (e of Entities; track e.ID) { <option [value]="e.ID">{{ e.DisplayName || e.Name }}</option> }
523
+ <select class="mj-input" (change)="onEntityChange($event)">
524
+ <option value="" disabled [selected]="!SavedEntityListed">— choose an entity —</option>
525
+ @for (e of Entities; track e.ID) { <option [value]="e.ID" [selected]="IsSavedEntity(e)">{{ e.DisplayName || e.Name }}</option> }
514
526
  </select></div>
515
527
  <div class="field"><label>Default scope</label>
516
528
  <select class="mj-input" [value]="Record.ScopeType || 'Filter'" (change)="set('ScopeType', $event)">
@@ -1 +1 @@
1
- {"version":3,"file":"record-process-editor.component.js","sourceRoot":"","sources":["../../../src/lib/record-process-editor/record-process-editor.component.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;A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AC,EAAE,CAAC;IAC7H,CAAC;6RA9LQ,4BAA4B,yBAA5B,4BAA4B;6DAA5B,4BAA4B;YAvH/B,AAFF,8FAAe,gEAEN;;YAFT,qCAkGC;4BApGK,0BAA0B,EAAE,+BAA+B,EAAE,2BAA2B,EAAE,iBAAiB;;iFA2H5G,4BAA4B;cA/HxC,SAAS;2BACI,0BAA0B,cACxB,IAAI,mBACC,uBAAuB,CAAC,MAAM,WACtC,CAAC,0BAA0B,EAAE,+BAA+B,EAAE,2BAA2B,EAAE,iBAAiB,CAAC,YAC5G;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAoGT;;kBA0BA,KAAK;;kBAEL,KAAK;;kBAEL,KAAK;;kBAEL,KAAK;;kBAEL,KAAK;;kBAEL,KAAK;;kBAGL,MAAM;;kBAEN,MAAM;;kFAnBE,4BAA4B","sourcesContent":["/**\n * @fileoverview The authoring surface for a single Record Process (a reusable bulk operation). Edits the\n * basics + target entity + scope, and — for the FieldRules work type — embeds the visual\n * `<mj-field-rules-builder>` so a business user defines rules without touching JSON. An inline \"Preview\"\n * runs the same server dry-run + diff runner used at invocation time.\n *\n * Reused in two places: standalone in the Bulk Operations hub (owns its Save/Preview toolbar), and inside\n * the custom Record Process entity form (toolbar hidden — the form owns Save).\n * @module @memberjunction/ng-record-process-studio\n */\nimport { ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, Input, OnInit, Output, inject } from '@angular/core';\nimport { BaseAngularComponent } from '@memberjunction/ng-base-types';\nimport { type EntityInfo } from '@memberjunction/core';\nimport { SafeJSONParse, type FieldRuleSet } from '@memberjunction/global';\nimport { MJRecordProcessEntity } from '@memberjunction/core-entities';\nimport { FieldRulesBuilderComponent, EntityActionUXHostComponent, type EntityActionUXContext, type EntityActionUXResult } from '@memberjunction/ng-entity-action-ux';\nimport { MJButtonDirective } from '@memberjunction/ng-ui-components';\nimport { type DataFeatureSpec } from '@memberjunction/feature-pipelines';\nimport { FeaturePipelineBuilderComponent } from '../feature-pipeline-builder/feature-pipeline-builder.component';\n\ntype ScopeKind = 'Filter' | 'View' | 'List';\n\n@Component({\n selector: 'mj-record-process-editor',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [FieldRulesBuilderComponent, FeaturePipelineBuilderComponent, EntityActionUXHostComponent, MJButtonDirective],\n template: `\n @if (!Record) {\n <div class=\"rpe-loading\"><i class=\"fa-solid fa-circle-notch fa-spin\"></i> Loading…</div>\n } @else {\n <div class=\"rpe\">\n <!-- BASICS -->\n <section class=\"rpe-sec\">\n <div class=\"rpe-sec-h\"><span class=\"num\">1</span><h3>Basics</h3></div>\n <div class=\"rpe-grid2\">\n <div class=\"field\"><label>Name</label>\n <input class=\"mj-input\" [value]=\"Record.Name || ''\" (input)=\"set('Name', $event)\" placeholder=\"e.g. Mark idle prompts for review\"></div>\n <div class=\"field\"><label>Status</label>\n <select class=\"mj-input\" [value]=\"Record.Status || 'Active'\" (change)=\"set('Status', $event)\">\n <option value=\"Draft\">Draft</option><option value=\"Active\">Active</option><option value=\"Disabled\">Disabled</option>\n </select></div>\n </div>\n <div class=\"field rpe-mt\"><label>Description</label>\n <input class=\"mj-input\" [value]=\"Record.Description || ''\" (input)=\"set('Description', $event)\" placeholder=\"What does this process do?\"></div>\n </section>\n\n <!-- TARGET + SCOPE -->\n <section class=\"rpe-sec\">\n <div class=\"rpe-sec-h\"><span class=\"num\">2</span><h3>What it acts on</h3></div>\n <div class=\"rpe-grid3\">\n <div class=\"field\"><label>Entity</label>\n <select class=\"mj-input\" [value]=\"Record.EntityID || ''\" (change)=\"onEntityChange($event)\">\n <option value=\"\" disabled>— choose an entity —</option>\n @for (e of Entities; track e.ID) { <option [value]=\"e.ID\">{{ e.DisplayName || e.Name }}</option> }\n </select></div>\n <div class=\"field\"><label>Default scope</label>\n <select class=\"mj-input\" [value]=\"Record.ScopeType || 'Filter'\" (change)=\"set('ScopeType', $event)\">\n <option value=\"Filter\">Filter</option><option value=\"View\">A view</option><option value=\"List\">A list</option>\n </select></div>\n <div class=\"field\"><label>Work type</label>\n <select class=\"mj-input\" [value]=\"Record.WorkType || 'FieldRules'\" (change)=\"set('WorkType', $event)\">\n <option value=\"FieldRules\">Field Rules</option>\n <option value=\"Infer\">Feature Pipeline (Infer)</option>\n </select></div>\n </div>\n @if (Record.ScopeType === 'Filter') {\n <div class=\"field rpe-mt\"><label>Filter <span class=\"muted\">— overridden by the grid selection at run time</span></label>\n <input class=\"mj-input mono\" [value]=\"Record.ScopeFilter || ''\" (input)=\"set('ScopeFilter', $event)\" placeholder=\"e.g. Status = 'Active'\"></div>\n }\n </section>\n\n <!-- RULES -->\n @if (Record.WorkType === 'FieldRules') {\n <section class=\"rpe-sec\">\n <div class=\"rpe-sec-h\"><span class=\"num\">3</span><h3>Rules</h3>\n @if (!SelectedEntityName) { <span class=\"muted rpe-h-note\">choose an entity first</span> }\n </div>\n @if (SelectedEntityName) {\n <mj-field-rules-builder\n [EntityName]=\"SelectedEntityName\"\n [Value]=\"RuleSet\"\n [Provider]=\"Provider\"\n (ValueChange)=\"onRulesChange($event)\"\n (ValidChange)=\"RulesValid = $event\">\n </mj-field-rules-builder>\n }\n </section>\n }\n\n <!-- FEATURE PIPELINE (INFER) -->\n @if (Record.WorkType === 'Infer') {\n <section class=\"rpe-sec\">\n <div class=\"rpe-sec-h\"><span class=\"num\">3</span><h3>Feature Pipeline Configuration</h3>\n @if (!SelectedEntityName) { <span class=\"muted rpe-h-note\">choose an entity first</span> }\n </div>\n @if (SelectedEntityName) {\n <mj-feature-pipeline-builder\n [Record]=\"Record\"\n [EntityID]=\"Record.EntityID\"\n (ValidChange)=\"FeaturePipelineValid = $event\"\n (SpecChange)=\"onFeaturePipelineSpecChange($event)\">\n </mj-feature-pipeline-builder>\n }\n </section>\n }\n\n <!-- TOOLBAR -->\n @if (ShowToolbar) {\n <div class=\"rpe-bar\">\n <button mjButton variant=\"primary\" [disabled]=\"!CanSave || Saving\" (click)=\"Save()\">\n <i class=\"fa-solid\" [class.fa-floppy-disk]=\"!Saving\" [class.fa-circle-notch]=\"Saving\" [class.fa-spin]=\"Saving\"></i> Save\n </button>\n <button mjButton [disabled]=\"!CanPreview || Saving\" (click)=\"Preview()\"><i class=\"fa-solid fa-flask\"></i> Preview changes</button>\n <button mjButton variant=\"flat\" (click)=\"Cancel()\">Cancel</button>\n @if (ErrorMessage) { <span class=\"rpe-err\"><i class=\"fa-solid fa-triangle-exclamation\"></i> {{ ErrorMessage }}</span> }\n </div>\n }\n </div>\n\n @if (PreviewDriver) {\n <mj-entity-action-ux-host\n [DriverClass]=\"PreviewDriver.DriverClass\" [Context]=\"PreviewDriver.Context\"\n (Completed)=\"onPreviewDone($event)\" (Cancelled)=\"PreviewDriver = null\">\n </mj-entity-action-ux-host>\n }\n }\n `,\n styles: [`\n .rpe-loading{padding:30px;color:var(--mj-text-muted);display:flex;align-items:center;gap:10px}\n .rpe{display:flex;flex-direction:column;gap:22px;color:var(--mj-text-primary)}\n .rpe-sec{background:var(--mj-bg-surface-card);border:1px solid var(--mj-border-subtle);border-radius:var(--mj-radius-md,10px);padding:18px 20px}\n .rpe-sec-h{display:flex;align-items:center;gap:11px;margin-bottom:16px}\n .rpe-sec-h h3{margin:0;font-size:16px;font-weight:700}\n .rpe-sec-h .num{width:23px;height:23px;border-radius:50%;background:var(--mj-brand-primary);color:var(--mj-text-inverse);display:grid;place-items:center;font-size:12px;font-weight:800}\n .rpe-h-note{margin-left:6px;font-size:12.5px}\n .rpe-grid2{display:grid;grid-template-columns:1fr 220px;gap:16px}\n .rpe-grid3{display:grid;grid-template-columns:1.4fr 1fr 1fr;gap:16px}\n .field{display:flex;flex-direction:column;gap:6px}\n .field label{font-size:12.5px;font-weight:600;color:var(--mj-text-secondary)}\n .rpe-mt{margin-top:16px}\n .mono{font-family:var(--mj-font-mono,monospace);font-size:12.5px}\n .muted{color:var(--mj-text-muted);font-weight:400}\n .rpe-bar{display:flex;align-items:center;gap:10px;padding-top:4px}\n .rpe-bar button i{margin-right:6px}\n .rpe-err{color:var(--mj-status-error-text);font-size:13px;display:flex;align-items:center;gap:7px}\n .rpe-err i{color:var(--mj-status-error)}\n `],\n})\nexport class RecordProcessEditorComponent extends BaseAngularComponent implements OnInit {\n private cdr = inject(ChangeDetectorRef);\n\n /** The process being edited. Set this OR `RecordProcessID` (or neither, for a new draft). */\n @Input() Record: MJRecordProcessEntity | null = null;\n /** Load an existing process by ID (alternative to passing `Record`). */\n @Input() RecordProcessID: string | null = null;\n /** Default EntityID for a brand-new process (e.g. the grid the user came from). */\n @Input() DefaultEntityID: string | null = null;\n /** Default WorkType for a brand-new process (e.g. 'Infer' when opened from Feature Pipelines). */\n @Input() DefaultWorkType: MJRecordProcessEntity['WorkType'] | null = null;\n /** Default CategoryID for a brand-new process (e.g. Feature Pipeline category ID). */\n @Input() DefaultCategoryID: string | null = null;\n /** Show the built-in Save / Preview / Cancel toolbar. Set false when an outer form owns Save. */\n @Input() ShowToolbar = true;\n\n /** Emitted after a successful Save (the persisted record). */\n @Output() Saved = new EventEmitter<MJRecordProcessEntity>();\n /** Emitted when the user cancels. */\n @Output() Cancelled = new EventEmitter<void>();\n\n public Entities: EntityInfo[] = [];\n public SelectedEntityName = '';\n public RuleSet: FieldRuleSet = { Rules: [] };\n public RulesValid = true;\n public FeaturePipelineValid = true;\n public FeaturePipelineSpec: DataFeatureSpec | null = null;\n public Saving = false;\n public ErrorMessage = '';\n public PreviewDriver: { DriverClass: string; Context: EntityActionUXContext } | null = null;\n\n get CanSave(): boolean {\n if (!this.Record?.Name || !this.Record?.EntityID) return false;\n if (this.Record.WorkType === 'FieldRules') return this.RulesValid;\n if (this.Record.WorkType === 'Infer') return this.FeaturePipelineValid && !!this.Record.PromptID;\n return true;\n }\n get CanPreview(): boolean {\n if (this.Record?.WorkType === 'FieldRules') return this.CanSave && this.RuleSet.Rules.length > 0;\n if (this.Record?.WorkType === 'Infer') return this.CanSave;\n return false;\n }\n\n async ngOnInit(): Promise<void> {\n const provider = this.ProviderToUse;\n this.Entities = [...provider.Entities].sort((a, b) => (a.DisplayName || a.Name).localeCompare(b.DisplayName || b.Name));\n await this.loadRecord();\n }\n\n /** Resolves the record to edit: passed instance → by ID → a fresh draft. */\n private async loadRecord(): Promise<void> {\n const provider = this.ProviderToUse;\n if (!this.Record) {\n this.Record = await provider.GetEntityObject<MJRecordProcessEntity>('MJ: Record Processes', provider.CurrentUser);\n if (this.RecordProcessID) {\n await this.Record.Load(this.RecordProcessID);\n } else {\n this.Record.NewRecord();\n this.Record.WorkType = this.DefaultWorkType ?? 'FieldRules';\n this.Record.ScopeType = 'Filter';\n this.Record.Status = 'Draft';\n if (this.DefaultEntityID) this.Record.EntityID = this.DefaultEntityID;\n if (this.DefaultCategoryID) this.Record.CategoryID = this.DefaultCategoryID;\n }\n }\n if (this.Record.WorkType === 'FieldRules') {\n this.RuleSet = this.Record.Configuration ? (SafeJSONParse<FieldRuleSet>(this.Record.Configuration) ?? { Rules: [] }) : { Rules: [] };\n } else if (this.Record.WorkType === 'Infer') {\n this.FeaturePipelineSpec = this.Record.Configuration ? SafeJSONParse<DataFeatureSpec>(this.Record.Configuration) : null;\n }\n this.resolveEntityName();\n this.cdr.detectChanges();\n }\n\n /** Generic setter for the simple string/enum fields, driven by the template inputs. */\n Set(field: 'Name' | 'Description' | 'Status' | 'ScopeType' | 'ScopeFilter' | 'WorkType', event: Event): void {\n if (!this.Record) return;\n const value = (event.target as HTMLInputElement | HTMLSelectElement).value;\n // Strongly-typed assignment per field (no dynamic Set()).\n switch (field) {\n case 'Name': this.Record.Name = value; break;\n case 'Description': this.Record.Description = value; break;\n case 'Status': this.Record.Status = value as MJRecordProcessEntity['Status']; break;\n case 'ScopeType': this.Record.ScopeType = value as MJRecordProcessEntity['ScopeType']; break;\n case 'ScopeFilter': this.Record.ScopeFilter = value; break;\n case 'WorkType': this.Record.WorkType = value as MJRecordProcessEntity['WorkType']; break;\n }\n this.cdr.detectChanges();\n }\n\n /** @deprecated Use {@link Set}. */\n set(field: 'Name' | 'Description' | 'Status' | 'ScopeType' | 'ScopeFilter' | 'WorkType', event: Event): void {\n return this.Set(field, event);\n }\n\n OnEntityChange(event: Event): void {\n if (!this.Record) return;\n this.Record.EntityID = (event.target as HTMLSelectElement).value;\n this.resolveEntityName();\n this.cdr.detectChanges();\n }\n\n /** @deprecated Use {@link OnEntityChange}. */\n onEntityChange(event: Event): void {\n return this.OnEntityChange(event);\n }\n\n OnRulesChange(ruleSet: FieldRuleSet): void {\n this.RuleSet = ruleSet;\n if (this.Record) this.Record.Configuration = JSON.stringify(ruleSet);\n this.cdr.detectChanges();\n }\n\n /** @deprecated Use {@link OnRulesChange}. */\n onRulesChange(ruleSet: FieldRuleSet): void {\n return this.OnRulesChange(ruleSet);\n }\n\n OnFeaturePipelineSpecChange(spec: DataFeatureSpec): void {\n this.FeaturePipelineSpec = spec;\n if (this.Record) {\n this.Record.Configuration = JSON.stringify(spec);\n }\n this.cdr.detectChanges();\n }\n\n /** @deprecated Use {@link OnFeaturePipelineSpecChange}. */\n onFeaturePipelineSpecChange(spec: DataFeatureSpec): void {\n return this.OnFeaturePipelineSpecChange(spec);\n }\n\n /** Saves the record (and emits). Returns success. */\n async Save(): Promise<boolean> {\n if (!this.Record || !this.CanSave) return false;\n this.Saving = true; this.ErrorMessage = ''; this.cdr.detectChanges();\n if (this.Record.WorkType === 'FieldRules') {\n this.Record.Configuration = JSON.stringify(this.RuleSet);\n } else if (this.Record.WorkType === 'Infer' && this.FeaturePipelineSpec) {\n this.Record.Configuration = JSON.stringify(this.FeaturePipelineSpec);\n }\n const ok = await this.Record.Save();\n this.Saving = false;\n if (ok) {\n this.Saved.emit(this.Record);\n } else {\n this.ErrorMessage = this.Record.LatestResult?.CompleteMessage ?? 'Save failed';\n }\n this.cdr.detectChanges();\n return ok;\n }\n\n /** Saves (if needed) then mounts the dry-run runner against the process's default scope. */\n async Preview(): Promise<void> {\n if (!this.Record) return;\n if (this.Record.Dirty || !this.Record.IsSaved) {\n const ok = await this.Save();\n if (!ok) return;\n }\n const entity = this.ProviderToUse.EntityByID(this.Record.EntityID);\n if (!entity) { this.ErrorMessage = 'Target entity not found'; this.cdr.detectChanges(); return; }\n this.PreviewDriver = {\n DriverClass: 'RecordProcessRunnerUX',\n Context: {\n EntityInfo: entity,\n ScopeKind: (this.Record.ScopeType?.toLowerCase() as EntityActionUXContext['ScopeKind']) || 'filter',\n Filter: this.Record.ScopeFilter ?? undefined,\n ViewID: this.Record.ScopeViewID ?? undefined,\n ListID: this.Record.ScopeListID ?? undefined,\n Config: { RecordProcessID: this.Record.ID },\n Provider: this.ProviderToUse,\n ActionLabel: `Preview: ${this.Record.Name}`,\n },\n };\n this.cdr.detectChanges();\n }\n\n OnPreviewDone(_result: EntityActionUXResult): void {\n this.PreviewDriver = null;\n this.cdr.detectChanges();\n }\n\n /** @deprecated Use {@link OnPreviewDone}. */\n onPreviewDone(_result: EntityActionUXResult): void {\n return this.OnPreviewDone(_result);\n }\n\n Cancel(): void { this.Cancelled.emit(); }\n\n private resolveEntityName(): void {\n this.SelectedEntityName = this.Record?.EntityID ? (this.ProviderToUse.EntityByID(this.Record.EntityID)?.Name ?? '') : '';\n }\n}\n"]}
1
+ {"version":3,"file":"record-process-editor.component.js","sourceRoot":"","sources":["../../../src/lib/record-process-editor/record-process-editor.component.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,EAAU,MAAM,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACnI,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAErE,OAAO,EAAE,aAAa,EAAE,UAAU,EAAqB,MAAM,wBAAwB,CAAC;AAEtF,OAAO,EAAE,0BAA0B,EAAE,2BAA2B,EAAyD,MAAM,qC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AU,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAC7H,CAAC;6RA3MQ,4BAA4B,yBAA5B,4BAA4B;6DAA5B,4BAA4B;YAvH/B,AAFF,8FAAe,gEAEN;;YAFT,qCAkGC;4BApGK,0BAA0B,EAAE,+BAA+B,EAAE,2BAA2B,EAAE,iBAAiB;;iFA2H5G,4BAA4B;cA/HxC,SAAS;2BACI,0BAA0B,cACxB,IAAI,mBACC,uBAAuB,CAAC,MAAM,WACtC,CAAC,0BAA0B,EAAE,+BAA+B,EAAE,2BAA2B,EAAE,iBAAiB,CAAC,YAC5G;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAoGT;;kBA0BA,KAAK;;kBAEL,KAAK;;kBAEL,KAAK;;kBAEL,KAAK;;kBAEL,KAAK;;kBAEL,KAAK;;kBAGL,MAAM;;kBAEN,MAAM;;kFAnBE,4BAA4B","sourcesContent":["/**\n * @fileoverview The authoring surface for a single Record Process (a reusable bulk operation). Edits the\n * basics + target entity + scope, and — for the FieldRules work type — embeds the visual\n * `<mj-field-rules-builder>` so a business user defines rules without touching JSON. An inline \"Preview\"\n * runs the same server dry-run + diff runner used at invocation time.\n *\n * Reused in two places: standalone in the Bulk Operations hub (owns its Save/Preview toolbar), and inside\n * the custom Record Process entity form (toolbar hidden — the form owns Save).\n * @module @memberjunction/ng-record-process-studio\n */\nimport { ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, Input, OnInit, Output, inject } from '@angular/core';\nimport { BaseAngularComponent } from '@memberjunction/ng-base-types';\nimport { type EntityInfo } from '@memberjunction/core';\nimport { SafeJSONParse, UUIDsEqual, type FieldRuleSet } from '@memberjunction/global';\nimport { MJRecordProcessEntity } from '@memberjunction/core-entities';\nimport { FieldRulesBuilderComponent, EntityActionUXHostComponent, type EntityActionUXContext, type EntityActionUXResult } from '@memberjunction/ng-entity-action-ux';\nimport { MJButtonDirective } from '@memberjunction/ng-ui-components';\nimport { type DataFeatureSpec } from '@memberjunction/feature-pipelines';\nimport { FeaturePipelineBuilderComponent } from '../feature-pipeline-builder/feature-pipeline-builder.component';\n\ntype ScopeKind = 'Filter' | 'View' | 'List';\n\n@Component({\n selector: 'mj-record-process-editor',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [FieldRulesBuilderComponent, FeaturePipelineBuilderComponent, EntityActionUXHostComponent, MJButtonDirective],\n template: `\n @if (!Record) {\n <div class=\"rpe-loading\"><i class=\"fa-solid fa-circle-notch fa-spin\"></i> Loading…</div>\n } @else {\n <div class=\"rpe\">\n <!-- BASICS -->\n <section class=\"rpe-sec\">\n <div class=\"rpe-sec-h\"><span class=\"num\">1</span><h3>Basics</h3></div>\n <div class=\"rpe-grid2\">\n <div class=\"field\"><label>Name</label>\n <input class=\"mj-input\" [value]=\"Record.Name || ''\" (input)=\"set('Name', $event)\" placeholder=\"e.g. Mark idle prompts for review\"></div>\n <div class=\"field\"><label>Status</label>\n <select class=\"mj-input\" [value]=\"Record.Status || 'Active'\" (change)=\"set('Status', $event)\">\n <option value=\"Draft\">Draft</option><option value=\"Active\">Active</option><option value=\"Disabled\">Disabled</option>\n </select></div>\n </div>\n <div class=\"field rpe-mt\"><label>Description</label>\n <input class=\"mj-input\" [value]=\"Record.Description || ''\" (input)=\"set('Description', $event)\" placeholder=\"What does this process do?\"></div>\n </section>\n\n <!-- TARGET + SCOPE -->\n <section class=\"rpe-sec\">\n <div class=\"rpe-sec-h\"><span class=\"num\">2</span><h3>What it acts on</h3></div>\n <div class=\"rpe-grid3\">\n <div class=\"field\"><label>Entity</label>\n <select class=\"mj-input\" (change)=\"onEntityChange($event)\">\n <option value=\"\" disabled [selected]=\"!SavedEntityListed\">— choose an entity —</option>\n @for (e of Entities; track e.ID) { <option [value]=\"e.ID\" [selected]=\"IsSavedEntity(e)\">{{ e.DisplayName || e.Name }}</option> }\n </select></div>\n <div class=\"field\"><label>Default scope</label>\n <select class=\"mj-input\" [value]=\"Record.ScopeType || 'Filter'\" (change)=\"set('ScopeType', $event)\">\n <option value=\"Filter\">Filter</option><option value=\"View\">A view</option><option value=\"List\">A list</option>\n </select></div>\n <div class=\"field\"><label>Work type</label>\n <select class=\"mj-input\" [value]=\"Record.WorkType || 'FieldRules'\" (change)=\"set('WorkType', $event)\">\n <option value=\"FieldRules\">Field Rules</option>\n <option value=\"Infer\">Feature Pipeline (Infer)</option>\n </select></div>\n </div>\n @if (Record.ScopeType === 'Filter') {\n <div class=\"field rpe-mt\"><label>Filter <span class=\"muted\">— overridden by the grid selection at run time</span></label>\n <input class=\"mj-input mono\" [value]=\"Record.ScopeFilter || ''\" (input)=\"set('ScopeFilter', $event)\" placeholder=\"e.g. Status = 'Active'\"></div>\n }\n </section>\n\n <!-- RULES -->\n @if (Record.WorkType === 'FieldRules') {\n <section class=\"rpe-sec\">\n <div class=\"rpe-sec-h\"><span class=\"num\">3</span><h3>Rules</h3>\n @if (!SelectedEntityName) { <span class=\"muted rpe-h-note\">choose an entity first</span> }\n </div>\n @if (SelectedEntityName) {\n <mj-field-rules-builder\n [EntityName]=\"SelectedEntityName\"\n [Value]=\"RuleSet\"\n [Provider]=\"Provider\"\n (ValueChange)=\"onRulesChange($event)\"\n (ValidChange)=\"RulesValid = $event\">\n </mj-field-rules-builder>\n }\n </section>\n }\n\n <!-- FEATURE PIPELINE (INFER) -->\n @if (Record.WorkType === 'Infer') {\n <section class=\"rpe-sec\">\n <div class=\"rpe-sec-h\"><span class=\"num\">3</span><h3>Feature Pipeline Configuration</h3>\n @if (!SelectedEntityName) { <span class=\"muted rpe-h-note\">choose an entity first</span> }\n </div>\n @if (SelectedEntityName) {\n <mj-feature-pipeline-builder\n [Record]=\"Record\"\n [EntityID]=\"Record.EntityID\"\n (ValidChange)=\"FeaturePipelineValid = $event\"\n (SpecChange)=\"onFeaturePipelineSpecChange($event)\">\n </mj-feature-pipeline-builder>\n }\n </section>\n }\n\n <!-- TOOLBAR -->\n @if (ShowToolbar) {\n <div class=\"rpe-bar\">\n <button mjButton variant=\"primary\" [disabled]=\"!CanSave || Saving\" (click)=\"Save()\">\n <i class=\"fa-solid\" [class.fa-floppy-disk]=\"!Saving\" [class.fa-circle-notch]=\"Saving\" [class.fa-spin]=\"Saving\"></i> Save\n </button>\n <button mjButton [disabled]=\"!CanPreview || Saving\" (click)=\"Preview()\"><i class=\"fa-solid fa-flask\"></i> Preview changes</button>\n <button mjButton variant=\"flat\" (click)=\"Cancel()\">Cancel</button>\n @if (ErrorMessage) { <span class=\"rpe-err\"><i class=\"fa-solid fa-triangle-exclamation\"></i> {{ ErrorMessage }}</span> }\n </div>\n }\n </div>\n\n @if (PreviewDriver) {\n <mj-entity-action-ux-host\n [DriverClass]=\"PreviewDriver.DriverClass\" [Context]=\"PreviewDriver.Context\"\n (Completed)=\"onPreviewDone($event)\" (Cancelled)=\"PreviewDriver = null\">\n </mj-entity-action-ux-host>\n }\n }\n `,\n styles: [`\n .rpe-loading{padding:30px;color:var(--mj-text-muted);display:flex;align-items:center;gap:10px}\n .rpe{display:flex;flex-direction:column;gap:22px;color:var(--mj-text-primary)}\n .rpe-sec{background:var(--mj-bg-surface-card);border:1px solid var(--mj-border-subtle);border-radius:var(--mj-radius-md,10px);padding:18px 20px}\n .rpe-sec-h{display:flex;align-items:center;gap:11px;margin-bottom:16px}\n .rpe-sec-h h3{margin:0;font-size:16px;font-weight:700}\n .rpe-sec-h .num{width:23px;height:23px;border-radius:50%;background:var(--mj-brand-primary);color:var(--mj-text-inverse);display:grid;place-items:center;font-size:12px;font-weight:800}\n .rpe-h-note{margin-left:6px;font-size:12.5px}\n .rpe-grid2{display:grid;grid-template-columns:1fr 220px;gap:16px}\n .rpe-grid3{display:grid;grid-template-columns:1.4fr 1fr 1fr;gap:16px}\n .field{display:flex;flex-direction:column;gap:6px}\n .field label{font-size:12.5px;font-weight:600;color:var(--mj-text-secondary)}\n .rpe-mt{margin-top:16px}\n .mono{font-family:var(--mj-font-mono,monospace);font-size:12.5px}\n .muted{color:var(--mj-text-muted);font-weight:400}\n .rpe-bar{display:flex;align-items:center;gap:10px;padding-top:4px}\n .rpe-bar button i{margin-right:6px}\n .rpe-err{color:var(--mj-status-error-text);font-size:13px;display:flex;align-items:center;gap:7px}\n .rpe-err i{color:var(--mj-status-error)}\n `],\n})\nexport class RecordProcessEditorComponent extends BaseAngularComponent implements OnInit {\n private cdr = inject(ChangeDetectorRef);\n\n /** The process being edited. Set this OR `RecordProcessID` (or neither, for a new draft). */\n @Input() Record: MJRecordProcessEntity | null = null;\n /** Load an existing process by ID (alternative to passing `Record`). */\n @Input() RecordProcessID: string | null = null;\n /** Default EntityID for a brand-new process (e.g. the grid the user came from). */\n @Input() DefaultEntityID: string | null = null;\n /** Default WorkType for a brand-new process (e.g. 'Infer' when opened from Feature Pipelines). */\n @Input() DefaultWorkType: MJRecordProcessEntity['WorkType'] | null = null;\n /** Default CategoryID for a brand-new process (e.g. Feature Pipeline category ID). */\n @Input() DefaultCategoryID: string | null = null;\n /** Show the built-in Save / Preview / Cancel toolbar. Set false when an outer form owns Save. */\n @Input() ShowToolbar = true;\n\n /** Emitted after a successful Save (the persisted record). */\n @Output() Saved = new EventEmitter<MJRecordProcessEntity>();\n /** Emitted when the user cancels. */\n @Output() Cancelled = new EventEmitter<void>();\n\n public Entities: EntityInfo[] = [];\n public SelectedEntityName = '';\n public RuleSet: FieldRuleSet = { Rules: [] };\n public RulesValid = true;\n public FeaturePipelineValid = true;\n public FeaturePipelineSpec: DataFeatureSpec | null = null;\n public Saving = false;\n public ErrorMessage = '';\n public PreviewDriver: { DriverClass: string; Context: EntityActionUXContext } | null = null;\n\n /**\n * Whether `entity` is the record's stored target entity. The picker marks it with [selected] on its option:\n * a [value] on the <select> runs before @for creates the options, so the first entity would show.\n */\n public IsSavedEntity(entity: EntityInfo): boolean {\n return !!this.Record?.EntityID && UUIDsEqual(entity.ID, this.Record.EntityID);\n }\n\n /** Whether the entity picker lists the record's stored entity; when it does not, the placeholder is selected. */\n public get SavedEntityListed(): boolean {\n return this.Entities.some((e) => this.IsSavedEntity(e));\n }\n\n get CanSave(): boolean {\n if (!this.Record?.Name || !this.Record?.EntityID) return false;\n if (this.Record.WorkType === 'FieldRules') return this.RulesValid;\n if (this.Record.WorkType === 'Infer') return this.FeaturePipelineValid && !!this.Record.PromptID;\n return true;\n }\n get CanPreview(): boolean {\n if (this.Record?.WorkType === 'FieldRules') return this.CanSave && this.RuleSet.Rules.length > 0;\n if (this.Record?.WorkType === 'Infer') return this.CanSave;\n return false;\n }\n\n async ngOnInit(): Promise<void> {\n const provider = this.ProviderToUse;\n this.Entities = [...provider.Entities].sort((a, b) => (a.DisplayName || a.Name).localeCompare(b.DisplayName || b.Name));\n await this.loadRecord();\n }\n\n /** Resolves the record to edit: passed instance → by ID → a fresh draft. */\n private async loadRecord(): Promise<void> {\n const provider = this.ProviderToUse;\n if (!this.Record) {\n this.Record = await provider.GetEntityObject<MJRecordProcessEntity>('MJ: Record Processes', provider.CurrentUser);\n if (this.RecordProcessID) {\n await this.Record.Load(this.RecordProcessID);\n } else {\n this.Record.NewRecord();\n this.Record.WorkType = this.DefaultWorkType ?? 'FieldRules';\n this.Record.ScopeType = 'Filter';\n this.Record.Status = 'Draft';\n if (this.DefaultEntityID) this.Record.EntityID = this.DefaultEntityID;\n if (this.DefaultCategoryID) this.Record.CategoryID = this.DefaultCategoryID;\n }\n }\n if (this.Record.WorkType === 'FieldRules') {\n this.RuleSet = this.Record.Configuration ? (SafeJSONParse<FieldRuleSet>(this.Record.Configuration) ?? { Rules: [] }) : { Rules: [] };\n } else if (this.Record.WorkType === 'Infer') {\n this.FeaturePipelineSpec = this.Record.Configuration ? SafeJSONParse<DataFeatureSpec>(this.Record.Configuration) : null;\n }\n this.resolveEntityName();\n this.cdr.detectChanges();\n }\n\n /** Generic setter for the simple string/enum fields, driven by the template inputs. */\n Set(field: 'Name' | 'Description' | 'Status' | 'ScopeType' | 'ScopeFilter' | 'WorkType', event: Event): void {\n if (!this.Record) return;\n const value = (event.target as HTMLInputElement | HTMLSelectElement).value;\n // Strongly-typed assignment per field (no dynamic Set()).\n switch (field) {\n case 'Name': this.Record.Name = value; break;\n case 'Description': this.Record.Description = value; break;\n case 'Status': this.Record.Status = value as MJRecordProcessEntity['Status']; break;\n case 'ScopeType': this.Record.ScopeType = value as MJRecordProcessEntity['ScopeType']; break;\n case 'ScopeFilter': this.Record.ScopeFilter = value; break;\n case 'WorkType': this.Record.WorkType = value as MJRecordProcessEntity['WorkType']; break;\n }\n this.cdr.detectChanges();\n }\n\n /** @deprecated Use {@link Set}. */\n set(field: 'Name' | 'Description' | 'Status' | 'ScopeType' | 'ScopeFilter' | 'WorkType', event: Event): void {\n return this.Set(field, event);\n }\n\n OnEntityChange(event: Event): void {\n if (!this.Record) return;\n this.Record.EntityID = (event.target as HTMLSelectElement).value;\n this.resolveEntityName();\n this.cdr.detectChanges();\n }\n\n /** @deprecated Use {@link OnEntityChange}. */\n onEntityChange(event: Event): void {\n return this.OnEntityChange(event);\n }\n\n OnRulesChange(ruleSet: FieldRuleSet): void {\n this.RuleSet = ruleSet;\n if (this.Record) this.Record.Configuration = JSON.stringify(ruleSet);\n this.cdr.detectChanges();\n }\n\n /** @deprecated Use {@link OnRulesChange}. */\n onRulesChange(ruleSet: FieldRuleSet): void {\n return this.OnRulesChange(ruleSet);\n }\n\n OnFeaturePipelineSpecChange(spec: DataFeatureSpec): void {\n this.FeaturePipelineSpec = spec;\n if (this.Record) {\n this.Record.Configuration = JSON.stringify(spec);\n }\n this.cdr.detectChanges();\n }\n\n /** @deprecated Use {@link OnFeaturePipelineSpecChange}. */\n onFeaturePipelineSpecChange(spec: DataFeatureSpec): void {\n return this.OnFeaturePipelineSpecChange(spec);\n }\n\n /** Saves the record (and emits). Returns success. */\n async Save(): Promise<boolean> {\n if (!this.Record || !this.CanSave) return false;\n this.Saving = true; this.ErrorMessage = ''; this.cdr.detectChanges();\n if (this.Record.WorkType === 'FieldRules') {\n this.Record.Configuration = JSON.stringify(this.RuleSet);\n } else if (this.Record.WorkType === 'Infer' && this.FeaturePipelineSpec) {\n this.Record.Configuration = JSON.stringify(this.FeaturePipelineSpec);\n }\n const ok = await this.Record.Save();\n this.Saving = false;\n if (ok) {\n this.Saved.emit(this.Record);\n } else {\n this.ErrorMessage = this.Record.LatestResult?.CompleteMessage ?? 'Save failed';\n }\n this.cdr.detectChanges();\n return ok;\n }\n\n /** Saves (if needed) then mounts the dry-run runner against the process's default scope. */\n async Preview(): Promise<void> {\n if (!this.Record) return;\n if (this.Record.Dirty || !this.Record.IsSaved) {\n const ok = await this.Save();\n if (!ok) return;\n }\n const entity = this.ProviderToUse.EntityByID(this.Record.EntityID);\n if (!entity) { this.ErrorMessage = 'Target entity not found'; this.cdr.detectChanges(); return; }\n this.PreviewDriver = {\n DriverClass: 'RecordProcessRunnerUX',\n Context: {\n EntityInfo: entity,\n ScopeKind: (this.Record.ScopeType?.toLowerCase() as EntityActionUXContext['ScopeKind']) || 'filter',\n Filter: this.Record.ScopeFilter ?? undefined,\n ViewID: this.Record.ScopeViewID ?? undefined,\n ListID: this.Record.ScopeListID ?? undefined,\n Config: { RecordProcessID: this.Record.ID },\n Provider: this.ProviderToUse,\n ActionLabel: `Preview: ${this.Record.Name}`,\n },\n };\n this.cdr.detectChanges();\n }\n\n OnPreviewDone(_result: EntityActionUXResult): void {\n this.PreviewDriver = null;\n this.cdr.detectChanges();\n }\n\n /** @deprecated Use {@link OnPreviewDone}. */\n onPreviewDone(_result: EntityActionUXResult): void {\n return this.OnPreviewDone(_result);\n }\n\n Cancel(): void { this.Cancelled.emit(); }\n\n private resolveEntityName(): void {\n this.SelectedEntityName = this.Record?.EntityID ? (this.ProviderToUse.EntityByID(this.Record.EntityID)?.Name ?? '') : '';\n }\n}\n"]}
@@ -7,6 +7,7 @@
7
7
  */
8
8
  import { OnInit } from '@angular/core';
9
9
  import { BaseAngularComponent } from '@memberjunction/ng-base-types';
10
+ import type { MJRecordProcessEntity } from '@memberjunction/core-entities';
10
11
  import { type EntityActionUXContext, type EntityActionUXResult } from '@memberjunction/ng-entity-action-ux';
11
12
  import * as i0 from "@angular/core";
12
13
  /** A row of the process list (read-only projection). */
@@ -16,9 +17,9 @@ interface ProcessRow {
16
17
  Description?: string;
17
18
  Entity: string;
18
19
  EntityID: string;
19
- WorkType: string;
20
- Status: string;
21
- ScopeType: string;
20
+ WorkType: MJRecordProcessEntity['WorkType'];
21
+ Status: MJRecordProcessEntity['Status'];
22
+ ScopeType: MJRecordProcessEntity['ScopeType'];
22
23
  ScopeFilter?: string;
23
24
  ScopeViewID?: string;
24
25
  ScopeListID?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"record-process-studio.component.d.ts","sourceRoot":"","sources":["../../../src/lib/record-process-studio/record-process-studio.component.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAgE,MAAM,EAAU,MAAM,eAAe,CAAC;AAC7G,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAErE,OAAO,EAA+B,KAAK,qBAAqB,EAAE,KAAK,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;;AAIzI,wDAAwD;AACxD,UAAU,UAAU;IAChB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,qBAgGa,4BAA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CAlG1B,4BAA4B;2CAA5B,4BAA4B;CAqGxC"}
1
+ {"version":3,"file":"record-process-studio.component.d.ts","sourceRoot":"","sources":["../../../src/lib/record-process-studio/record-process-studio.component.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAgE,MAAM,EAAU,MAAM,eAAe,CAAC;AAC7G,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAErE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAA+B,KAAK,qBAAqB,EAAE,KAAK,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;;AAIzI,wDAAwD;AACxD,UAAU,UAAU;IAChB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,qBAAqB,CAAC,UAAU,CAAC,CAAC;IAC5C,MAAM,EAAE,qBAAqB,CAAC,QAAQ,CAAC,CAAC;IACxC,SAAS,EAAE,qBAAqB,CAAC,WAAW,CAAC,CAAC;IAC9C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,qBAgGa,4BAA6B,SAAQ,oBAAqB,YAAW,MAAM;IACpF,OAAO,CAAC,GAAG,CAA6B;IAExC,qGAAqG;IAC5F,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAQ;IAEjC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAU;IAC/B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAQ;IAChC,OAAO,UAAQ;IACf,MAAM,SAAM;IACZ,SAAS,EAAE,UAAU,EAAE,CAAM;IAC7B,SAAS,EAAE;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,qBAAqB,CAAA;KAAE,GAAG,IAAI,CAAQ;IAElF,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAI/B,IAAI,QAAQ,IAAI,UAAU,EAAE,CAI3B;IAEK,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAgB7B,sCAAsC;IAChC,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAI7B,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IAE5B,wCAAwC;IACxC,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IAI5B,GAAG,IAAI,IAAI;IACX,IAAI,CAAC,CAAC,EAAE,UAAU,GAAG,IAAI;IACzB,UAAU,IAAI,IAAI;IAElB,0CAA0C;IAC1C,UAAU,IAAI,IAAI;IAGZ,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAE9B,uCAAuC;IACjC,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAI9B,4FAA4F;IAC5F,GAAG,CAAC,CAAC,EAAE,UAAU,GAAG,IAAI;IAmBxB,SAAS,CAAC,EAAE,EAAE,oBAAoB,GAAG,IAAI;IAEzC,yCAAyC;IACzC,SAAS,CAAC,EAAE,EAAE,oBAAoB,GAAG,IAAI;IAIzC,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;IAInC,yCAAyC;IACzC,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;yCAlG1B,4BAA4B;2CAA5B,4BAA4B;CAqGxC"}
@@ -318,5 +318,5 @@ export class RecordProcessStudioComponent extends BaseAngularComponent {
318
318
  }], null, { EntityID: [{
319
319
  type: Input
320
320
  }] }); })();
321
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(RecordProcessStudioComponent, { className: "RecordProcessStudioComponent", filePath: "lib/record-process-studio/record-process-studio.component.ts", lineNumber: 126 }); })();
321
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(RecordProcessStudioComponent, { className: "RecordProcessStudioComponent", filePath: "lib/record-process-studio/record-process-studio.component.ts", lineNumber: 127 }); })();
322
322
  //# sourceMappingURL=record-process-studio.component.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"record-process-studio.component.js","sourceRoot":"","sources":["../../../src/lib/record-process-studio/record-process-studio.component.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,SAAS,EAAE,KAAK,EAAU,MAAM,EAAE,MAAM,eAAe,CAAC;AAC7G,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,2BAA2B,EAAyD,MAAM,qCAAqC,CAAC;AACzI,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAC5F,OAAO,EAAE,4BAA4B,EAAE,MAAM,0DAA0D,CAAC;;;;IAiCxF,+BAAqB;IAAA,wBAAgD;IAAC,8BAAQ;IAAA,iBAAM;;;;IAEpF,0CAKuB;IAAnB,0NAAU,YAAK,KAAC;IALpB,iBAKuB;;;IAQqD,+BAAqB;IAAA,YAAmB;IAAA,iBAAM;;;IAAzB,cAAmB;IAAnB,sCAAmB;;;;IAD5G,+BAAsC;IAAlB,2OAAS,iBAAO,KAAC;IAC5B,AAAL,2BAAK,cAAoB;IAAA,YAAY;IAAA,iBAAM;IAAA,mIAAqB;IAA+C,iBAAM;IACrH,2BAAK;IAAA,YAAc;IAAA,iBAAM;IACpB,AAAL,2BAAK,eAA0B;IAAA,YAA2B;IAAO,AAAP,iBAAO,EAAM;IAClE,AAAL,4BAAK,gBAA4H;IAAA,aAAc;IAAO,AAAP,iBAAO,EAAM;IAC5J,gCAA8D;IAAnC,iJAAS,wBAAwB,IAAC;IACzD,mCAAyD;IAAjB,+OAAS,gBAAM,KAAC;IAAC,yBAAgC;IAAA,iBAAS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ACtB;SACJ,CAAC;QACF,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,CAAC;IAC7B,CAAC;IAED,SAAS,CAAC,EAAwB,IAAU,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC;IAE9F,yCAAyC;IACzC,SAAS,CAAC,EAAwB;QAC9B,OAAO,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;IAC9B,CAAC;IAED,SAAS,CAAC,QAAgB;QACtB,OAAO,QAAQ,KAAK,YAAY,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC;IAChE,CAAC;IAED,yCAAyC;IACzC,SAAS,CAAC,QAAgB;QACtB,OAAO,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;IACpC,CAAC;6RApGQ,4BAA4B,yBAA5B,4BAA4B;6DAA5B,4BAA4B;YArD/B,AArCF,qFAAuB,8DAqCd;YAcT,mHAAiB;;YAnDjB,6CAiDC;YAED,eAKC;YALD,wCAKC;4BA1DK,4BAA4B,EAAE,2BAA2B,EAAE,iBAAiB,EAAE,qBAAqB;;iFA4FpG,4BAA4B;cAhGxC,SAAS;2BACI,0BAA0B,cACxB,IAAI,mBACC,uBAAuB,CAAC,MAAM,WACtC,CAAC,4BAA4B,EAAE,2BAA2B,EAAE,iBAAiB,EAAE,qBAAqB,CAAC,YACpG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA0DT;;kBAqCA,KAAK;;kFAJG,4BAA4B","sourcesContent":["/**\n * @fileoverview The Bulk Operations hub: lists the org's Record Processes, lets a user create / edit one\n * (via the embedded {@link RecordProcessEditorComponent}), and run any of them on demand (mounting the\n * same dry-run → confirm runner used from a grid). Generic + reusable — Explorer's Bulk Operations app\n * hosts it, but any MJ app can drop it in.\n * @module @memberjunction/ng-record-process-studio\n */\nimport { ChangeDetectionStrategy, ChangeDetectorRef, Component, Input, OnInit, inject } from '@angular/core';\nimport { BaseAngularComponent } from '@memberjunction/ng-base-types';\nimport { RunView } from '@memberjunction/core';\nimport { EntityActionUXHostComponent, type EntityActionUXContext, type EntityActionUXResult } from '@memberjunction/ng-entity-action-ux';\nimport { MJButtonDirective, MJEmptyStateComponent } from '@memberjunction/ng-ui-components';\nimport { RecordProcessEditorComponent } from '../record-process-editor/record-process-editor.component';\n\n/** A row of the process list (read-only projection). */\ninterface ProcessRow {\n ID: string;\n Name: string;\n Description?: string;\n Entity: string;\n EntityID: string;\n WorkType: string;\n Status: string;\n ScopeType: string;\n ScopeFilter?: string;\n ScopeViewID?: string;\n ScopeListID?: string;\n}\n\n@Component({\n selector: 'mj-record-process-studio',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [RecordProcessEditorComponent, EntityActionUXHostComponent, MJButtonDirective, MJEmptyStateComponent],\n template: `\n @if (Mode === 'list') {\n <div class=\"rps-bar\">\n <div class=\"rps-search\"><i class=\"fa-solid fa-magnifying-glass\"></i>\n <input class=\"mj-input\" placeholder=\"Search bulk operations…\" [value]=\"Search\" (input)=\"onSearch($event)\"></div>\n <span class=\"rps-spacer\"></span>\n <button mjButton variant=\"flat\" (click)=\"reload()\"><i class=\"fa-solid fa-arrows-rotate\"></i> Refresh</button>\n <button mjButton variant=\"primary\" (click)=\"New()\"><i class=\"fa-solid fa-plus\"></i> New operation</button>\n </div>\n\n @if (Loading) {\n <div class=\"rps-msg\"><i class=\"fa-solid fa-circle-notch fa-spin\"></i> Loading…</div>\n } @else if (Filtered.length === 0) {\n <mj-empty-state class=\"rps-empty\"\n Icon=\"fa-solid fa-list-check\"\n Title=\"No bulk operations yet\"\n ActionText=\"Create one\"\n ActionIcon=\"fa-solid fa-plus\"\n (Action)=\"New()\" />\n } @else {\n <div class=\"rps-table\">\n <div class=\"rps-tr rps-head\">\n <div>Operation</div><div>Entity</div><div>Type</div><div>Status</div><div class=\"ta-r\">Actions</div>\n </div>\n @for (p of Filtered; track p.ID) {\n <div class=\"rps-tr\" (click)=\"Edit(p)\">\n <div><div class=\"rps-nm\">{{ p.Name }}</div>@if (p.Description) {<div class=\"rps-sub\">{{ p.Description }}</div>}</div>\n <div>{{ p.Entity }}</div>\n <div><span class=\"pill purple\">{{ workLabel(p.WorkType) }}</span></div>\n <div><span class=\"pill\" [class.ok]=\"p.Status==='Active'\" [class.warn]=\"p.Status==='Draft'\" [class.muted]=\"p.Status==='Disabled'\">{{ p.Status }}</span></div>\n <div class=\"ta-r rps-acts\" (click)=\"$event.stopPropagation()\">\n <button class=\"iconbtn run\" title=\"Run\" (click)=\"Run(p)\"><i class=\"fa-solid fa-play\"></i></button>\n <button class=\"iconbtn\" title=\"Edit\" (click)=\"Edit(p)\"><i class=\"fa-solid fa-pen\"></i></button>\n </div>\n </div>\n }\n </div>\n }\n } @else {\n <div class=\"rps-editbar\">\n <button mjButton variant=\"flat\" (click)=\"backToList()\"><i class=\"fa-solid fa-arrow-left\"></i> Back</button>\n <h2>{{ EditingID ? 'Edit operation' : 'New operation' }}</h2>\n </div>\n <mj-record-process-editor\n [RecordProcessID]=\"EditingID\"\n [DefaultEntityID]=\"EntityID\"\n [Provider]=\"Provider\"\n (Saved)=\"onSaved()\"\n (Cancelled)=\"backToList()\">\n </mj-record-process-editor>\n }\n\n @if (RunDriver) {\n <mj-entity-action-ux-host\n [DriverClass]=\"RunDriver.DriverClass\" [Context]=\"RunDriver.Context\"\n (Completed)=\"onRunDone($event)\" (Cancelled)=\"RunDriver = null\">\n </mj-entity-action-ux-host>\n }\n `,\n styles: [`\n :host{display:block;color:var(--mj-text-primary)}\n .rps-bar{display:flex;align-items:center;gap:12px;margin-bottom:16px}\n .rps-search{position:relative;flex:0 0 360px;max-width:360px}\n .rps-search i{position:absolute;left:12px;top:50%;transform:translateY(-50%);color:var(--mj-text-muted);font-size:13px}\n .rps-search input{padding-left:34px}\n .rps-spacer{flex:1}\n .rps-bar button i,.rps-editbar button i{margin-right:6px}\n .rps-msg,.rps-empty{padding:40px;text-align:center;color:var(--mj-text-muted)}\n .rps-empty i{font-size:30px;display:block;margin-bottom:12px;color:var(--mj-text-disabled)}\n .rps-empty p{margin:0 0 16px}\n .rps-table{border:1px solid var(--mj-border-subtle);border-radius:var(--mj-radius-md,10px);overflow:hidden}\n .rps-tr{display:grid;grid-template-columns:2.2fr 1.2fr 1fr .8fr 1fr;gap:14px;align-items:center;padding:13px 16px;border-bottom:1px solid var(--mj-border-subtle);cursor:pointer;font-size:13.5px}\n .rps-tr:last-child{border-bottom:none}\n .rps-tr:not(.rps-head):hover{background:var(--mj-bg-surface-hover)}\n .rps-head{background:var(--mj-bg-surface-sunken);font-size:11.5px;text-transform:uppercase;letter-spacing:.05em;color:var(--mj-text-muted);font-weight:700;cursor:default}\n .rps-nm{font-weight:600}\n .rps-sub{color:var(--mj-text-muted);font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:420px}\n .ta-r{text-align:right;justify-self:end}\n .rps-acts{display:flex;gap:6px}\n .iconbtn{width:30px;height:30px;border-radius:7px;border:1px solid var(--mj-border-default);background:var(--mj-bg-surface-card);color:var(--mj-text-secondary);cursor:pointer;font-size:12.5px}\n .iconbtn:hover{background:var(--mj-bg-surface-hover);color:var(--mj-text-primary)}\n .iconbtn.run:hover{color:var(--mj-status-success-text);border-color:var(--mj-status-success)}\n .pill{display:inline-flex;align-items:center;padding:3px 10px;border-radius:999px;font-size:11.5px;font-weight:700;background:var(--mj-bg-surface-sunken);color:var(--mj-text-secondary)}\n .pill.purple{background:color-mix(in srgb,var(--mj-brand-primary) 14%,transparent);color:var(--mj-brand-primary)}\n .pill.ok{background:var(--mj-status-success-bg);color:var(--mj-status-success-text)}\n .pill.warn{background:var(--mj-status-warning-bg);color:var(--mj-status-warning-text)}\n .pill.muted{background:var(--mj-bg-surface-sunken);color:var(--mj-text-muted)}\n .rps-editbar{display:flex;align-items:center;gap:14px;margin-bottom:18px}\n .rps-editbar h2{margin:0;font-size:18px;font-weight:700}\n `],\n})\nexport class RecordProcessStudioComponent extends BaseAngularComponent implements OnInit {\n private cdr = inject(ChangeDetectorRef);\n\n /** Optional: restrict the hub to processes for one entity (e.g. when embedded on an entity page). */\n @Input() EntityID: string | null = null;\n\n public Mode: 'list' | 'edit' = 'list';\n public EditingID: string | null = null;\n public Loading = true;\n public Search = '';\n public Processes: ProcessRow[] = [];\n public RunDriver: { DriverClass: string; Context: EntityActionUXContext } | null = null;\n\n async ngOnInit(): Promise<void> {\n await this.Reload();\n }\n\n get Filtered(): ProcessRow[] {\n const q = this.Search.trim().toLowerCase();\n if (!q) return this.Processes;\n return this.Processes.filter((p) => p.Name.toLowerCase().includes(q) || (p.Entity ?? '').toLowerCase().includes(q));\n }\n\n async Reload(): Promise<void> {\n this.Loading = true; this.cdr.detectChanges();\n const rv = RunView.FromMetadataProvider(this.ProviderToUse);\n const filter = this.EntityID ? `EntityID='${this.EntityID}'` : '';\n const result = await rv.RunView<ProcessRow>({\n EntityName: 'MJ: Record Processes',\n Fields: ['ID', 'Name', 'Description', 'Entity', 'EntityID', 'WorkType', 'Status', 'ScopeType', 'ScopeFilter', 'ScopeViewID', 'ScopeListID'],\n ExtraFilter: filter,\n OrderBy: 'Name',\n ResultType: 'simple',\n });\n this.Processes = result.Success ? (result.Results ?? []) : [];\n this.Loading = false;\n this.cdr.detectChanges();\n }\n\n /** @deprecated Use {@link Reload}. */\n async reload(): Promise<void> {\n return this.Reload();\n }\n\n OnSearch(event: Event): void { this.Search = (event.target as HTMLInputElement).value; this.cdr.detectChanges(); }\n\n /** @deprecated Use {@link OnSearch}. */\n onSearch(event: Event): void {\n return this.OnSearch(event);\n }\n\n New(): void { this.EditingID = null; this.Mode = 'edit'; this.cdr.detectChanges(); }\n Edit(p: ProcessRow): void { this.EditingID = p.ID; this.Mode = 'edit'; this.cdr.detectChanges(); }\n BackToList(): void { this.Mode = 'list'; this.EditingID = null; this.cdr.detectChanges(); }\n\n /** @deprecated Use {@link BackToList}. */\n backToList(): void {\n return this.BackToList();\n }\n async OnSaved(): Promise<void> { this.BackToList(); await this.Reload(); }\n\n /** @deprecated Use {@link OnSaved}. */\n async onSaved(): Promise<void> {\n return this.OnSaved();\n }\n\n /** Runs a process on demand against its default scope, via the dry-run → confirm runner. */\n Run(p: ProcessRow): void {\n const entity = this.ProviderToUse.EntityByID(p.EntityID);\n if (!entity) return;\n this.RunDriver = {\n DriverClass: 'RecordProcessRunnerUX',\n Context: {\n EntityInfo: entity,\n ScopeKind: (p.ScopeType?.toLowerCase() as EntityActionUXContext['ScopeKind']) || 'filter',\n Filter: p.ScopeFilter ?? undefined,\n ViewID: p.ScopeViewID ?? undefined,\n ListID: p.ScopeListID ?? undefined,\n Config: { RecordProcessID: p.ID },\n Provider: this.ProviderToUse,\n ActionLabel: p.Name,\n },\n };\n this.cdr.detectChanges();\n }\n\n OnRunDone(_r: EntityActionUXResult): void { this.RunDriver = null; this.cdr.detectChanges(); }\n\n /** @deprecated Use {@link OnRunDone}. */\n onRunDone(_r: EntityActionUXResult): void {\n return this.OnRunDone(_r);\n }\n\n WorkLabel(workType: string): string {\n return workType === 'FieldRules' ? 'Field Rules' : workType;\n }\n\n /** @deprecated Use {@link WorkLabel}. */\n workLabel(workType: string): string {\n return this.WorkLabel(workType);\n }\n}\n"]}
1
+ {"version":3,"file":"record-process-studio.component.js","sourceRoot":"","sources":["../../../src/lib/record-process-studio/record-process-studio.component.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,SAAS,EAAE,KAAK,EAAU,MAAM,EAAE,MAAM,eAAe,CAAC;AAC7G,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE/C,OAAO,EAAE,2BAA2B,EAAyD,MAAM,qCAAqC,CAAC;AACzI,OAAO,EAAE,iBAAiB,EAAE,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C,CAAC;6RApGQ,4BAA4B,yBAA5B,4BAA4B;6DAA5B,4BAA4B;YArD/B,AArCF,qFAAuB,8DAqCd;YAcT,mHAAiB;;YAnDjB,6CAiDC;YAED,eAKC;YALD,wCAKC;4BA1DK,4BAA4B,EAAE,2BAA2B,EAAE,iBAAiB,EAAE,qBAAqB;;iFA4FpG,4BAA4B;cAhGxC,SAAS;2BACI,0BAA0B,cACxB,IAAI,mBACC,uBAAuB,CAAC,MAAM,WACtC,CAAC,4BAA4B,EAAE,2BAA2B,EAAE,iBAAiB,EAAE,qBAAqB,CAAC,YACpG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA0DT;;kBAqCA,KAAK;;kFAJG,4BAA4B","sourcesContent":["/**\n * @fileoverview The Bulk Operations hub: lists the org's Record Processes, lets a user create / edit one\n * (via the embedded {@link RecordProcessEditorComponent}), and run any of them on demand (mounting the\n * same dry-run → confirm runner used from a grid). Generic + reusable — Explorer's Bulk Operations app\n * hosts it, but any MJ app can drop it in.\n * @module @memberjunction/ng-record-process-studio\n */\nimport { ChangeDetectionStrategy, ChangeDetectorRef, Component, Input, OnInit, inject } from '@angular/core';\nimport { BaseAngularComponent } from '@memberjunction/ng-base-types';\nimport { RunView } from '@memberjunction/core';\nimport type { MJRecordProcessEntity } from '@memberjunction/core-entities';\nimport { EntityActionUXHostComponent, type EntityActionUXContext, type EntityActionUXResult } from '@memberjunction/ng-entity-action-ux';\nimport { MJButtonDirective, MJEmptyStateComponent } from '@memberjunction/ng-ui-components';\nimport { RecordProcessEditorComponent } from '../record-process-editor/record-process-editor.component';\n\n/** A row of the process list (read-only projection). */\ninterface ProcessRow {\n ID: string;\n Name: string;\n Description?: string;\n Entity: string;\n EntityID: string;\n WorkType: MJRecordProcessEntity['WorkType'];\n Status: MJRecordProcessEntity['Status'];\n ScopeType: MJRecordProcessEntity['ScopeType'];\n ScopeFilter?: string;\n ScopeViewID?: string;\n ScopeListID?: string;\n}\n\n@Component({\n selector: 'mj-record-process-studio',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [RecordProcessEditorComponent, EntityActionUXHostComponent, MJButtonDirective, MJEmptyStateComponent],\n template: `\n @if (Mode === 'list') {\n <div class=\"rps-bar\">\n <div class=\"rps-search\"><i class=\"fa-solid fa-magnifying-glass\"></i>\n <input class=\"mj-input\" placeholder=\"Search bulk operations…\" [value]=\"Search\" (input)=\"onSearch($event)\"></div>\n <span class=\"rps-spacer\"></span>\n <button mjButton variant=\"flat\" (click)=\"reload()\"><i class=\"fa-solid fa-arrows-rotate\"></i> Refresh</button>\n <button mjButton variant=\"primary\" (click)=\"New()\"><i class=\"fa-solid fa-plus\"></i> New operation</button>\n </div>\n\n @if (Loading) {\n <div class=\"rps-msg\"><i class=\"fa-solid fa-circle-notch fa-spin\"></i> Loading…</div>\n } @else if (Filtered.length === 0) {\n <mj-empty-state class=\"rps-empty\"\n Icon=\"fa-solid fa-list-check\"\n Title=\"No bulk operations yet\"\n ActionText=\"Create one\"\n ActionIcon=\"fa-solid fa-plus\"\n (Action)=\"New()\" />\n } @else {\n <div class=\"rps-table\">\n <div class=\"rps-tr rps-head\">\n <div>Operation</div><div>Entity</div><div>Type</div><div>Status</div><div class=\"ta-r\">Actions</div>\n </div>\n @for (p of Filtered; track p.ID) {\n <div class=\"rps-tr\" (click)=\"Edit(p)\">\n <div><div class=\"rps-nm\">{{ p.Name }}</div>@if (p.Description) {<div class=\"rps-sub\">{{ p.Description }}</div>}</div>\n <div>{{ p.Entity }}</div>\n <div><span class=\"pill purple\">{{ workLabel(p.WorkType) }}</span></div>\n <div><span class=\"pill\" [class.ok]=\"p.Status==='Active'\" [class.warn]=\"p.Status==='Draft'\" [class.muted]=\"p.Status==='Disabled'\">{{ p.Status }}</span></div>\n <div class=\"ta-r rps-acts\" (click)=\"$event.stopPropagation()\">\n <button class=\"iconbtn run\" title=\"Run\" (click)=\"Run(p)\"><i class=\"fa-solid fa-play\"></i></button>\n <button class=\"iconbtn\" title=\"Edit\" (click)=\"Edit(p)\"><i class=\"fa-solid fa-pen\"></i></button>\n </div>\n </div>\n }\n </div>\n }\n } @else {\n <div class=\"rps-editbar\">\n <button mjButton variant=\"flat\" (click)=\"backToList()\"><i class=\"fa-solid fa-arrow-left\"></i> Back</button>\n <h2>{{ EditingID ? 'Edit operation' : 'New operation' }}</h2>\n </div>\n <mj-record-process-editor\n [RecordProcessID]=\"EditingID\"\n [DefaultEntityID]=\"EntityID\"\n [Provider]=\"Provider\"\n (Saved)=\"onSaved()\"\n (Cancelled)=\"backToList()\">\n </mj-record-process-editor>\n }\n\n @if (RunDriver) {\n <mj-entity-action-ux-host\n [DriverClass]=\"RunDriver.DriverClass\" [Context]=\"RunDriver.Context\"\n (Completed)=\"onRunDone($event)\" (Cancelled)=\"RunDriver = null\">\n </mj-entity-action-ux-host>\n }\n `,\n styles: [`\n :host{display:block;color:var(--mj-text-primary)}\n .rps-bar{display:flex;align-items:center;gap:12px;margin-bottom:16px}\n .rps-search{position:relative;flex:0 0 360px;max-width:360px}\n .rps-search i{position:absolute;left:12px;top:50%;transform:translateY(-50%);color:var(--mj-text-muted);font-size:13px}\n .rps-search input{padding-left:34px}\n .rps-spacer{flex:1}\n .rps-bar button i,.rps-editbar button i{margin-right:6px}\n .rps-msg,.rps-empty{padding:40px;text-align:center;color:var(--mj-text-muted)}\n .rps-empty i{font-size:30px;display:block;margin-bottom:12px;color:var(--mj-text-disabled)}\n .rps-empty p{margin:0 0 16px}\n .rps-table{border:1px solid var(--mj-border-subtle);border-radius:var(--mj-radius-md,10px);overflow:hidden}\n .rps-tr{display:grid;grid-template-columns:2.2fr 1.2fr 1fr .8fr 1fr;gap:14px;align-items:center;padding:13px 16px;border-bottom:1px solid var(--mj-border-subtle);cursor:pointer;font-size:13.5px}\n .rps-tr:last-child{border-bottom:none}\n .rps-tr:not(.rps-head):hover{background:var(--mj-bg-surface-hover)}\n .rps-head{background:var(--mj-bg-surface-sunken);font-size:11.5px;text-transform:uppercase;letter-spacing:.05em;color:var(--mj-text-muted);font-weight:700;cursor:default}\n .rps-nm{font-weight:600}\n .rps-sub{color:var(--mj-text-muted);font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:420px}\n .ta-r{text-align:right;justify-self:end}\n .rps-acts{display:flex;gap:6px}\n .iconbtn{width:30px;height:30px;border-radius:7px;border:1px solid var(--mj-border-default);background:var(--mj-bg-surface-card);color:var(--mj-text-secondary);cursor:pointer;font-size:12.5px}\n .iconbtn:hover{background:var(--mj-bg-surface-hover);color:var(--mj-text-primary)}\n .iconbtn.run:hover{color:var(--mj-status-success-text);border-color:var(--mj-status-success)}\n .pill{display:inline-flex;align-items:center;padding:3px 10px;border-radius:999px;font-size:11.5px;font-weight:700;background:var(--mj-bg-surface-sunken);color:var(--mj-text-secondary)}\n .pill.purple{background:color-mix(in srgb,var(--mj-brand-primary) 14%,transparent);color:var(--mj-brand-primary)}\n .pill.ok{background:var(--mj-status-success-bg);color:var(--mj-status-success-text)}\n .pill.warn{background:var(--mj-status-warning-bg);color:var(--mj-status-warning-text)}\n .pill.muted{background:var(--mj-bg-surface-sunken);color:var(--mj-text-muted)}\n .rps-editbar{display:flex;align-items:center;gap:14px;margin-bottom:18px}\n .rps-editbar h2{margin:0;font-size:18px;font-weight:700}\n `],\n})\nexport class RecordProcessStudioComponent extends BaseAngularComponent implements OnInit {\n private cdr = inject(ChangeDetectorRef);\n\n /** Optional: restrict the hub to processes for one entity (e.g. when embedded on an entity page). */\n @Input() EntityID: string | null = null;\n\n public Mode: 'list' | 'edit' = 'list';\n public EditingID: string | null = null;\n public Loading = true;\n public Search = '';\n public Processes: ProcessRow[] = [];\n public RunDriver: { DriverClass: string; Context: EntityActionUXContext } | null = null;\n\n async ngOnInit(): Promise<void> {\n await this.Reload();\n }\n\n get Filtered(): ProcessRow[] {\n const q = this.Search.trim().toLowerCase();\n if (!q) return this.Processes;\n return this.Processes.filter((p) => p.Name.toLowerCase().includes(q) || (p.Entity ?? '').toLowerCase().includes(q));\n }\n\n async Reload(): Promise<void> {\n this.Loading = true; this.cdr.detectChanges();\n const rv = RunView.FromMetadataProvider(this.ProviderToUse);\n const filter = this.EntityID ? `EntityID='${this.EntityID}'` : '';\n const result = await rv.RunView<ProcessRow>({\n EntityName: 'MJ: Record Processes',\n Fields: ['ID', 'Name', 'Description', 'Entity', 'EntityID', 'WorkType', 'Status', 'ScopeType', 'ScopeFilter', 'ScopeViewID', 'ScopeListID'],\n ExtraFilter: filter,\n OrderBy: 'Name',\n ResultType: 'simple',\n });\n this.Processes = result.Success ? (result.Results ?? []) : [];\n this.Loading = false;\n this.cdr.detectChanges();\n }\n\n /** @deprecated Use {@link Reload}. */\n async reload(): Promise<void> {\n return this.Reload();\n }\n\n OnSearch(event: Event): void { this.Search = (event.target as HTMLInputElement).value; this.cdr.detectChanges(); }\n\n /** @deprecated Use {@link OnSearch}. */\n onSearch(event: Event): void {\n return this.OnSearch(event);\n }\n\n New(): void { this.EditingID = null; this.Mode = 'edit'; this.cdr.detectChanges(); }\n Edit(p: ProcessRow): void { this.EditingID = p.ID; this.Mode = 'edit'; this.cdr.detectChanges(); }\n BackToList(): void { this.Mode = 'list'; this.EditingID = null; this.cdr.detectChanges(); }\n\n /** @deprecated Use {@link BackToList}. */\n backToList(): void {\n return this.BackToList();\n }\n async OnSaved(): Promise<void> { this.BackToList(); await this.Reload(); }\n\n /** @deprecated Use {@link OnSaved}. */\n async onSaved(): Promise<void> {\n return this.OnSaved();\n }\n\n /** Runs a process on demand against its default scope, via the dry-run → confirm runner. */\n Run(p: ProcessRow): void {\n const entity = this.ProviderToUse.EntityByID(p.EntityID);\n if (!entity) return;\n this.RunDriver = {\n DriverClass: 'RecordProcessRunnerUX',\n Context: {\n EntityInfo: entity,\n ScopeKind: (p.ScopeType?.toLowerCase() as EntityActionUXContext['ScopeKind']) || 'filter',\n Filter: p.ScopeFilter ?? undefined,\n ViewID: p.ScopeViewID ?? undefined,\n ListID: p.ScopeListID ?? undefined,\n Config: { RecordProcessID: p.ID },\n Provider: this.ProviderToUse,\n ActionLabel: p.Name,\n },\n };\n this.cdr.detectChanges();\n }\n\n OnRunDone(_r: EntityActionUXResult): void { this.RunDriver = null; this.cdr.detectChanges(); }\n\n /** @deprecated Use {@link OnRunDone}. */\n onRunDone(_r: EntityActionUXResult): void {\n return this.OnRunDone(_r);\n }\n\n WorkLabel(workType: string): string {\n return workType === 'FieldRules' ? 'Field Rules' : workType;\n }\n\n /** @deprecated Use {@link WorkLabel}. */\n workLabel(workType: string): string {\n return this.WorkLabel(workType);\n }\n}\n"]}