Skip to content

Commit

Permalink
web: Reorder Result section content
Browse files Browse the repository at this point in the history
And improve a bit the warning. Now the actions summary is placed at the
top of the section, near to the description which already hints about
the amount actions when there is a valid proposal.
  • Loading branch information
dgdavid committed Mar 14, 2024
1 parent 2c75413 commit bc8b068
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions web/src/components/storage/ProposalResultSection.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,10 @@ const DeletionsInfo = ({ actions, systems }) => {

if (total === 0) return;

// TRANSLATORS: %d will be replaced by the amount of destructive actions
const warningTitle = sprintf(n_(
"There are %d destructive planned action",
"There are %d destructive planned actions",
"There is %d destructive action planned",
"There are %d destructive actions planned",
total
), total);

Expand Down Expand Up @@ -223,12 +224,12 @@ const SectionContent = ({ system, staging, actions, errors }) => {

return (
<>
<DevicesTreeTable devicesManager={devicesManager} />
<DeletionsInfo
actions={devicesManager.actions.filter(a => a.delete && !a.subvol)}
systems={devicesManager.deletedSystems()}
/>
<ActionsInfo actions={actions} />
<DevicesTreeTable devicesManager={devicesManager} />
</>
);
};
Expand All @@ -253,12 +254,18 @@ export default function ProposalResultSection({
}) {
if (isLoading) errors = [];

const description = sprintf(
// TRANSLATORS: %d will be replaced by the amount actions
_("During installation, %d actions will be performed to configure the system as displayed below"),
actions.length
);

return (
<Section
// TRANSLATORS: The storage "Result" section's title
title={_("Result")}
// TRANSLATORS: The storage "Result" section's description
description={_("How the system will look after installing with current proposal.")}
description={errors.length === 0 && description}
id="storage-result"
errors={errors}
>
Expand Down

0 comments on commit bc8b068

Please sign in to comment.