Wizard: hide some review items for cockpit frontend

Hide some of the steps in the review step that aren't applicable to the
cockpit frontend.
This commit is contained in:
Gianluca Zuccarelli 2025-08-11 14:53:35 +00:00
parent 122c481c09
commit 11e352440f
3 changed files with 101 additions and 84 deletions

View file

@ -121,6 +121,7 @@ test.describe.serial('test', () => {
await frame.getByRole('button', { name: 'Review and finish' }).click(); await frame.getByRole('button', { name: 'Review and finish' }).click();
await frame.getByRole('button', { name: 'About packages' }).click(); await frame.getByRole('button', { name: 'About packages' }).click();
frame.getByRole('gridcell', { name: 'osbuild-composer' }); frame.getByRole('gridcell', { name: 'osbuild-composer' });
await frame.getByRole('button', { name: 'Close', exact: true }).click();
await frame await frame
.getByRole('button', { name: 'Save changes to blueprint' }) .getByRole('button', { name: 'Save changes to blueprint' })
.click(); .click();
@ -128,6 +129,7 @@ test.describe.serial('test', () => {
await frame.getByRole('button', { name: 'Edit blueprint' }).click(); await frame.getByRole('button', { name: 'Edit blueprint' }).click();
await frame.getByRole('button', { name: 'About packages' }).click(); await frame.getByRole('button', { name: 'About packages' }).click();
frame.getByRole('gridcell', { name: 'osbuild-composer' }); frame.getByRole('gridcell', { name: 'osbuild-composer' });
await frame.getByRole('button', { name: 'Close', exact: true }).click();
await frame.getByRole('button', { name: 'Cancel', exact: true }).click(); await frame.getByRole('button', { name: 'Cancel', exact: true }).click();
frame.getByRole('heading', { name: 'All images' }); frame.getByRole('heading', { name: 'All images' });
}); });

View file

@ -499,21 +499,23 @@ const Review = () => {
<ServicesList /> <ServicesList />
</ExpandableSection> </ExpandableSection>
)} )}
<ExpandableSection {!process.env.IS_ON_PREMISE && (
toggleContent={composeExpandable( <ExpandableSection
'First boot', toggleContent={composeExpandable(
'revisit-first-boot', 'First boot',
'wizard-first-boot', 'revisit-first-boot',
)} 'wizard-first-boot',
onToggle={(_event, isExpandableFirstBoot) => )}
onToggleFirstBoot(isExpandableFirstBoot) onToggle={(_event, isExpandableFirstBoot) =>
} onToggleFirstBoot(isExpandableFirstBoot)
isExpanded={isExpandableFirstBoot} }
isIndented isExpanded={isExpandableFirstBoot}
data-testid='firstboot-expandable' isIndented
> data-testid='firstboot-expandable'
<FirstBootList /> >
</ExpandableSection> <FirstBootList />
</ExpandableSection>
)}
{(blueprintName || blueprintDescription) && ( {(blueprintName || blueprintDescription) && (
<ExpandableSection <ExpandableSection
toggleContent={composeExpandable( toggleContent={composeExpandable(

View file

@ -506,78 +506,91 @@ export const ContentList = () => {
<> <>
<Content> <Content>
<Content component={ContentVariants.dl} className='review-step-dl'> <Content component={ContentVariants.dl} className='review-step-dl'>
<> {!process.env.IS_ON_PREMISE && (
<Content <>
component={ContentVariants.dt} <Content
className='pf-v6-u-min-width' component={ContentVariants.dt}
> className='pf-v6-u-min-width'
Repeatable build
</Content>
<Content component={ContentVariants.dd}>
<Popover
position='bottom'
headerContent={
useLatest
? 'Use the latest repository content'
: template
? 'Use content from the content template'
: `Repositories as of ${yyyyMMddFormat(
new Date(snapshotDate),
)}`
}
hasAutoWidth
minWidth='60rem'
bodyContent={
<SnapshotTable snapshotForDate={data?.data || []} />
}
> >
<Button Repeatable build
variant='link' </Content>
isInline <Content component={ContentVariants.dd}>
aria-label='Snapshot method' <Popover
className='popover-button pf-v6-u-p-0' position='bottom'
isDisabled={noRepositoriesSelected} headerContent={
useLatest
? 'Use the latest repository content'
: template
? 'Use content from the content template'
: `Repositories as of ${yyyyMMddFormat(
new Date(snapshotDate),
)}`
}
hasAutoWidth
minWidth='60rem'
bodyContent={
<SnapshotTable snapshotForDate={data?.data || []} />
}
> >
{snapshottingText} <Button
</Button> variant='link'
</Popover> isInline
{!useLatest && !isLoading && isSuccess && hasSnapshotDateAfter ? ( aria-label='Snapshot method'
<Alert className='popover-button pf-v6-u-p-0'
variant='warning' isDisabled={noRepositoriesSelected}
isInline >
isPlain {snapshottingText}
title='A snapshot for this date is not available for some repositories.' </Button>
/> </Popover>
) : ( {!useLatest &&
'' !isLoading &&
)} isSuccess &&
</Content> hasSnapshotDateAfter ? (
</> <Alert
<Content component={ContentVariants.dt} className='pf-v6-u-min-width'> variant='warning'
Custom repositories isInline
</Content> isPlain
<Content component={ContentVariants.dd}> title='A snapshot for this date is not available for some repositories.'
{customRepositories.length + recommendedRepositories.length > 0 ? ( />
<Popover ) : (
position='bottom' ''
headerContent='Custom repositories' )}
hasAutoWidth </Content>
minWidth='30rem' </>
bodyContent={<RepositoriesTable />} )}
{!process.env.IS_ON_PREMISE && (
<>
<Content
component={ContentVariants.dt}
className='pf-v6-u-min-width'
> >
<Button Custom repositories
variant='link' </Content>
aria-label='About custom repositories' <Content component={ContentVariants.dd}>
className='popover-button pf-v6-u-p-0' {customRepositories.length + recommendedRepositories.length >
> 0 ? (
{customRepositories.length + recommendedRepositories.length || <Popover
0} position='bottom'
</Button> headerContent='Custom repositories'
</Popover> hasAutoWidth
) : ( minWidth='30rem'
0 bodyContent={<RepositoriesTable />}
)} >
</Content> <Button
variant='link'
aria-label='About custom repositories'
className='popover-button pf-v6-u-p-0'
>
{customRepositories.length +
recommendedRepositories.length || 0}
</Button>
</Popover>
) : (
0
)}
</Content>
</>
)}
<Content component={ContentVariants.dt} className='pf-v6-u-min-width'> <Content component={ContentVariants.dt} className='pf-v6-u-min-width'>
Additional packages Additional packages
</Content> </Content>