From 0bbb9a55f8137612e1fe7bad87f9e8da8341d5f6 Mon Sep 17 00:00:00 2001 From: meganrm Date: Tue, 19 Dec 2023 11:36:07 -0800 Subject: [PATCH] change names of checkboxtree components --- src/components/{CheckBoxTree => AgentTree}/index.tsx | 12 ++++++------ src/components/{CheckBoxTree => AgentTree}/style.css | 0 .../index.tsx | 8 ++++---- .../style.css | 0 src/components/SharedCheckbox/index.tsx | 2 +- src/containers/ModelPanel/index.tsx | 2 +- src/containers/ModelPanel/selectors.ts | 6 ++---- 7 files changed, 14 insertions(+), 16 deletions(-) rename src/components/{CheckBoxTree => AgentTree}/index.tsx (98%) rename src/components/{CheckBoxTree => AgentTree}/style.css (100%) rename src/components/{CheckboxTreeSubmenu => AgentTreeSubmenu}/index.tsx (92%) rename src/components/{CheckboxTreeSubmenu => AgentTreeSubmenu}/style.css (100%) diff --git a/src/components/CheckBoxTree/index.tsx b/src/components/AgentTree/index.tsx similarity index 98% rename from src/components/CheckBoxTree/index.tsx rename to src/components/AgentTree/index.tsx index d13ebf9fd..8b8c5f8af 100644 --- a/src/components/CheckBoxTree/index.tsx +++ b/src/components/AgentTree/index.tsx @@ -12,7 +12,7 @@ import { VisibilitySelectionMap, } from "../../state/selection/types"; import SharedCheckbox from "../SharedCheckbox"; -import CheckboxTreeSubmenu from "../CheckboxTreeSubmenu"; +import AgentTreeSubmenu from "../AgentTreeSubmenu"; import TreeNode from "../TreeNode"; import Checkbox from "../Checkbox"; import { CHECKBOX_TYPE_STAR } from "../../constants"; @@ -34,7 +34,7 @@ export interface AgentDisplayNode { color: string; } -interface CheckBoxTreeProps { +interface AgentTreeProps { treeData: AgentDisplayNode[]; agentsChecked: VisibilitySelectionMap; agentsHighlighted: VisibilitySelectionMap; @@ -51,7 +51,7 @@ interface CheckBoxTreeProps { const CHECKBOX_SPAN_NO = 2; import styles from "./style.css"; -class CheckBoxTree extends React.Component { +class AgentTree extends React.Component { onSubCheckboxChange = (key: string, values: string[]) => { const { handleAgentCheck } = this.props; handleAgentCheck({ [key]: values }); @@ -295,7 +295,7 @@ class CheckBoxTree extends React.Component { {nodeData.children.length > 0 && ( - { })} - { } } -export default CheckBoxTree; +export default AgentTree; diff --git a/src/components/CheckBoxTree/style.css b/src/components/AgentTree/style.css similarity index 100% rename from src/components/CheckBoxTree/style.css rename to src/components/AgentTree/style.css diff --git a/src/components/CheckboxTreeSubmenu/index.tsx b/src/components/AgentTreeSubmenu/index.tsx similarity index 92% rename from src/components/CheckboxTreeSubmenu/index.tsx rename to src/components/AgentTreeSubmenu/index.tsx index fa233d88a..416c86826 100644 --- a/src/components/CheckboxTreeSubmenu/index.tsx +++ b/src/components/AgentTreeSubmenu/index.tsx @@ -8,7 +8,7 @@ const CheckboxGroup = AntdCheckbox.Group; import Checkbox from "../Checkbox"; import { CHECKBOX_TYPE_STAR } from "../../constants"; -interface CheckboxTreeSubmenuProps { +interface AgentTreeSubmenuProps { checkedAgents: string[]; options: CheckboxOptionType[]; onChange: (values: CheckboxValueType[]) => void; @@ -16,12 +16,12 @@ interface CheckboxTreeSubmenuProps { } import styles from "./style.css"; -const CheckboxTreeSubmenu = ({ +const AgentTreeSubmenu = ({ checkedAgents, options, onChange, checkboxType, -}: CheckboxTreeSubmenuProps): JSX.Element => { +}: AgentTreeSubmenuProps): JSX.Element => { const onCheckboxChange = ({ target }: CheckboxChangeEvent) => { const allowedValues = map(options, "value"); const optionIndex = checkedAgents.indexOf(target.value); @@ -60,4 +60,4 @@ const CheckboxTreeSubmenu = ({ ); }; -export default CheckboxTreeSubmenu; +export default AgentTreeSubmenu; diff --git a/src/components/CheckboxTreeSubmenu/style.css b/src/components/AgentTreeSubmenu/style.css similarity index 100% rename from src/components/CheckboxTreeSubmenu/style.css rename to src/components/AgentTreeSubmenu/style.css diff --git a/src/components/SharedCheckbox/index.tsx b/src/components/SharedCheckbox/index.tsx index ca45a7950..2798067d8 100644 --- a/src/components/SharedCheckbox/index.tsx +++ b/src/components/SharedCheckbox/index.tsx @@ -7,7 +7,7 @@ import { CHECKBOX_TYPE_STAR } from "../../constants"; import { isUndefined } from "lodash"; import styles from "./style.css"; -import { CHECK_ALL_BUTTON_TITLE } from "../CheckBoxTree"; +import { CHECK_ALL_BUTTON_TITLE } from "../AgentTree"; interface SharedCheckboxProps { options: string[]; diff --git a/src/containers/ModelPanel/index.tsx b/src/containers/ModelPanel/index.tsx index 839cd6a80..d814d79ed 100644 --- a/src/containers/ModelPanel/index.tsx +++ b/src/containers/ModelPanel/index.tsx @@ -32,7 +32,7 @@ import { VisibilitySelectionMap, SetRecentColorsAction, } from "../../state/selection/types"; -import CheckBoxTree, { AgentDisplayNode } from "../../components/CheckBoxTree"; +import CheckBoxTree, { AgentDisplayNode } from "../../components/AgentTree"; import { getSelectAllVisibilityMap, getSelectNoneVisibilityMap, diff --git a/src/containers/ModelPanel/selectors.ts b/src/containers/ModelPanel/selectors.ts index 5fc23ed84..8b787b369 100644 --- a/src/containers/ModelPanel/selectors.ts +++ b/src/containers/ModelPanel/selectors.ts @@ -1,7 +1,7 @@ import { createSelector } from "reselect"; import { isEmpty } from "lodash"; -import { AgentDisplayNode } from "../../components/CheckBoxTree"; +import { AgentDisplayNode } from "../../components/AgentTree"; import { getUiDisplayDataTree } from "../../state/trajectory/selectors"; import { getAgentVisibilityMap } from "../../state/selection/selectors"; import { VisibilitySelectionMap } from "../../state/selection/types"; @@ -56,9 +56,7 @@ export const getIsSharedCheckboxIndeterminate = createSelector( if (visibleStates === undefined) { // This should theoretically never happen console.warn( - `Skipping agent ${ - agent.key - } in getIsSharedCheckboxIndeterminate because it doesn't exist in agentVisibilityMap` + `Skipping agent ${agent.key} in getIsSharedCheckboxIndeterminate because it doesn't exist in agentVisibilityMap` ); continue; }