diff --git a/package.json b/package.json index 9c731505..67f5be4a 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "devDependencies": { "@babel/core": "^7.21.4", "@emotion/css": "^11.1.3", - "@grafana/aws-sdk": "0.3.2", + "@grafana/aws-sdk": "0.4.0", "@grafana/data": "10.2.0", "@grafana/e2e": "10.2.0", "@grafana/e2e-selectors": "10.2.0", diff --git a/playwright.config.ts b/playwright.config.ts index df936b17..0fe34ed3 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -21,10 +21,7 @@ export default defineConfig({ reporter: 'html', use: { baseURL: 'http://localhost:3000', - trace: 'on-first-retry', - featureToggles: { - awsDatasourcesNewFormStyling: true, - } + trace: 'on-first-retry' }, projects: [ diff --git a/src/components/ConfigEditor.test.tsx b/src/components/ConfigEditor.test.tsx index f4d6e24b..4ac9f894 100644 --- a/src/components/ConfigEditor.test.tsx +++ b/src/components/ConfigEditor.test.tsx @@ -3,7 +3,6 @@ import { DataSourcePluginOptionsEditorProps } from '@grafana/data'; import { ConfigEditor } from './ConfigEditor'; import { render, screen } from '@testing-library/react'; import { SitewiseOptions, SitewiseSecureJsonData } from 'types'; -import { config } from '@grafana/runtime'; const datasourceOptions = { id: 1, uid: 'sitewise', @@ -28,15 +27,6 @@ const defaultProps: DataSourcePluginOptionsEditorProps { - beforeEach(() => { - config.featureToggles.awsDatasourcesNewFormStyling = true; - }) - afterEach(() => { - config.featureToggles.awsDatasourcesNewFormStyling = originalToggleValue; - }) describe('edge configuration', () => { it('should show correct fields if Standard authentication', () => { render( @@ -75,5 +65,4 @@ describe('ConfigEditor', () => { expect(screen.queryByText('Edge settings')).not.toBeInTheDocument(); expect(screen.getByText('Authentication Provider')).toBeInTheDocument(); }); - }); -}); + }); \ No newline at end of file diff --git a/src/components/ConfigEditor.tsx b/src/components/ConfigEditor.tsx index b9aeebdf..5083d2b1 100644 --- a/src/components/ConfigEditor.tsx +++ b/src/components/ConfigEditor.tsx @@ -9,9 +9,8 @@ import { } from '@grafana/data'; import { SitewiseOptions, SitewiseSecureJsonData } from '../types'; import { ConnectionConfig, ConnectionConfigProps, Divider } from '@grafana/aws-sdk'; -import { Alert, Button, Field, FieldSet, InlineField, InlineFieldRow, Input, Select } from '@grafana/ui'; +import { Alert, Button, Field, Input, Select } from '@grafana/ui'; import { standardRegions } from '../regions'; -import { config } from '@grafana/runtime'; import { ConfigSection } from '@grafana/experimental'; export type Props = ConnectionConfigProps; @@ -23,29 +22,23 @@ const edgeAuthMethods: Array> = [ ]; export function ConfigEditor(props: Props) { - const newFormStylingEnabled = config.featureToggles.awsDatasourcesNewFormStyling; - if (props.options.jsonData.defaultRegion === 'Edge') { - return + return } - return newFormStylingEnabled ? ( -
- {' '} + return
+ {' '}
- ) : ( - - ); + } -function EdgeConfig(props: {newFormStylingEnabled?: boolean} & Props) { +function EdgeConfig(props: Props) { const { options } = props; const { jsonData } = options; const { endpoint } = jsonData; const edgeAuthMode = edgeAuthMethods.find((f) => f.value === jsonData.edgeAuthMode) ?? edgeAuthMethods[0]; const hasEdgeAuth = edgeAuthMode !== edgeAuthMethods[0]; - const labelWidth = 28; const regions = standardRegions.map((value) => ({ value, label: value })); const onUserChange = (event: ChangeEvent) => { @@ -77,9 +70,7 @@ function EdgeConfig(props: {newFormStylingEnabled?: boolean} & Props) { }); } - if (props.newFormStylingEnabled) { - return ( -
+ return
{hasEdgeAuth && ( )} {!hasEdgeAuth && ( - + )} @@ -193,131 +184,5 @@ function EdgeConfig(props: {newFormStylingEnabled?: boolean} & Props) {
- ); - } else { - return ( - <> - {hasEdgeAuth && ( -
- - - - - { - updateDatasourcePluginJsonDataOption(props, 'edgeAuthMode', v.value); - }} - /> - - - {hasEdgeAuth && ( - <> - - - - - - - - - - - - )} - - - {options.secureJsonFields?.cert ? ( - - ) : ( -