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:
@@ -2,6 +2,7 @@ import { del, get, post, put } from "./shared";
|
||||
import type {
|
||||
ServiceInstance,
|
||||
ServiceInstanceInput,
|
||||
ServiceTestResult,
|
||||
ServiceTypeInfo,
|
||||
} from "../types";
|
||||
|
||||
@@ -36,3 +37,9 @@ export async function deleteServiceInstance(
|
||||
): Promise<{ status: string }> {
|
||||
return del<{ status: string }>(`/api/services/instances/${serviceId}`);
|
||||
}
|
||||
|
||||
export async function testServiceInstance(
|
||||
input: ServiceInstanceInput,
|
||||
): Promise<ServiceTestResult> {
|
||||
return post<ServiceTestResult>("/api/services/test", input);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user