mirror of
https://github.com/apache/superset.git
synced 2026-04-21 09:04:38 +00:00
fix(explore): DndColumnSelect not handling controls with "multi: false" (#14737)
* fix(explore): DndColumnSelect not handling controls with multi={false}
* Implement translations for singular and plural cases
* Fix test
This commit is contained in:
committed by
GitHub
parent
6d33432b58
commit
d03c608ce1
@@ -18,7 +18,7 @@
|
||||
*/
|
||||
|
||||
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
||||
import { ensureIsArray, Metric, t } from '@superset-ui/core';
|
||||
import { ensureIsArray, Metric, tn } from '@superset-ui/core';
|
||||
import { ColumnMeta } from '@superset-ui/chart-controls';
|
||||
import { isEqual } from 'lodash';
|
||||
import { usePrevious } from 'src/common/hooks/usePrevious';
|
||||
@@ -268,7 +268,11 @@ export const DndMetricSelect = (props: any) => {
|
||||
canDrop={canDrop}
|
||||
valuesRenderer={valuesRenderer}
|
||||
accept={[DndItemType.Column, DndItemType.Metric]}
|
||||
ghostButtonText={t('Drop columns or metrics')}
|
||||
ghostButtonText={tn(
|
||||
'Drop column or metric',
|
||||
'Drop columns or metrics',
|
||||
multi ? 2 : 1,
|
||||
)}
|
||||
displayGhostButton={multi || value.length === 0}
|
||||
{...props}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user