このコミットが含まれているのは:
2026-07-18 17:07:56 +09:00
コミット 583ce22a7e
4個のファイルの変更22行の追加18行の削除
+6 -1
ファイルの表示
@@ -69,7 +69,12 @@ module PostRepr
return nil unless post.thumbnail.attached? return nil unless post.thumbnail.attached?
Rails.application.routes.url_helpers.rails_blob_url(post.thumbnail, only_path: false) Rails.application.routes.url_helpers.rails_blob_url(post.thumbnail, only_path: false)
rescue rescue ActionController::UrlGenerationError, ArgumentError, URI::InvalidURIError => e
Rails.logger.warn(
"PostRepr.thumbnail_url failed post_id=#{post.id} " \
"attachment_id=#{post.thumbnail.attachment&.id} " \
"blob_id=#{post.thumbnail.blob&.id} " \
"error_class=#{e.class} message=#{e.message}")
nil nil
end end
end end
+5 -1
ファイルの表示
@@ -36,7 +36,11 @@ Rails.application.configure do
config.action_mailer.perform_caching = false config.action_mailer.perform_caching = false
# Set localhost to be used by links generated in mailer templates. # Set localhost to be used by links generated in mailer templates.
config.action_mailer.default_url_options = { host: "localhost", port: 3000 } config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }
Rails.application.routes.default_url_options.merge!(
host: 'localhost',
port: 3002,
protocol: 'http')
# Print deprecation notices to the Rails logger. # Print deprecation notices to the Rails logger.
config.active_support.deprecation = :log config.active_support.deprecation = :log
+10 -15
ファイルの表示
@@ -826,9 +826,8 @@ const PostImportReviewPage: FC<Props> = ({ user }) => {
: rows : rows
const existingRows = sortedRows.filter (row => isExistingSkipRow (row)) const existingRows = sortedRows.filter (row => isExistingSkipRow (row))
const reviewRows = sortedRows.filter (row => !(isExistingSkipRow (row))) const reviewRows = sortedRows.filter (row => !(isExistingSkipRow (row)))
const canSubmit = const processingRows = processableImportRows (rows)
rows.every (row => isCompletedReviewRow (row)) const canSubmit = processingRows.length > 0
|| processableImportRows (rows).length > 0
const toggleManualSkip = async (sourceRow: number, checked: boolean) => { const toggleManualSkip = async (sourceRow: number, checked: boolean) => {
const currentSession = sessionRef.current const currentSession = sessionRef.current
@@ -1089,19 +1088,13 @@ const PostImportReviewPage: FC<Props> = ({ user }) => {
|| submitting || submitting
|| busyRowIds.size > 0) || busyRowIds.size > 0)
return return
if (currentSession.rows.every (row => isCompletedReviewRow (row))) const processingRows = processableImportRows (currentSession.rows)
{ if (processingRows.length === 0)
finishImport () return
return
}
setSubmitting (true) setSubmitting (true)
try try
{ {
const processingRows = processableImportRows (currentSession.rows)
if (processingRows.length === 0)
return
const result = await apiPost<{ results: BulkApiRow[] }>( const result = await apiPost<{ results: BulkApiRow[] }>(
'/posts/bulk', '/posts/bulk',
buildBulkFormData (processingRows)) buildBulkFormData (processingRows))
@@ -1216,7 +1209,9 @@ const PostImportReviewPage: FC<Props> = ({ user }) => {
manualSkippedCount={counts.manualSkipped} manualSkippedCount={counts.manualSkipped}
existingSkippedCount={counts.existingSkipped} existingSkippedCount={counts.existingSkipped}
pendingOrErrorCount={counts.pendingOrError} pendingOrErrorCount={counts.pendingOrError}
onBack={() => navigate ('/posts/new')} onBack={() => navigate (location.state?.from === '/posts/new'
? '/posts/new'
: (-1))}
onSubmit={() => submit ()}/> onSubmit={() => submit ()}/>
</>) </>)
} }
@@ -1251,7 +1246,7 @@ const PostImportFooter = (
<span> {creatableCount}</span> <span> {creatableCount}</span>
<span> {manualSkippedCount}</span> <span> {manualSkippedCount}</span>
<span>稿 {existingSkippedCount}</span> <span>稿 {existingSkippedCount}</span>
<span> {pendingOrErrorCount}</span> <span> {pendingOrErrorCount}</span>
</div> </div>
<div className="flex flex-col gap-2 md:flex-row"> <div className="flex flex-col gap-2 md:flex-row">
<Button <Button
@@ -1260,7 +1255,7 @@ const PostImportFooter = (
className="w-full md:w-auto" className="w-full md:w-auto"
onClick={onBack} onClick={onBack}
disabled={submitting}> disabled={submitting}>
URL
</Button> </Button>
<Button <Button
type="button" type="button"
+1 -1
ファイルの表示
@@ -258,7 +258,7 @@ const PostImportSourcePage: FC<Props> = ({ user }) => {
<Form className="max-w-4xl"> <Form className="max-w-4xl">
<PageTitle>稿</PageTitle> <PageTitle>稿</PageTitle>
<FormField label="URL リスト"> <FormField label="URL リスト(1 行 1 URL)">
{() => ( {() => (
<TextArea <TextArea
value={source} value={source}