Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ class WizardOptions extends React.Component<Props> {
let groups: Array<{ fields: FieldRender[]; name?: string }> = [{ fields }];

const workerFields = fields.filter(
f => f.field.name.indexOf("migr_") === 0,
f => f.field.name.indexOf("migr_") === 0 && !f.field.groupName,
);
if (workerFields.length > 1) {
groups = [
Expand Down Expand Up @@ -594,7 +594,7 @@ class WizardOptions extends React.Component<Props> {
<GroupName>
<GroupNameBar />
<GroupNameText>
{LabelDictionary.get(g.name)}
{LabelDictionary.get(g.name, this.props.dictionaryKey)}
</GroupNameText>
<GroupNameBar />
</GroupName>
Expand Down
32 changes: 32 additions & 0 deletions src/plugins/vmware_vsphere/OptionsSchemaPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,31 @@ export default class OptionsSchemaParser extends OptionsSchemaPluginBase {
];
});

const exportMechField = fields.find(
f => f.name === "export_transfer_mechanism",
);
if (!exportMechField?.enum) {
return fields;
}
exportMechField.subFields = [];
exportMechField.enum.forEach((exportType: any) => {
const exportTypeFieldIdx = fields.findIndex(
f => f.name === `${exportType}_options`,
);
if (exportTypeFieldIdx === -1) {
return;
}
const subField = fields[exportTypeFieldIdx];
if (subField.properties?.length) {
subField.properties = subField.properties.map((p: Field) => ({
...p,
groupName: subField.name,
}));
}
exportMechField.subFields!.push(subField);
fields.splice(exportTypeFieldIdx, 1);
});

return fields;
}

Expand All @@ -68,6 +93,13 @@ export default class OptionsSchemaParser extends OptionsSchemaPluginBase {
requiresWindowsImage: boolean;
}) {
const { field, options, requiresWindowsImage } = opts;
if (field.name === "export_transfer_mechanism" && field.subFields) {
field.subFields.forEach(sf => {
sf.properties?.forEach(f => {
super.fillFieldValues({ field: f, options, requiresWindowsImage });
});
});
}

const option = options.find(f => f.name === field.name);
if (!option) {
Expand Down
Loading