このコミットが含まれているのは:
@@ -98,6 +98,7 @@ export type CountsResult = {
|
||||
export type CountSort = { key: string; direction: 'asc' | 'desc' }
|
||||
export type CountField = { key: string; label: string; children?: CountField[]
|
||||
labelValues?: Record<string, string>
|
||||
multipleValues?: boolean
|
||||
nameLocale?: { code: string; languageCode: string; scriptCode: string } }
|
||||
export type CountRecord = Record<string, unknown>
|
||||
|
||||
@@ -335,12 +336,17 @@ export const normaliseCountsParams = (
|
||||
const params = new URLSearchParams (source)
|
||||
if (definition?.nameColumns != null)
|
||||
{
|
||||
const names = definition.nameColumns.map (field => field.key)
|
||||
const names = definition.nameColumns.filter (field => !field.multipleValues)
|
||||
.map (field => field.key)
|
||||
const current = definition.nameColumns.find (field =>
|
||||
field.nameLocale?.code === currentViewingLocale ())?.key
|
||||
!field.multipleValues && field.nameLocale?.code === currentViewingLocale ())?.key
|
||||
const aliases = definition.nameColumns.find (field =>
|
||||
field.multipleValues && field.nameLocale?.code === currentViewingLocale ())?.key
|
||||
const rootKey = (key: string) => (key === 'name' && current != null) ? current
|
||||
: ((key === 'aliases' && aliases != null) ? aliases : key)
|
||||
if (resource === 'tags' && params.has ('columns'))
|
||||
params.set ('columns', params.get ('columns')!.split (' ').flatMap (key =>
|
||||
key === 'names' ? names : [key === 'name' && current != null ? current : key])
|
||||
key === 'names' ? names : [rootKey (key)])
|
||||
.join (' '))
|
||||
if (params.has ('children'))
|
||||
{
|
||||
@@ -348,12 +354,15 @@ export const normaliseCountsParams = (
|
||||
params.set ('children', selected.flatMap (key => {
|
||||
if (['tags.names', 'parents.names'].includes (key))
|
||||
return names.map (name => `${key.slice (0, -6)}.${name}`)
|
||||
if (['tags.aliases', 'parents.aliases'].includes (key) && aliases != null)
|
||||
return [`${key.slice (0, -8)}.${aliases}`]
|
||||
if (key.startsWith ('tags.aliases.') || key.startsWith ('parents.aliases.')) return []
|
||||
return key.startsWith ('tags.names.') || key.startsWith ('parents.names.') ? [] : [key]
|
||||
}).join (' '))
|
||||
}
|
||||
if (resource === 'tags' && params.has ('order'))
|
||||
params.set ('order', params.get ('order')!.split (' ').flatMap (key =>
|
||||
key === 'names' ? names : [key === 'name' && current != null ? current : key])
|
||||
key === 'names' ? names : [rootKey (key)])
|
||||
.join (' '))
|
||||
}
|
||||
for (const [key, value] of params)
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする