Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 35074a3

Browse files
ksiekllucasgarfield
authored andcommittedMar 17, 2025
Wizard: race condition with activation key
Fixes osbuild#2961 The "Create blueprint" button is disabled if an activation key was not created in the Review step of the wizard.
1 parent 29c290a commit 35074a3

File tree

1 file changed

+7
-3
lines changed
  • src/Components/CreateImageWizard/steps/Review/Footer

1 file changed

+7
-3
lines changed
 

‎src/Components/CreateImageWizard/steps/Review/Footer/Footer.tsx

+7-3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ import {
1919
useCreateBlueprintMutation,
2020
useUpdateBlueprintMutation,
2121
} from '../../../../../store/backendApi';
22+
import { useAppSelector } from '../../../../../store/hooks';
23+
import { selectActivationKey } from '../../../../../store/wizardSlice';
2224
import { resolveRelPath } from '../../../../../Utilities/path';
2325
import { mapRequestFromState } from '../../../utilities/requestMapper';
2426
import { useIsBlueprintValid } from '../../../utilities/useValidation';
@@ -62,6 +64,8 @@ const ReviewWizardFooter = () => {
6264
return mapRequestFromState(store, '');
6365
};
6466

67+
const activationKey = useAppSelector(selectActivationKey);
68+
6569
return (
6670
<WizardFooterWrapper>
6771
<div data-testid="wizard-save-button-div">
@@ -74,7 +78,7 @@ const ReviewWizardFooter = () => {
7478
ref={toggleRef}
7579
onClick={onToggleClick}
7680
isExpanded={isOpen}
77-
isDisabled={!isValid}
81+
isDisabled={!isValid || !activationKey}
7882
splitButtonOptions={{
7983
variant: 'action',
8084
items: composeId
@@ -84,15 +88,15 @@ const ReviewWizardFooter = () => {
8488
getBlueprintPayload={getBlueprintPayload}
8589
setIsOpen={setIsOpen}
8690
blueprintId={composeId}
87-
isDisabled={!isValid}
91+
isDisabled={!isValid || !activationKey}
8892
/>,
8993
]
9094
: [
9195
<CreateSaveButton
9296
key="wizard-create-save-btn"
9397
getBlueprintPayload={getBlueprintPayload}
9498
setIsOpen={setIsOpen}
95-
isDisabled={!isValid}
99+
isDisabled={!isValid || !activationKey}
96100
/>,
97101
],
98102
}}

0 commit comments

Comments
 (0)
Please sign in to comment.