このコミットが含まれているのは:
2026-07-18 00:31:02 +09:00
コミット c31d84115d
3個のファイルの変更58行の追加24行の削除
+13 -4
ファイルの表示
@@ -74,6 +74,7 @@ type PreviewResponse = {
tags?: string
fieldWarnings?: Record<string, string[]>
baseWarnings?: string[]
validationErrors?: Record<string, string[]>
existingPost?: {
id: number
title: string
@@ -249,7 +250,13 @@ const mergePreviewRow = (
): PostImportRow => {
const fieldWarnings = preview.fieldWarnings ?? { }
const baseWarnings = preview.baseWarnings ?? []
const validationErrors = preview.validationErrors ?? { }
const metadataChanged = currentRow.metadataUrl !== preview.url
const hasWarnings =
Object.values (fieldWarnings).some (messages => messages.length > 0)
|| baseWarnings.length > 0
const hasErrors =
Object.values (validationErrors).some (messages => messages.length > 0)
const nextRow: PostImportRow = {
...currentRow,
attributes: { ...currentRow.attributes },
@@ -260,6 +267,7 @@ const mergePreviewRow = (
url: preview.url,
fieldWarnings,
baseWarnings,
validationErrors,
existingPostId: preview.existingPost?.id,
existingPost: preview.existingPost ?? undefined,
skipReason:
@@ -274,10 +282,11 @@ const mergePreviewRow = (
? buildPreviewResetSnapshot (preview)
: currentRow.resetSnapshot,
status:
Object.keys (fieldWarnings).length > 0
|| baseWarnings.length > 0
? 'warning'
: 'ready' }
hasErrors
? 'error'
: hasWarnings
? 'warning'
: 'ready' }
if (currentRow.provenance.title !== 'manual')
nextRow.attributes.title = preview.title ?? ''