fix: multiple test-workflow bugs — draft wipe, dark date pickers, Jira status strings, Tempo gate, hold timer
Aegis CI / lint-and-test (push) Has been cancelled
Snyk Security Scan / Python vulnerabilities (backend) (push) Has been cancelled
Snyk Security Scan / npm vulnerabilities (frontend) (push) Has been cancelled
Snyk Security Scan / Docker image vulnerabilities (backend) (push) Has been cancelled

- Fix the red/blue draft form losing unsaved fields (e.g. execution_start_time) whenever an evidence upload refetches the test — the hydration effect now runs once per test, not on every refetch.
- Add color-scheme: dark so native date/time picker popups match the app theme instead of rendering white.
- Fix _STATE_TO_JIRA_STATUS: real Jira statuses are 'To Do' and 'Red Team test review', not 'To-Do' and 'RT Test Review' — confirmed live against the actual workflow transitions, which is why Submit to Blue Team never moved the ticket past 'In Progress'.
- Tempo worklog sync was silently blocked by TEMPO_ENABLED defaulting to False with no admin-facing toggle, even after configuring a Tempo token via Settings. Now bypassed once an admin or personal token is actually configured, mirroring Jira's DB-backed enabled flag.
- Hold now actually pauses the running phase timer (paused_at), and Resume accumulates the held duration into red/blue_paused_seconds — previously the timer kept counting through a hold.
This commit is contained in:
kitos
2026-07-10 15:24:19 +02:00
parent 997b38d333
commit be2a3fdced
8 changed files with 180 additions and 13 deletions
+7
View File
@@ -1 +1,8 @@
@import "tailwindcss";
/* App is dark-themed throughout — tell the browser so native controls
(date/time picker popups, scrollbars, etc.) render dark instead of
the default light/white UI. */
:root {
color-scheme: dark;
}
+9 -3
View File
@@ -1,7 +1,7 @@
import { useParams, useNavigate } from "react-router-dom";
import MarkdownText from "../components/MarkdownText";
import { useQuery, useMutation, useQueryClient } from "@tanstack/react-query";
import { useState, useEffect, useCallback } from "react";
import { useState, useEffect, useCallback, useRef } from "react";
import { Loader2, AlertCircle, ArrowLeft, BookOpen, X, CheckCircle } from "lucide-react";
import {
@@ -143,9 +143,15 @@ export default function TestDetailPage() {
staleTime: 5 * 60 * 1000,
});
// Hydrate drafts from test data
// Hydrate drafts from test data — only once per test, on first load or
// when navigating to a different test. Refetches triggered by evidence
// uploads, timer ticks, etc. must NOT re-run this, or they'd stomp
// whatever the user is still typing (e.g. execution_start_time) with
// whatever is still saved server-side.
const hydratedTestId = useRef<string | null>(null);
useEffect(() => {
if (test) {
if (test && hydratedTestId.current !== test.id) {
hydratedTestId.current = test.id;
setRedDraft({
procedure_text: test.procedure_text || "",
tool_used: test.tool_used || "",