@propriety/court-calendar 1.0.145 → 1.0.147
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs
CHANGED
|
@@ -15619,7 +15619,7 @@ const AH = Ml(function({
|
|
|
15619
15619
|
mt,
|
|
15620
15620
|
{
|
|
15621
15621
|
label: "Negotiator",
|
|
15622
|
-
value: o && !isNaN(o) ? `${r[o].UserFirstName} ${r[o].UserLastName}` : "—"
|
|
15622
|
+
value: o && !isNaN(o) && r[o] ? `${r[o].UserFirstName} ${r[o].UserLastName}` : "—"
|
|
15623
15623
|
}
|
|
15624
15624
|
),
|
|
15625
15625
|
v != null && /* @__PURE__ */ a(
|
|
@@ -19778,7 +19778,7 @@ function v1(t, e, n, r) {
|
|
|
19778
19778
|
if (!e.showOnlyUnsettled && !e.showOnlyWithoutEvidence && !e.showOnlyUnreviewed)
|
|
19779
19779
|
return !0;
|
|
19780
19780
|
const u = n[Kt(f)];
|
|
19781
|
-
if (u === void 0 || u.length === 0) return !
|
|
19781
|
+
if (u === void 0 || u.length === 0) return !0;
|
|
19782
19782
|
const d = Qt(f.MuniCode), l = e.searchTerm ? { ...e, searchTerm: "" } : e;
|
|
19783
19783
|
return Ou(u, l, d).length > 0;
|
|
19784
19784
|
}).filter((f) => e.dateTypeFilter === "negotiations" ? f.DateType === Fe.NEGOTIATIONS : e.dateTypeFilter === "collections" ? f.DateType === Fe.COLLECTIONS : e.dateTypeFilter === "scar" ? f.DateType !== Fe.NEGOTIATIONS && f.DateType !== Fe.COLLECTIONS : !0);
|
package/package.json
CHANGED
|
@@ -428,17 +428,31 @@ describe('filterCourtDates — case-based filters (showOnlyUnsettled et al.
|
|
|
428
428
|
expect(result).toHaveLength(0);
|
|
429
429
|
});
|
|
430
430
|
|
|
431
|
-
it('
|
|
431
|
+
it('keeps date when cases not yet loaded (undefined) and case filter is active (pending guard hides the event downstream)', () => {
|
|
432
432
|
const cd = makeCourtDate({ CourtDateID: 1 });
|
|
433
433
|
const result = filterCourtDates([cd], makeFilter({ showOnlyUnsettled: true }), {}, null);
|
|
434
|
-
expect(result).toHaveLength(
|
|
434
|
+
expect(result).toHaveLength(1);
|
|
435
435
|
});
|
|
436
436
|
|
|
437
|
-
it('
|
|
437
|
+
it('keeps date with an empty (loaded) case list when case filter is active — nothing to hide', () => {
|
|
438
438
|
const cd = makeCourtDate({ CourtDateID: 1 });
|
|
439
439
|
const cases = { '1': [] };
|
|
440
440
|
const result = filterCourtDates([cd], makeFilter({ showOnlyUnsettled: true }), cases, null);
|
|
441
|
-
expect(result).toHaveLength(
|
|
441
|
+
expect(result).toHaveLength(1);
|
|
442
|
+
});
|
|
443
|
+
|
|
444
|
+
it('regression AVE-1689: case-less negotiation date survives default Hide Settled on both all and negotiations tabs', () => {
|
|
445
|
+
const neg = makeCourtDate({ CourtDateID: 227, DateType: DateType.NEGOTIATIONS, MuniCode: 'W18' });
|
|
446
|
+
const cases = { neg_227: [] };
|
|
447
|
+
for (const tab of ['all', 'negotiations'] as const) {
|
|
448
|
+
const result = filterCourtDates(
|
|
449
|
+
[neg],
|
|
450
|
+
makeFilter({ dateTypeFilter: tab, showOnlyUnsettled: true }),
|
|
451
|
+
cases,
|
|
452
|
+
null,
|
|
453
|
+
);
|
|
454
|
+
expect(result).toHaveLength(1);
|
|
455
|
+
}
|
|
442
456
|
});
|
|
443
457
|
|
|
444
458
|
it('shows date with no filters active even when cases are empty', () => {
|
|
@@ -505,12 +519,19 @@ describe('filterCourtDates — case-based filters (showOnlyUnsettled et al.
|
|
|
505
519
|
expect(result).toHaveLength(1);
|
|
506
520
|
});
|
|
507
521
|
|
|
508
|
-
it('NEGOTIATIONS date
|
|
522
|
+
it('NEGOTIATIONS date does not inherit cases loaded under the un-prefixed SCAR key', () => {
|
|
509
523
|
const cd = makeCourtDate({ CourtDateID: 5, DateType: DateType.NEGOTIATIONS });
|
|
510
524
|
// Wrong key: '5' instead of 'neg_5'
|
|
511
525
|
const cases = { '5': [makeCase({ SCARDeterminationAction: '' })] };
|
|
526
|
+
// The date itself passes the date-level filter (its own bucket is simply
|
|
527
|
+
// not loaded), but the SCAR cases must not leak into its event: the
|
|
528
|
+
// bucket stays empty/pending, so the event is suppressed downstream.
|
|
512
529
|
const result = filterCourtDates([cd], makeFilter({ showOnlyUnsettled: true }), cases, null);
|
|
513
|
-
expect(result).toHaveLength(
|
|
530
|
+
expect(result).toHaveLength(1);
|
|
531
|
+
const [event] = buildCalEvents(result, cases);
|
|
532
|
+
expect(event.cases).toHaveLength(0);
|
|
533
|
+
expect(event.casesLoaded).toBe(false);
|
|
534
|
+
expect(shouldSkipEvent(event, makeFilter({ showOnlyUnsettled: true }))).toBe(true);
|
|
514
535
|
});
|
|
515
536
|
});
|
|
516
537
|
|
|
@@ -152,7 +152,7 @@ const CaseDetails = memo(function CaseDetails({
|
|
|
152
152
|
<InfoField
|
|
153
153
|
label='Negotiator'
|
|
154
154
|
value={
|
|
155
|
-
Negotiator && !isNaN(Negotiator)
|
|
155
|
+
Negotiator && !isNaN(Negotiator) && allUsers[Negotiator]
|
|
156
156
|
? `${allUsers[Negotiator].UserFirstName} ${allUsers[Negotiator].UserLastName}`
|
|
157
157
|
: '—'
|
|
158
158
|
}
|
package/src/helpers/filtering.ts
CHANGED
|
@@ -41,8 +41,12 @@ export function filterCourtDates(
|
|
|
41
41
|
if (!filterCtx.showOnlyUnsettled && !filterCtx.showOnlyWithoutEvidence && !filterCtx.showOnlyUnreviewed)
|
|
42
42
|
return true;
|
|
43
43
|
const casesEntry = allCases[caseKey(cd)];
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
// An empty (or not-yet-loaded) case bucket has nothing for a case-level
|
|
45
|
+
// filter to act on — keep the date visible so genuinely case-less dates
|
|
46
|
+
// (e.g. manually created negotiation dates) aren't hidden by the
|
|
47
|
+
// default-on unsettled filter. Not-yet-loaded buckets are still
|
|
48
|
+
// suppressed at the event layer by shouldSkipEvent's casesLoaded guard.
|
|
49
|
+
if (casesEntry === undefined || casesEntry.length === 0) return true;
|
|
46
50
|
const isVillage = isVillageDate(cd.MuniCode);
|
|
47
51
|
// searchTerm selects court dates via searchedDateIDs — strip it from
|
|
48
52
|
// the case-level filter so township name searches don't hide all cases.
|