diff --git a/frontend/src/pages/SettingsPage.tsx b/frontend/src/pages/SettingsPage.tsx
index b9f4b71..e9378d3 100644
--- a/frontend/src/pages/SettingsPage.tsx
+++ b/frontend/src/pages/SettingsPage.tsx
@@ -845,6 +845,8 @@ function ProfileSection() {
const [showTempoToken, setShowTempoToken] = useState(false);
const [tempoTestResult, setTempoTestResult] = useState(null);
const [tempoTestError, setTempoTestError] = useState(null);
+ const [jiraTestResult, setJiraTestResult] = useState<{ connectedAs: string; url: string } | null>(null);
+ const [jiraTestError, setJiraTestError] = useState(null);
const [dirty, setDirty] = useState(false);
// Initialise editable fields from server on first successful load
@@ -871,6 +873,23 @@ function ProfileSection() {
onError: () => setToast({ msg: "Failed to save", type: "error" }),
});
+ const jiraTestMut = useMutation({
+ mutationFn: testJiraConnection,
+ onSuccess: (data) => {
+ if (data.status === "ok") {
+ setJiraTestResult({ connectedAs: data.connected_as ?? "", url: data.jira_url ?? "" });
+ setJiraTestError(null);
+ } else {
+ setJiraTestError((data as { message?: string }).message ?? "Connection failed");
+ setJiraTestResult(null);
+ }
+ },
+ onError: (err: Error) => {
+ setJiraTestError(err.message || "Connection failed");
+ setJiraTestResult(null);
+ },
+ });
+
const tempoTestMut = useMutation({
mutationFn: testTempoConnection,
onSuccess: (data) => {
@@ -1041,6 +1060,38 @@ function ProfileSection() {
+
+ {/* Test Jira connection */}
+
+
+ {jiraTestResult && (
+
+
+ Connected as: {jiraTestResult.connectedAs}
+
+ )}
+ {jiraTestError && (
+
+
+ {jiraTestError}
+
+ )}
+
}
{/* ── Tempo Integration ─────────────────────────────────── */}
@@ -1153,8 +1204,6 @@ function ProfileSection() {
function JiraConfigSection() {
const qc = useQueryClient();
const [toast, setToast] = useState<{ msg: string; type: "success" | "error" } | null>(null);
- const [testResult, setTestResult] = useState<{ connectedAs: string; url: string } | null>(null);
- const [testError, setTestError] = useState(null);
const { data: cfg, isLoading } = useQuery({
queryKey: ["jira-config"],
@@ -1174,24 +1223,6 @@ function JiraConfigSection() {
onError: () => setToast({ msg: "Failed to save Jira configuration", type: "error" }),
});
- const testMut = useMutation({
- mutationFn: testJiraConnection,
- onSuccess: (data) => {
- // Backend always returns HTTP 200; status field tells us if it worked
- if (data.status === "ok") {
- setTestResult({ connectedAs: data.connected_as ?? "", url: data.jira_url ?? "" });
- setTestError(null);
- } else {
- setTestError((data as { message?: string }).message ?? "Connection failed");
- setTestResult(null);
- }
- },
- onError: (err: Error) => {
- setTestError(err.message || "Connection failed");
- setTestResult(null);
- },
- });
-
if (isLoading) {
return (
@@ -1284,43 +1315,6 @@ function JiraConfigSection() {
- {/* Test Jira connection */}
-
-
Test Jira Connection
-
- Uses your personal Jira API token (configured in the Profile tab)
-
-
-
- {testResult && (
-
-
- Connected as: {testResult.connectedAs}
-
- )}
- {testError && (
-
-
- {testError}
-
- )}
-
-
>
);