Chore: More typescript improvements 💪 (#68699)

* fix some anys

* some canvas/geomap improvements

* some more panel type fixes

* just omit the type in TagOption
This commit is contained in:
Ashley Harrison
2023-05-22 11:53:58 +01:00
committed by GitHub
parent 623c014cda
commit e8ca3c0409
48 changed files with 187 additions and 298 deletions

View File

@@ -66,8 +66,7 @@ export function randomizeData(data: DataFrameJSON[], opts: Randomize): DataFrame
if (opts.values) {
schema.fields.forEach((f, idx) => {
if (f.type === FieldType.string && data) {
// eslint-ignore-next-line
const v = data.values[idx].map((v) => rand(v as string));
const v = data.values[idx].map((v) => rand(String(v)));
data.values[idx] = v;
}
});

View File

@@ -14,7 +14,7 @@ interface SaveDashboardErrorProxyProps {
/** original dashboard */
dashboard: DashboardModel;
/** dashboard save model with applied modifications, i.e. title */
dashboardSaveModel: any;
dashboardSaveModel: DashboardModel;
error: FetchError;
onDismiss: () => void;
}

View File

@@ -28,7 +28,7 @@ export interface SaveDashboardFormProps {
dashboard: DashboardModel;
onCancel: () => void;
onSuccess: () => void;
onSubmit?: (clone: any, options: SaveDashboardOptions, dashboard: DashboardModel) => Promise<any>;
onSubmit?: (clone: DashboardModel, options: SaveDashboardOptions, dashboard: DashboardModel) => Promise<any>;
}
export interface SaveDashboardModalProps {

View File

@@ -29,7 +29,7 @@ export const useDashboardSave = (dashboard: DashboardModel, isCopy = false) => {
const dispatch = useDispatch();
const notifyApp = useAppNotification();
const [state, onDashboardSave] = useAsyncFn(
async (clone: any, options: SaveDashboardOptions, dashboard: DashboardModel) => {
async (clone: DashboardModel, options: SaveDashboardOptions, dashboard: DashboardModel) => {
try {
const result = await saveDashboard(clone, options, dashboard);
dashboard.version = result.version;

View File

@@ -48,11 +48,7 @@ export function versions() {
];
}
export function compare(type: any) {
return type === 'basic' ? '<div></div>' : '<pre><code></code></pre>';
}
export function restore(version: any, restoredFrom?: any): any {
export function restore(version: number, restoredFrom?: number) {
return {
dashboard: {
meta: {