mirror of https://github.com/apache/superset.git
fix: typescript errors in 4.0 (#27402)
This commit is contained in:
parent
a54a24e3b5
commit
ce0b70cc86
|
@ -115,11 +115,11 @@ export default function makeApi<
|
|||
jsonPayload: undefined as JsonObject | undefined,
|
||||
};
|
||||
if (requestType === 'search') {
|
||||
requestConfig.searchParams = payload as URLSearchParams;
|
||||
requestConfig.searchParams = payload as unknown as URLSearchParams;
|
||||
} else if (requestType === 'rison') {
|
||||
requestConfig.endpoint = `${endpoint}?q=${rison.encode(payload)}`;
|
||||
} else if (requestType === 'form') {
|
||||
requestConfig.postPayload = payload as FormData;
|
||||
requestConfig.postPayload = payload as unknown as FormData;
|
||||
} else {
|
||||
requestConfig.jsonPayload = payload as JsonObject;
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
* under the License.
|
||||
*/
|
||||
import { QueryFormData } from '@superset-ui/core';
|
||||
import { ControlPanelConfig } from 'packages/superset-ui-chart-controls/src/types';
|
||||
import { ControlPanelConfig } from '@superset-ui/chart-controls';
|
||||
import { DiffType, RowType } from './index';
|
||||
|
||||
export const defaultProps: Record<string, Partial<QueryFormData>> = {
|
||||
|
|
|
@ -179,7 +179,7 @@ class AlteredSliceTag extends React.Component<
|
|||
return '[]';
|
||||
}
|
||||
return value
|
||||
.map(v => {
|
||||
.map((v: FilterItemType) => {
|
||||
const filterVal =
|
||||
v.comparator && v.comparator.constructor === Array
|
||||
? `[${v.comparator.join(', ')}]`
|
||||
|
@ -198,14 +198,14 @@ class AlteredSliceTag extends React.Component<
|
|||
return value.map(v => safeStringify(v)).join(', ');
|
||||
}
|
||||
if (controlsMap[key]?.type === 'MetricsControl' && Array.isArray(value)) {
|
||||
const formattedValue = value.map(v => v?.label ?? v);
|
||||
const formattedValue = value.map((v: FilterItemType) => v?.label ?? v);
|
||||
return formattedValue.length ? formattedValue.join(', ') : '[]';
|
||||
}
|
||||
if (typeof value === 'boolean') {
|
||||
return value ? 'true' : 'false';
|
||||
}
|
||||
if (Array.isArray(value)) {
|
||||
const formattedValue = value.map(v => v?.label ?? v);
|
||||
const formattedValue = value.map((v: FilterItemType) => v?.label ?? v);
|
||||
return formattedValue.length ? formattedValue.join(', ') : '[]';
|
||||
}
|
||||
if (typeof value === 'string' || typeof value === 'number') {
|
||||
|
|
|
@ -47,6 +47,7 @@ const TelemetryPixel = ({
|
|||
const pixelPath = `https://apachesuperset.gateway.scarf.sh/pixel/${PIXEL_ID}/${version}/${sha}/${build}`;
|
||||
return process.env.SCARF_ANALYTICS === 'false' ? null : (
|
||||
<img
|
||||
// @ts-ignore
|
||||
referrerPolicy="no-referrer-when-downgrade"
|
||||
src={pixelPath}
|
||||
width={0}
|
||||
|
|
Loading…
Reference in New Issue