fix: code review cleanup - schema sync, type safety, null handling
- Sync KnowledgeLink schema with migration (add displayText, positionStart, positionEnd, resolved) - Make targetId optional to support unresolved links - Fix null handling in graph.service.ts (skip unresolved links) - Add explicit types to frontend components (remove implicit any) - Remove unused WikiLink import - Add null-safe statusInfo check in EntryCard
This commit is contained in:
@@ -61,7 +61,7 @@ export function EntryCard({ entry }: EntryCardProps) {
|
||||
{/* Tags */}
|
||||
{entry.tags && entry.tags.length > 0 && (
|
||||
<div className="flex flex-wrap gap-1.5 mb-3">
|
||||
{entry.tags.map((tag) => (
|
||||
{entry.tags.map((tag: { id: string; name: string; color: string | null }) => (
|
||||
<span
|
||||
key={tag.id}
|
||||
className="inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium"
|
||||
@@ -79,10 +79,12 @@ export function EntryCard({ entry }: EntryCardProps) {
|
||||
{/* Metadata row */}
|
||||
<div className="flex flex-wrap items-center gap-3 text-xs text-gray-500">
|
||||
{/* Status */}
|
||||
<span className={`inline-flex items-center gap-1 px-2 py-1 rounded-full ${statusInfo.className}`}>
|
||||
<span>{statusInfo.icon}</span>
|
||||
<span>{statusInfo.label}</span>
|
||||
</span>
|
||||
{statusInfo && (
|
||||
<span className={`inline-flex items-center gap-1 px-2 py-1 rounded-full ${statusInfo.className}`}>
|
||||
<span>{statusInfo.icon}</span>
|
||||
<span>{statusInfo.label}</span>
|
||||
</span>
|
||||
)}
|
||||
|
||||
{/* Visibility */}
|
||||
<span className="inline-flex items-center gap-1">
|
||||
|
||||
Reference in New Issue
Block a user