fix: typescript errors in 4.0 (#27402)

This commit is contained in:
JUST.in DO IT 2024-03-06 10:16:51 -08:00 committed by GitHub
parent a54a24e3b5
commit ce0b70cc86
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 7 additions and 6 deletions

View File

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

View File

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

View File

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

View File

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