Skip to content

Commit

Permalink
webui: Allow changing and removing duplicate required mount points
Browse files Browse the repository at this point in the history
If user tries to add second / or  /boot mount point we need to
allow them to change or remove it.
  • Loading branch information
vojtechtrefny committed Aug 11, 2023
1 parent 5c7b9b0 commit 10db58a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ui/webui/src/components/storage/MountPointMapping.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ const MountPointColumn = ({ handleRequestChange, idPrefix, isRequiredMountPoint,
return (
<Flex direction={{ default: "column" }} spaceItems={{ default: "spaceItemsNone" }}>
<Flex spaceItems={{ default: "spaceItemsMd" }}>
{isRequiredMountPoint
{isRequiredMountPoint && !duplicatedMountPoint
? (
<FlexItem
className="mount-point-mapping__mountpoint-text"
Expand Down Expand Up @@ -299,6 +299,7 @@ const RequestsTable = ({
const columnClassName = idPrefix + "__column";
const getRequestRow = (request) => {
const isRequiredMountPoint = !!requiredMountPointOptions.find(val => val.value === request["mount-point"]);
const duplicatedMountPoint = isDuplicateRequestField(requests, "mount-point", request["mount-point"]);
const rowId = idPrefix + "-row-" + request["request-id"];

return {
Expand Down Expand Up @@ -344,7 +345,7 @@ const RequestsTable = ({
},
{
title: (
isRequiredMountPoint ? null : <MountPointRowRemove request={request} setRequests={setRequests} />
(isRequiredMountPoint && !duplicatedMountPoint) ? null : <MountPointRowRemove request={request} setRequests={setRequests} />
),
props: { className: columnClassName }
}
Expand Down

0 comments on commit 10db58a

Please sign in to comment.