このコミットが含まれているのは:
@@ -17,7 +17,8 @@ import type { LocaleCode } from '@/lib/locales'
|
||||
export const countsErrorMessage = (failure: unknown, locale: LocaleCode) => {
|
||||
const response = isApiError (failure) ? failure.response : null
|
||||
const body = (response?.data ?? failure) as {
|
||||
error?: unknown; max_axes?: unknown; maxAxes?: unknown
|
||||
error?: unknown; stage?: unknown; timeout_seconds?: unknown; timeoutSeconds?: unknown
|
||||
max_axes?: unknown; maxAxes?: unknown
|
||||
max_columns?: unknown; maxColumns?: unknown } | null
|
||||
const code = body != null && typeof body === 'object' ? body.error : null
|
||||
const message = (key: string, values?: Record<string, string | number>) =>
|
||||
@@ -31,6 +32,11 @@ export const countsErrorMessage = (failure: unknown, locale: LocaleCode) => {
|
||||
max: maximum })
|
||||
}
|
||||
if (code === 'private_condition') return message ('privateCondition')
|
||||
if (code === 'counts_query_timeout' && body?.stage === 'totals')
|
||||
{
|
||||
const seconds = body.timeoutSeconds ?? body.timeout_seconds
|
||||
if (typeof seconds === 'number') return message ('errors.totalsTimeout', { seconds })
|
||||
}
|
||||
if (code === 'counts_query_timeout' || code === 'generation_timeout')
|
||||
return message ('errors.queryTimeout')
|
||||
if (code === 'export_worker_unavailable' || code === 'worker_unavailable')
|
||||
@@ -40,7 +46,9 @@ export const countsErrorMessage = (failure: unknown, locale: LocaleCode) => {
|
||||
if (response?.status === 401) return message ('errors.authentication')
|
||||
if (response?.status === 403) return message ('errors.permission')
|
||||
if (response?.status === 400 || response?.status === 422) return message ('errors.input')
|
||||
return message ('common:fetchError')
|
||||
if (response != null) return message ('errors.http', { status: response.status })
|
||||
if (isApiError (failure)) return message ('errors.network')
|
||||
return message ('errors.internal')
|
||||
}
|
||||
|
||||
|
||||
@@ -158,7 +166,7 @@ export const countsLogicalName = (
|
||||
if (value == null) return { text: '' }
|
||||
if (field.startsWith ('aliases_') && Array.isArray (value))
|
||||
return { text: value.map (entry => typeof entry === 'string' ? entry
|
||||
: String (entry?.name ?? '')).join ('\n') }
|
||||
: String (entry?.name ?? '')).join (' ') }
|
||||
if (field === 'sections')
|
||||
return { text: (countsSectionRanges (value, locale) ?? []).join (
|
||||
translateUIMessage ('sections.separator', 'counts', locale).text) }
|
||||
@@ -528,6 +536,8 @@ export const countsSummaryValue = (
|
||||
const logical = data.axisLabels?.[`a${index}`]?.[String (value)]
|
||||
if (axis.field === 'user') return message ('actorWithId', {
|
||||
name: logical || message ('notRegistered'), id: value })
|
||||
if (axis.field === 'parent_tag_ids')
|
||||
return String (value) === '' ? '' : logical || message ('notRegistered')
|
||||
if (logical != null) return logical
|
||||
if (axis.field === 'tags')
|
||||
return message ('notRegistered')
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする