-
Notifications
You must be signed in to change notification settings - Fork 890
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Multiple DataSource]Refactor authentication type selection in create and edit data source forms #3693
[Multiple DataSource]Refactor authentication type selection in create and edit data source forms #3693
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -17,7 +17,7 @@ import { | |||||
EuiFormRow, | ||||||
EuiHorizontalRule, | ||||||
EuiPanel, | ||||||
EuiRadioGroup, | ||||||
EuiSelect, | ||||||
EuiSpacer, | ||||||
EuiText, | ||||||
} from '@elastic/eui'; | ||||||
|
@@ -162,8 +162,8 @@ export class EditDataSourceForm extends React.Component<EditDataSourceProps, Edi | |||||
}); | ||||||
}; | ||||||
|
||||||
onChangeAuthType = (value: string) => { | ||||||
this.setState({ auth: { ...this.state.auth, type: value as AuthType } }, () => { | ||||||
onChangeAuthType = (e: React.ChangeEvent<HTMLSelectElement>) => { | ||||||
this.setState({ auth: { ...this.state.auth, type: e.target.value as AuthType } }, () => { | ||||||
this.onChangeFormValues(); | ||||||
}); | ||||||
}; | ||||||
|
@@ -738,10 +738,10 @@ export class EditDataSourceForm extends React.Component<EditDataSourceProps, Edi | |||||
defaultMessage: 'Credential', | ||||||
})} | ||||||
> | ||||||
<EuiRadioGroup | ||||||
<EuiSelect | ||||||
options={credentialSourceOptions} | ||||||
idSelected={this.state.auth.type} | ||||||
onChange={(id) => this.onChangeAuthType(id)} | ||||||
value={this.state.auth.type} | ||||||
onChange={(e) => this.onChangeAuthType(e)} | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
nit: not blocking the PR for this though There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. made the change |
||||||
name="Credential" | ||||||
data-test-subj="editDataSourceSelectAuthType" | ||||||
/> | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,9 +57,9 @@ export enum AuthType { | |
} | ||
|
||
export const credentialSourceOptions = [ | ||
{ id: AuthType.NoAuth, label: 'No authentication' }, | ||
{ id: AuthType.UsernamePasswordType, label: 'Username & Password' }, | ||
{ id: AuthType.SigV4, label: 'AWS SigV4' }, | ||
{ value: AuthType.NoAuth, text: 'No authentication' }, | ||
{ value: AuthType.UsernamePasswordType, text: 'Username & Password' }, | ||
{ value: AuthType.SigV4, text: 'AWS SigV4' }, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we use i18n for these? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. of course |
||
]; | ||
|
||
export interface DataSourceAttributes extends SavedObjectAttributes { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does this sound?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this sound nicer!