# Conflicts:
#	company-explorer/frontend/src/components/Inspector.tsx
#	company-explorer/frontend/src/components/RoboticsSettings.tsx
This commit is contained in:
2026-01-27 09:21:39 +00:00
2 changed files with 14 additions and 12 deletions

View File

@@ -296,15 +296,7 @@ export function Inspector({ companyId, initialContactId, onClose, apiBase }: Ins
}
}
const handleLockToggle = async (sourceType: string, currentLockStatus: boolean) => {
if (!companyId) return
try {
await axios.post(`${apiBase}/enrichment/${companyId}/${sourceType}/lock?locked=${!currentLockStatus}`)
fetchData(true) // Silent refresh
} catch (e) {
console.error("Lock toggle failed", e)
}
}
const handleLockToggle = async (sourceType: string, currentLockStatus: boolean) => {\n if (!companyId) return\n try {\n await axios.post(`${apiBase}/enrichment/${companyId}/${sourceType}/lock?locked=${!currentLockStatus}`)\n fetchData(true) // Silent refresh\n } catch (e) {\n console.error(\"Lock toggle failed\", e)\n }\n }\n\n // NEW: Interface for reporting mistakes\n interface ReportedMistakeRequest {\n field_name: string;\n wrong_value?: string | null;\n corrected_value?: string | null;\n source_url?: string | null;\n quote?: string | null;\n user_comment?: string | null;\n }\n\n const handleReportMistake = async () => {\n if (!companyId) return;\n if (!reportedFieldName) {\n alert(\"Field Name is required.\");\n return;\n }\n\n setIsProcessing(true);\n try {\n const payload: ReportedMistakeRequest = {\n field_name: reportedFieldName,\n wrong_value: reportedWrongValue || null,\n corrected_value: reportedCorrectedValue || null,\n source_url: reportedSourceUrl || null,\n quote: reportedQuote || null,\n user_comment: reportedComment || null,\n };\n\n await axios.post(`${apiBase}/companies/${companyId}/report-mistake`, payload);\n alert(\"Mistake reported successfully!\");\n setIsReportingMistake(false);\n // Reset form fields\n setReportedFieldName(\"\");\n setReportedWrongValue(\"\");\ setReportedCorrectedValue(\"\");\n setReportedSourceUrl(\"\");\n setReportedQuote(\"\");\n setReportedComment(\"\");\n } catch (e) {\n alert(\"Failed to report mistake.\");\n console.error(e);\n } finally {\n setIsProcessing(false);\n }\n };
// NEW: Interface for reporting mistakes
interface ReportedMistakeRequest {
@@ -1110,7 +1102,7 @@ export function Inspector({ companyId, initialContactId, onClose, apiBase }: Ins
placeholder="e.g., Impressum City"
/>
</div>
)}
)}
<div>
<label htmlFor="wrongValue" className="block text-xs font-medium text-slate-700 dark:text-slate-300">Currently Displayed Value (Optional)</label>
<input

View File

@@ -9,7 +9,8 @@ import subprocess
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
try:
from dev_session import add_comment_to_notion_task
from dev_session import add_comment_to_notion_task, decimal_hours_to_hhmm
from datetime import datetime
except ImportError:
print("Fehler: Konnte dev_session.py nicht importieren.", file=sys.stderr)
sys.exit(1)
@@ -43,6 +44,7 @@ def main():
task_id = session_data.get("task_id")
token = session_data.get("token")
session_start_time_str = session_data.get("session_start_time")
if not task_id or not token:
sys.exit(0)
@@ -50,8 +52,16 @@ def main():
commit_message = get_last_commit_message()
if commit_message:
time_comment = ""
if session_start_time_str:
session_start_time = datetime.fromisoformat(session_start_time_str)
elapsed_time = datetime.now() - session_start_time
elapsed_hours = elapsed_time.total_seconds() / 3600
elapsed_hhmm = decimal_hours_to_hhmm(elapsed_hours)
time_comment = f"⏱️ Arbeitszeit in dieser Session: {elapsed_hhmm}\\n"
# Formatieren der Nachricht für Notion
comment = f"✅ New Commit:\n---\n{commit_message}"
comment = f"✅ New Commit:\\n{time_comment}---\\n{commit_message}"
add_comment_to_notion_task(token, task_id, comment)
except (FileNotFoundError, json.JSONDecodeError):