Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

storage: Add new integration layer between anaconda and cockpit storage #72

Merged
merged 9 commits into from
Feb 16, 2024
Merged
2 changes: 1 addition & 1 deletion packaging/anaconda-webui.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ BuildRequires: gettext

%global anacondacorever 40.20
%global cockpitver 275
%global cockpitstorver 310
%global cockpitstorver 311

Requires: cockpit-storaged >= %{cockpitstorver}
Requires: cockpit-bridge >= %{cockpitver}
Expand Down
10 changes: 10 additions & 0 deletions src/components/AnacondaWizard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@ export const AnacondaWizard = ({ dispatch, storageData, localizationData, runtim
const osRelease = useContext(OsReleaseContext);
const isBootIso = useContext(SystemTypeContext) === "BOOT_ISO";
const selectedDisks = storageData.diskSelection.selectedDisks;
const [scenarioPartitioningMapping, setScenarioPartitioningMapping] = useState({});

useEffect(() => {
if (storageScenarioId && storageData.partitioning.path) {
setScenarioPartitioningMapping({ [storageScenarioId]: storageData.partitioning.path });
}
}, [storageData.partitioning.path, storageScenarioId]);

const availableDevices = useMemo(() => {
return Object.keys(storageData.devices);
Expand Down Expand Up @@ -108,6 +115,8 @@ export const AnacondaWizard = ({ dispatch, storageData, localizationData, runtim
deviceNames: storageData.deviceNames,
diskSelection: storageData.diskSelection,
dispatch,
partitioning: storageData.partitioning.path,
scenarioPartitioningMapping,
storageScenarioId,
setStorageScenarioId: (scenarioId) => {
window.sessionStorage.setItem("storage-scenario-id", scenarioId);
Expand Down Expand Up @@ -275,6 +284,7 @@ export const AnacondaWizard = ({ dispatch, storageData, localizationData, runtim
deviceData={storageData.devices}
dispatch={dispatch}
onCritFail={onCritFail}
scenarioPartitioningMapping={scenarioPartitioningMapping}
selectedDisks={selectedDisks}
setShowStorage={setShowStorage}
setStorageScenarioId={setStorageScenarioId}
Expand Down
9 changes: 8 additions & 1 deletion src/components/review/ReviewConfiguration.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,14 @@ export const ReviewConfiguration = ({ deviceData, diskSelection, language, local
<DescriptionListDescription id={idPrefix + "-target-storage"}>
<Stack hasGutter>
{diskSelection.selectedDisks.map(disk => {
return <DeviceRow key={disk} deviceData={deviceData} disk={disk} requests={storageScenarioId === "mount-point-mapping" ? requests : null} />;
return (
<DeviceRow
key={disk}
deviceData={deviceData}
disk={disk}
requests={["mount-point-mapping", "use-configured-storage"].includes(storageScenarioId) ? requests : null}
/>
);
})}
</Stack>
</DescriptionListDescription>
Expand Down
Loading
Loading