Wizard: Add Timezone step to Review lists
This adds a Timezone overview to the Review step.
This commit is contained in:
parent
6427dc5285
commit
c851d4abac
2 changed files with 55 additions and 0 deletions
|
|
@ -28,6 +28,7 @@ import {
|
|||
TargetEnvGCPList,
|
||||
TargetEnvOciList,
|
||||
TargetEnvOtherList,
|
||||
TimezoneList,
|
||||
} from './ReviewStepTextLists';
|
||||
|
||||
import isRhel from '../../../../../src/Utilities/isRhel';
|
||||
|
|
@ -66,8 +67,11 @@ const Review = ({ snapshottingEnabled }: { snapshottingEnabled: boolean }) => {
|
|||
const [isExpandedOscapDetail, setIsExpandedOscapDetail] = useState(true);
|
||||
const [isExpandedComplianceDetail, setIsExpandedComplianceDetail] =
|
||||
useState(true);
|
||||
const [isExpandedTimezone, setIsExpandedTimezone] = useState(true);
|
||||
const [isExpandableFirstBoot, setIsExpandedFirstBoot] = useState(true);
|
||||
|
||||
const isTimezoneEnabled = useFlag('image-builder.timezone.enabled');
|
||||
|
||||
const onToggleImageOutput = (isExpandedImageOutput: boolean) =>
|
||||
setIsExpandedImageOutput(isExpandedImageOutput);
|
||||
const onToggleTargetEnvs = (isExpandedTargetEnvs: boolean) =>
|
||||
|
|
@ -84,6 +88,8 @@ const Review = ({ snapshottingEnabled }: { snapshottingEnabled: boolean }) => {
|
|||
setIsExpandedOscapDetail(isExpandedOscapDetail);
|
||||
const onToggleComplianceDetails = (isExpandedComplianceDetail: boolean) =>
|
||||
setIsExpandedComplianceDetail(isExpandedComplianceDetail);
|
||||
const onToggleTimezone = (isExpandedTimezone: boolean) =>
|
||||
setIsExpandedTimezone(isExpandedTimezone);
|
||||
const onToggleFirstBoot = (isExpandableFirstBoot: boolean) =>
|
||||
setIsExpandedFirstBoot(isExpandableFirstBoot);
|
||||
|
||||
|
|
@ -298,6 +304,23 @@ const Review = ({ snapshottingEnabled }: { snapshottingEnabled: boolean }) => {
|
|||
{/* Intentional prop drilling for simplicity - To be removed */}
|
||||
<ContentList snapshottingEnabled={snapshottingEnabled} />
|
||||
</ExpandableSection>
|
||||
{isTimezoneEnabled && (
|
||||
<ExpandableSection
|
||||
toggleContent={composeExpandable(
|
||||
'Timezone',
|
||||
'revisit-timezone',
|
||||
'wizard-timezone'
|
||||
)}
|
||||
onToggle={(_event, isExpandedTimezone) =>
|
||||
onToggleTimezone(isExpandedTimezone)
|
||||
}
|
||||
isExpanded={isExpandedTimezone}
|
||||
isIndented
|
||||
data-testid="timezone-expandable"
|
||||
>
|
||||
<TimezoneList />
|
||||
</ExpandableSection>
|
||||
)}
|
||||
{isFirstBootEnabled && (
|
||||
<ExpandableSection
|
||||
toggleContent={composeExpandable(
|
||||
|
|
|
|||
|
|
@ -63,6 +63,8 @@ import {
|
|||
selectUseLatest,
|
||||
selectPartitions,
|
||||
selectFirstBootScript,
|
||||
selectTimezone,
|
||||
selectNtpServers,
|
||||
} from '../../../../store/wizardSlice';
|
||||
import { toMonthAndYear, yyyyMMddFormat } from '../../../../Utilities/time';
|
||||
import {
|
||||
|
|
@ -739,6 +741,36 @@ export const OscapList = () => {
|
|||
return <OscapProfileInformation allowChangingCompliancePolicy={true} />;
|
||||
};
|
||||
|
||||
export const TimezoneList = () => {
|
||||
const timezone = useAppSelector(selectTimezone);
|
||||
const ntpServers = useAppSelector(selectNtpServers);
|
||||
|
||||
return (
|
||||
<TextContent>
|
||||
<TextList component={TextListVariants.dl}>
|
||||
<TextListItem
|
||||
component={TextListItemVariants.dt}
|
||||
className="pf-u-min-width"
|
||||
>
|
||||
Timezone
|
||||
</TextListItem>
|
||||
<TextListItem component={TextListItemVariants.dd}>
|
||||
{timezone ? timezone : 'None'}
|
||||
</TextListItem>
|
||||
<TextListItem
|
||||
component={TextListItemVariants.dt}
|
||||
className="pf-u-min-width"
|
||||
>
|
||||
NTP servers
|
||||
</TextListItem>
|
||||
<TextListItem component={TextListItemVariants.dd}>
|
||||
{ntpServers && ntpServers.length > 0 ? ntpServers.join(', ') : 'None'}
|
||||
</TextListItem>
|
||||
</TextList>
|
||||
</TextContent>
|
||||
);
|
||||
};
|
||||
|
||||
export const FirstBootList = () => {
|
||||
const isFirstbootEnabled = !!useAppSelector(selectFirstBootScript);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue