feat(frontend): Firmenname + Domain Input + useCompanyOrigin hook
CI / nodejs-build (push) Successful in 2m20s
CI / test-go (push) Has been skipped
CI / iace-gt-coverage (push) Has been skipped
CI / test-python-backend (push) Has been skipped
CI / test-python-document-crawler (push) Has been skipped
CI / detect-changes (push) Successful in 7s
CI / branch-name (push) Has been skipped
CI / guardrail-integrity (push) Has been skipped
CI / secret-scan (push) Has been skipped
CI / dep-audit (push) Has been skipped
CI / sbom-scan (push) Has been skipped
CI / build-sha-integrity (push) Failing after 4s
CI / validate-canonical-controls (push) Successful in 10s
CI / loc-budget (push) Successful in 14s
CI / go-lint (push) Has been skipped
CI / python-lint (push) Has been skipped
CI / nodejs-lint (push) Has been skipped
CI / test-python-dsms-gateway (push) Has been skipped
CI / nodejs-build (push) Successful in 2m20s
CI / test-go (push) Has been skipped
CI / iace-gt-coverage (push) Has been skipped
CI / test-python-backend (push) Has been skipped
CI / test-python-document-crawler (push) Has been skipped
CI / detect-changes (push) Successful in 7s
CI / branch-name (push) Has been skipped
CI / guardrail-integrity (push) Has been skipped
CI / secret-scan (push) Has been skipped
CI / dep-audit (push) Has been skipped
CI / sbom-scan (push) Has been skipped
CI / build-sha-integrity (push) Failing after 4s
CI / validate-canonical-controls (push) Successful in 10s
CI / loc-budget (push) Successful in 14s
CI / go-lint (push) Has been skipped
CI / python-lint (push) Has been skipped
CI / nodejs-lint (push) Has been skipped
CI / test-python-dsms-gateway (push) Has been skipped
ComplianceCheckTab.tsx bekommt zwei neue UI-Felder oberhalb des PreScanWizard: - Firma → z.B. 'Tesla Germany GmbH' - Domain (Site-Origin) → z.B. 'https://www.tesla.com/de_de' Beide werden: - in localStorage persistiert (Hook _useCompanyOrigin.ts) - im POST-Body als company_name + origin_domain mitgeschickt - haben Vorrang vor LLM-extracted_profile (Backend nutzt eingegebene Werte falls vorhanden, fallback auf Inferenz) Datei jetzt 489 LOC (war vorher 461 + 28 für die Inputs). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
/**
|
||||
* Custom hook: persistente Firmenname + Origin-Domain für die
|
||||
* ComplianceCheckTab-Form. Priorisierte Werte vor der LLM-basierten
|
||||
* extracted_profile-Inferenz.
|
||||
*/
|
||||
|
||||
import { useEffect, useState } from 'react'
|
||||
|
||||
const STORAGE_KEY_COMPANY = 'compliance-check-company-name'
|
||||
const STORAGE_KEY_DOMAIN = 'compliance-check-origin-domain'
|
||||
|
||||
|
||||
function readInitial(key: string): string {
|
||||
if (typeof window === 'undefined') return ''
|
||||
return localStorage.getItem(key) || ''
|
||||
}
|
||||
|
||||
|
||||
export function useCompanyOrigin() {
|
||||
const [companyName, setCompanyName] = useState<string>(
|
||||
() => readInitial(STORAGE_KEY_COMPANY),
|
||||
)
|
||||
const [originDomain, setOriginDomain] = useState<string>(
|
||||
() => readInitial(STORAGE_KEY_DOMAIN),
|
||||
)
|
||||
|
||||
useEffect(() => {
|
||||
try {
|
||||
localStorage.setItem(STORAGE_KEY_COMPANY, companyName)
|
||||
} catch { /* quota */ }
|
||||
}, [companyName])
|
||||
|
||||
useEffect(() => {
|
||||
try {
|
||||
localStorage.setItem(STORAGE_KEY_DOMAIN, originDomain)
|
||||
} catch { /* quota */ }
|
||||
}, [originDomain])
|
||||
|
||||
return { companyName, setCompanyName, originDomain, setOriginDomain }
|
||||
}
|
||||
Reference in New Issue
Block a user