@propriety/court-calendar 1.0.196 → 1.0.198
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/_components/LoadingBar.d.ts +6 -1
- package/dist/_components/Modal/DateDetails/HearingOfficerPrompt.d.ts +7 -0
- package/dist/_components/Toolbar/CalendarNav.d.ts +3 -2
- package/dist/_components/Toolbar/Toolbar.d.ts +3 -2
- package/dist/helpers/CalEvent.d.ts +4 -0
- package/dist/hooks/UseCaseData.d.ts +21 -4
- package/dist/hooks/UseModalActions.d.ts +6 -1
- package/dist/index.mjs +8245 -8097
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -454,7 +454,7 @@ All data is fetched from `https://utils.aventine.ai`. Every request requires the
|
|
|
454
454
|
| `/court-dates/{id}` | DELETE | Delete a court date |
|
|
455
455
|
| `/court-dates/{id}/cases` | GET | Fetch cases for a court date |
|
|
456
456
|
| `/court-cases/search?term=...&page=...` | GET | Search cases (paginated) |
|
|
457
|
-
| `/court-cases/by-court-dates` | POST | Cases for up to 1000 court dates, `{"ids": [...]}` → `{"cases": {id: [...]}}
|
|
457
|
+
| `/court-cases/by-court-dates` | POST | Cases for up to 1000 court dates, `{"ids": [...]}` → `{"cases": {id: [...]}}`, with only the Courtfiles columns the calendar reads |
|
|
458
458
|
| `/court-cases/snooze/upload/{id}` | GET | Snooze upload deadline by 1 business day |
|
|
459
459
|
| `/users/all` | GET | Fetch all users |
|
|
460
460
|
| `/users/hearing-officers` | GET | Fetch hearing officers |
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
interface LoadingBarProps {
|
|
2
2
|
isFetchingDates: boolean;
|
|
3
3
|
isFetchingCases: boolean;
|
|
4
|
+
caseLoad?: {
|
|
5
|
+
requested: number;
|
|
6
|
+
settled: number;
|
|
7
|
+
failed: number;
|
|
8
|
+
};
|
|
4
9
|
isSearching?: boolean;
|
|
5
10
|
isFiltering?: boolean;
|
|
6
11
|
}
|
|
7
|
-
export default function LoadingBar({ isFetchingDates, isFetchingCases, isSearching, isFiltering, }: LoadingBarProps): import("react/jsx-runtime").JSX.Element | null;
|
|
12
|
+
export default function LoadingBar({ isFetchingDates, isFetchingCases, caseLoad, isSearching, isFiltering, }: LoadingBarProps): import("react/jsx-runtime").JSX.Element | null;
|
|
8
13
|
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CourtDate } from '../../../types';
|
|
2
|
+
/** Asks who hears the session Adjourn moved cases onto, when that session has no hearing officer. */
|
|
3
|
+
export default function HearingOfficerPrompt({ session, onAssign, onClose, }: {
|
|
4
|
+
session: CourtDate;
|
|
5
|
+
onAssign: (session: CourtDate, officerId: number) => Promise<boolean>;
|
|
6
|
+
onClose: () => void;
|
|
7
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Calendar } from '@fullcalendar/core/index.js';
|
|
2
|
-
|
|
2
|
+
declare const _default: import('react').NamedExoticComponent<{
|
|
3
3
|
calendarApi: Calendar | null;
|
|
4
4
|
handleCreateClick: () => void;
|
|
5
5
|
onPrint: () => void;
|
|
@@ -12,4 +12,5 @@ export default function CalendarNav({ calendarApi, handleCreateClick, onPrint, o
|
|
|
12
12
|
isFetchingCases: boolean;
|
|
13
13
|
lastFetchedAt: Date | null;
|
|
14
14
|
canEdit: boolean;
|
|
15
|
-
}
|
|
15
|
+
}>;
|
|
16
|
+
export default _default;
|
|
@@ -43,4 +43,8 @@ export declare function dateToKey(d: Date): string;
|
|
|
43
43
|
* "2025-04-15" and "2025-04-15T00:00:00Z" would both land on April 15 locally.
|
|
44
44
|
*/
|
|
45
45
|
export declare function parseLocalDate(s: string): Date;
|
|
46
|
+
/** The day a date or marker value is drawn on: a Date as given, an API string on its local day. */
|
|
47
|
+
export declare function markerDay(value: Date | string | null | undefined): Date | null;
|
|
48
|
+
/** Whether `value` is drawn in [start, end). */
|
|
49
|
+
export declare function dayIn(value: Date | string | null | undefined, start: Date, end: Date): boolean;
|
|
46
50
|
export declare function buildCalEvents(courtDates: CourtDate[], casesByCourtDateId: Record<string, Case[]>): CalEvent[];
|
|
@@ -1,34 +1,51 @@
|
|
|
1
1
|
import { Case, CourtDate } from '../types';
|
|
2
|
+
/** The range the calendar shows. A bulk load requests the dates drawn in it first. */
|
|
3
|
+
export interface VisibleRange {
|
|
4
|
+
start: Date;
|
|
5
|
+
end: Date;
|
|
6
|
+
}
|
|
2
7
|
/**
|
|
3
8
|
* Manages fetching and in-memory storage of cases for court dates.
|
|
4
9
|
*
|
|
5
10
|
* Each court date is served from memory if React state already holds its cases, otherwise from the
|
|
6
|
-
* API: per date for up to BULK_THRESHOLD SCAR dates,
|
|
7
|
-
* date always loads per date, because the bulk case is
|
|
8
|
-
* browser cache: a reload starts from an empty memory, so every
|
|
11
|
+
* API: per date for up to BULK_THRESHOLD SCAR dates, by-ids bulk requests above that (the dates drawn in
|
|
12
|
+
* the visible range first, then the rest). The open date always loads per date, because the bulk case is
|
|
13
|
+
* thinner than its modal reads. There is no browser cache: a reload starts from an empty memory, so every
|
|
14
|
+
* reload reaches the API.
|
|
9
15
|
*
|
|
10
16
|
* @param apiKey API key forwarded to case fetch helpers.
|
|
11
17
|
* @param courtDates The court dates to load cases for.
|
|
12
18
|
* @param selectedCourtDate The currently-selected court date; its cases are always force-refreshed
|
|
13
19
|
* from the API (bypassing memory) when the selection changes.
|
|
20
|
+
* @param visibleRangeRef The calendar's visible range, read when a bulk load starts.
|
|
14
21
|
*
|
|
15
22
|
* @returns
|
|
16
23
|
* - `allCases` – Map of `caseKey → Case[]` for all loaded court dates.
|
|
17
24
|
* - `selectedCases` – Cases belonging to `selectedCourtDate`.
|
|
18
25
|
* - `isFetchingCases` – `true` while any non-silent fetch is in flight.
|
|
26
|
+
* - `caseLoad` – Dates requested, settled and failed by the latest non-silent load. Kept after it
|
|
27
|
+
* ends, so the loading bar can tell a finished load from a failed one.
|
|
19
28
|
* - `forceRefreshCases` – Re-fetches every court date from the API (manual refresh).
|
|
20
29
|
* - `updateCases` – Optimistically merges a partial cases map into state.
|
|
21
30
|
* - `refreshCases` – Silently reconciles one court date with the server after a mutation.
|
|
22
31
|
* - `deleteCasesFromMemory` – Removes all cases for a given court date from memory.
|
|
23
32
|
*/
|
|
24
|
-
export declare function useCaseData({ apiKey, courtDates, selectedCourtDate, }: {
|
|
33
|
+
export declare function useCaseData({ apiKey, courtDates, selectedCourtDate, visibleRangeRef, }: {
|
|
25
34
|
apiKey: string;
|
|
26
35
|
courtDates: CourtDate[];
|
|
27
36
|
selectedCourtDate: CourtDate | null;
|
|
37
|
+
visibleRangeRef?: {
|
|
38
|
+
readonly current: VisibleRange | null;
|
|
39
|
+
};
|
|
28
40
|
}): {
|
|
29
41
|
allCases: Record<string, Case[]>;
|
|
30
42
|
selectedCases: Case[];
|
|
31
43
|
isFetchingCases: boolean;
|
|
44
|
+
caseLoad: {
|
|
45
|
+
requested: number;
|
|
46
|
+
settled: number;
|
|
47
|
+
failed: number;
|
|
48
|
+
};
|
|
32
49
|
forceRefreshCases: () => void;
|
|
33
50
|
updateCases: (cases: Record<string, Case[]>) => void;
|
|
34
51
|
refreshCases: (courtDate: CourtDate) => Promise<void>;
|
|
@@ -22,6 +22,8 @@ import { AdjournResult } from '../helpers/api/cases';
|
|
|
22
22
|
* false and leaves local state untouched if the server refused.
|
|
23
23
|
* - `handleViewUpdateChair` – Optimistically updates a first/second chair in view mode.
|
|
24
24
|
* - `handleSelectedCasesAdjournmentChange` – Adjourns a set of cases (sets AdjournedDate + `OA` determination), then reconciles with the server.
|
|
25
|
+
* `needsJudge` is the session they moved to when it has no hearing officer.
|
|
26
|
+
* - `handleAssignHearingOfficer` – Sets the hearing officer on that session, in memory once the server has it.
|
|
25
27
|
* - `handleSelectedCasesClearDetermination` – Clears the determination for a set of cases (backend only clears `D`), then reconciles with the server.
|
|
26
28
|
*/
|
|
27
29
|
export declare function useModalActions({ modalMode, selectedCourtDate, selectedCases, editedData, editedCases, setEditedData, setIsOpen, pendingNoticeFiles, onUploadDeadlineNotice, }: {
|
|
@@ -40,6 +42,9 @@ export declare function useModalActions({ modalMode, selectedCourtDate, selected
|
|
|
40
42
|
handleDelete: () => Promise<boolean>;
|
|
41
43
|
handleViewUpdateChair: (position: "first" | "second", userId: number | null) => void;
|
|
42
44
|
handleToggleComplete: (complete: boolean) => void;
|
|
43
|
-
handleSelectedCasesAdjournmentChange: (casesToUpdate: Case[], date: Date | null) => Promise<AdjournResult
|
|
45
|
+
handleSelectedCasesAdjournmentChange: (casesToUpdate: Case[], date: Date | null) => Promise<AdjournResult & {
|
|
46
|
+
needsJudge?: CourtDate;
|
|
47
|
+
}>;
|
|
48
|
+
handleAssignHearingOfficer: (session: CourtDate, officerId: number) => Promise<boolean>;
|
|
44
49
|
handleSelectedCasesClearDetermination: (casesToUpdate: Case[]) => Promise<boolean>;
|
|
45
50
|
};
|