Skip to content

Commit

Permalink
Dropdown option fix (#2505)
Browse files Browse the repository at this point in the history
* dropdown option fix

* auto lint fixes
  • Loading branch information
Advitya17 authored Jan 25, 2024
1 parent 6973ee4 commit 7ff3476
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ export class FlyoutObjectDetection extends React.Component<
const selectableObjectIndexes =
FlyoutStyles.generateSelectableObjectDetectionIndexes(
localization.InterpretVision.Dashboard.prefix,
item
item,
this.props.dataset.class_names
);
this.setState({ item, metadata, selectableObjectIndexes });
}
Expand All @@ -75,7 +76,8 @@ export class FlyoutObjectDetection extends React.Component<
const selectableObjectIndexes =
FlyoutStyles.generateSelectableObjectDetectionIndexes(
localization.InterpretVision.Dashboard.prefix,
item
item,
this.props.dataset.class_names
);
this.setState({
item: this.props.item,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,14 @@ export function onRenderCell(

export function generateSelectableObjectDetectionIndexes(
prefix: string,
item: IVisionListItem | undefined
item: IVisionListItem | undefined,
classNames: string[] | undefined
): IComboBoxOption[] {
const temp = item?.odPredictedY;
const selectableObjectIndexes: IComboBoxOption[] = [];
if (temp) {
if (temp && classNames) {
for (let i = 0; i < Object.values(temp).length; i++) {
const className = item?.predictedY[i];
const className = classNames[temp[i][0] - 1];
selectableObjectIndexes.push({
key: prefix + String(i),
text: String(i) + String(": ") + className
Expand Down

0 comments on commit 7ff3476

Please sign in to comment.