Skip to content

Commit

Permalink
fix: typescript errors in 4.0 (apache#27402)
Browse files Browse the repository at this point in the history
  • Loading branch information
justinpark authored Mar 6, 2024
1 parent a54a24e commit ce0b70c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>> = {
Expand Down
6 changes: 3 additions & 3 deletions superset-frontend/src/components/AlteredSliceTag/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(', ')}]`
Expand All @@ -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') {
Expand Down
1 change: 1 addition & 0 deletions superset-frontend/src/components/TelemetryPixel/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down

0 comments on commit ce0b70c

Please sign in to comment.