Skip to content

Commit a2e37dd

Browse files
author
Sergiu Miclea
committed
Show dropdown in Wizard's options if field type is text and has an 'enum' option
Fix typo in CloudLabes for one of the options in enum
1 parent dd2c0c2 commit a2e37dd

2 files changed

Lines changed: 13 additions & 2 deletions

File tree

src/constants/CloudLabels.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export const defaultLabels = {
4545
volumes_are_zeroed: "Volumes on destination are created zeroed",
4646
port_reuse_policy: "Port Reuse Policy",
4747
keep_mac: "Keep MAC address",
48-
reuse_port: "Reuse Existing Ports",
48+
reuse_ports: "Reuse Existing Ports",
4949
replace_mac: "Replace MAC address",
5050
migr_image_name: "Migration Image Name",
5151
migr_image_name_map: "Migration Image Name Map",

src/stores/ConnectionsStore/ConnectionsStore.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,18 @@ class ConnectionsStore extends Reflux.Store
276276
break
277277

278278
case "string":
279-
field.type = "text"
279+
let enums = cloudData.properties[propName].enum
280+
if (enums && enums.length) {
281+
field.type = "dropdown"
282+
field.options = enums.map(option => {
283+
return {
284+
label: Helper.convertCloudFieldLabel(option),
285+
value: option
286+
}
287+
})
288+
} else {
289+
field.type = "text"
290+
}
280291
break
281292

282293
case "integer":

0 commit comments

Comments
 (0)