このコミットが含まれているのは:
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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)))
|
|
||||||
{
|
|
||||||
finishImport ()
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
setSubmitting (true)
|
|
||||||
try
|
|
||||||
{
|
|
||||||
const processingRows = processableImportRows (currentSession.rows)
|
const processingRows = processableImportRows (currentSession.rows)
|
||||||
if (processingRows.length === 0)
|
if (processingRows.length === 0)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
setSubmitting (true)
|
||||||
|
try
|
||||||
|
{
|
||||||
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"
|
||||||
|
|||||||
@@ -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}
|
||||||
|
|||||||
新しい課題から参照
ユーザをブロックする