Skip to content

Commit

Permalink
fix: remove unused code comments
Browse files Browse the repository at this point in the history
  • Loading branch information
harshpatel-crest committed May 8, 2021
1 parent 02339bf commit b4752d3
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions ui/src/main/webapp/components/SingleInputComponent.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,34 +42,27 @@ function SingleInputComponent(props) {
restProps.handleChange(field, obj.value);
}
const [labelValueMapping, setLabelValueMapping] = useState(null);
// const [isGroup, setIsGroup] = useState(false);
const Option = createSearchChoice ? ComboBox.Option : Select.Option;
const Heading = createSearchChoice ? ComboBox.Heading : Select.Heading;

function generateOptions(items) {
const data = [];
const mapping = new Map();
// let groupFlag = false;
items.forEach((item) => {
if (item.value && item.label) {
// TODO: add conditional label in case of Select
data.push(<Option label={item.label} value={item.value} key={item.value} />);
mapping.set(item.label, item.value);
// data.push(<Option value={item.label} key={item.value} />);
}
if (item.children && item.label) {
// groupFlag = true;
mapping.set(item.label.toUpperCase(), new Map());
data.push(<Heading key={item.label}>{item.label}</Heading>);
item.children.forEach((child) => {
data.push(<Option label={child.label} value={child.value} key={child.value} />);
mapping.get(item.label.toUpperCase()).set(child.label, child.value);
// data.push(<Option value={child.label} key={child.value} />);
});
}
});
setLabelValueMapping(mapping);
// setIsGroup(groupFlag);
return data;
}

Expand Down Expand Up @@ -136,7 +129,6 @@ function SingleInputComponent(props) {
placeholder={effectivePlaceholder}
disabled={effectiveDisabled}
labelValueMapping={labelValueMapping}
// isGroup={isGroup}
handleChange={handleChange}
>
{options && options.length > 0 && options}
Expand Down

0 comments on commit b4752d3

Please sign in to comment.