fix(ui): make all Jira and time panels read-only everywhere
Some checks failed
Aegis CI / lint-and-test (push) Has been cancelled
Some checks failed
Aegis CI / lint-and-test (push) Has been cancelled
WorklogTimeline: add readOnly prop — hides 'Log Time' button and form. TestPhaseTimeline: remove 'Sync to Tempo' button from TempoSyncBadge; only displays the green 'Tempo' badge when already synced. Cleans up unused imports (useState, useMutation, useQueryClient, syncTestToTempo). CampaignDetailPage: JiraLinkPanel and WorklogTimeline both now rendered with readOnly=true; JiraLinkPanel receives campaign name as label. Jira tickets and time worklogs are created automatically by the system (campaign activation, test workflow) — no manual editing from detail pages. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -7,6 +7,8 @@ import { useAuth } from "../context/AuthContext";
|
||||
interface WorklogTimelineProps {
|
||||
entityType: string;
|
||||
entityId: string;
|
||||
/** When true, hides the Log Time button and form (read-only display). */
|
||||
readOnly?: boolean;
|
||||
}
|
||||
|
||||
const activityColors: Record<string, { bg: string; text: string; icon: string }> = {
|
||||
@@ -36,7 +38,7 @@ function formatDate(dateStr: string): string {
|
||||
});
|
||||
}
|
||||
|
||||
export default function WorklogTimeline({ entityType, entityId }: WorklogTimelineProps) {
|
||||
export default function WorklogTimeline({ entityType, entityId, readOnly = false }: WorklogTimelineProps) {
|
||||
const queryClient = useQueryClient();
|
||||
const { user } = useAuth();
|
||||
const [showForm, setShowForm] = useState(false);
|
||||
@@ -92,25 +94,27 @@ export default function WorklogTimeline({ entityType, entityId }: WorklogTimelin
|
||||
Total: <span className="text-cyan-400 font-medium">{formatDuration(totalSeconds)}</span>
|
||||
</span>
|
||||
)}
|
||||
<button
|
||||
onClick={() => setShowForm(!showForm)}
|
||||
className="flex items-center gap-1 rounded-lg border border-gray-700 px-3 py-1.5 text-xs text-gray-300 hover:border-cyan-500/50 hover:text-cyan-400 transition-colors"
|
||||
>
|
||||
{showForm ? (
|
||||
<>
|
||||
<X className="h-3.5 w-3.5" /> Cancel
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<Plus className="h-3.5 w-3.5" /> Log Time
|
||||
</>
|
||||
)}
|
||||
</button>
|
||||
{!readOnly && (
|
||||
<button
|
||||
onClick={() => setShowForm(!showForm)}
|
||||
className="flex items-center gap-1 rounded-lg border border-gray-700 px-3 py-1.5 text-xs text-gray-300 hover:border-cyan-500/50 hover:text-cyan-400 transition-colors"
|
||||
>
|
||||
{showForm ? (
|
||||
<>
|
||||
<X className="h-3.5 w-3.5" /> Cancel
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<Plus className="h-3.5 w-3.5" /> Log Time
|
||||
</>
|
||||
)}
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* New worklog form */}
|
||||
{showForm && (
|
||||
{/* New worklog form — only in edit mode */}
|
||||
{!readOnly && showForm && (
|
||||
<div className="mb-4 rounded-lg border border-gray-700 bg-gray-800/50 p-3 space-y-3">
|
||||
<div className="grid gap-3 sm:grid-cols-2">
|
||||
<div>
|
||||
|
||||
Reference in New Issue
Block a user