Skip to content

Commit a1588ab

Browse files
committed
Wizard: Spread registration options
This moves registration options outside of the "Show additional connection options" expandable, making them always visible.
1 parent 6bf800d commit a1588ab

File tree

3 files changed

+7
-29
lines changed

3 files changed

+7
-29
lines changed

src/Components/CreateImageWizard/CreateImageWizard.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
--pf-c-form__group-label--PaddingBottom: var(--pf-v6-global--spacer--xs);
1818
}
1919

20+
.pf-v6-c-radio__body { // remove margin from radio button body block
21+
margin: 0;
22+
}
23+
2024
.provider-icon {
2125
width: 3.5em;
2226
height: 3.5em;

src/Components/CreateImageWizard/steps/Registration/components/Registration.tsx

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,6 @@ const Registration = () => {
101101
const distribution = useAppSelector(selectDistribution);
102102
const registrationType = useAppSelector(selectRegistrationType);
103103

104-
const [showOptions, setShowOptions] = useState(
105-
registrationType === 'register-later'
106-
);
107-
108104
const isSatelliteRegistrationEnabled = useFlag(
109105
'image-builder.satellite.enabled'
110106
);
@@ -136,21 +132,9 @@ const Registration = () => {
136132
id="register-system-now"
137133
name="register-system-now"
138134
autoFocus
139-
description={
140-
<Button
141-
component="a"
142-
variant="link"
143-
isDisabled={!registrationType.startsWith('register-now')}
144-
isInline
145-
onClick={() => setShowOptions(!showOptions)}
146-
>
147-
{`${!showOptions ? 'Show' : 'Hide'} additional connection options`}
148-
</Button>
149-
}
135+
className="pf-v6-u-pb-sm"
150136
body={
151-
showOptions && (
152137
<Checkbox
153-
className="pf-v6-u-ml-lg"
154138
label={
155139
<>
156140
Enable predictive analytics and management capabilities
@@ -170,6 +154,7 @@ const Registration = () => {
170154
}}
171155
id="register-system-now-insights"
172156
name="register-system-insights"
157+
className="pf-v6-u-pt-0"
173158
body={
174159
<Checkbox
175160
label={
@@ -194,15 +179,13 @@ const Registration = () => {
194179
/>
195180
}
196181
/>
197-
)
198182
}
199183
/>
200184
<Radio
201185
label="Register later"
202186
isChecked={registrationType === 'register-later'}
203187
onChange={() => {
204188
dispatch(changeRegistrationType('register-later'));
205-
setShowOptions(false);
206189
}}
207190
id="register-later"
208191
name="register-later"
@@ -213,7 +196,6 @@ const Registration = () => {
213196
isChecked={registrationType === 'register-satellite'}
214197
onChange={() => {
215198
dispatch(changeRegistrationType('register-satellite'));
216-
setShowOptions(false);
217199
}}
218200
id="register-satellite"
219201
name="register-satellite"

src/test/Components/CreateImageWizard/steps/Registration/Registration.test.tsx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,6 @@ Object.defineProperty(window, 'localStorage', {
5757
// Initiliaze the router
5858
const router: RemixRouter | undefined = undefined;
5959

60-
const clickShowAdditionalConnectionOptions = async () => {
61-
const user = userEvent.setup();
62-
const link = await screen.findByText('Show additional connection options');
63-
await waitFor(() => user.click(link));
64-
};
65-
6660
const deselectEnableRemoteRemediations = async () => {
6761
const user = userEvent.setup();
6862
const checkBox = await screen.findByRole('checkbox', {
@@ -301,7 +295,6 @@ describe('Registration request generated correctly', () => {
301295
test('register + insights', async () => {
302296
await renderCreateMode();
303297
await goToRegistrationStep();
304-
await clickShowAdditionalConnectionOptions();
305298
await deselectEnableRemoteRemediations();
306299
await goToReviewStep();
307300
const receivedRequest = await interceptBlueprintRequest(CREATE_BLUEPRINT);
@@ -325,7 +318,6 @@ describe('Registration request generated correctly', () => {
325318
test('register now', async () => {
326319
await renderCreateMode();
327320
await goToRegistrationStep();
328-
await clickShowAdditionalConnectionOptions();
329321
await deselectPredictiveAnalytics();
330322
await goToReviewStep();
331323
// informational modal pops up in the first test only as it's tied
@@ -423,7 +415,7 @@ describe('Registration request generated correctly', () => {
423415
localStorage.clear();
424416
});
425417

426-
test('register with satellite', { timeout: 20000 }, async () => {
418+
test('register with satellite', { timeout: 25000 }, async () => {
427419
await renderCreateMode();
428420
await goToRegistrationStep();
429421
await clickRegisterSatellite();

0 commit comments

Comments
 (0)