Datasources: Rename a UI tracking event property (#62788)

refactor: rename the the `editLink` property to `path`
pull/62851/head
Levente Balogh 2 years ago committed by GitHub
parent 7391793504
commit de97ac7128
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      public/app/features/datasources/state/actions.test.ts
  2. 6
      public/app/features/datasources/state/actions.ts
  3. 8
      public/app/features/datasources/tracking.ts

@ -242,7 +242,7 @@ describe('testDataSource', () => {
datasource_uid: 'CW1234', datasource_uid: 'CW1234',
grafana_version: '1.0', grafana_version: '1.0',
success: true, success: true,
editLink: '/datasources/edit/CloudWatch', path: '/datasources/edit/CloudWatch',
}); });
}); });
@ -279,7 +279,7 @@ describe('testDataSource', () => {
datasource_uid: 'azM0nit0R', datasource_uid: 'azM0nit0R',
grafana_version: '1.0', grafana_version: '1.0',
success: false, success: false,
editLink: '/datasources/edit/Azure Monitor', path: '/datasources/edit/Azure Monitor',
}); });
}); });
@ -360,7 +360,7 @@ describe('addDataSource', () => {
plugin_version: '1.2.3', plugin_version: '1.2.3',
datasource_uid: 'azure23', datasource_uid: 'azure23',
grafana_version: '1.0', grafana_version: '1.0',
editLink: DATASOURCES_ROUTES.Edit.replace(':uid', 'azure23'), path: DATASOURCES_ROUTES.Edit.replace(':uid', 'azure23'),
}); });
}); });
}); });

@ -116,7 +116,7 @@ export const testDataSource = (
plugin_id: dsApi.type, plugin_id: dsApi.type,
datasource_uid: dsApi.uid, datasource_uid: dsApi.uid,
success: true, success: true,
editLink, path: editLink,
}); });
} catch (err) { } catch (err) {
let message: string | undefined; let message: string | undefined;
@ -137,7 +137,7 @@ export const testDataSource = (
plugin_id: dsApi.type, plugin_id: dsApi.type,
datasource_uid: dsApi.uid, datasource_uid: dsApi.uid,
success: false, success: false,
editLink, path: editLink,
}); });
} }
}); });
@ -221,7 +221,7 @@ export function addDataSource(plugin: DataSourcePluginMeta, editRoute = DATASOUR
plugin_id: plugin.id, plugin_id: plugin.id,
datasource_uid: result.datasource.uid, datasource_uid: result.datasource.uid,
plugin_version: result.meta?.info?.version, plugin_version: result.meta?.info?.version,
editLink, path: editLink,
}); });
locationService.push(editLink); locationService.push(editLink);

@ -24,8 +24,8 @@ type DataSourceCreatedProps = {
plugin_id: string; plugin_id: string;
/** The plugin version (especially interesting in external plugins - core plugins are aligned with grafana version) */ /** The plugin version (especially interesting in external plugins - core plugins are aligned with grafana version) */
plugin_version?: string; plugin_version?: string;
/** The URL that points to the edit page for the datasoruce. We are using this to be able to distinguish between the performance of different datasource edit locations. */ /** The URL path that points to the page where the event was triggered. We are using this to be able to distinguish between the performance of different datasource edit locations. */
editLink?: string; path?: string;
}; };
/** /**
@ -53,6 +53,6 @@ type DataSourceTestedProps = {
plugin_version?: string; plugin_version?: string;
/** Whether or not the datasource test succeeded = the datasource was successfully configured */ /** Whether or not the datasource test succeeded = the datasource was successfully configured */
success: boolean; success: boolean;
/** The URL that points to the edit page for the datasoruce. We are using this to be able to distinguish between the performance of different datasource edit locations. */ /** The URL path that points to the page where the event was triggered. We are using this to be able to distinguish between the performance of different datasource edit locations. */
editLink?: string; path?: string;
}; };

Loading…
Cancel
Save