Skip to content

Commit 4c50958

Browse files
sago2k8claude
andcommitted
fix(frontend): restore propSharedConfig sync effect and revert react-doctor upgrade
The useEffect syncing propSharedConfig to state in CreateACL was lost during the file move to security/acls/. Re-add it to fix the acl-create-page test that expects principal input to update when search params arrive after initial render. Revert react-doctor from 0.0.33 to 0.0.29 because the newer version pulls knip@6 which requires zod@4, conflicting with the project's zod@3 and causing ERR_PACKAGE_PATH_NOT_EXPORTED for zod/mini on CI. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 4be0590 commit 4c50958

3 files changed

Lines changed: 16 additions & 54 deletions

File tree

frontend/bun.lock

Lines changed: 4 additions & 52 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frontend/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"format:check": "biome format src/*",
3939
"format": "biome format src/* --write",
4040
"load-git-hooks": "cd .. && git config core.hooksPath \"./.git-hooks\"",
41-
"doctor": "react-doctor . -y --fail-on error",
41+
"doctor": "bunx react-doctor . -y --fail-on error",
4242
"quality:gate": "bun run lint && bun run doctor && bun run type:check && bun run build && bun run test:unit && bun run test:integration",
4343
"analyze": "RSDOCTOR=true npm run build",
4444
"prepare": "lefthook install"
@@ -191,7 +191,7 @@
191191
"babel-plugin-react-compiler": "^1.0.0",
192192
"lefthook": "^2.0.12",
193193
"node-fetch": "^3.3.2",
194-
"react-doctor": "^0.0.33",
194+
"react-doctor": "^0.0.29",
195195
"rsbuild-plugin-devtools-json": "^0.2.5",
196196
"tar-stream": "^3.1.7",
197197
"testcontainers": "^11.10.0",

frontend/src/components/pages/security/acls/create-acl.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -766,6 +766,16 @@ export default function CreateACL({
766766
host: propSharedConfig?.host ?? '*',
767767
});
768768

769+
// Sync sharedConfig when props change (e.g., route search params arrive after initial render)
770+
useEffect(() => {
771+
if (propSharedConfig?.principal) {
772+
setSharedConfig((prev) => ({
773+
principal: propSharedConfig.principal ?? prev.principal,
774+
host: propSharedConfig.host ?? prev.host,
775+
}));
776+
}
777+
}, [propSharedConfig?.principal, propSharedConfig?.host]);
778+
769779
const ruleIdCounter = useRef(2);
770780
const [rules, setRules] = useState<Rule[]>(
771781
propRules ?? [

0 commit comments

Comments
 (0)