Skip to content

Commit 8451673

Browse files
committed
Update auth type and credentials in CreateDataSourceForm
Signed-off-by: Su <szhongna@amazon.com>
1 parent 2df5ad5 commit 8451673

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/plugins/data_source_management/public/components/create_data_source_wizard/components/create_form/create_data_source_form.tsx

+11-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,17 @@ export class CreateDataSourceForm extends React.Component<
125125
};
126126

127127
onChangeAuthType = (e: React.ChangeEvent<HTMLSelectElement>) => {
128-
this.setState({ auth: { ...this.state.auth, type: e.target.value as AuthType } });
128+
const authType = e.target.value as AuthType;
129+
this.setState({
130+
auth: {
131+
...this.state.auth,
132+
type: authType,
133+
credentials: {
134+
...this.state.auth.credentials,
135+
service: authType === AuthType.SigV4 ? SigV4ServiceName.OpenSearch : undefined,
136+
},
137+
},
138+
});
129139
};
130140

131141
onChangeSigV4ServiceName = (e: React.ChangeEvent<HTMLSelectElement>) => {

0 commit comments

Comments
 (0)