mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Datasources: Pass down the edit-form errors (#69830)
feat: pass the error to the event handler
This commit is contained in:
parent
32ff712e98
commit
324b33146a
@ -130,10 +130,10 @@ export function EditDataSourceView({
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
await onUpdate({ ...dataSource });
|
await onUpdate({ ...dataSource });
|
||||||
trackDsConfigUpdated('success');
|
trackDsConfigUpdated({ item: 'success' });
|
||||||
appEvents.publish(new DataSourceUpdatedSuccessfully());
|
appEvents.publish(new DataSourceUpdatedSuccessfully());
|
||||||
} catch (err) {
|
} catch (error) {
|
||||||
trackDsConfigUpdated('fail');
|
trackDsConfigUpdated({ item: 'fail', error });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,6 +83,6 @@ export const trackDsConfigClicked = (item: string) => {
|
|||||||
reportInteraction('connections_datasources_settings_clicked', { item });
|
reportInteraction('connections_datasources_settings_clicked', { item });
|
||||||
};
|
};
|
||||||
|
|
||||||
export const trackDsConfigUpdated = (item: string) => {
|
export const trackDsConfigUpdated = (props: { item: string; error?: unknown }) => {
|
||||||
reportInteraction('connections_datasources_ds_configured', { item });
|
reportInteraction('connections_datasources_ds_configured', props);
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user