-
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 one
- Loading branch information
1 parent
f9ce129
commit 875c4ae
Showing
4 changed files
with
110 additions
and
31 deletions.
There are no files selected for viewing
20 changes: 13 additions & 7 deletions
20
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,27 @@ | ||
// Activation Keys helpers | ||
|
||
export const validateAKField = (hostGroupId, userKeys, hgKeys) => { | ||
export const validateAKField = ( | ||
hasInteraction, | ||
hostGroupId, | ||
activationKeys, | ||
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 && activationKeys?.length > 0) { | ||
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
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