Skip to content

Commit

Permalink
Merge pull request #5338 from TheRealJon/1832933-bz
Browse files Browse the repository at this point in the history
Bug 1832933: Fix select descriptor
  • Loading branch information
openshift-merge-robot committed May 15, 2020
2 parents e0521e3 + 2f4120b commit 9c32723
Showing 1 changed file with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -885,6 +885,21 @@ export const CreateOperandForm: React.FC<CreateOperandFormProps> = ({
/>
);
}
if (capabilities.some((c) => c.startsWith(SpecCapability.select))) {
return (
<div>
<Dropdown
title={`Select ${displayName}`}
selectedKey={currentValue}
items={capabilities
.filter((c) => c.startsWith(SpecCapability.select))
.map((c) => c.split(SpecCapability.select)[1])
.reduce((all, option) => ({ [option]: option, ...all }), {})}
onChange={(value) => updateFormData(path, value)}
/>
</div>
);
}
if (capabilities.includes(SpecCapability.text)) {
return (
<div>
Expand Down Expand Up @@ -940,21 +955,6 @@ export const CreateOperandForm: React.FC<CreateOperandFormProps> = ({
</div>
);
}
if (capabilities.some((c) => c.startsWith(SpecCapability.select))) {
return (
<div>
<Dropdown
title={`Select ${displayName}`}
selectedKey={currentValue}
items={capabilities
.filter((c) => c.startsWith(SpecCapability.select))
.map((c) => c.split(SpecCapability.select)[1])
.reduce((all, option) => ({ [option]: option, ...all }), {})}
onChange={(value) => updateFormData(path, value)}
/>
</div>
);
}
return null;
};

Expand Down

0 comments on commit 9c32723

Please sign in to comment.