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 74d4bc6 commit 26fae2a
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 16 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- [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))

### 🔩 Tests

- [Multi DataSource] Add unit test coverage for Update Data source management stack ([#2567](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2567))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export class CreateDataSourceForm extends React.Component<
});
};

onChangeAuthType = (e: { target: { value: any } }) => {
onChangeAuthType = (e: React.ChangeEvent<HTMLSelectElement>) => {
this.setState({ auth: { ...this.state.auth, type: e.target.value as AuthType } });
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ describe('Datasource Management: Edit Datasource Form', () => {
});

/* Save Changes */
test('should update the form with NoAUth on click save chan ges', async () => {
test('should update the form with NoAuth on click save changes', async () => {
await new Promise((resolve) =>
setTimeout(() => {
updateInputFieldAndBlur(component, descriptionFieldIdentifier, '');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ export class EditDataSourceForm extends React.Component<EditDataSourceProps, Edi
});
};

onChangeAuthType = (e: { target: { value: any } }) => {
onChangeAuthType = (e: React.ChangeEvent<HTMLSelectElement>) => {
this.setState({ auth: { ...this.state.auth, type: e.target.value as AuthType } }, () => {
this.onChangeFormValues();
});
Expand Down Expand Up @@ -738,13 +738,6 @@ export class EditDataSourceForm extends React.Component<EditDataSourceProps, Edi
defaultMessage: 'Credential',
})}
>
{/* <EuiRadioGroup
options={credentialSourceOptions}
idSelected={this.state.auth.type}
onChange={(id) => this.onChangeAuthType(id)}
name="Credential"
data-test-subj="editDataSourceSelectAuthType"
/> */}
<EuiSelect
options={credentialSourceOptions}
value={this.state.auth.type}
Expand Down
6 changes: 0 additions & 6 deletions src/plugins/data_source_management/public/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,6 @@ export enum AuthType {
SigV4 = 'sigv4',
}

// export const credentialSourceOptions = [
// { id: AuthType.NoAuth, label: 'No authentication' },
// { id: AuthType.UsernamePasswordType, label: 'Username & Password' },
// { id: AuthType.SigV4, label: 'AWS SigV4' },
// ];

export const credentialSourceOptions = [
{ value: AuthType.NoAuth, text: 'No authentication' },
{ value: AuthType.UsernamePasswordType, text: 'Username & Password' },
Expand Down

0 comments on commit 26fae2a

Please sign in to comment.