このコミットが含まれているのは:
@@ -9,7 +9,7 @@ import FormField from '@/components/common/FormField'
|
||||
import HelpPopover from '@/components/common/HelpPopover'
|
||||
import TagInput from '@/components/common/TagInput'
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { countsUseLatest, fieldsForCounts, normaliseCountsParams, readCountSort,
|
||||
import { countsRequestParams, countsUseLatest, fieldsForCounts, normaliseCountsParams, readCountSort,
|
||||
selectedCountChildren, selectedCountColumns } from '@/lib/counts'
|
||||
import { countsNestedIsScalar } from '@/lib/countsDisplay'
|
||||
import { useCountsDefinition } from '@/lib/countsDefinitions'
|
||||
@@ -26,9 +26,11 @@ import type { CountsResource, CountsResult } from '@/lib/counts'
|
||||
|
||||
const CountsControls = (
|
||||
{ resource, applied, open, setOpen, execute, displayJSON, displayRowNumbers,
|
||||
displayThumbnail, reorder, actions, conditionLabels, pending = false }: {
|
||||
displayThumbnail, reorder, actions, conditionLabels, conditionLabelsParams,
|
||||
pending = false }: {
|
||||
resource: CountsResource; applied: URLSearchParams; open: boolean
|
||||
conditionLabels?: CountsResult['conditionLabels']
|
||||
conditionLabelsParams?: string
|
||||
pending?: boolean
|
||||
setOpen: (open: boolean) => void
|
||||
execute: (params: URLSearchParams) => void
|
||||
@@ -42,6 +44,8 @@ const CountsControls = (
|
||||
const id = useId ()
|
||||
const motion = useClientMotion ()
|
||||
const [draft, setDraft] = useState (() => new URLSearchParams (applied))
|
||||
const labelParams = conditionLabelsParams == null
|
||||
? null : new URLSearchParams (conditionLabelsParams)
|
||||
const thumbnail = selectedCountColumns (resource, applied, definition).includes ('thumbnail')
|
||||
const previousApplied = useRef ({ resource, params: new URLSearchParams (applied) })
|
||||
const appliedState = applied.toString ()
|
||||
@@ -282,7 +286,12 @@ const CountsControls = (
|
||||
</div>}
|
||||
</FormField>}
|
||||
<CountsAdditionalConditions params={draft} update={update}
|
||||
conditionLabels={conditionLabels}/>
|
||||
conditionLabels={(labelParams != null
|
||||
&& draft.get ('current') === labelParams.get ('current')
|
||||
&& draft.get ('at') === labelParams.get ('at')
|
||||
&& countsRequestParams (draft).toString ()
|
||||
=== countsRequestParams (labelParams).toString ())
|
||||
? conditionLabels : undefined}/>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -454,8 +454,14 @@ export const countsConditionValue = (
|
||||
return translateUIMessage ('bot', 'counts', locale).text
|
||||
if (value == null) return 'NULL'
|
||||
if (axis.field === 'tags' || axis.field === 'user')
|
||||
return labels?.[axis.field]?.[String (value)]
|
||||
{
|
||||
if (labels == null) return '…'
|
||||
const names = labels[axis.field]
|
||||
if (names == null || !Object.prototype.hasOwnProperty.call (names, String (value)))
|
||||
return '—'
|
||||
return names[String (value)]
|
||||
|| translateUIMessage ('notRegistered', 'counts', locale).text
|
||||
}
|
||||
if (axis.field === 'changed_field')
|
||||
return translateUIMessage (countsFieldLabel (String (value)), 'counts', locale).text
|
||||
if (typeof value === 'boolean')
|
||||
|
||||
@@ -342,7 +342,9 @@ const CountsResourceContent = (
|
||||
<div ref={controlsArea} className="shrink-0"
|
||||
style={{ minHeight: definition == null ? controlsHeight : undefined }}>
|
||||
{definition != null && <CountsControls key={`${resource}:${params.get ('definition')}`}
|
||||
resource={resource} applied={params} conditionLabels={data?.conditionLabels}
|
||||
resource={resource} applied={params}
|
||||
conditionLabels={errorFlg ? undefined : data?.conditionLabels}
|
||||
conditionLabelsParams={resultParams.toString ()}
|
||||
pending={running || fetching || !params.has ('execution_at')}
|
||||
open={open} setOpen={setOpen}
|
||||
reorder={value => update ('order', value)}
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする