@propriety/court-calendar 1.0.174 → 1.0.176
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/CLAUDE.md +20 -4
- package/dist/__tests__/ChairDepartedUser.test.d.ts +1 -0
- package/dist/_components/Modal/Layout/ModalActions.d.ts +13 -2
- package/dist/index.mjs +1080 -1080
- package/docs/REFERENCE.md +254 -0
- package/package.json +1 -1
- package/src/__tests__/ChairDepartedUser.test.tsx +82 -0
- package/src/__tests__/ModalActionsSaveGuard.test.tsx +31 -11
- package/src/_components/Modal/DateEdit/EditUserFieldDropdown.tsx +16 -6
- package/src/_components/Modal/Layout/ModalActions.tsx +72 -41
- package/src/_components/Modal/Modal.tsx +1 -0
- package/src/_components/Shared/FirstSecondChairIcons.tsx +1 -1
- package/src/_components/Toolbar/UserFilter.tsx +1 -1
- package/src/constants.ts +4 -1
- package/src/helpers/api/people.ts +3 -1
package/CLAUDE.md
CHANGED
|
@@ -2,15 +2,30 @@
|
|
|
2
2
|
|
|
3
3
|
Published npm package: `@propriety/court-calendar` — a React component library built with Vite in library mode.
|
|
4
4
|
|
|
5
|
+
## Read this before debugging anything
|
|
6
|
+
|
|
7
|
+
**[docs/REFERENCE.md](docs/REFERENCE.md)** — the data model (three date types in three tables, one
|
|
8
|
+
`CourtDate` shape), the call path a mutation travels, the permission gates, and a table of traps
|
|
9
|
+
that each cost a real debugging session. Most bugs here look like frontend bugs and are one of
|
|
10
|
+
those. Read it before forming a hypothesis, and add to it when a session rediscovers something
|
|
11
|
+
structural.
|
|
12
|
+
|
|
5
13
|
## Commands
|
|
6
14
|
|
|
7
15
|
```bash
|
|
8
16
|
npm run build # tsc -b && vite build → dist/
|
|
9
|
-
npx
|
|
10
|
-
npx
|
|
11
|
-
npx biome
|
|
17
|
+
npx tsc -b # typecheck only
|
|
18
|
+
npx vitest run # run all tests (~1260 of them, ~60s)
|
|
19
|
+
npx biome lint <file> # lint — this is the useful one
|
|
12
20
|
```
|
|
13
21
|
|
|
22
|
+
- `npx biome check` reports whole-file **format** drift on almost every file at `HEAD`: the repo is
|
|
23
|
+
not biome-formatted. Judge your own edit with `biome lint`. Never `biome format --write` a whole
|
|
24
|
+
file — it buries the change under hundreds of lines.
|
|
25
|
+
- `npm run lint` is a leftover from the Vite template (`eslint .`, and there is no eslint config
|
|
26
|
+
here — only `biome.json`). The `eslint-disable-next-line` comments in `src/` are vestigial.
|
|
27
|
+
- `rtk` is not installed on this machine, despite the global instruction to prefix with it.
|
|
28
|
+
|
|
14
29
|
## Architecture
|
|
15
30
|
|
|
16
31
|
- **Entry**: `src/index.ts` → exports `CCalendar` component from `src/_components/CCalendar.tsx`
|
|
@@ -44,4 +59,5 @@ Context is at `src/context/ReferenceDataContext.tsx` and provides: `allUsers`, `
|
|
|
44
59
|
failure is plausible. If you cannot name the bug, do not write the test. Never assert on the text
|
|
45
60
|
of a file, a private helper's internals, or a constant equalling itself. `/test-audit` applies this
|
|
46
61
|
retroactively.
|
|
47
|
-
- **
|
|
62
|
+
- **Git hooks**: one only — Husky `pre-push` runs `npm test`. There is no pre-commit hook and
|
|
63
|
+
nothing formats on commit, so do not reformat files to satisfy an imagined one.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ModalMode } from '../types';
|
|
2
|
-
export default function ModalActions({ modalMode, onDelete, onSave, setModalMode, setIsOpen, canEdit, isAdmin, createdBy, createdOn, }: {
|
|
2
|
+
export default function ModalActions({ modalMode, onDelete, onSave, setModalMode, setIsOpen, canEdit, isAdmin, courtDateId, createdBy, createdOn, }: {
|
|
3
3
|
modalMode: ModalMode;
|
|
4
4
|
onDelete: () => void | Promise<unknown>;
|
|
5
5
|
onSave: () => void | Promise<unknown>;
|
|
@@ -7,8 +7,19 @@ export default function ModalActions({ modalMode, onDelete, onSave, setModalMode
|
|
|
7
7
|
setIsOpen: (isOpen: boolean) => void;
|
|
8
8
|
/** Gates Edit/Save — everyone who works on cases. */
|
|
9
9
|
canEdit: boolean;
|
|
10
|
-
/**
|
|
10
|
+
/**
|
|
11
|
+
* Gates Delete, and is the whole gate. Deleting a date is not recoverable from the UI,
|
|
12
|
+
* so the protection is the permission plus `handleDelete`'s confirm — not obscurity.
|
|
13
|
+
* Delete used to be hidden behind an unlabelled triple-click on a blank strip in this
|
|
14
|
+
* footer, which admins could not find and which broke outright whenever anything else
|
|
15
|
+
* in the row needed the space.
|
|
16
|
+
*/
|
|
11
17
|
isAdmin: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* The row Delete would act on, or undefined/null while it is still unresolved. Only a
|
|
20
|
+
* positive id is a real saved date — CREATE's stub is -1 and `DEFAULT_COURT_DATE` is 0.
|
|
21
|
+
*/
|
|
22
|
+
courtDateId?: number | null;
|
|
12
23
|
createdBy?: number | null;
|
|
13
24
|
createdOn?: Date | string | null;
|
|
14
25
|
}): import("react/jsx-runtime").JSX.Element;
|