summaryrefslogtreecommitdiff
path: root/opendc-web/opendc-web-ui/src/components/topologies
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2023-03-26 22:09:05 +0100
committerFabian Mastenbroek <mail.fabianm@gmail.com>2023-03-27 20:31:42 +0100
commit42caec326fe5b6f4a0a2fe73e4cf2ba26ecba23d (patch)
treeb9533219b0340db9a92f2995b2cdb59f8c127e0c /opendc-web/opendc-web-ui/src/components/topologies
parent760cb3632d9c7352ae866667657785297502ce08 (diff)
bug(web): Do not allow selection of empty unit
This change fixes #138 which reports that when adding a unit to a machine, if the user does not select a unit and presses add, the UI will crash. We now disable the add button until the user has selected a unit.
Diffstat (limited to 'opendc-web/opendc-web-ui/src/components/topologies')
-rw-r--r--opendc-web/opendc-web-ui/src/components/topologies/sidebar/machine/UnitAddComponent.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/opendc-web/opendc-web-ui/src/components/topologies/sidebar/machine/UnitAddComponent.js b/opendc-web/opendc-web-ui/src/components/topologies/sidebar/machine/UnitAddComponent.js
index 4507b409..18cba23a 100644
--- a/opendc-web/opendc-web-ui/src/components/topologies/sidebar/machine/UnitAddComponent.js
+++ b/opendc-web/opendc-web-ui/src/components/topologies/sidebar/machine/UnitAddComponent.js
@@ -27,7 +27,7 @@ function UnitAddComponent({ units, onAdd }) {
</SelectOption>
))}
</Select>
- <Button icon={<PlusIcon />} variant="control" onClick={() => onAdd(selected)}>
+ <Button icon={<PlusIcon />} variant="control" onClick={() => onAdd(selected)} isDisabled={!selected}>
Add
</Button>
</InputGroup>