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:
@@ -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),
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user