Skip to content

Commit

Permalink
Merge pull request #5038 from vojtechtrefny/master_duplicate-required…
Browse files Browse the repository at this point in the history
…-mountpoint-fix

webui: Allow changing and removing duplicate required mount points
  • Loading branch information
vojtechtrefny authored Aug 15, 2023
2 parents 8f475b1 + 10db58a commit 61828cd
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 61828cd

Please sign in to comment.