mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
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:
@@ -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;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user