refactor: rebrand project to HartOMat
This commit is contained in:
@@ -98,10 +98,10 @@ export default function MaterialWizard({ open, onClose, onCreated }: Props) {
|
||||
.replace(/^-|-$/g, '')
|
||||
|
||||
const fullMaterialName = fullCode && sanitizedName
|
||||
? `SCHAEFFLER_${fullCode}_${sanitizedName}`
|
||||
? `HARTOMAT_${fullCode}_${sanitizedName}`
|
||||
: null
|
||||
|
||||
const schaefflerCodeInt = fullCode ? parseInt(fullCode, 10) : null
|
||||
const hartomatCodeInt = fullCode ? parseInt(fullCode, 10) : null
|
||||
|
||||
const createMut = useMutation({
|
||||
mutationFn: () =>
|
||||
@@ -109,7 +109,7 @@ export default function MaterialWizard({ open, onClose, onCreated }: Props) {
|
||||
name: fullMaterialName!,
|
||||
description: description.trim() || undefined,
|
||||
source: 'manual',
|
||||
schaeffler_code: schaefflerCodeInt,
|
||||
hartomat_code: hartomatCodeInt,
|
||||
}),
|
||||
onSuccess: () => {
|
||||
toast.success('Material created')
|
||||
@@ -133,7 +133,7 @@ export default function MaterialWizard({ open, onClose, onCreated }: Props) {
|
||||
{/* Header */}
|
||||
<div className="flex items-center justify-between px-6 py-4 border-b border-border-default">
|
||||
<div>
|
||||
<h2 className="text-lg font-semibold text-content">Schaeffler Material Wizard</h2>
|
||||
<h2 className="text-lg font-semibold text-content">HartOMat Material Wizard</h2>
|
||||
<p className="text-xs text-content-muted mt-0.5">Step {step} of 3</p>
|
||||
</div>
|
||||
<button onClick={onClose} className="text-content-muted hover:text-content-secondary">
|
||||
@@ -267,7 +267,7 @@ export default function MaterialWizard({ open, onClose, onCreated }: Props) {
|
||||
<p className="font-mono text-sm font-semibold text-content truncate">
|
||||
{fullMaterialName || (
|
||||
<span className="text-content-muted">
|
||||
SCHAEFFLER_{typeCode || 'XX'}{effectiveSubType || 'YY'}{consecutive !== null ? String(consecutive).padStart(2, '0') : 'ZZ'}_{sanitizedName || 'Name'}
|
||||
HARTOMAT_{typeCode || 'XX'}{effectiveSubType || 'YY'}{consecutive !== null ? String(consecutive).padStart(2, '0') : 'ZZ'}_{sanitizedName || 'Name'}
|
||||
</span>
|
||||
)}
|
||||
</p>
|
||||
|
||||
@@ -47,7 +47,7 @@ export default function OutputTypeTable() {
|
||||
queryKey: ['materials'],
|
||||
queryFn: listMaterials,
|
||||
})
|
||||
const libraryMaterials = (allMaterials ?? []).filter((m: Material) => m.schaeffler_code !== null).sort((a: Material, b: Material) => a.name.localeCompare(b.name))
|
||||
const libraryMaterials = (allMaterials ?? []).filter((m: Material) => m.hartomat_code !== null).sort((a: Material, b: Material) => a.name.localeCompare(b.name))
|
||||
|
||||
const { data: workflows } = useQuery({
|
||||
queryKey: ['workflows'],
|
||||
@@ -856,7 +856,7 @@ export default function OutputTypeTable() {
|
||||
<td className="px-4 py-2">
|
||||
{ot.material_override ? (
|
||||
<span className="text-xs px-1.5 py-0.5 rounded bg-amber-50 text-amber-700 font-mono truncate block max-w-[140px]" title={ot.material_override}>
|
||||
{ot.material_override.replace('SCHAEFFLER_', '').replace(/_/g, ' ')}
|
||||
{ot.material_override.replace('HARTOMAT_', '').replace(/_/g, ' ')}
|
||||
</span>
|
||||
) : (
|
||||
<span className="text-xs text-content-muted">—</span>
|
||||
|
||||
@@ -15,7 +15,7 @@ export interface MaterialOut {
|
||||
id: string
|
||||
name: string
|
||||
description: string | null
|
||||
schaeffler_code: number | null
|
||||
hartomat_code: number | null
|
||||
source: string
|
||||
}
|
||||
|
||||
|
||||
@@ -159,7 +159,7 @@ export function pbrColorHex(pbr: MaterialPBR): string {
|
||||
|
||||
/**
|
||||
* Get a preview hex color for a material entry, using PBR data when available.
|
||||
* Replaces the old hardcoded SCHAEFFLER_COLORS lookup.
|
||||
* Replaces the old hardcoded HARTOMAT_COLORS lookup.
|
||||
*/
|
||||
export function previewColorForEntry(
|
||||
entry: PartMaterialEntry,
|
||||
|
||||
@@ -23,7 +23,7 @@ export default function ChatPanel({ open, onClose, contextType, contextId }: Cha
|
||||
const [messages, setMessages] = useState<ChatMessage[]>([])
|
||||
const [sessionId, setSessionId] = useState<string | undefined>(() => {
|
||||
// Restore last session from localStorage
|
||||
try { return localStorage.getItem('schaeffler-chat-session') || undefined } catch { return undefined }
|
||||
try { return localStorage.getItem('hartomat-chat-session') || undefined } catch { return undefined }
|
||||
})
|
||||
const [input, setInput] = useState('')
|
||||
const [showSessions, setShowSessions] = useState(false)
|
||||
@@ -31,8 +31,8 @@ export default function ChatPanel({ open, onClose, contextType, contextId }: Cha
|
||||
// Persist sessionId to localStorage
|
||||
useEffect(() => {
|
||||
try {
|
||||
if (sessionId) localStorage.setItem('schaeffler-chat-session', sessionId)
|
||||
else localStorage.removeItem('schaeffler-chat-session')
|
||||
if (sessionId) localStorage.setItem('hartomat-chat-session', sessionId)
|
||||
else localStorage.removeItem('hartomat-chat-session')
|
||||
} catch { /* ignore */ }
|
||||
}, [sessionId])
|
||||
const messagesEndRef = useRef<HTMLDivElement>(null)
|
||||
|
||||
@@ -27,7 +27,7 @@ export default function UnmappedMaterialsDialog({ unmapped, onResolved, onCancel
|
||||
})
|
||||
|
||||
const libraryMaterials = (allMaterials ?? []).filter(
|
||||
(m: Material) => m.schaeffler_code !== null
|
||||
(m: Material) => m.hartomat_code !== null
|
||||
)
|
||||
|
||||
const allMapped = unmapped.every((u) => mappings[u.raw_name])
|
||||
|
||||
@@ -11,14 +11,14 @@ const TYPE_GROUPS: Record<string, { label: string; color: string }> = {
|
||||
}
|
||||
|
||||
function getTypeCode(mat: Material): string | null {
|
||||
if (mat.schaeffler_code == null) return null
|
||||
const s = String(mat.schaeffler_code).padStart(6, '0')
|
||||
if (mat.hartomat_code == null) return null
|
||||
const s = String(mat.hartomat_code).padStart(6, '0')
|
||||
return s.slice(0, 2)
|
||||
}
|
||||
|
||||
/** Extract the human-readable short name after the last underscore: SCHAEFFLER_010101_Steel-Bare -> Steel-Bare */
|
||||
/** Extract the human-readable short name after the last underscore: HARTOMAT_010101_Steel-Bare -> Steel-Bare */
|
||||
function shortName(name: string): string {
|
||||
const match = name.match(/^SCHAEFFLER_\d{6}_(.+)$/)
|
||||
const match = name.match(/^HARTOMAT_\d{6}_(.+)$/)
|
||||
return match ? match[1].replace(/-/g, ' ') : name
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ export default function MaterialInput({ value, onChange, library, missing, onOpe
|
||||
buckets.get(tc)!.push(m)
|
||||
}
|
||||
|
||||
// Sorted type codes first, then non-schaeffler
|
||||
// Sorted type codes first, then non-hartomat
|
||||
const sortedKeys = [...buckets.keys()].sort((a, b) => {
|
||||
if (a === null) return 1
|
||||
if (b === null) return -1
|
||||
|
||||
Reference in New Issue
Block a user