fix: critical QA findings — dead code and prop mismatch
1. Remove get_config_manager() call from translate_run_websocket
(@app.websocket /ws/translate/run/{run_id}) — was not imported
and unused. Also remove unused from sqlalchemy.orm import Session.
2. Fix prop name mismatch: showBulkReplace -> showPageBulkReplace
in RunTabContent. Use () for reactive two-way binding.
3. Add ('DRAFT') for status prop in RunTabContent.
This commit is contained in:
@@ -640,10 +640,8 @@ async def translate_run_websocket(websocket: WebSocket, run_id: str):
|
|||||||
await websocket.accept()
|
await websocket.accept()
|
||||||
logger.reason("Accepted translate run WebSocket", extra={"run_id": run_id})
|
logger.reason("Accepted translate run WebSocket", extra={"run_id": run_id})
|
||||||
try:
|
try:
|
||||||
config_manager = get_config_manager()
|
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
from sqlalchemy.orm import Session
|
|
||||||
from .core.database import SessionLocal
|
from .core.database import SessionLocal
|
||||||
from .plugins.translate.orchestrator_aggregator import TranslationResultAggregator
|
from .plugins.translate.orchestrator_aggregator import TranslationResultAggregator
|
||||||
from .core.event_log import EventLog
|
from .core.event_log import EventLog
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
import TranslationRunResult from './TranslationRunResult.svelte';
|
import TranslationRunResult from './TranslationRunResult.svelte';
|
||||||
|
|
||||||
let {
|
let {
|
||||||
status = 'DRAFT',
|
status = $bindable('DRAFT'),
|
||||||
jobId = '',
|
jobId = '',
|
||||||
isRunning = false,
|
isRunning = false,
|
||||||
isFullRun = false,
|
isFullRun = false,
|
||||||
@@ -30,14 +30,12 @@
|
|||||||
runComplete = false,
|
runComplete = false,
|
||||||
completedRuns = [],
|
completedRuns = [],
|
||||||
expandedRunIds = [],
|
expandedRunIds = [],
|
||||||
showBulkReplace = false,
|
showPageBulkReplace = $bindable(false),
|
||||||
onTriggerRun = (isFull) => {},
|
onTriggerRun = (isFull) => {},
|
||||||
onRetryRun = () => {},
|
onRetryRun = () => {},
|
||||||
onRetryInsert = () => {},
|
onRetryInsert = () => {},
|
||||||
onLoadRunHistory = () => {},
|
onLoadRunHistory = () => {},
|
||||||
onToggleRunDetails = (id) => {},
|
onToggleRunDetails = (id) => {},
|
||||||
onBulkReplaceApplied = (count) => {},
|
|
||||||
onBulkReplaceClose = () => {},
|
|
||||||
getJobStatusLabel = (s) => s,
|
getJobStatusLabel = (s) => s,
|
||||||
} = $props();
|
} = $props();
|
||||||
|
|
||||||
@@ -144,7 +142,7 @@
|
|||||||
<div class="flex items-center justify-between mb-2">
|
<div class="flex items-center justify-between mb-2">
|
||||||
<h3 class="text-sm font-medium text-gray-700">{$t.translate?.config?.recent_runs}</h3>
|
<h3 class="text-sm font-medium text-gray-700">{$t.translate?.config?.recent_runs}</h3>
|
||||||
<button
|
<button
|
||||||
onclick={() => showBulkReplace = true}
|
onclick={() => showPageBulkReplace = true}
|
||||||
class="px-3 py-1.5 text-xs bg-indigo-600 text-white rounded hover:bg-indigo-700 transition-colors"
|
class="px-3 py-1.5 text-xs bg-indigo-600 text-white rounded hover:bg-indigo-700 transition-colors"
|
||||||
>
|
>
|
||||||
{$t.translate?.run?.bulk_replace || 'Bulk Replace'}
|
{$t.translate?.run?.bulk_replace || 'Bulk Replace'}
|
||||||
|
|||||||
Reference in New Issue
Block a user