From 4405d2ddd2eb3839a46abedaeb8ba5dacc3351dc Mon Sep 17 00:00:00 2001 From: regexowl Date: Mon, 3 Apr 2023 17:11:55 +0200 Subject: [PATCH] Wizard: Disable remove button for the root partition Fixes #910. This disables the remove button and select for the root partition as that one is required to continue with creating an image. The third point mentioned in the issue is removing mount points that have already been chosen from the dropdown to prevent adding duplicate mountpoints. This point was not implemented as we need to allow the user to create multiple sub directories under the same mount point if needed. --- .../formComponents/FileSystemConfiguration.js | 1 + src/Components/CreateImageWizard/formComponents/MountPoint.js | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Components/CreateImageWizard/formComponents/FileSystemConfiguration.js b/src/Components/CreateImageWizard/formComponents/FileSystemConfiguration.js index 0f5068a0..d42a8282 100644 --- a/src/Components/CreateImageWizard/formComponents/FileSystemConfiguration.js +++ b/src/Components/CreateImageWizard/formComponents/FileSystemConfiguration.js @@ -389,6 +389,7 @@ const FileSystemConfiguration = ({ ...props }) => { icon={} onClick={() => removeRow(row.id)} data-testid="remove-mount-point" + isDisabled={row.mountpoint === '/' ? true : false} /> diff --git a/src/Components/CreateImageWizard/formComponents/MountPoint.js b/src/Components/CreateImageWizard/formComponents/MountPoint.js index e148dc57..290aeee5 100644 --- a/src/Components/CreateImageWizard/formComponents/MountPoint.js +++ b/src/Components/CreateImageWizard/formComponents/MountPoint.js @@ -11,7 +11,6 @@ import { import PropTypes from 'prop-types'; const MountPoint = ({ ...props }) => { - // check '/' last! const validPrefixes = [ '/app', '/boot', @@ -23,7 +22,6 @@ const MountPoint = ({ ...props }) => { '/usr', '/usr/local', '/var', - '/', ]; const [isOpen, setIsOpen] = useState(false); const [prefix, setPrefix] = useState('/'); @@ -72,6 +70,7 @@ const MountPoint = ({ ...props }) => { onSelect={onSelect} selections={prefix} variant={SelectVariant.single} + isDisabled={prefix === '/' ? true : false} > {validPrefixes.map((pfx, index) => { return ;