Pass testing status to the data source plugin extension (#69988)

This commit is contained in:
Jaroslav Benc 2023-06-14 13:18:24 +02:00 committed by GitHub
parent 91272ee4f9
commit 12cd99ae8d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 0 deletions

View File

@ -121,6 +121,12 @@ export type PluginExtensionDataSourceConfigContext<JsonData extends DataSourceJs
// Meta information about the datasource plugin
dataSourceMeta: DataSourcePluginMeta;
// Testing status
testingStatus?: {
message?: string | null;
status?: string | null;
};
// Can be used to update the `jsonData` field on the datasource
// (Only updates the form, it still needs to be saved by the user)
setJsonData: (jsonData: JsonData) => void;

View File

@ -359,6 +359,7 @@ describe('<EditDataSource>', () => {
expect(props.context.dataSource).toBeDefined();
expect(props.context.dataSourceMeta).toBeDefined();
expect(props.context.setJsonData).toBeDefined();
expect(props.context.testingStatus).toBeDefined();
});
});
});

View File

@ -217,6 +217,7 @@ export function EditDataSourceView({
context={{
dataSource: omit(dataSource, ['secureJsonData']),
dataSourceMeta: dataSourceMeta,
testingStatus,
setJsonData: (jsonData) =>
onOptionsChange({
...dataSource,