@superset-ui/core
Advanced tools
Comparing version 0.17.48 to 0.17.49
@@ -18,3 +18,4 @@ import _pt from "prop-types"; | ||
height: 400, | ||
width: '100%' | ||
width: '100%', | ||
enableNoResults: true | ||
}; | ||
@@ -76,2 +77,3 @@ export default class SuperChart extends React.PureComponent { | ||
queriesData, | ||
enableNoResults, | ||
...rest | ||
@@ -86,5 +88,5 @@ } = this.props; | ||
const noResultQueries = !queriesData || queriesData.every(({ | ||
const noResultQueries = enableNoResults && (!queriesData || queriesData.every(({ | ||
data | ||
}) => !data || Array.isArray(data) && data.length === 0); | ||
}) => !data || Array.isArray(data) && data.length === 0)); | ||
@@ -154,2 +156,3 @@ if (noResultQueries) { | ||
debounceTime: _pt.number, | ||
enableNoResults: _pt.bool, | ||
FallbackComponent: _pt.elementType, | ||
@@ -156,0 +159,0 @@ height: _pt.oneOfType([_pt.number, _pt.string]), |
@@ -14,2 +14,3 @@ export default class ChartMetadata { | ||
this.datasourceCount = void 0; | ||
this.enableNoResults = void 0; | ||
const { | ||
@@ -25,3 +26,4 @@ name, | ||
behaviors = [], | ||
datasourceCount = 1 | ||
datasourceCount = 1, | ||
enableNoResults = true | ||
} = config; | ||
@@ -43,2 +45,3 @@ this.name = name; | ||
this.datasourceCount = datasourceCount; | ||
this.enableNoResults = enableNoResults; | ||
} | ||
@@ -61,3 +64,4 @@ | ||
behaviors: this.behaviors, | ||
datasourceCount: this.datasourceCount | ||
datasourceCount: this.datasourceCount, | ||
enableNoResults: this.enableNoResults | ||
}); | ||
@@ -64,0 +68,0 @@ } |
@@ -0,1 +1,4 @@ | ||
/** Type checking is disabled for this file due to reselect only supporting | ||
* TS declarations for selectors with up to 12 arguments. */ | ||
// @ts-nocheck | ||
import { createSelector } from 'reselect'; | ||
@@ -21,2 +24,3 @@ import { convertKeysToCamelCase } from '../..'; | ||
this.appSection = void 0; | ||
this.isRefreshing = void 0; | ||
const { | ||
@@ -34,3 +38,4 @@ annotationData = {}, | ||
height = DEFAULT_HEIGHT, | ||
appSection | ||
appSection, | ||
isRefreshing | ||
} = config; | ||
@@ -51,2 +56,3 @@ this.width = width; | ||
this.appSection = appSection; | ||
this.isRefreshing = isRefreshing; | ||
} | ||
@@ -59,3 +65,3 @@ | ||
ChartProps.createSelector = function create() { | ||
return createSelector(input => input.annotationData, input => input.datasource, input => input.formData, input => input.height, input => input.hooks, input => input.initialValues, input => input.queriesData, input => input.width, input => input.ownState, input => input.filterState, input => input.behaviors, input => input.appSection, (annotationData, datasource, formData, height, hooks, initialValues, queriesData, width, ownState, filterState, behaviors, appSection) => new ChartProps({ | ||
return createSelector(input => input.annotationData, input => input.datasource, input => input.formData, input => input.height, input => input.hooks, input => input.initialValues, input => input.queriesData, input => input.width, input => input.ownState, input => input.filterState, input => input.behaviors, input => input.appSection, input => input.isRefreshing, (annotationData, datasource, formData, height, hooks, initialValues, queriesData, width, ownState, filterState, behaviors, appSection, isRefreshing) => new ChartProps({ | ||
annotationData, | ||
@@ -72,4 +78,5 @@ datasource, | ||
behaviors, | ||
appSection | ||
appSection, | ||
isRefreshing | ||
})); | ||
}; |
@@ -20,2 +20,4 @@ import React, { ReactNode } from 'react'; | ||
debounceTime?: number; | ||
/** enable "No Results" message if empty result set */ | ||
enableNoResults?: boolean; | ||
/** Component to render when there are unexpected errors */ | ||
@@ -51,2 +53,3 @@ FallbackComponent?: React.ComponentType<FallbackPropsWithDimension>; | ||
width: string | number; | ||
enableNoResults: boolean; | ||
}; | ||
@@ -53,0 +56,0 @@ private setRef; |
@@ -35,3 +35,4 @@ "use strict"; | ||
height: 400, | ||
width: '100%' | ||
width: '100%', | ||
enableNoResults: true | ||
}; | ||
@@ -94,2 +95,3 @@ | ||
queriesData, | ||
enableNoResults, | ||
...rest | ||
@@ -104,5 +106,5 @@ } = this.props; | ||
const noResultQueries = !queriesData || queriesData.every(({ | ||
const noResultQueries = enableNoResults && (!queriesData || queriesData.every(({ | ||
data | ||
}) => !data || Array.isArray(data) && data.length === 0); | ||
}) => !data || Array.isArray(data) && data.length === 0)); | ||
@@ -173,2 +175,3 @@ if (noResultQueries) { | ||
debounceTime: _propTypes.default.number, | ||
enableNoResults: _propTypes.default.bool, | ||
FallbackComponent: _propTypes.default.elementType, | ||
@@ -175,0 +178,0 @@ height: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]), |
@@ -11,2 +11,3 @@ import { Behavior } from '../types/Base'; | ||
datasourceCount?: number; | ||
enableNoResults?: boolean; | ||
show?: boolean; | ||
@@ -30,2 +31,3 @@ supportedAnnotationTypes?: string[]; | ||
datasourceCount: number; | ||
enableNoResults: boolean; | ||
constructor(config: ChartMetadataConfig); | ||
@@ -32,0 +34,0 @@ canBeAnnotationType(type: string): boolean; |
@@ -19,2 +19,3 @@ "use strict"; | ||
this.datasourceCount = void 0; | ||
this.enableNoResults = void 0; | ||
const { | ||
@@ -30,3 +31,4 @@ name, | ||
behaviors = [], | ||
datasourceCount = 1 | ||
datasourceCount = 1, | ||
enableNoResults = true | ||
} = config; | ||
@@ -48,2 +50,3 @@ this.name = name; | ||
this.datasourceCount = datasourceCount; | ||
this.enableNoResults = enableNoResults; | ||
} | ||
@@ -66,3 +69,4 @@ | ||
behaviors: this.behaviors, | ||
datasourceCount: this.datasourceCount | ||
datasourceCount: this.datasourceCount, | ||
enableNoResults: this.enableNoResults | ||
}); | ||
@@ -69,0 +73,0 @@ } |
@@ -56,2 +56,4 @@ import { AppSection, Behavior, Datasource, FilterState, JsonObject } from '../..'; | ||
appSection?: AppSection; | ||
/** is the chart refreshing its contents */ | ||
isRefreshing?: boolean; | ||
} | ||
@@ -74,2 +76,3 @@ export default class ChartProps<FormData extends RawFormData = RawFormData> { | ||
appSection?: AppSection; | ||
isRefreshing?: boolean; | ||
constructor(config?: ChartPropsConfig & { | ||
@@ -76,0 +79,0 @@ formData?: FormData; |
@@ -10,2 +10,5 @@ "use strict"; | ||
/** Type checking is disabled for this file due to reselect only supporting | ||
* TS declarations for selectors with up to 12 arguments. */ | ||
// @ts-nocheck | ||
const DEFAULT_WIDTH = 800; | ||
@@ -30,2 +33,3 @@ const DEFAULT_HEIGHT = 600; | ||
this.appSection = void 0; | ||
this.isRefreshing = void 0; | ||
const { | ||
@@ -43,3 +47,4 @@ annotationData = {}, | ||
height = DEFAULT_HEIGHT, | ||
appSection | ||
appSection, | ||
isRefreshing | ||
} = config; | ||
@@ -60,2 +65,3 @@ this.width = width; | ||
this.appSection = appSection; | ||
this.isRefreshing = isRefreshing; | ||
} | ||
@@ -70,3 +76,3 @@ | ||
ChartProps.createSelector = function create() { | ||
return (0, _reselect.createSelector)(input => input.annotationData, input => input.datasource, input => input.formData, input => input.height, input => input.hooks, input => input.initialValues, input => input.queriesData, input => input.width, input => input.ownState, input => input.filterState, input => input.behaviors, input => input.appSection, (annotationData, datasource, formData, height, hooks, initialValues, queriesData, width, ownState, filterState, behaviors, appSection) => new ChartProps({ | ||
return (0, _reselect.createSelector)(input => input.annotationData, input => input.datasource, input => input.formData, input => input.height, input => input.hooks, input => input.initialValues, input => input.queriesData, input => input.width, input => input.ownState, input => input.filterState, input => input.behaviors, input => input.appSection, input => input.isRefreshing, (annotationData, datasource, formData, height, hooks, initialValues, queriesData, width, ownState, filterState, behaviors, appSection, isRefreshing) => new ChartProps({ | ||
annotationData, | ||
@@ -83,4 +89,5 @@ datasource, | ||
behaviors, | ||
appSection | ||
appSection, | ||
isRefreshing | ||
})); | ||
}; |
{ | ||
"name": "@superset-ui/core", | ||
"version": "0.17.48", | ||
"version": "0.17.49", | ||
"description": "Superset UI core", | ||
@@ -70,3 +70,3 @@ "sideEffects": false, | ||
}, | ||
"gitHead": "9e89c9e05ad6c986d3290720815558fb71ae4951" | ||
"gitHead": "4114094999aa80ad6f09fa90abdb9acd8451f9e2" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
741547
15825
3309