Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
Signed-off-by: Su <[email protected]>
  • Loading branch information
zhongnansu committed Apr 5, 2023
1 parent 26fae2a commit 8cce371
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- [Vis Builder] Removed Hard Coded Strings and Used i18n to transalte([#2867](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2867))
- [Console] Replace jQuery.ajax with core.http when calling OSD APIs in console ([#3080](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3080))
- [I18n] Fix Listr type errors and error handlers ([#3629](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3629))
- [Multiple DataSource]Refactor authentication type selection in create and edit data source forms to use EuiSelect ([#3693](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3693))
- [Multiple DataSource] Present the authentication type choices in a drop-down ([#3693](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3693))

### 🔩 Tests

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@ export class EditDataSourceForm extends React.Component<EditDataSourceProps, Edi
<EuiSelect
options={credentialSourceOptions}
value={this.state.auth.type}
onChange={(e) => this.onChangeAuthType(e)}
onChange={this.onChangeAuthType}
name="Credential"
data-test-subj="editDataSourceSelectAuthType"
/>
Expand Down
22 changes: 19 additions & 3 deletions src/plugins/data_source_management/public/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
} from 'src/core/public';
import { ManagementAppMountParams } from 'src/plugins/management/public';
import { SavedObjectAttributes } from 'src/core/types';
import { i18n } from '@osd/i18n';
import { OpenSearchDashboardsReactContextValue } from '../../opensearch_dashboards_react/public';

// eslint-disable-next-line @typescript-eslint/no-empty-interface
Expand Down Expand Up @@ -57,9 +58,24 @@ export enum AuthType {
}

export const credentialSourceOptions = [
{ value: AuthType.NoAuth, text: 'No authentication' },
{ value: AuthType.UsernamePasswordType, text: 'Username & Password' },
{ value: AuthType.SigV4, text: 'AWS SigV4' },
{
value: AuthType.NoAuth,
text: i18n.translate('dataSourceManagement.credentialSourceOptions.NoAuthentication', {
defaultMessage: 'No authentication',
}),
},
{
value: AuthType.UsernamePasswordType,
text: i18n.translate('dataSourceManagement.credentialSourceOptions.UsernamePassword', {
defaultMessage: 'Username & Password',
}),
},
{
value: AuthType.SigV4,
text: i18n.translate('dataSourceManagement.credentialSourceOptions.AwsSigV4', {
defaultMessage: 'AWS SigV4',
}),
},
];

export interface DataSourceAttributes extends SavedObjectAttributes {
Expand Down

0 comments on commit 8cce371

Please sign in to comment.