Skip to content

Commit

Permalink
Merge pull request #72 from KKoukiou/cockpit-storage
Browse files Browse the repository at this point in the history
storage: Add new integration layer between anaconda and cockpit storage
  • Loading branch information
KKoukiou committed Feb 16, 2024
2 parents 739140d + 33dfc8e commit ddd1dff
Show file tree
Hide file tree
Showing 12 changed files with 768 additions and 89 deletions.
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

0 comments on commit ddd1dff

Please sign in to comment.