このコミットが含まれているのは:
@@ -7,7 +7,7 @@ import { countsConditionInputs, countsEventTypes, countsFieldLabel, countsFilter
|
||||
countsSetOperators, useCountsDefinition }
|
||||
from '@/lib/countsDefinitions'
|
||||
import useDialogue from '@/lib/dialogues/useDialogue'
|
||||
import { countsSummaryValue } from '@/lib/countsDisplay'
|
||||
import { countsConditionValue } from '@/lib/countsDisplay'
|
||||
import { countsAxisLabel } from '@/lib/countsDefinitions'
|
||||
import { useLocale } from '@/lib/useLocale'
|
||||
import { inputClass } from '@/lib/utils'
|
||||
@@ -131,7 +131,7 @@ const CountsAdditionalConditions = ({ params, update }: {
|
||||
{
|
||||
const options: string[] = type === 'boolean' ? ['true', 'false'] : [...countsEventTypes]
|
||||
const namespace = type === 'boolean' ? 'truthValues' : 'events'
|
||||
return <select value={condition[key] ?? ''} disabled={condition.blank}
|
||||
return <select value={condition[key] == null ? '' : String (condition[key])} disabled={condition.blank}
|
||||
className={inputClass (false, 'h-10 w-36 min-w-0 max-w-full py-1')}
|
||||
aria-label={aria.text}
|
||||
lang={aria.language}
|
||||
@@ -144,10 +144,10 @@ const CountsAdditionalConditions = ({ params, update }: {
|
||||
}
|
||||
if (type === 'datetime')
|
||||
return <DateTimeField precision="second" className="h-10 w-48 min-w-0 max-w-full py-1"
|
||||
value={condition[key] ?? ''} disabled={condition.blank}
|
||||
value={condition[key] == null ? '' : String (condition[key])} disabled={condition.blank}
|
||||
aria-label={aria.text} lang={aria.language}
|
||||
onChange={value => patch (index, { [key]: value ?? '' })}/>
|
||||
return <input value={condition[key] ?? ''} disabled={condition.blank}
|
||||
return <input value={condition[key] == null ? '' : String (condition[key])} disabled={condition.blank}
|
||||
type={(type === 'integer' || type === 'interval') ? 'number' : 'text'}
|
||||
className={inputClass (false, 'h-10 w-36 min-w-0 max-w-full py-1')}
|
||||
aria-label={aria.text} lang={aria.language}
|
||||
@@ -157,30 +157,12 @@ const CountsAdditionalConditions = ({ params, update }: {
|
||||
<legend className="flex items-center gap-2">{label ('additionalConditions')}
|
||||
<Button type="button" variant="outline" size="sm" disabled={fields.length === 0}
|
||||
onClick={() => edit ()}>{label ('add')}</Button></legend>
|
||||
{params.get ('tags') && params.get ('match') && <div
|
||||
className="flex items-center gap-2">
|
||||
<span>match = {params.get ('match')}</span>
|
||||
<Button type="button" variant="ghost" size="sm"
|
||||
aria-label={message ('remove').text} onClick={() => update ('match', '')}>×</Button>
|
||||
</div>}
|
||||
{readCountState<Record<string, string | number | boolean>[]> (
|
||||
params, 'tag_refs', []).map ((reference, index, references) => (
|
||||
<div key={`reference-${index}`} className="flex flex-wrap items-center gap-2">
|
||||
<span>{Object.entries (reference).map (([key, value]) =>
|
||||
`${key}=${value}`).join (' ')}</span>
|
||||
<Button type="button" variant="ghost" size="sm"
|
||||
aria-label={message ('remove').text}
|
||||
onClick={() => update ('tag_refs', encodeCountState ('tag_refs',
|
||||
references.filter ((_, position) => position !== index)))}>×</Button>
|
||||
</div>))}
|
||||
{conditions.map ((condition, index) => condition.operator === 'axis_eq' ? (
|
||||
<div key={index} className="flex flex-wrap items-center gap-2 border-b py-2">
|
||||
<span>{countsAxisLabel (condition, definition, locale).text}</span>
|
||||
<span>{label ('operatorSymbols.eq')}</span>
|
||||
<span>{condition.value == null ? 'NULL' : (condition.field === 'tags'
|
||||
? condition.value : countsSummaryValue (
|
||||
condition.value, condition, 0, { count: 0, page: 1, limit: 100 }, locale,
|
||||
params.get ('timezone') ?? 'UTC'))}</span>
|
||||
<span>{countsConditionValue (condition.value, condition, locale,
|
||||
params.get ('timezone') ?? 'UTC')}</span>
|
||||
<Button type="button" variant="ghost" size="sm"
|
||||
aria-label={message ('remove').text}
|
||||
onClick={() => write (conditions.filter ((_, position) => position !== index))}>
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする