Skip to content

Commit

Permalink
EditDiskModal: Properly initialize Cache selector
Browse files Browse the repository at this point in the history
`cacheMode` is null if the domain XML does not specify a value, but the
`value` should always point to an actual valid option. Fall back to
"default".
  • Loading branch information
martinpitt committed Oct 27, 2023
1 parent 983fea3 commit 252a2e9
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/vm/disks/diskEdit.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const CacheRow = ({ onValueChanged, dialogValues, idPrefix, shutoff }) => {
<FormSelect id={`${idPrefix}-cache-mode`}
onChange={(_event, value) => onValueChanged('cacheMode', value)}
isDisabled={!shutoff}
value={dialogValues.cacheMode}>
value={dialogValues.cacheMode ?? "default"}>
{diskCacheModes.map(cacheMode => {
return (
<FormSelectOption value={cacheMode} key={cacheMode}
Expand Down
1 change: 0 additions & 1 deletion test/machineslib.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,6 @@ def setUp(self):
"Tried changing state of a disconnected RFB object",
"Failed to get libvirt version from the dbus API:.*Cannot recv data: Connection reset by peer",
# FIXME: React errors on /devel scenario; these are actual bugs!
"Warning: .* prop on .* should not be null.",
"Warning: Received .* for a non-boolean attribute",
'Warning: Each child in a list should have a unique "key" prop',
"Warning: React does not recognize the .* prop on a DOM element",
Expand Down

0 comments on commit 252a2e9

Please sign in to comment.