mirror of
https://github.com/apache/superset.git
synced 2024-09-06 22:07:34 -04:00
chore(explore): change dnd placeholders (#16116)
* chore(explore): change dnd placeholders * Fix tests and lint
This commit is contained in:
parent
2db1615c83
commit
6ac4f4ef2f
@ -29,7 +29,7 @@ const defaultProps: LabelProps = {
|
||||
|
||||
test('renders with default props', () => {
|
||||
render(<DndColumnSelect {...defaultProps} />, { useDnd: true });
|
||||
expect(screen.getByText('Drop columns')).toBeInTheDocument();
|
||||
expect(screen.getByText('Drop columns here')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
test('renders with value', () => {
|
||||
|
@ -143,7 +143,8 @@ export const DndColumnSelect = (props: LabelProps) => {
|
||||
accept={DndItemType.Column}
|
||||
displayGhostButton={multi || optionSelector.values.length === 0}
|
||||
ghostButtonText={
|
||||
ghostButtonText || tn('Drop column', 'Drop columns', multi ? 2 : 1)
|
||||
ghostButtonText ||
|
||||
tn('Drop column here', 'Drop columns here', multi ? 2 : 1)
|
||||
}
|
||||
{...props}
|
||||
/>
|
||||
|
@ -38,7 +38,7 @@ const defaultProps = {
|
||||
|
||||
test('renders with default props', () => {
|
||||
render(<DndFilterSelect {...defaultProps} />, { useDnd: true });
|
||||
expect(screen.getByText('Drop columns or metrics')).toBeInTheDocument();
|
||||
expect(screen.getByText('Drop columns or metrics here')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
test('renders with value', () => {
|
||||
@ -56,7 +56,7 @@ test('renders options with saved metric', () => {
|
||||
render(<DndFilterSelect {...defaultProps} formData={['saved_metric']} />, {
|
||||
useDnd: true,
|
||||
});
|
||||
expect(screen.getByText('Drop columns or metrics')).toBeInTheDocument();
|
||||
expect(screen.getByText('Drop columns or metrics here')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
test('renders options with column', () => {
|
||||
@ -76,7 +76,7 @@ test('renders options with column', () => {
|
||||
useDnd: true,
|
||||
},
|
||||
);
|
||||
expect(screen.getByText('Drop columns or metrics')).toBeInTheDocument();
|
||||
expect(screen.getByText('Drop columns or metrics here')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
test('renders options with adhoc metric', () => {
|
||||
@ -87,5 +87,5 @@ test('renders options with adhoc metric', () => {
|
||||
render(<DndFilterSelect {...defaultProps} formData={[adhocMetric]} />, {
|
||||
useDnd: true,
|
||||
});
|
||||
expect(screen.getByText('Drop columns or metrics')).toBeInTheDocument();
|
||||
expect(screen.getByText('Drop columns or metrics here')).toBeInTheDocument();
|
||||
});
|
||||
|
@ -374,7 +374,7 @@ export const DndFilterSelect = (props: DndFilterSelectProps) => {
|
||||
canDrop={canDrop}
|
||||
valuesRenderer={valuesRenderer}
|
||||
accept={DND_ACCEPTED_TYPES}
|
||||
ghostButtonText={t('Drop columns or metrics')}
|
||||
ghostButtonText={t('Drop columns or metrics here')}
|
||||
{...props}
|
||||
/>
|
||||
<AdhocFilterPopoverTrigger
|
||||
|
@ -31,10 +31,10 @@ const defaultProps = {
|
||||
|
||||
test('renders with default props', () => {
|
||||
render(<DndMetricSelect {...defaultProps} />, { useDnd: true });
|
||||
expect(screen.getByText('Drop column or metric')).toBeInTheDocument();
|
||||
expect(screen.getByText('Drop column or metric here')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
test('renders with default props and multi = true', () => {
|
||||
render(<DndMetricSelect {...defaultProps} multi />, { useDnd: true });
|
||||
expect(screen.getByText('Drop columns or metrics')).toBeInTheDocument();
|
||||
expect(screen.getByText('Drop columns or metrics here')).toBeInTheDocument();
|
||||
});
|
||||
|
@ -334,8 +334,8 @@ export const DndMetricSelect = (props: any) => {
|
||||
valuesRenderer={valuesRenderer}
|
||||
accept={DND_ACCEPTED_TYPES}
|
||||
ghostButtonText={tn(
|
||||
'Drop column or metric',
|
||||
'Drop columns or metrics',
|
||||
'Drop column or metric here',
|
||||
'Drop columns or metrics here',
|
||||
multi ? 2 : 1,
|
||||
)}
|
||||
displayGhostButton={multi || value.length === 0}
|
||||
|
@ -33,7 +33,7 @@ const defaultProps = {
|
||||
|
||||
test('renders with default props', async () => {
|
||||
render(<DndSelectLabel {...defaultProps} />, { useDnd: true });
|
||||
expect(await screen.findByText('Drop columns')).toBeInTheDocument();
|
||||
expect(await screen.findByText('Drop columns here')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
test('renders ghost button when empty', async () => {
|
||||
|
@ -55,7 +55,7 @@ export default function DndSelectLabel<T, O>({
|
||||
return (
|
||||
<AddControlLabel cancelHover>
|
||||
<Icons.PlusSmall iconColor={theme.colors.grayscale.light1} />
|
||||
{t(props.ghostButtonText || 'Drop columns')}
|
||||
{t(props.ghostButtonText || 'Drop columns here')}
|
||||
</AddControlLabel>
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user