Skip to content

Commit 2a8ecaa

Browse files
committed
Wizard: Show Users under Base Settings in image mode
Users are configured in Base Settings when in image mode (cockpit-image-builder), but the Review step always displayed them under Advanced Settings. Show Users under Image Overview in image mode, and keep them under Advanced Settings in package mode.
1 parent 64fc1c6 commit 2a8ecaa

2 files changed

Lines changed: 13 additions & 2 deletions

File tree

  • src/Components/CreateImageWizard/steps/Review/components

src/Components/CreateImageWizard/steps/Review/components/AdvancedSettings/index.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ import React from 'react';
22

33
import { Card, CardBody } from '@patternfly/react-core';
44

5+
import { useAppSelector } from '@/store/hooks';
6+
import { selectIsImageMode } from '@/store/slices';
7+
58
import {
69
Filesystem,
710
Firewall,
@@ -33,6 +36,7 @@ const AdvancedSettingsOverview = ({
3336
oscapKernelArgs = [],
3437
oscapServices,
3538
}: AdvancedSettingsOverviewProps) => {
39+
const isImageMode = useAppSelector(selectIsImageMode);
3640
return (
3741
<Card>
3842
<ReviewCardHeader
@@ -54,7 +58,7 @@ const AdvancedSettingsOverview = ({
5458
oscapServices={oscapServices}
5559
/>
5660
<Firewall shouldHide={restrictions.firewall.shouldHide} />
57-
<Users shouldHide={restrictions.users.shouldHide} />
61+
{!isImageMode && <Users shouldHide={restrictions.users.shouldHide} />}
5862
<Firstboot shouldHide={restrictions.firstBoot.shouldHide} />
5963
</ReviewList>
6064
</CardBody>

src/Components/CreateImageWizard/steps/Review/components/ImageOverview/index.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { Card, CardBody } from '@patternfly/react-core';
44

55
import { ON_PREM_RELEASES, RELEASES } from '@/constants';
66
import { useTargetEnvironmentCategories } from '@/Hooks';
7+
import { useCustomizationRestrictions } from '@/store/api/distributions';
78
import { useAppSelector } from '@/store/hooks';
89
import {
910
selectArchitecture,
@@ -18,6 +19,7 @@ import {
1819

1920
import { MiscFormats, PrivateClouds, PublicClouds } from './components';
2021

22+
import { Users } from '../AdvancedSettings/components';
2123
import { ReviewCardHeader, ReviewGroup, ReviewList } from '../shared';
2224

2325
const ImageOverview = () => {
@@ -29,8 +31,12 @@ const ImageOverview = () => {
2931
const distribution = useAppSelector(selectDistribution);
3032
const arch = useAppSelector(selectArchitecture);
3133

34+
const environments = useAppSelector(selectImageTypes);
3235
const { publicClouds, privateClouds, miscFormats } =
33-
useTargetEnvironmentCategories(useAppSelector(selectImageTypes));
36+
useTargetEnvironmentCategories(environments);
37+
const { restrictions } = useCustomizationRestrictions({
38+
selectedImageTypes: environments,
39+
});
3440

3541
const releases = isOnPremise ? ON_PREM_RELEASES : RELEASES;
3642

@@ -70,6 +76,7 @@ const ImageOverview = () => {
7076
<PrivateClouds environments={privateClouds} />
7177
<PublicClouds environments={publicClouds} />
7278
<MiscFormats environments={miscFormats} />
79+
{isImageMode && <Users shouldHide={restrictions.users.shouldHide} />}
7380
</ReviewList>
7481
</CardBody>
7582
</Card>

0 commit comments

Comments
 (0)