このコミットが含まれているのは:
2026-10-28 22:28:12 +09:00
コミット ecd8b449e3
9個のファイルの変更、95行の追加、16行の削除
+22 -1
ファイルの表示
@@ -262,6 +262,17 @@ export const selectedCountChildren = (
): Set<string> => {
const selected = new Set (params.has ('children') ? params.get ('children')!.split (' ')
: ['tags.name', 'parents.id', 'aliases.name', 'members.tagId'])
if (!params.has ('children') && fields != null)
{
const language = localeLanguage (currentViewingLocale ())
const name = fields.find (field => field.key === 'tags')?.children?.find (field =>
!field.multipleValues && field.nameLocale?.languageCode === language)
if (name != null)
{
selected.delete ('tags.name')
selected.add (`tags.${name.key}`)
}
}
if (fields != null)
{
const valid = new Set (countChildPaths (fields).filter (path => path.includes ('.')))
@@ -357,6 +368,7 @@ export const normaliseCountsParams = (
definition?: CountsDefinition,
): URLSearchParams => {
const params = new URLSearchParams (source)
if (!params.has ('limit')) params.set ('limit', '100')
const nameScope = params.get ('name_scope')
if (definition?.conditionAliases != null && (nameScope == null || nameScope === 'locale'))
{
@@ -448,9 +460,18 @@ export const normaliseCountsParams = (
.filter (key => key !== 'original_created_at').join (' '))
const defaults = definition?.defaults?.find (entry =>
entry.definition === params.get ('definition') && entry.mode === params.get ('mode'))
if (params.get ('mode') === 'details' && !params.has ('sort'))
params.set ('sort', 'resource_id:asc version_no:asc')
for (const { key, value } of defaults?.params ?? [])
{
if (params.has (key)) continue
if (key === 'children' && resource === 'posts' && params.get ('mode') === 'details')
{
const name = definition?.nameColumns?.find (field => !field.multipleValues
&& field.nameLocale?.languageCode === localeLanguage (currentViewingLocale ()))
params.set (key, name == null ? value : `tags.${name.key} parents.id`)
continue
}
if (key === 'sort')
{
const expected = defaults?.params.find (entry => entry.key === 'rows')?.value
@@ -541,7 +562,7 @@ export const countsExportPayload = (
const payload = new URLSearchParams (params)
if (!payload.has ('children'))
{
const selected = selectedCountChildren (params)
const selected = selectedCountChildren (params, fieldsForCounts (resource, definition))
payload.set ('children', countChildPaths (fieldsForCounts (resource, definition))
.filter (path => selected.has (path)).join (' '))
}
+2
ファイルの表示
@@ -2,6 +2,7 @@ import { createContext, useContext } from 'react'
export const MIN_COUNT_WIDTH = 64
export const MAX_COUNT_WIDTH = 2000
export const MAX_INITIAL_COUNT_WIDTH = 640
export const defaultCountWidths: Record<string, number> = {
row_number: 72, thumbnail: 88, resource_id: 88, version_no: 88, latest: 104,
@@ -15,6 +16,7 @@ export const defaultCountWidths: Record<string, number> = {
type Layout = {
width: (family: string, key: string) => number
custom: (family: string, key: string) => boolean
fit: (family: string, key: string, width: number) => void
resize: (family: string, key: string, width: number) => void }
export const CountsLayoutContext = createContext<Layout | null> (null)
export const CountsTableScope = createContext ('')