feat(service-credential-tester): slice 2 — Test button + gating (shared ServiceTestPanel)

Presentational ServiceTestPanel (props-driven, no internal hooks) wired into
both CreateServiceDialog (ServicesPage.tsx) and ServiceConfigEditor
(Settings.tsx). Parent owns testResult + saveAnyway state; store-previous
pattern resets on input change (avoids setState-in-effect). Create/Save
button gated on testPassed || saveAnyway. 7 panel tests (button states,
success/failure pills, checkbox toggle). All gates: 158 vitest, build exit 0,
lint 0 errors, 362 backend pytest (regression).
This commit is contained in:
Developer
2026-07-09 22:55:55 +00:00
parent 3391fbc85d
commit f6c67bd3ff
7 changed files with 314 additions and 6 deletions
+7
View File
@@ -4,6 +4,7 @@ import {
deleteServiceInstance,
fetchServiceInstances,
fetchServiceTypes,
testServiceInstance,
updateServiceInstance,
} from "../api/services";
import type { ServiceInstanceInput } from "../types";
@@ -45,3 +46,9 @@ export function useDeleteServiceInstance() {
},
});
}
export function useTestServiceInstance() {
return useMutation({
mutationFn: (input: ServiceInstanceInput) => testServiceInstance(input),
});
}