chore(explore): change dnd placeholders (#16116)

* chore(explore): change dnd placeholders

* Fix tests and lint
This commit is contained in:
Kamil Gabryjelski 2021-08-09 17:50:11 +02:00 committed by GitHub
parent 2db1615c83
commit 6ac4f4ef2f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 14 additions and 13 deletions

View File

@ -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', () => {

View File

@ -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}
/>

View File

@ -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();
});

View File

@ -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

View File

@ -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();
});

View File

@ -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}

View File

@ -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 () => {

View File

@ -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>
);
}