fix: Drill to detail blocked by tooltip (#22082)

Co-authored-by: Ville Brofeldt <ville.brofeldt@apple.com>
This commit is contained in:
Michael S. Molina
2022-11-23 14:50:06 -05:00
committed by GitHub
parent 1809d2b957
commit 3bc0865d90
45 changed files with 572 additions and 255 deletions

View File

@@ -25,6 +25,7 @@ import transformProps from '../../src/BigNumber/BigNumberWithTrendline/transform
import {
BigNumberDatum,
BigNumberWithTrendlineChartProps,
BigNumberWithTrendlineFormData,
} from '../../src/BigNumber/types';
const formData = {
@@ -44,7 +45,8 @@ const formData = {
datasource: 'test_datasource',
};
const rawFormData = {
const rawFormData: BigNumberWithTrendlineFormData = {
colorPicker: { b: 0, g: 0, r: 0 },
datasource: '1__table',
metric: 'value',
color_picker: {
@@ -129,7 +131,8 @@ describe('BigNumberWithTrendline', () => {
expect(transformed.bigNumber).toStrictEqual(1.2345);
expect(transformed.bigNumberFallback).not.toBeNull();
// should successfully formatTime by ganularity
// should successfully formatTime by granularity
// @ts-ignore
expect(transformed.formatTime(new Date('2020-01-01'))).toStrictEqual(
'2020-01-01 00:00:00',
);
@@ -150,6 +153,7 @@ describe('BigNumberWithTrendline', () => {
},
};
const transformed = transformProps(propsWithDatasource);
// @ts-ignore
expect(transformed.headerFormatter(transformed.bigNumber)).toStrictEqual(
'1.23',
);

View File

@@ -16,13 +16,14 @@
* specific language governing permissions and limitations
* under the License.
*/
import { ChartProps, supersetTheme } from '@superset-ui/core';
import { ChartProps, SqlaFormData, supersetTheme } from '@superset-ui/core';
import transformProps from '../../src/Graph/transformProps';
import { DEFAULT_GRAPH_SERIES_OPTION } from '../../src/Graph/constants';
import { EchartsGraphChartProps } from '../../src/Graph/types';
describe('EchartsGraph transformProps', () => {
it('should transform chart props for viz without category', () => {
const formData = {
const formData: SqlaFormData = {
colorScheme: 'bnbColors',
datasource: '3__table',
granularity_sqla: 'ds',
@@ -30,6 +31,7 @@ describe('EchartsGraph transformProps', () => {
source: 'source_column',
target: 'target_column',
category: null,
viz_type: 'graph',
};
const queriesData = [
{
@@ -57,7 +59,7 @@ describe('EchartsGraph transformProps', () => {
};
const chartProps = new ChartProps(chartPropsConfig);
expect(transformProps(chartProps)).toEqual(
expect(transformProps(chartProps as EchartsGraphChartProps)).toEqual(
expect.objectContaining({
width: 800,
height: 600,
@@ -151,7 +153,7 @@ describe('EchartsGraph transformProps', () => {
});
it('should transform chart props for viz with category and falsey normalization', () => {
const formData = {
const formData: SqlaFormData = {
colorScheme: 'bnbColors',
datasource: '3__table',
granularity_sqla: 'ds',
@@ -160,6 +162,7 @@ describe('EchartsGraph transformProps', () => {
target: 'target_column',
sourceCategory: 'source_category_column',
targetCategory: 'target_category_column',
viz_type: 'graph',
};
const queriesData = [
{
@@ -197,7 +200,7 @@ describe('EchartsGraph transformProps', () => {
};
const chartProps = new ChartProps(chartPropsConfig);
expect(transformProps(chartProps)).toEqual(
expect(transformProps(chartProps as EchartsGraphChartProps)).toEqual(
expect.objectContaining({
width: 800,
height: 600,

View File

@@ -18,6 +18,7 @@
*/
import { ChartProps, supersetTheme } from '@superset-ui/core';
import transformProps from '../../src/Tree/transformProps';
import { EchartsTreeChartProps } from '../../src/Tree/types';
describe('EchartsTree transformProps', () => {
const formData = {
@@ -70,7 +71,7 @@ describe('EchartsTree transformProps', () => {
];
const chartProps = new ChartProps({ ...chartPropsConfig, queriesData });
expect(transformProps(chartProps)).toEqual(
expect(transformProps(chartProps as EchartsTreeChartProps)).toEqual(
expect.objectContaining({
width: 800,
height: 600,
@@ -137,7 +138,7 @@ describe('EchartsTree transformProps', () => {
];
const chartProps = new ChartProps({ ...chartPropsConfig, queriesData });
expect(transformProps(chartProps)).toEqual(
expect(transformProps(chartProps as EchartsTreeChartProps)).toEqual(
expect.objectContaining({
width: 800,
height: 600,
@@ -223,7 +224,7 @@ describe('EchartsTree transformProps', () => {
];
const chartProps = new ChartProps({ ...chartPropsConfig, queriesData });
expect(transformProps(chartProps)).toEqual(
expect(transformProps(chartProps as EchartsTreeChartProps)).toEqual(
expect.objectContaining({
width: 800,
height: 600,
@@ -299,7 +300,7 @@ describe('EchartsTree transformProps', () => {
];
const chartProps = new ChartProps({ ...chartPropsConfig, queriesData });
expect(transformProps(chartProps)).toEqual(
expect(transformProps(chartProps as EchartsTreeChartProps)).toEqual(
expect.objectContaining({
width: 800,
height: 600,
@@ -385,7 +386,7 @@ describe('EchartsTree transformProps', () => {
];
const chartProps = new ChartProps({ ...chartPropsConfig, queriesData });
expect(transformProps(chartProps)).toEqual(
expect(transformProps(chartProps as EchartsTreeChartProps)).toEqual(
expect.objectContaining({
width: 800,
height: 600,