Skip to content

Commit ad73534

Browse files
authored
ConfigEditor: add links to data source docs (#753)
1 parent c51d57e commit ad73534

File tree

4 files changed

+69
-86
lines changed

4 files changed

+69
-86
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"dependencies": {
2323
"@emotion/css": "11.13.5",
2424
"@grafana/async-query-data": "0.4.2",
25+
"@grafana/aws-sdk": "0.8.3",
2526
"@grafana/data": "^12.0.2",
2627
"@grafana/plugin-ui": "^0.11.1",
2728
"@grafana/runtime": "^12.0.2",
@@ -36,13 +37,12 @@
3637
"devDependencies": {
3738
"@babel/core": "^7.28.5",
3839
"@eslint/eslintrc": "^3.3.1",
39-
"@grafana/aws-sdk": "0.7.2",
4040
"@grafana/eslint-config": "^8.2.0",
4141
"@grafana/plugin-e2e": "^2.1.14",
4242
"@grafana/tsconfig": "^2.0.1",
4343
"@playwright/test": "1.55.1",
4444
"@stylistic/eslint-plugin-ts": "^4.2.0",
45-
"@swc/core": "^1.13.21",
45+
"@swc/core": "^1.14.0",
4646
"@swc/helpers": "^0.5.17",
4747
"@swc/jest": "^0.2.39",
4848
"@testing-library/jest-dom": "6.6.3",

src/ConfigEditor.test.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,9 @@ describe('ConfigEditor', () => {
112112
/>
113113
);
114114

115-
expect(screen.queryByText('Grafana Assume Role')).toBeInTheDocument();
115+
// The selected option and the link to the docs both have the same text
116+
expect(screen.queryAllByText('Grafana Assume Role').length).toBe(2);
117+
expect(screen.getByRole('link', { name: 'Grafana Assume Role' })).toBeInTheDocument();
116118
const instructionsButton = await screen.findByRole('button', {
117119
name: /How to create an IAM role for grafana to assume/i,
118120
});
@@ -139,7 +141,9 @@ describe('ConfigEditor', () => {
139141
/>
140142
);
141143

142-
expect(screen.queryByText('Grafana Assume Role')).toBeInTheDocument();
144+
// The selected option and the link to the docs both have the same text
145+
expect(screen.queryAllByText('Grafana Assume Role').length).toBe(2);
146+
expect(screen.getByRole('link', { name: 'Grafana Assume Role' })).toBeInTheDocument();
143147
const instructionsButton = await screen.findByRole('button', {
144148
name: /How to create an IAM role for grafana to assume/i,
145149
});
@@ -166,7 +170,9 @@ describe('ConfigEditor', () => {
166170
/>
167171
);
168172

169-
expect(screen.queryByText('Grafana Assume Role')).toBeInTheDocument();
173+
// The selected option and the link to the docs both have the same text
174+
expect(screen.queryAllByText('Grafana Assume Role').length).toBe(2);
175+
expect(screen.getByRole('link', { name: 'Grafana Assume Role' })).toBeInTheDocument();
170176
const instructionsButton = await screen.findByRole('button', {
171177
name: /How to create an IAM role for grafana to assume/i,
172178
});

src/ConfigEditor.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { AthenaDataSourceOptions, AthenaDataSourceSecureJsonData, AthenaDataSour
44
import { config, getBackendSrv } from '@grafana/runtime';
55
import { AwsAuthType, ConfigSelect, ConnectionConfig, Divider } from '@grafana/aws-sdk';
66
import { selectors } from 'tests/selectors';
7-
import { ConfigSection } from '@grafana/plugin-ui';
7+
import { ConfigSection, DataSourceDescription } from '@grafana/plugin-ui';
88
import { Field, Input, SecureSocksProxySettings, useStyles2 } from '@grafana/ui';
99
import { gte } from 'semver';
1010
import { css } from '@emotion/css';
@@ -104,6 +104,11 @@ export function ConfigEditor(props: Props) {
104104

105105
return (
106106
<div className={styles.formStyles}>
107+
<DataSourceDescription
108+
dataSourceName="Amazon Athena"
109+
docsLink="https://grafana.com/grafana/plugins/grafana-athena-datasource/"
110+
/>
111+
<Divider />
107112
<ConnectionConfig {...props} onOptionsChange={onOptionsChange} externalId={externalId} />
108113
{config.secureSocksDSProxyEnabled && gte(config.buildInfo.version, '10.0.0') && (
109114
<SecureSocksProxySettings options={props.options} onOptionsChange={onOptionsChange} />

yarn.lock

Lines changed: 52 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -1601,13 +1601,13 @@ __metadata:
16011601
languageName: node
16021602
linkType: hard
16031603

1604-
"@grafana/aws-sdk@npm:0.7.2":
1605-
version: 0.7.2
1606-
resolution: "@grafana/aws-sdk@npm:0.7.2"
1604+
"@grafana/aws-sdk@npm:0.8.3":
1605+
version: 0.8.3
1606+
resolution: "@grafana/aws-sdk@npm:0.8.3"
16071607
dependencies:
16081608
"@grafana/async-query-data": "npm:0.4.2"
1609-
"@grafana/plugin-ui": "npm:^0.10.1"
1610-
checksum: 10c0/47d77b2809c2a9cd2d2c5f0a3c40ef6bb05ec5fa0b666b96d01a90b477529cc1496c0524c0c6c1c3a63508ffede23a42472b99e2286914a3e98f9065780c0183
1609+
"@grafana/plugin-ui": "npm:^0.11.0"
1610+
checksum: 10c0/6791ca41c849d944601a3dd857ab05bc1da48aed3de80dc987589ffbbf662e8e595d6e118dba0da3fb16f49aab15d2691aebd1eece3e4f03957e818033e29093
16111611
languageName: node
16121612
linkType: hard
16131613

@@ -1722,35 +1722,7 @@ __metadata:
17221722
languageName: node
17231723
linkType: hard
17241724

1725-
"@grafana/plugin-ui@npm:^0.10.1":
1726-
version: 0.10.7
1727-
resolution: "@grafana/plugin-ui@npm:0.10.7"
1728-
dependencies:
1729-
"@emotion/css": "npm:^11.11.2"
1730-
"@hello-pangea/dnd": "npm:^17.0.0"
1731-
"@react-awesome-query-builder/ui": "npm:^6.6.4"
1732-
"@types/prismjs": "npm:^1.26.4"
1733-
lodash: "npm:^4.17.21"
1734-
prismjs: "npm:^1.30.0"
1735-
react-calendar: "npm:^4.8.0"
1736-
react-popper-tooltip: "npm:^4.4.2"
1737-
react-use: "npm:^17.3.1"
1738-
react-virtualized-auto-sizer: "npm:^1.0.6"
1739-
sql-formatter-plus: "npm:^1.3.6"
1740-
uuid: "npm:^11.0.0"
1741-
peerDependencies:
1742-
"@grafana/data": ">=10.4.0"
1743-
"@grafana/e2e-selectors": ">=10.4.0"
1744-
"@grafana/runtime": ">=10.4.0"
1745-
"@grafana/ui": ">=10.4.0"
1746-
react: ^18.2.0
1747-
react-dom: ^18.2.0
1748-
rxjs: ^7.8.1
1749-
checksum: 10c0/288cbe2f005cd98f1aac3cb32dd813ca89d81837b95ee5d18d8629e7143d5ced73f4e78e3942f90d38df3cc612e10ceed3d6f968f32201c637a1019596dff237
1750-
languageName: node
1751-
linkType: hard
1752-
1753-
"@grafana/plugin-ui@npm:^0.11.1":
1725+
"@grafana/plugin-ui@npm:^0.11.0, @grafana/plugin-ui@npm:^0.11.1":
17541726
version: 0.11.1
17551727
resolution: "@grafana/plugin-ui@npm:0.11.1"
17561728
dependencies:
@@ -3592,90 +3564,90 @@ __metadata:
35923564
languageName: node
35933565
linkType: hard
35943566

3595-
"@swc/core-darwin-arm64@npm:1.13.21":
3596-
version: 1.13.21
3597-
resolution: "@swc/core-darwin-arm64@npm:1.13.21"
3567+
"@swc/core-darwin-arm64@npm:1.14.0":
3568+
version: 1.14.0
3569+
resolution: "@swc/core-darwin-arm64@npm:1.14.0"
35983570
conditions: os=darwin & cpu=arm64
35993571
languageName: node
36003572
linkType: hard
36013573

3602-
"@swc/core-darwin-x64@npm:1.13.21":
3603-
version: 1.13.21
3604-
resolution: "@swc/core-darwin-x64@npm:1.13.21"
3574+
"@swc/core-darwin-x64@npm:1.14.0":
3575+
version: 1.14.0
3576+
resolution: "@swc/core-darwin-x64@npm:1.14.0"
36053577
conditions: os=darwin & cpu=x64
36063578
languageName: node
36073579
linkType: hard
36083580

3609-
"@swc/core-linux-arm-gnueabihf@npm:1.13.21":
3610-
version: 1.13.21
3611-
resolution: "@swc/core-linux-arm-gnueabihf@npm:1.13.21"
3581+
"@swc/core-linux-arm-gnueabihf@npm:1.14.0":
3582+
version: 1.14.0
3583+
resolution: "@swc/core-linux-arm-gnueabihf@npm:1.14.0"
36123584
conditions: os=linux & cpu=arm
36133585
languageName: node
36143586
linkType: hard
36153587

3616-
"@swc/core-linux-arm64-gnu@npm:1.13.21":
3617-
version: 1.13.21
3618-
resolution: "@swc/core-linux-arm64-gnu@npm:1.13.21"
3588+
"@swc/core-linux-arm64-gnu@npm:1.14.0":
3589+
version: 1.14.0
3590+
resolution: "@swc/core-linux-arm64-gnu@npm:1.14.0"
36193591
conditions: os=linux & cpu=arm64 & libc=glibc
36203592
languageName: node
36213593
linkType: hard
36223594

3623-
"@swc/core-linux-arm64-musl@npm:1.13.21":
3624-
version: 1.13.21
3625-
resolution: "@swc/core-linux-arm64-musl@npm:1.13.21"
3595+
"@swc/core-linux-arm64-musl@npm:1.14.0":
3596+
version: 1.14.0
3597+
resolution: "@swc/core-linux-arm64-musl@npm:1.14.0"
36263598
conditions: os=linux & cpu=arm64 & libc=musl
36273599
languageName: node
36283600
linkType: hard
36293601

3630-
"@swc/core-linux-x64-gnu@npm:1.13.21":
3631-
version: 1.13.21
3632-
resolution: "@swc/core-linux-x64-gnu@npm:1.13.21"
3602+
"@swc/core-linux-x64-gnu@npm:1.14.0":
3603+
version: 1.14.0
3604+
resolution: "@swc/core-linux-x64-gnu@npm:1.14.0"
36333605
conditions: os=linux & cpu=x64 & libc=glibc
36343606
languageName: node
36353607
linkType: hard
36363608

3637-
"@swc/core-linux-x64-musl@npm:1.13.21":
3638-
version: 1.13.21
3639-
resolution: "@swc/core-linux-x64-musl@npm:1.13.21"
3609+
"@swc/core-linux-x64-musl@npm:1.14.0":
3610+
version: 1.14.0
3611+
resolution: "@swc/core-linux-x64-musl@npm:1.14.0"
36403612
conditions: os=linux & cpu=x64 & libc=musl
36413613
languageName: node
36423614
linkType: hard
36433615

3644-
"@swc/core-win32-arm64-msvc@npm:1.13.21":
3645-
version: 1.13.21
3646-
resolution: "@swc/core-win32-arm64-msvc@npm:1.13.21"
3616+
"@swc/core-win32-arm64-msvc@npm:1.14.0":
3617+
version: 1.14.0
3618+
resolution: "@swc/core-win32-arm64-msvc@npm:1.14.0"
36473619
conditions: os=win32 & cpu=arm64
36483620
languageName: node
36493621
linkType: hard
36503622

3651-
"@swc/core-win32-ia32-msvc@npm:1.13.21":
3652-
version: 1.13.21
3653-
resolution: "@swc/core-win32-ia32-msvc@npm:1.13.21"
3623+
"@swc/core-win32-ia32-msvc@npm:1.14.0":
3624+
version: 1.14.0
3625+
resolution: "@swc/core-win32-ia32-msvc@npm:1.14.0"
36543626
conditions: os=win32 & cpu=ia32
36553627
languageName: node
36563628
linkType: hard
36573629

3658-
"@swc/core-win32-x64-msvc@npm:1.13.21":
3659-
version: 1.13.21
3660-
resolution: "@swc/core-win32-x64-msvc@npm:1.13.21"
3630+
"@swc/core-win32-x64-msvc@npm:1.14.0":
3631+
version: 1.14.0
3632+
resolution: "@swc/core-win32-x64-msvc@npm:1.14.0"
36613633
conditions: os=win32 & cpu=x64
36623634
languageName: node
36633635
linkType: hard
36643636

3665-
"@swc/core@npm:^1.13.21":
3666-
version: 1.13.21
3667-
resolution: "@swc/core@npm:1.13.21"
3637+
"@swc/core@npm:^1.14.0":
3638+
version: 1.14.0
3639+
resolution: "@swc/core@npm:1.14.0"
36683640
dependencies:
3669-
"@swc/core-darwin-arm64": "npm:1.13.21"
3670-
"@swc/core-darwin-x64": "npm:1.13.21"
3671-
"@swc/core-linux-arm-gnueabihf": "npm:1.13.21"
3672-
"@swc/core-linux-arm64-gnu": "npm:1.13.21"
3673-
"@swc/core-linux-arm64-musl": "npm:1.13.21"
3674-
"@swc/core-linux-x64-gnu": "npm:1.13.21"
3675-
"@swc/core-linux-x64-musl": "npm:1.13.21"
3676-
"@swc/core-win32-arm64-msvc": "npm:1.13.21"
3677-
"@swc/core-win32-ia32-msvc": "npm:1.13.21"
3678-
"@swc/core-win32-x64-msvc": "npm:1.13.21"
3641+
"@swc/core-darwin-arm64": "npm:1.14.0"
3642+
"@swc/core-darwin-x64": "npm:1.14.0"
3643+
"@swc/core-linux-arm-gnueabihf": "npm:1.14.0"
3644+
"@swc/core-linux-arm64-gnu": "npm:1.14.0"
3645+
"@swc/core-linux-arm64-musl": "npm:1.14.0"
3646+
"@swc/core-linux-x64-gnu": "npm:1.14.0"
3647+
"@swc/core-linux-x64-musl": "npm:1.14.0"
3648+
"@swc/core-win32-arm64-msvc": "npm:1.14.0"
3649+
"@swc/core-win32-ia32-msvc": "npm:1.14.0"
3650+
"@swc/core-win32-x64-msvc": "npm:1.14.0"
36793651
"@swc/counter": "npm:^0.1.3"
36803652
"@swc/types": "npm:^0.1.25"
36813653
peerDependencies:
@@ -3704,7 +3676,7 @@ __metadata:
37043676
peerDependenciesMeta:
37053677
"@swc/helpers":
37063678
optional: true
3707-
checksum: 10c0/b4d650b1ef797c0076d2a2225c2415e99e99b714578f43db40b2a913bf62c327d74b1c097d8d980d75b7cbac0a8bc63834bdcdd26a58c0fcb41daad36bd307cf
3679+
checksum: 10c0/40823d5cf408f305ef91debc555109054dfd234117114dddc6078e498b7dfc97a8cb3ef756a4ff09708372457c40cc0804088c9e07ebc8c0e0030fdc4b8bdfba
37083680
languageName: node
37093681
linkType: hard
37103682

@@ -7981,7 +7953,7 @@ __metadata:
79817953
"@emotion/css": "npm:11.13.5"
79827954
"@eslint/eslintrc": "npm:^3.3.1"
79837955
"@grafana/async-query-data": "npm:0.4.2"
7984-
"@grafana/aws-sdk": "npm:0.7.2"
7956+
"@grafana/aws-sdk": "npm:0.8.3"
79857957
"@grafana/data": "npm:^12.0.2"
79867958
"@grafana/eslint-config": "npm:^8.2.0"
79877959
"@grafana/plugin-e2e": "npm:^2.1.14"
@@ -7992,7 +7964,7 @@ __metadata:
79927964
"@grafana/ui": "npm:^12.0.0"
79937965
"@playwright/test": "npm:1.55.1"
79947966
"@stylistic/eslint-plugin-ts": "npm:^4.2.0"
7995-
"@swc/core": "npm:^1.13.21"
7967+
"@swc/core": "npm:^1.14.0"
79967968
"@swc/helpers": "npm:^0.5.17"
79977969
"@swc/jest": "npm:^0.2.39"
79987970
"@testing-library/jest-dom": "npm:6.6.3"

0 commit comments

Comments
 (0)