-
Notifications
You must be signed in to change notification settings - Fork 293
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #36295 - Auto activation key selection if there's only 1
- Loading branch information
1 parent
f3cd18a
commit ecc90cb
Showing
3 changed files
with
96 additions
and
30 deletions.
There are no files selected for viewing
19 changes: 12 additions & 7 deletions
19
webpack/components/extensions/RegistrationCommands/RegistrationCommandsPageHelpers.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,26 @@ | ||
// Activation Keys helpers | ||
|
||
export const validateAKField = (hostGroupId, userKeys, hgKeys) => { | ||
export const validateAKField = ( | ||
hasInteraction, | ||
hostGroupId, | ||
userKeys, | ||
hgKeys, | ||
) => { | ||
if (hostGroupId === '') { | ||
return (userKeys?.length > 0 ? 'success' : 'error'); | ||
return userKeys?.length > 0 ? 'success' : 'error'; | ||
} | ||
|
||
if (userKeys === undefined && hgKeys === undefined) { | ||
return ('default'); | ||
if (!hasInteraction) { | ||
return 'default'; | ||
} | ||
|
||
return ((userKeys?.length > 0 || hgKeys?.length > 0) ? 'success' : 'error'); | ||
return userKeys?.length > 0 || hgKeys?.length > 0 ? 'success' : 'error'; | ||
}; | ||
|
||
export const akHasValidValue = (hostGroupId, userKeys, hgKeys) => { | ||
if (hostGroupId === '') { | ||
return (userKeys?.length > 0); | ||
return userKeys?.length > 0; | ||
} | ||
|
||
return (hgKeys?.length > 0 || userKeys?.length > 0); | ||
return hgKeys?.length > 0 || userKeys?.length > 0; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters