Skip to content

Commit

Permalink
[Ingest Manager] Fix config selection in enrollment flyout from confi…
Browse files Browse the repository at this point in the history
…g list page (elastic#73833) (elastic#73879)
  • Loading branch information
nchaulet authored Jul 31, 2020
1 parent dc5fca2 commit 6ca87f5
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,14 @@ export const EnrollmentStepAgentConfig: React.FC<Props> = (props) => {
useEffect(
function useDefaultConfigEffect() {
if (agentConfigs && agentConfigs.length && !selectedState.agentConfigId) {
if (agentConfigs.length === 1) {
setSelectedState({
...selectedState,
agentConfigId: agentConfigs[0].id,
});
return;
}

const defaultConfig = agentConfigs.find((config) => config.is_default);
if (defaultConfig) {
setSelectedState({
Expand Down

0 comments on commit 6ca87f5

Please sign in to comment.