16073: Process io file array and secondaryFiles into groups preserving main file...
[arvados-workbench2.git] / src / components / tree / tree.tsx
index 1b77b5d9d57726e66d149a3494ac92d1becc4f08..fc9dbc743ae19a15d59172bd2c30734eb223cd11 100644 (file)
@@ -97,6 +97,8 @@ export interface TreeItem<T> {
     open: boolean;
     active: boolean;
     selected?: boolean;
+    initialState?: boolean;
+    indeterminate?: boolean;
     flatTree?: boolean;
     status: TreeItemStatus;
     items?: Array<TreeItem<T>>;
@@ -202,7 +204,7 @@ const ItemIcon = React.memo(({ type, kind, active, groupClass, classes }: any) =
 const FlatTree = (props: FlatTreeProps) =>
     <div
         onContextMenu={(event) => {
-            const [action, id] = getActionAndId(event, FLAT_TREE_ACTIONS.contextMenu);
+            const id = getActionAndId(event, FLAT_TREE_ACTIONS.contextMenu)[1];
             props.onContextMenu(event, { id } as any);
         }}
         onClick={(event) => {
@@ -292,6 +294,7 @@ export const Tree = withStyles(styles)(
                             {showSelection(it) && !useRadioButtons &&
                                 <Checkbox
                                     checked={it.selected}
+                                    indeterminate={!it.selected && it.indeterminate}
                                     className={classes.checkbox}
                                     color="primary"
                                     onClick={this.handleCheckboxChange(it)} />}