Skip to content

Commit

Permalink
Merge pull request #450 from adamkankovsky/device-type-label
Browse files Browse the repository at this point in the history
Change device type label to blivet part_type_name
  • Loading branch information
KKoukiou authored Oct 2, 2024
2 parents c3338ff + 9baead8 commit 1046f5d
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 21 deletions.
2 changes: 1 addition & 1 deletion packaging/anaconda-webui.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ BuildRequires: gettext
%endif

%if 0%{?fedora} >= 41
%global anacondacorever 41.2
%global anacondacorever 42.5
%endif

%global cockpitver 275
Expand Down
17 changes: 0 additions & 17 deletions src/actions/storage-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,23 +64,6 @@ export const getDevicesAction = () => {
const formatData = await getFormatData({ diskName: device });
devData.formatData = formatData;

// FIXME: https://github.com/storaged-project/blivet/issues/1258
// This is a workaround for the issue with missing partition label human readable strings in blivet
try {
const partName = await cockpit.script(`udevadm info --query=property --name=${devData.path.v} | grep PARTNAME= | cut -d= -f2`);
const fsLabel = await cockpit.script(`udevadm info --query=property --name=${devData.path.v} | grep ID_FS_LABEL= | cut -d= -f2`);
devData.misc = {
fsLabel: fsLabel.trim(),
partName: partName.trim(),
};
} catch (e) {
console.warn("Failed to get partition label", e);
devData.misc = {
fsLabel: "",
partName: "",
};
}

deviceData[device] = devData;
} catch (error) {
if (error.name === "org.fedoraproject.Anaconda.Modules.Storage.UnknownDeviceError") {
Expand Down
2 changes: 1 addition & 1 deletion src/components/storage/MountPointMapping.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ const DeviceColumnSelect = ({ deviceData, devices, handleRequestChange, idPrefix

const ancestors = getDeviceAncestors(deviceData, device);
const parentPartition = [device, ...ancestors].find(ancestor => deviceData[ancestor].type.v === "partition");
const typeLabel = deviceData[parentPartition]?.misc.fsLabel || deviceData[parentPartition]?.misc.partName;
const typeLabel = device[parentPartition]?.attrs?.v?.["partition-type-name"] || "";

const formatType = deviceData[device]?.formatData.type.v;
const format = deviceData[device]?.formatData.description.v;
Expand Down
2 changes: 1 addition & 1 deletion src/components/storage/ReclaimSpaceModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ const getDeviceRow = (disk, devices, level = 0, unappliedActions, setUnappliedAc
const device = devices[disk];
const isDisk = device["is-disk"].v;
const isPartition = device.type.v === "partition";
const typeLabel = isPartition ? (device.misc.fsLabel || device.misc.partName) : "";
const typeLabel = device.attrs?.v["partition-type-name"] || "";
const diskDescription = (
<Flex spaceItems={{ default: "spaceItemsSm" }} alignItems={{ default: "alignItemsCenter" }} flexWrap={{ default: "nowrap" }}>
<FlexItem><HddIcon /></FlexItem>
Expand Down

0 comments on commit 1046f5d

Please sign in to comment.