From a881205a49d0bbe5dcde75be5988878a1de84126 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ida=20=C5=A0tambuk?= Date: Wed, 12 Feb 2025 10:56:22 +0100 Subject: [PATCH] Migrate to plugin-ui from grafana/experimental (#384) --- README.md | 6 +- package.json | 2 +- src/components/ConfigEditor.tsx | 221 +++--- src/components/query/ClientCacheRow.tsx | 2 +- .../query/ListAssetsQueryEditor.tsx | 2 +- .../query/ListTimeSeriesQueryEditor.tsx | 100 +-- src/components/query/PropertyQueryEditor.tsx | 2 +- src/components/query/QualityAndOrderRow.tsx | 2 +- src/components/query/QueryEditor.tsx | 2 +- src/components/query/QueryOptions.tsx | 2 +- src/plugin.json | 3 +- yarn.lock | 652 ++++-------------- 12 files changed, 317 insertions(+), 679 deletions(-) diff --git a/README.md b/README.md index 3c199bf2..014bcdf2 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,8 @@ -# AWS IoT Sitewise Datasource Development Guide +# Compatibility + +AWS IoT Sitewise data source plugin >=2.0.0 is not compatible with Grafana versions <=10.4.x due to a breaking change in UI components. + +# AWS IoT Sitewise Data Source Development Guide Please add feedback to the [issues](https://github.com/grafana/iot-sitewise-datasource/issues) folder, and we will follow up shortly. Be sure to include version information for both grafana and the installed plugin. diff --git a/package.json b/package.json index 9f0ed0e2..d9e9c91c 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "license": "Apache-2.0", "dependencies": { "@grafana/data": "^11.5.0", - "@grafana/experimental": "2.1.6", + "@grafana/plugin-ui": "^0.9.4", "@grafana/runtime": "^11.5.0", "@grafana/schema": "^11.4.0", "@grafana/ui": "^11.4.0", diff --git a/src/components/ConfigEditor.tsx b/src/components/ConfigEditor.tsx index 5083d2b1..175af4f0 100644 --- a/src/components/ConfigEditor.tsx +++ b/src/components/ConfigEditor.tsx @@ -11,7 +11,7 @@ import { SitewiseOptions, SitewiseSecureJsonData } from '../types'; import { ConnectionConfig, ConnectionConfigProps, Divider } from '@grafana/aws-sdk'; import { Alert, Button, Field, Input, Select } from '@grafana/ui'; import { standardRegions } from '../regions'; -import { ConfigSection } from '@grafana/experimental'; +import { ConfigSection } from '@grafana/plugin-ui'; export type Props = ConnectionConfigProps; @@ -23,15 +23,15 @@ const edgeAuthMethods: Array> = [ export function ConfigEditor(props: Props) { if (props.options.jsonData.defaultRegion === 'Edge') { - return + return ; } - return
+ return ( +
{' '}
- + ); } - function EdgeConfig(props: Props) { const { options } = props; const { jsonData } = options; @@ -70,119 +70,110 @@ function EdgeConfig(props: Props) { }); } - return
- {hasEdgeAuth && ( - - - - - - + + + { - updateDatasourcePluginJsonDataOption(props, 'edgeAuthMode', v.value); - }} + + - {hasEdgeAuth && ( - <> - - - - - - - - )} - - {options.secureJsonFields?.cert ? ( - - ) : ( -