@mj-biz-apps/common-ng 5.51.0 → 5.53.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.
Files changed (40) hide show
  1. package/dist/lib/components/address-editor/address-editor.component.d.ts.map +1 -1
  2. package/dist/lib/components/address-editor/address-editor.component.js +5 -2
  3. package/dist/lib/components/address-editor/address-editor.component.js.map +1 -1
  4. package/dist/lib/components/contact-method-list/contact-method-list.component.d.ts +5 -0
  5. package/dist/lib/components/contact-method-list/contact-method-list.component.d.ts.map +1 -1
  6. package/dist/lib/components/contact-method-list/contact-method-list.component.js +6 -1
  7. package/dist/lib/components/contact-method-list/contact-method-list.component.js.map +1 -1
  8. package/dist/lib/components/related-chips/related-links.js +2 -2
  9. package/dist/lib/components/related-chips/related-links.js.map +1 -1
  10. package/dist/lib/components/selling-company-field/selling-company-field.component.d.ts.map +1 -1
  11. package/dist/lib/components/selling-company-field/selling-company-field.component.js +3 -2
  12. package/dist/lib/components/selling-company-field/selling-company-field.component.js.map +1 -1
  13. package/dist/lib/custom/custom-forms.module.d.ts +2 -1
  14. package/dist/lib/custom/custom-forms.module.d.ts.map +1 -1
  15. package/dist/lib/custom/custom-forms.module.js +9 -3
  16. package/dist/lib/custom/custom-forms.module.js.map +1 -1
  17. package/dist/lib/custom/panels/organization-staff.panel.d.ts +38 -0
  18. package/dist/lib/custom/panels/organization-staff.panel.d.ts.map +1 -0
  19. package/dist/lib/custom/panels/organization-staff.panel.js +282 -0
  20. package/dist/lib/custom/panels/organization-staff.panel.js.map +1 -0
  21. package/dist/lib/custom/panels/person-addresses.panel.js +1 -1
  22. package/dist/lib/custom/panels/person-addresses.panel.js.map +1 -1
  23. package/dist/lib/custom/panels/person-relationships.panel.js +1 -1
  24. package/dist/lib/custom/panels/person-relationships.panel.js.map +1 -1
  25. package/dist/lib/data/__tests__/organization-staff.test.d.ts +2 -0
  26. package/dist/lib/data/__tests__/organization-staff.test.d.ts.map +1 -0
  27. package/dist/lib/data/__tests__/organization-staff.test.js +124 -0
  28. package/dist/lib/data/__tests__/organization-staff.test.js.map +1 -0
  29. package/dist/lib/data/directory-views.d.ts.map +1 -1
  30. package/dist/lib/data/directory-views.js +2 -1
  31. package/dist/lib/data/directory-views.js.map +1 -1
  32. package/dist/lib/data/organization-staff.d.ts +87 -0
  33. package/dist/lib/data/organization-staff.d.ts.map +1 -0
  34. package/dist/lib/data/organization-staff.js +99 -0
  35. package/dist/lib/data/organization-staff.js.map +1 -0
  36. package/dist/public-api.d.ts +2 -0
  37. package/dist/public-api.d.ts.map +1 -1
  38. package/dist/public-api.js +2 -0
  39. package/dist/public-api.js.map +1 -1
  40. package/package.json +26 -14
@@ -0,0 +1,282 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { ChangeDetectionStrategy, ChangeDetectorRef, Component, inject } from '@angular/core';
8
+ import { CommonModule } from '@angular/common';
9
+ import { CompositeKey, Metadata } from '@memberjunction/core';
10
+ import { RegisterClassEx } from '@memberjunction/global';
11
+ import { BaseFormPanel, BaseFormsModule } from '@memberjunction/ng-base-forms';
12
+ import { StatTileComponent } from '../../components/stat-tile/stat-tile.component';
13
+ import { StatRowComponent } from '../../components/stat-tile/stat-row.component';
14
+ import { COMMON_ENTITIES } from '../../data/entity-names';
15
+ import { CommonStaffFigures, DiscoverOrganizationStaffContributors, LoadOrganizationStaff, RunStaffContributors, } from '../../data/organization-staff';
16
+ import * as i0 from "@angular/core";
17
+ import * as i1 from "@memberjunction/ng-base-forms";
18
+ import * as i2 from "@angular/common";
19
+ const _forTrack0 = ($index, $item) => $item.Id;
20
+ const _forTrack1 = ($index, $item) => $item.PersonID;
21
+ function OrganizationStaffPanel_Conditional_1_Template(rf, ctx) { if (rf & 1) {
22
+ i0.ɵɵelementStart(0, "p", 1);
23
+ i0.ɵɵtext(1, "Save the organization to see its staff.");
24
+ i0.ɵɵelementEnd();
25
+ } }
26
+ function OrganizationStaffPanel_Conditional_2_Template(rf, ctx) { if (rf & 1) {
27
+ i0.ɵɵelementStart(0, "div", 1);
28
+ i0.ɵɵtext(1, "Loading staff\u2026");
29
+ i0.ɵɵelementEnd();
30
+ } }
31
+ function OrganizationStaffPanel_Conditional_3_Template(rf, ctx) { if (rf & 1) {
32
+ i0.ɵɵelementStart(0, "p", 2);
33
+ i0.ɵɵtext(1);
34
+ i0.ɵɵelementEnd();
35
+ } if (rf & 2) {
36
+ const ctx_r0 = i0.ɵɵnextContext();
37
+ i0.ɵɵadvance();
38
+ i0.ɵɵtextInterpolate(ctx_r0.LoadError);
39
+ } }
40
+ function OrganizationStaffPanel_Conditional_4_Template(rf, ctx) { if (rf & 1) {
41
+ i0.ɵɵelementStart(0, "p", 1);
42
+ i0.ɵɵtext(1, "No active staff on file. Staff are people with an active Employee relationship to this organization.");
43
+ i0.ɵɵelementEnd();
44
+ } }
45
+ function OrganizationStaffPanel_Conditional_5_For_2_Template(rf, ctx) { if (rf & 1) {
46
+ i0.ɵɵelement(0, "bizapps-stat-tile", 4);
47
+ } if (rf & 2) {
48
+ const figure_r2 = ctx.$implicit;
49
+ i0.ɵɵproperty("Label", figure_r2.Label)("Icon", figure_r2.Icon ?? null)("Value", figure_r2.Value)("Detail", figure_r2.Detail ?? null)("Tone", figure_r2.Tone ?? "none")("Clickable", false);
50
+ } }
51
+ function OrganizationStaffPanel_Conditional_5_For_14_Template(rf, ctx) { if (rf & 1) {
52
+ i0.ɵɵelementStart(0, "th");
53
+ i0.ɵɵtext(1);
54
+ i0.ɵɵelementEnd();
55
+ } if (rf & 2) {
56
+ const col_r3 = ctx.$implicit;
57
+ i0.ɵɵadvance();
58
+ i0.ɵɵtextInterpolate(col_r3.Header);
59
+ } }
60
+ function OrganizationStaffPanel_Conditional_5_For_17_For_10_Template(rf, ctx) { if (rf & 1) {
61
+ i0.ɵɵelementStart(0, "td");
62
+ i0.ɵɵtext(1);
63
+ i0.ɵɵelementEnd();
64
+ } if (rf & 2) {
65
+ const col_r6 = ctx.$implicit;
66
+ const member_r5 = i0.ɵɵnextContext().$implicit;
67
+ const cell_r7 = i0.ɵɵnextContext(2).CellFor(member_r5, col_r6);
68
+ i0.ɵɵclassMap("bizapps-staff-cell bizapps-staff-cell--" + ((cell_r7 == null ? null : cell_r7.Tone) ?? "none"));
69
+ i0.ɵɵattribute("title", (cell_r7 == null ? null : cell_r7.Title) ?? null);
70
+ i0.ɵɵadvance();
71
+ i0.ɵɵtextInterpolate((cell_r7 == null ? null : cell_r7.Text) ?? "\u2014");
72
+ } }
73
+ function OrganizationStaffPanel_Conditional_5_For_17_Template(rf, ctx) { if (rf & 1) {
74
+ const _r4 = i0.ɵɵgetCurrentView();
75
+ i0.ɵɵelementStart(0, "tr")(1, "td")(2, "button", 7);
76
+ i0.ɵɵlistener("click", function OrganizationStaffPanel_Conditional_5_For_17_Template_button_click_2_listener() { const member_r5 = i0.ɵɵrestoreView(_r4).$implicit; const ctx_r0 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r0.OpenPerson(member_r5)); });
77
+ i0.ɵɵtext(3);
78
+ i0.ɵɵelementEnd()();
79
+ i0.ɵɵelementStart(4, "td");
80
+ i0.ɵɵtext(5);
81
+ i0.ɵɵelementEnd();
82
+ i0.ɵɵelementStart(6, "td");
83
+ i0.ɵɵtext(7);
84
+ i0.ɵɵpipe(8, "date");
85
+ i0.ɵɵelementEnd();
86
+ i0.ɵɵrepeaterCreate(9, OrganizationStaffPanel_Conditional_5_For_17_For_10_Template, 2, 4, "td", 8, _forTrack0);
87
+ i0.ɵɵelementEnd();
88
+ } if (rf & 2) {
89
+ const member_r5 = ctx.$implicit;
90
+ const ctx_r0 = i0.ɵɵnextContext(2);
91
+ i0.ɵɵadvance(3);
92
+ i0.ɵɵtextInterpolate(member_r5.Name);
93
+ i0.ɵɵadvance(2);
94
+ i0.ɵɵtextInterpolate(member_r5.Title || "\u2014");
95
+ i0.ɵɵadvance(2);
96
+ i0.ɵɵtextInterpolate(member_r5.StartDate ? i0.ɵɵpipeBind3(8, 3, member_r5.StartDate, "MMM y", "UTC") : "\u2014");
97
+ i0.ɵɵadvance(2);
98
+ i0.ɵɵrepeater(ctx_r0.Columns);
99
+ } }
100
+ function OrganizationStaffPanel_Conditional_5_Template(rf, ctx) { if (rf & 1) {
101
+ i0.ɵɵelementStart(0, "bizapps-stat-row", 3);
102
+ i0.ɵɵrepeaterCreate(1, OrganizationStaffPanel_Conditional_5_For_2_Template, 1, 6, "bizapps-stat-tile", 4, i0.ɵɵrepeaterTrackByIndex);
103
+ i0.ɵɵelementEnd();
104
+ i0.ɵɵelementStart(3, "div", 5)(4, "table", 6)(5, "thead")(6, "tr")(7, "th");
105
+ i0.ɵɵtext(8, "Name");
106
+ i0.ɵɵelementEnd();
107
+ i0.ɵɵelementStart(9, "th");
108
+ i0.ɵɵtext(10, "Title");
109
+ i0.ɵɵelementEnd();
110
+ i0.ɵɵelementStart(11, "th");
111
+ i0.ɵɵtext(12, "Since");
112
+ i0.ɵɵelementEnd();
113
+ i0.ɵɵrepeaterCreate(13, OrganizationStaffPanel_Conditional_5_For_14_Template, 2, 1, "th", null, _forTrack0);
114
+ i0.ɵɵelementEnd()();
115
+ i0.ɵɵelementStart(15, "tbody");
116
+ i0.ɵɵrepeaterCreate(16, OrganizationStaffPanel_Conditional_5_For_17_Template, 11, 7, "tr", null, _forTrack1);
117
+ i0.ɵɵelementEnd()()();
118
+ } if (rf & 2) {
119
+ const ctx_r0 = i0.ɵɵnextContext();
120
+ i0.ɵɵproperty("Error", ctx_r0.ContributorError);
121
+ i0.ɵɵadvance();
122
+ i0.ɵɵrepeater(ctx_r0.Figures);
123
+ i0.ɵɵadvance(12);
124
+ i0.ɵɵrepeater(ctx_r0.Columns);
125
+ i0.ɵɵadvance(3);
126
+ i0.ɵɵrepeater(ctx_r0.Staff);
127
+ } }
128
+ /**
129
+ * Organization form **Staff** section: the organization's active employees, rolled up into headline
130
+ * figures and a staff table. Other apps add figures and columns through
131
+ * `OrganizationStaffContributor` (see `data/organization-staff.ts`); this section never names them.
132
+ */
133
+ let OrganizationStaffPanel = class OrganizationStaffPanel extends BaseFormPanel {
134
+ cdr = inject(ChangeDetectorRef);
135
+ Staff = [];
136
+ Figures = [];
137
+ Columns = [];
138
+ IsLoading = false;
139
+ LoadError = null;
140
+ /** One line naming the contributors that failed; their figures and columns are absent. */
141
+ ContributorError = null;
142
+ results = [];
143
+ async ngOnInit() {
144
+ if (this.Record?.IsSaved) {
145
+ await this.load();
146
+ }
147
+ }
148
+ /** The cell a contributor supplied for this person and column, if any. */
149
+ CellFor(member, col) {
150
+ const result = this.results.find(r => r.Contributor.Key === col.ContributorKey);
151
+ return result?.Contribution?.Cells.get(member.PersonID.toUpperCase())?.[col.Key] ?? null;
152
+ }
153
+ OpenPerson(member) {
154
+ this.FormComponent.OnFormNavigate({
155
+ Kind: 'record',
156
+ EntityName: COMMON_ENTITIES.Person,
157
+ PrimaryKey: CompositeKey.FromID(member.PersonID),
158
+ });
159
+ }
160
+ async load() {
161
+ this.IsLoading = true;
162
+ this.cdr.detectChanges();
163
+ try {
164
+ const provider = Metadata.Provider;
165
+ this.Staff = await LoadOrganizationStaff(this.Record.ID, provider);
166
+ if (this.Staff.length > 0) {
167
+ const request = { OrganizationID: this.Record.ID, Staff: this.Staff, Provider: provider };
168
+ this.results = await RunStaffContributors(DiscoverOrganizationStaffContributors(), request);
169
+ }
170
+ this.applyResults();
171
+ }
172
+ catch (e) {
173
+ this.LoadError = e instanceof Error ? e.message : 'Could not load the organization\'s staff.';
174
+ }
175
+ finally {
176
+ this.IsLoading = false;
177
+ this.cdr.detectChanges();
178
+ }
179
+ }
180
+ applyResults() {
181
+ const ok = this.results.filter(r => r.Contribution);
182
+ this.Figures = [...CommonStaffFigures(this.Staff), ...ok.flatMap(r => r.Contribution.Figures)];
183
+ this.Columns = ok.flatMap(r => r.Contribution.Columns.map(c => ({
184
+ Id: `${r.Contributor.Key}:${c.Key}`,
185
+ ContributorKey: r.Contributor.Key,
186
+ Key: c.Key,
187
+ Header: c.Header,
188
+ })));
189
+ const failed = this.results.filter(r => r.Error).map(r => r.Contributor.Label);
190
+ this.ContributorError = failed.length > 0
191
+ ? `Could not load: ${failed.join(', ')}. Those figures and columns are not shown.`
192
+ : null;
193
+ }
194
+ static ɵfac = /*@__PURE__*/ (() => { let ɵOrganizationStaffPanel_BaseFactory; return function OrganizationStaffPanel_Factory(__ngFactoryType__) { return (ɵOrganizationStaffPanel_BaseFactory || (ɵOrganizationStaffPanel_BaseFactory = i0.ɵɵgetInheritedFactory(OrganizationStaffPanel)))(__ngFactoryType__ || OrganizationStaffPanel); }; })();
195
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: OrganizationStaffPanel, selectors: [["bizapps-organization-staff-panel"]], features: [i0.ɵɵInheritDefinitionFeature], decls: 6, vars: 5, consts: [["SectionKey", "staff", "SectionName", "Staff", "Icon", "fa-solid fa-id-badge", 3, "Form", "FormContext", "BadgeCount", "DefaultExpanded"], [1, "bizapps-staff-empty"], ["role", "status", 1, "bizapps-staff-error"], [3, "Error"], [3, "Label", "Icon", "Value", "Detail", "Tone", "Clickable"], [1, "bizapps-staff-table-wrap"], [1, "bizapps-staff-table"], ["type", "button", 1, "bizapps-staff-link", 3, "click"], [3, "class"]], template: function OrganizationStaffPanel_Template(rf, ctx) { if (rf & 1) {
196
+ i0.ɵɵelementStart(0, "mj-collapsible-panel", 0);
197
+ i0.ɵɵconditionalCreate(1, OrganizationStaffPanel_Conditional_1_Template, 2, 0, "p", 1)(2, OrganizationStaffPanel_Conditional_2_Template, 2, 0, "div", 1)(3, OrganizationStaffPanel_Conditional_3_Template, 2, 1, "p", 2)(4, OrganizationStaffPanel_Conditional_4_Template, 2, 0, "p", 1)(5, OrganizationStaffPanel_Conditional_5_Template, 18, 1);
198
+ i0.ɵɵelementEnd();
199
+ } if (rf & 2) {
200
+ i0.ɵɵproperty("Form", ctx.FormComponent)("FormContext", ctx.FormContext)("BadgeCount", ctx.Staff.length)("DefaultExpanded", true);
201
+ i0.ɵɵadvance();
202
+ i0.ɵɵconditional(!ctx.Record.IsSaved ? 1 : ctx.IsLoading ? 2 : ctx.LoadError ? 3 : ctx.Staff.length === 0 ? 4 : 5);
203
+ } }, dependencies: [CommonModule, BaseFormsModule, i1.MjCollapsiblePanelComponent, StatTileComponent, StatRowComponent, i2.DatePipe], styles: ["[_nghost-%COMP%] { display: block; width: 100%; }\n .bizapps-staff-empty[_ngcontent-%COMP%] { color: var(--mj-text-muted); font-size: 13px; margin: 0; padding: 8px 0; }\n .bizapps-staff-error[_ngcontent-%COMP%] { color: var(--mj-status-error-text); font-size: 13px; margin: 0; padding: 8px 0; }\n .bizapps-staff-table-wrap[_ngcontent-%COMP%] { margin-top: 12px; max-height: 420px; overflow: auto; border: 1px solid var(--mj-border-default); border-radius: var(--mj-radius-md, 8px); }\n .bizapps-staff-table[_ngcontent-%COMP%] { width: 100%; border-collapse: collapse; font-size: 13px; }\n .bizapps-staff-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%] { position: sticky; top: 0; background: var(--mj-bg-surface-sunken, var(--mj-bg-surface)); color: var(--mj-text-secondary); font-weight: 600; text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--mj-border-default); white-space: nowrap; }\n .bizapps-staff-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%] { padding: 7px 10px; border-bottom: 1px solid var(--mj-border-subtle, var(--mj-border-default)); color: var(--mj-text-primary); }\n .bizapps-staff-table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:last-child td[_ngcontent-%COMP%] { border-bottom: none; }\n .bizapps-staff-link[_ngcontent-%COMP%] { background: none; border: none; padding: 0; font: inherit; color: var(--mj-brand-primary); cursor: pointer; text-align: left; }\n .bizapps-staff-link[_ngcontent-%COMP%]:hover { text-decoration: underline; }\n .bizapps-staff-cell--success[_ngcontent-%COMP%] { color: var(--mj-status-success-text); font-weight: 600; }\n .bizapps-staff-cell--warn[_ngcontent-%COMP%] { color: var(--mj-status-warning-text); font-weight: 600; }\n .bizapps-staff-cell--error[_ngcontent-%COMP%] { color: var(--mj-status-error-text); font-weight: 600; }\n .bizapps-staff-cell--muted[_ngcontent-%COMP%] { color: var(--mj-text-muted); }"], changeDetection: 0 });
204
+ };
205
+ OrganizationStaffPanel = __decorate([
206
+ RegisterClassEx(BaseFormPanel, {
207
+ key: 'form-panel:Organizations:staff',
208
+ metadata: {
209
+ entity: 'MJ_BizApps_Common: Organizations',
210
+ slot: 'after-fields',
211
+ sortKey: 80,
212
+ contributionKey: 'staff',
213
+ },
214
+ })
215
+ ], OrganizationStaffPanel);
216
+ export { OrganizationStaffPanel };
217
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(OrganizationStaffPanel, [{
218
+ type: Component,
219
+ args: [{ selector: 'bizapps-organization-staff-panel', standalone: true, imports: [CommonModule, BaseFormsModule, StatTileComponent, StatRowComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: `
220
+ <mj-collapsible-panel
221
+ SectionKey="staff"
222
+ SectionName="Staff"
223
+ Icon="fa-solid fa-id-badge"
224
+ [Form]="FormComponent"
225
+ [FormContext]="FormContext"
226
+ [BadgeCount]="Staff.length"
227
+ [DefaultExpanded]="true">
228
+ @if (!Record.IsSaved) {
229
+ <p class="bizapps-staff-empty">Save the organization to see its staff.</p>
230
+ } @else if (IsLoading) {
231
+ <div class="bizapps-staff-empty">Loading staff…</div>
232
+ } @else if (LoadError) {
233
+ <p class="bizapps-staff-error" role="status">{{ LoadError }}</p>
234
+ } @else if (Staff.length === 0) {
235
+ <p class="bizapps-staff-empty">No active staff on file. Staff are people with an active Employee relationship to this organization.</p>
236
+ } @else {
237
+ <bizapps-stat-row [Error]="ContributorError">
238
+ @for (figure of Figures; track $index) {
239
+ <bizapps-stat-tile
240
+ [Label]="figure.Label"
241
+ [Icon]="figure.Icon ?? null"
242
+ [Value]="figure.Value"
243
+ [Detail]="figure.Detail ?? null"
244
+ [Tone]="figure.Tone ?? 'none'"
245
+ [Clickable]="false" />
246
+ }
247
+ </bizapps-stat-row>
248
+ <div class="bizapps-staff-table-wrap">
249
+ <table class="bizapps-staff-table">
250
+ <thead>
251
+ <tr>
252
+ <th>Name</th>
253
+ <th>Title</th>
254
+ <th>Since</th>
255
+ @for (col of Columns; track col.Id) {
256
+ <th>{{ col.Header }}</th>
257
+ }
258
+ </tr>
259
+ </thead>
260
+ <tbody>
261
+ @for (member of Staff; track member.PersonID) {
262
+ <tr>
263
+ <td>
264
+ <button type="button" class="bizapps-staff-link" (click)="OpenPerson(member)">{{ member.Name }}</button>
265
+ </td>
266
+ <td>{{ member.Title || '—' }}</td>
267
+ <td>{{ member.StartDate ? (member.StartDate | date: 'MMM y' : 'UTC') : '—' }}</td>
268
+ @for (col of Columns; track col.Id) {
269
+ @let cell = CellFor(member, col);
270
+ <td [class]="'bizapps-staff-cell bizapps-staff-cell--' + (cell?.Tone ?? 'none')" [attr.title]="cell?.Title ?? null">{{ cell?.Text ?? '—' }}</td>
271
+ }
272
+ </tr>
273
+ }
274
+ </tbody>
275
+ </table>
276
+ </div>
277
+ }
278
+ </mj-collapsible-panel>
279
+ `, styles: ["\n :host { display: block; width: 100%; }\n .bizapps-staff-empty { color: var(--mj-text-muted); font-size: 13px; margin: 0; padding: 8px 0; }\n .bizapps-staff-error { color: var(--mj-status-error-text); font-size: 13px; margin: 0; padding: 8px 0; }\n .bizapps-staff-table-wrap { margin-top: 12px; max-height: 420px; overflow: auto; border: 1px solid var(--mj-border-default); border-radius: var(--mj-radius-md, 8px); }\n .bizapps-staff-table { width: 100%; border-collapse: collapse; font-size: 13px; }\n .bizapps-staff-table th { position: sticky; top: 0; background: var(--mj-bg-surface-sunken, var(--mj-bg-surface)); color: var(--mj-text-secondary); font-weight: 600; text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--mj-border-default); white-space: nowrap; }\n .bizapps-staff-table td { padding: 7px 10px; border-bottom: 1px solid var(--mj-border-subtle, var(--mj-border-default)); color: var(--mj-text-primary); }\n .bizapps-staff-table tr:last-child td { border-bottom: none; }\n .bizapps-staff-link { background: none; border: none; padding: 0; font: inherit; color: var(--mj-brand-primary); cursor: pointer; text-align: left; }\n .bizapps-staff-link:hover { text-decoration: underline; }\n .bizapps-staff-cell--success { color: var(--mj-status-success-text); font-weight: 600; }\n .bizapps-staff-cell--warn { color: var(--mj-status-warning-text); font-weight: 600; }\n .bizapps-staff-cell--error { color: var(--mj-status-error-text); font-weight: 600; }\n .bizapps-staff-cell--muted { color: var(--mj-text-muted); }\n "] }]
280
+ }], null, null); })();
281
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(OrganizationStaffPanel, { className: "OrganizationStaffPanel", filePath: "lib/custom/panels/organization-staff.panel.ts", lineNumber: 126 }); })();
282
+ //# sourceMappingURL=organization-staff.panel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"organization-staff.panel.js","sourceRoot":"","sources":["../../../../src/lib/custom/panels/organization-staff.panel.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,SAAS,EAAU,MAAM,EAAE,MAAM,eAAe,CAAC;AACtG,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,+B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,EAAE;QAC5B,GAAG,EAAE,gCAAgC;QACrC,QAAQ,EAAE;YACN,MAAM,EAAE,kCAAkC;YAC1C,IAAI,EAAE,cAAc;YACpB,OAAO,EAAE,EAAE;YACX,eAAe,EAAE,OAAO;SAC3B;KACJ,CAAC;GAoFW,sBAAsB,CAiElC;;iFAjEY,sBAAsB;cAnFlC,SAAS;2BACI,kCAAkC,cAChC,IAAI,WACP,CAAC,YAAY,EAAE,eAAe,EAAE,iBAAiB,EAAE,gBAAgB,CAAC,mBAC5D,uBAAuB,CAAC,MAAM,YACrC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA4DT;;kFAkBQ,sBAAsB"}
@@ -41,7 +41,7 @@ PersonAddressesPanel = __decorate([
41
41
  key: 'form-panel:People:addresses',
42
42
  metadata: {
43
43
  entity: 'MJ_BizApps_Common: People',
44
- slot: 'after-fields',
44
+ slot: 'after-related', // its own rail tab — after-fields would fold it into Details (MJ #4311 slot default)
45
45
  sortKey: 90,
46
46
  replacesSectionKey: 'contactAddress',
47
47
  contributionKey: 'addresses',
@@ -1 +1 @@
1
- {"version":3,"file":"person-addresses.panel.js","sourceRoot":"","sources":["../../../../src/lib/custom/panels/person-addresses.panel.ts","../../../../src/lib/custom/panels/person-addresses.panel.html"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAE9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;;;;;;ICIhD,iDAI0C;IAAtC,oNAAe,4BAAqB,KAAC;IACzC,iBAAyB;;;IAFrB,AADA,2CAAsB,6BACD;;ADLjC;;;GAGG;AAgBI,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,gBAA6C;6PAA1E,oBAAoB,yBAApB,oBAAoB;6DAApB,oBAAoB;YCzBjC,+CAM6B;YACzB,yGAAsB;YAQ1B,iBAAuB;;YATnB,AADA,AADA,wCAAsB,gCACK,yBACH;YACxB,cAOC;YAPD,6CAOC;;;ADWQ,oBAAoB;IAfhC,eAAe,CAAC,aAAa,EAAE;QAC5B,GAAG,EAAE,6BAA6B;QAClC,QAAQ,EAAE;YACN,MAAM,EAAE,2BAA2B;YACnC,IAAI,EAAE,cAAc;YACpB,OAAO,EAAE,EAAE;YACX,kBAAkB,EAAE,gBAAgB;YACpC,eAAe,EAAE,WAAW;SAC/B;KACJ,CAAC;GAMW,oBAAoB,CAAyD;;iFAA7E,oBAAoB;cALhC,SAAS;6BACM,KAAK,YACP,gCAAgC;;kFAGjC,oBAAoB"}
1
+ {"version":3,"file":"person-addresses.panel.js","sourceRoot":"","sources":["../../../../src/lib/custom/panels/person-addresses.panel.ts","../../../../src/lib/custom/panels/person-addresses.panel.html"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAE9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;;;;;;ICIhD,iDAI0C;IAAtC,oNAAe,4BAAqB,KAAC;IACzC,iBAAyB;;;IAFrB,AADA,2CAAsB,6BACD;;ADLjC;;;GAGG;AAgBI,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,gBAA6C;6PAA1E,oBAAoB,yBAApB,oBAAoB;6DAApB,oBAAoB;YCzBjC,+CAM6B;YACzB,yGAAsB;YAQ1B,iBAAuB;;YATnB,AADA,AADA,wCAAsB,gCACK,yBACH;YACxB,cAOC;YAPD,6CAOC;;;ADWQ,oBAAoB;IAfhC,eAAe,CAAC,aAAa,EAAE;QAC5B,GAAG,EAAE,6BAA6B;QAClC,QAAQ,EAAE;YACN,MAAM,EAAE,2BAA2B;YACnC,IAAI,EAAE,eAAe,EAAE,qFAAqF;YAC5G,OAAO,EAAE,EAAE;YACX,kBAAkB,EAAE,gBAAgB;YACpC,eAAe,EAAE,WAAW;SAC/B;KACJ,CAAC;GAMW,oBAAoB,CAAyD;;iFAA7E,oBAAoB;cALhC,SAAS;6BACM,KAAK,YACP,gCAAgC;;kFAGjC,oBAAoB"}
@@ -147,7 +147,7 @@ PersonRelationshipsPanel = PersonRelationshipsPanel_1 = __decorate([
147
147
  key: 'form-panel:People:relationships',
148
148
  metadata: {
149
149
  entity: 'MJ_BizApps_Common: People',
150
- slot: 'after-fields',
150
+ slot: 'after-related', // its own rail tab — after-fields would fold it into Details (MJ #4311 slot default)
151
151
  sortKey: 70,
152
152
  contributionKey: 'relationships',
153
153
  relatedEntity: 'MJ_BizApps_Common: Relationships',
@@ -1 +1 @@
1
- {"version":3,"file":"person-relationships.panel.js","sourceRoot":"","sources":["../../../../src/lib/custom/panels/person-relationships.panel.ts","../../../../src/lib/custom/panels/person-relationships.panel.html"],"names":[],"mappings":";;;;;;;AAAA,OAAO,EAAE,SAAS,EAAU,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;;;;;;;ICyB5C,oDAKsD;IAAlD,AADA,2OAAe,4BAAqB,KAAC,8NACzB,2CAAoC,KAAC;IACrD,iBAA4B;;;IAHxB,AADA,AADA,2CAAsB,mDACqB,6BACtB;;;;IAKzB,qDAGsD;IAAlD,4OAAY,2CAAoC,KAAC;IACrD,iBAA6B;;;IAFzB,AADA,2CAAsB,mBACJ;;;;IA9BlB,AADJ,AADJ,8BAAuC,aACwD,gBAKrD;IAA9B,4LAAS,m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aAAa,EAAE;QAC5B,GAAG,EAAE,iCAAiC;QACtC,QAAQ,EAAE;YACN,MAAM,EAAE,2BAA2B;YACnC,IAAI,EAAE,cAAc;YACpB,OAAO,EAAE,EAAE;YACX,eAAe,EAAE,eAAe;YAChC,aAAa,EAAE,kCAAkC;SACpD;KACJ,CAAC;GAOW,wBAAwB,CAepC;;iFAfY,wBAAwB;cANpC,SAAS;6BACM,KAAK,YACP,oCAAoC;;kFAIrC,wBAAwB"}
1
+ {"version":3,"file":"person-relationships.panel.js","sourceRoot":"","sources":["../../../../src/lib/custom/panels/person-relationships.panel.ts","../../../../src/lib/custom/panels/person-relationships.panel.html"],"names":[],"mappings":";;;;;;;AAAA,OAAO,EAAE,SAAS,EAAU,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;;;;;;;ICyB5C,oDAKsD;IAAlD,AADA,2OAAe,4BAAqB,KAAC,8NACzB,2CAAoC,KAAC;IACrD,iBAA4B;;;IAHxB,AADA,AADA,2CAAsB,mDACqB,6BACtB;;;;IAKzB,qDAGsD;IAAlD,4OAAY,2CAAoC,KAAC;IACrD,iBAA6B;;;IAFzB,AADA,2CAAsB,mBACJ;;;;IA9BlB,AADJ,AADJ,8BAAuC,aACwD,gBAKrD;IAA9B,4LAAS,mBAAY,MAAM,CAAC,KAAC;IAC7B,uBAAsC;IACtC,4BAAM;IAAA,qBAAK;IACf,AADe,iBAAO,EACb;IACT,iCAImC;IAA/B,4LAAS,mBAAY,OAAO,CAAC,KAAC;IAC9B,uBAAwC;IACxC,4BAAM;IAAA,kCAAkB;IAGpC,AADI,AADI,AAD4B,iBAAO,EAC1B,EACP,EACJ;IAUJ,AARF,gIAA2B,2GAQlB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AAS;6BACM,KAAK,YACP,oCAAoC;;kFAIrC,wBAAwB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=organization-staff.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"organization-staff.test.d.ts","sourceRoot":"","sources":["../../../../src/lib/data/__tests__/organization-staff.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,124 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { describe, expect, it, vi } from 'vitest';
8
+ import { RegisterClass } from '@memberjunction/global';
9
+ import { CommonStaffFigures, DiscoverOrganizationStaffContributors, LoadOrganizationStaff, OrganizationStaffContributor, RunStaffContributors, } from '../organization-staff';
10
+ const TODAY = new Date(Date.UTC(2026, 9, 7)); // 2026-10-07
11
+ function member(id, title, start) {
12
+ return { PersonID: id, Name: `Person ${id}`, Title: title, StartDate: start };
13
+ }
14
+ function contribution(label) {
15
+ return { Figures: [{ Label: label, Value: 1 }], Columns: [], Cells: new Map() };
16
+ }
17
+ describe('CommonStaffFigures', () => {
18
+ it('counts staff, distinct roles, and people who joined in the last 12 months (inclusive)', () => {
19
+ const staff = [
20
+ member('A', 'Cheesemaker', '2026-10-07T00:00:00.000Z'), // today
21
+ member('B', 'Cheesemaker', '2025-10-07T00:00:00.000Z'), // exactly 12 months ago: counts
22
+ member('C', 'Quality Manager', '2025-10-06T00:00:00.000Z'), // one day too old
23
+ member('D', null, null),
24
+ { PersonID: 'E', Name: 'Person E', Title: 'Affineur', StartDate: new Date('2026-01-15T00:00:00.000Z') }, // Date object, as the browser provider sends
25
+ ];
26
+ const figures = CommonStaffFigures(staff, TODAY);
27
+ expect(figures).toEqual([
28
+ { Label: 'Staff', Value: 5, Icon: 'fa-solid fa-users', Detail: '3 roles' },
29
+ { Label: 'Joined in 12 months', Value: 3, Icon: 'fa-solid fa-user-plus' },
30
+ ]);
31
+ });
32
+ it('omits the roles detail when nobody has a title, and says "1 role" for one', () => {
33
+ expect(CommonStaffFigures([member('A', null, null)], TODAY)[0].Detail).toBeUndefined();
34
+ expect(CommonStaffFigures([member('A', 'Affineur', null), member('B', ' Affineur ', null)], TODAY)[0].Detail).toBe('1 role');
35
+ });
36
+ });
37
+ describe('RunStaffContributors', () => {
38
+ class Ok extends OrganizationStaffContributor {
39
+ Key = 'ok';
40
+ Label = 'Good figures';
41
+ async Load() { return contribution('Good'); }
42
+ }
43
+ class Broken extends OrganizationStaffContributor {
44
+ Key = 'broken';
45
+ Label = 'Broken figures';
46
+ async Load() { throw new Error('query not found'); }
47
+ }
48
+ const request = { OrganizationID: 'ORG', Staff: [member('A', null, null)] };
49
+ it('keeps a working contributor when another one throws, and reports the failure', async () => {
50
+ const results = await RunStaffContributors([new Ok(), new Broken()], request);
51
+ expect(results[0].Contribution?.Figures[0].Label).toBe('Good');
52
+ expect(results[0].Error).toBeNull();
53
+ expect(results[1].Contribution).toBeNull();
54
+ expect(results[1].Error).toBe('query not found');
55
+ expect(results[1].Contributor.Label).toBe('Broken figures');
56
+ });
57
+ it('passes the same request to every contributor', async () => {
58
+ const c = new Ok();
59
+ const spy = vi.spyOn(c, 'Load');
60
+ await RunStaffContributors([c], request);
61
+ expect(spy).toHaveBeenCalledWith(request);
62
+ });
63
+ });
64
+ describe('DiscoverOrganizationStaffContributors', () => {
65
+ let LowPriority = class LowPriority extends OrganizationStaffContributor {
66
+ Key = 'test-staff-low';
67
+ Label = 'Low';
68
+ async Load() { return contribution('low'); }
69
+ };
70
+ LowPriority = __decorate([
71
+ RegisterClass(OrganizationStaffContributor, 'test-staff-low')
72
+ ], LowPriority);
73
+ let HighPriority = class HighPriority extends OrganizationStaffContributor {
74
+ Key = 'test-staff-high';
75
+ Label = 'High';
76
+ Priority = 50;
77
+ async Load() { return contribution('high'); }
78
+ };
79
+ HighPriority = __decorate([
80
+ RegisterClass(OrganizationStaffContributor, 'test-staff-high')
81
+ ], HighPriority);
82
+ // An implementation replacing one app's contributor: same key, higher registration priority.
83
+ let LowReplacement = class LowReplacement extends OrganizationStaffContributor {
84
+ Key = 'test-staff-low';
85
+ Label = 'Low (replaced)';
86
+ async Load() { return contribution('replaced'); }
87
+ };
88
+ LowReplacement = __decorate([
89
+ RegisterClass(OrganizationStaffContributor, 'test-staff-low', 10)
90
+ ], LowReplacement);
91
+ it('returns one instance per key, the highest-priority registration wins, sorted by Priority', () => {
92
+ void LowPriority;
93
+ void HighPriority;
94
+ void LowReplacement;
95
+ const found = DiscoverOrganizationStaffContributors().filter(c => c.Key.startsWith('test-staff-'));
96
+ expect(found.map(c => c.Label)).toEqual(['High', 'Low (replaced)']);
97
+ });
98
+ it('reuses the same instance across calls', () => {
99
+ const a = DiscoverOrganizationStaffContributors().find(c => c.Key === 'test-staff-high');
100
+ const b = DiscoverOrganizationStaffContributors().find(c => c.Key === 'test-staff-high');
101
+ expect(a).toBe(b);
102
+ });
103
+ });
104
+ describe('LoadOrganizationStaff', () => {
105
+ it('reads active, not-ended Employee relationships to the organization, sorted by name', async () => {
106
+ const runView = vi.fn().mockResolvedValue({
107
+ Success: true,
108
+ Results: [{ FromPersonID: 'P1', FromPerson: 'Nia Ferraro', Title: 'Cheesemaker', StartDate: '2025-11-12' }],
109
+ });
110
+ const provider = { RunView: runView };
111
+ const staff = await LoadOrganizationStaff("ORG'1", provider, TODAY);
112
+ expect(staff).toEqual([{ PersonID: 'P1', Name: 'Nia Ferraro', Title: 'Cheesemaker', StartDate: '2025-11-12' }]);
113
+ const params = runView.mock.calls[0][0];
114
+ expect(params.EntityName).toBe('MJ_BizApps_Common: Relationships');
115
+ expect(params.ExtraFilter).toBe("ToOrganizationID='ORG''1' AND FromPersonID IS NOT NULL AND RelationshipType='Employee' AND Status='Active' AND (EndDate IS NULL OR EndDate >= '2026-10-07')");
116
+ expect(params.OrderBy).toBe('FromPerson');
117
+ expect(params.ResultType).toBe('simple');
118
+ });
119
+ it('throws with the view error so the section can show it', async () => {
120
+ const provider = { RunView: vi.fn().mockResolvedValue({ Success: false, ErrorMessage: 'boom', Results: [] }) };
121
+ await expect(LoadOrganizationStaff('ORG', provider, TODAY)).rejects.toThrow('boom');
122
+ });
123
+ });
124
+ //# sourceMappingURL=organization-staff.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"organization-staff.test.js","sourceRoot":"","sources":["../../../../src/lib/data/__tests__/organization-staff.test.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAElD,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EACH,kBAAkB,EAClB,qCAAqC,EACrC,qBAAqB,EACrB,4BAA4B,EAC5B,oBAAoB,GAIvB,MAAM,uBAAuB,CAAC;AAE/B,MAAM,KAAK,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,aAAa;AAE3D,SAAS,MAAM,CAAC,EAAU,EAAE,KAAoB,EAAE,KAAoB;IAClE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;AAClF,CAAC;AAED,SAAS,YAAY,CAAC,KAAa;IAC/B,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,EAAE,OA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AEvE;AAED,wBAAgB,wBAAwB;;;;;;EAUvC;AAED,wBAAgB,qBAAqB;;;;;;EAQpC;AAED,wBAAgB,+BAA+B;;;;;;EAS9C;AAED,wBAAgB,sBAAsB;;;;;;EAUrC;AAoCD,wBAAsB,iBAAiB,CACnC,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,UAAU,CAAC,OAAO,IAAI,CAAC,EAClC,OAAO,EAAE,MAAM,GAChB,OAAO,CAAC;IAAE,MAAM,EAAE,UAAU,GAAG,IAAI,CAAC;IAAC,IAAI,EAAE,wBAAwB,GAAG,IAAI,CAAA;CAAE,CAAC,CAO/E;AAED,wBAAsB,uBAAuB;YATxB,UAAU,GAAG,IAAI;UAAQ,wBAAwB,GAAG,IAAI;GAW5E;AAED,wBAAsB,oBAAoB;YAbrB,UAAU,GAAG,IAAI;UAAQ,wBAAwB,GAAG,IAAI;GAe5E;AAED,wBAAsB,8BAA8B;YAjB/B,UAAU,GAAG,IAAI;UAAQ,wBAAwB,GAAG,IAAI;GAmB5E;AAED,wBAAsB,2BAA2B;YArB5B,UAAU,GAAG,IAAI;UAAQ,wBAAwB,GAAG,IAAI;GAuB5E;AAED,OAAO,EAAE,eAAe,EAAE,CAAC"}
@@ -6,6 +6,7 @@
6
6
  */
7
7
  import { Metadata, RunView } from '@memberjunction/core';
8
8
  import { COMMON_ENTITIES } from './entity-names';
9
+ import { EscapeFilterValue } from './directory-stats';
9
10
  export const DIRECTORY_VIEW_NAMES = {
10
11
  People: 'Common: People directory',
11
12
  LatestPeople: 'Common: Latest people',
@@ -61,7 +62,7 @@ async function loadViewByName(name) {
61
62
  const rv = new RunView();
62
63
  const found = await rv.RunView({
63
64
  EntityName: 'MJ: User Views',
64
- ExtraFilter: `Name = '${name.replace(/'/g, "''")}'`,
65
+ ExtraFilter: `Name = '${EscapeFilterValue(name)}'`,
65
66
  Fields: ['ID'],
66
67
  MaxRows: 1,
67
68
  ResultType: 'simple',
@@ -1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U,uBAAuB;IACzC,OAAO,iBAAiB,CAAC,eAAe,CAAC,MAAM,EAAE,oBAAoB,CAAC,MAAM,EAAE,wBAAwB,EAAE,EAAE,iBAAiB,CAAC,CAAC;AACjI,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,oBAAoB;IACtC,OAAO,iBAAiB,CAAC,eAAe,CAAC,MAAM,EAAE,oBAAoB,CAAC,YAAY,EAAE,qBAAqB,EAAE,EAAE,qBAAqB,CAAC,CAAC;AACxI,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,8BAA8B;IAChD,OAAO,iBAAiB,CAAC,eAAe,CAAC,YAAY,EAAE,oBAAoB,CAAC,aAAa,EAAE,+BAA+B,EAAE,EAAE,UAAU,CAAC,CAAC;AAC9I,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,2BAA2B;IAC7C,OAAO,iBAAiB,CAAC,eAAe,CAAC,YAAY,EAAE,oBAAoB,CAAC,mBAAmB,EAAE,sBAAsB,EAAE,EAAE,qBAAqB,CAAC,CAAC;AACtJ,CAAC;AAED,OAAO,EAAE,eAAe,EAAE,CAAC"}
@@ -0,0 +1,87 @@
1
+ import { type IMetadataProvider } from '@memberjunction/core';
2
+ import type { StatTileTone } from '../components/stat-tile/stat-tile.component';
3
+ /**
4
+ * The Organization form's **Staff** section: the people who work at an organization, rolled up.
5
+ *
6
+ * Common owns the section and the staff list (active `Employee` relationships). Other apps add their
7
+ * own totals and per-person columns by registering an {@link OrganizationStaffContributor} (e.g. order
8
+ * figures, membership status), so several apps can extend the one section at once. Common never names
9
+ * or imports a contributor; apps depend on Common, not the reverse. (Replacing the whole section is still possible through the form-panel
10
+ * `contributionKey: 'staff'` + `priority`, but then only one app's version shows.)
11
+ */
12
+ /** One active employee of the organization, from Common's `Employee` relationships. */
13
+ export interface OrganizationStaffMember {
14
+ PersonID: string;
15
+ Name: string;
16
+ Title: string | null;
17
+ /** The browser provider hands dates back as Date objects; tests and the server use ISO strings. */
18
+ StartDate: Date | string | null;
19
+ }
20
+ /** One headline number in the section's stat row. `Value: null` renders an em dash (unknown), never 0. */
21
+ export interface StaffFigure {
22
+ Label: string;
23
+ Value: number | string | null;
24
+ Detail?: string;
25
+ Icon?: string;
26
+ Tone?: StatTileTone;
27
+ }
28
+ /** A column a contributor adds to the staff table. `Key` must be unique within that contributor. */
29
+ export interface StaffColumn {
30
+ Key: string;
31
+ Header: string;
32
+ }
33
+ /** One cell in a contributed column. `Tone` colours the text only. */
34
+ export interface StaffCell {
35
+ Text: string;
36
+ Tone?: 'success' | 'warn' | 'error' | 'muted';
37
+ Title?: string;
38
+ }
39
+ /** What one contributor adds to the section. `Cells` is keyed by upper-cased PersonID, then by column Key. */
40
+ export interface StaffContribution {
41
+ Figures: StaffFigure[];
42
+ Columns: StaffColumn[];
43
+ Cells: Map<string, Record<string, StaffCell>>;
44
+ }
45
+ /** Everything a contributor is given. Staff is never empty when a contributor is called. */
46
+ export interface OrganizationStaffRequest {
47
+ OrganizationID: string;
48
+ Staff: OrganizationStaffMember[];
49
+ Provider?: IMetadataProvider;
50
+ }
51
+ /**
52
+ * Plug-in point for the Staff section. Register a subclass with
53
+ * `@RegisterClass(OrganizationStaffContributor, '<unique key>')`; the highest-priority registration
54
+ * wins per key (so an implementation can replace one app's contributor without touching the others).
55
+ * Contributors are ClassFactory-instantiated (no Angular DI) and should be stateless.
56
+ */
57
+ export declare abstract class OrganizationStaffContributor {
58
+ /** Stable identifier; also the registration key. */
59
+ abstract readonly Key: string;
60
+ /** Shown in the error line when this contributor fails, e.g. "Order figures". */
61
+ abstract readonly Label: string;
62
+ /** Higher renders first. Common's own figures always come before every contributor. */
63
+ readonly Priority: number;
64
+ /** Load this contributor's figures and columns for the given staff. Throwing is allowed; the section reports it. */
65
+ abstract Load(request: OrganizationStaffRequest): Promise<StaffContribution>;
66
+ }
67
+ /**
68
+ * Every registered contributor — the winning registration per key — sorted by Priority (desc) then Key.
69
+ * Returns [] when no app registers one.
70
+ */
71
+ export declare function DiscoverOrganizationStaffContributors(): OrganizationStaffContributor[];
72
+ /** A contributor's result: its contribution, or the reason it failed. */
73
+ export interface StaffContributorResult {
74
+ Contributor: OrganizationStaffContributor;
75
+ Contribution: StaffContribution | null;
76
+ Error: string | null;
77
+ }
78
+ /** Runs every contributor concurrently. One failing contributor never hides the others. */
79
+ export declare function RunStaffContributors(contributors: OrganizationStaffContributor[], request: OrganizationStaffRequest): Promise<StaffContributorResult[]>;
80
+ /** Common's own headline figures for the staff list. `today` is injectable for tests. */
81
+ export declare function CommonStaffFigures(staff: OrganizationStaffMember[], today?: Date): StaffFigure[];
82
+ /**
83
+ * Active staff of an organization: `Employee` relationships from a person to this organization whose
84
+ * Status is Active and that have not ended. Sorted by name.
85
+ */
86
+ export declare function LoadOrganizationStaff(organizationID: string, provider?: IMetadataProvider, today?: Date): Promise<OrganizationStaffMember[]>;
87
+ //# sourceMappingURL=organization-staff.d.ts.map