Skip to content

Commit

Permalink
rename ColorSettings to ColorSetting across the board
Browse files Browse the repository at this point in the history
  • Loading branch information
interim17 committed Nov 11, 2024
1 parent 853fb53 commit 881e59c
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 25 deletions.
16 changes: 8 additions & 8 deletions src/containers/ModelPanel/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import {
ChangeAgentsRenderingStateAction,
SetVisibleAction,
SetRecentColorsAction,
ColorSettings,
SetCurrentColorSettingsAction,
ColorSetting,
SetCurrentColorSettingAction,
SetSelectedUIDisplayDataAction,
} from "../../state/selection/types";
import {
Expand All @@ -27,7 +27,7 @@ import {
setAgentsVisible,
setRecentColors,
setSelectedUIDisplayData,
setCurrentColorSettings,
setCurrentColorSetting,
storeDisplayDataInBrowser,
} from "../../state/selection/actions";
import {
Expand Down Expand Up @@ -70,7 +70,7 @@ interface ModelPanelProps {
setRecentColors: ActionCreator<SetRecentColorsAction>;
selectedAgentMetadata: AgentMetadata;
currentUIDisplayData: UIDisplayData;
setCurrentColorSettings: ActionCreator<SetCurrentColorSettingsAction>;
setCurrentColorSetting: ActionCreator<SetCurrentColorSettingAction>;
setSelectedUIDisplayData: ActionCreator<SetSelectedUIDisplayDataAction>;
storeDisplayDataInBrowser: ActionCreator<SetSelectedUIDisplayDataAction>;
}
Expand All @@ -92,7 +92,7 @@ const ModelPanel: React.FC<ModelPanelProps> = ({
setRecentColors,
selectedAgentMetadata,
setSelectedUIDisplayData,
setCurrentColorSettings,
setCurrentColorSetting,
storeDisplayDataInBrowser,
currentUIDisplayData,
}): JSX.Element => {
Expand All @@ -102,8 +102,8 @@ const ModelPanel: React.FC<ModelPanelProps> = ({
currentUIDisplayData
);
setSelectedUIDisplayData(newUIData);
setCurrentColorSettings({
currentColorSettings: ColorSettings.UserSelected,
setCurrentColorSetting({
currentColorSetting: ColorSetting.UserSelected,
});
storeDisplayDataInBrowser(newUIData);
};
Expand Down Expand Up @@ -173,7 +173,7 @@ const dispatchToPropsMap = {
setAgentsVisible,
setRecentColors,
setSelectedUIDisplayData,
setCurrentColorSettings,
setCurrentColorSetting: setCurrentColorSetting,
storeDisplayDataInBrowser,
};

Expand Down
10 changes: 5 additions & 5 deletions src/state/selection/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ import {
SetRecentColorsAction,
SetSelectedAgentMetadataAction,
SetSelectedUIDisplayDataAction,
ColorSettings,
SetCurrentColorSettingsAction,
ColorSetting,
SetCurrentColorSettingAction,
} from "./types";

export function changeTime(time: number): ChangeTimeAction {
Expand Down Expand Up @@ -127,9 +127,9 @@ export function getDisplayDataFromBrowserStorage() {
};
}

export function setCurrentColorSettings(payload: {
currentColorSettings: ColorSettings;
}): SetCurrentColorSettingsAction {
export function setCurrentColorSetting(payload: {
currentColorSetting: ColorSetting;
}): SetCurrentColorSettingAction {
return {
payload,
type: SET_CURRENT_COLOR_SETTINGS,
Expand Down
8 changes: 4 additions & 4 deletions src/state/selection/logics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import {
GET_DISPLAY_DATA_FROM_BROWSER,
STORE_DISPLAY_DATA_IN_BROWSER,
} from "./constants";
import { setCurrentColorSettings, setSelectedUIDisplayData } from "./actions";
import { setCurrentColorSetting, setSelectedUIDisplayData } from "./actions";
import { compareAgentTrees } from "../../util";
import { ColorSettings } from "./types";
import { ColorSetting } from "./types";

const storeDisplayDataInBrowserLogic = createLogic({
process(deps: ReduxLogicDeps) {
Expand Down Expand Up @@ -56,8 +56,8 @@ const applySessionColorsLogic = createLogic({
}
dispatch(setSelectedUIDisplayData(storedUIData));
dispatch(
setCurrentColorSettings({
currentColorSettings: ColorSettings.UserSelected,
setCurrentColorSetting({
currentColorSetting: ColorSetting.UserSelected,
})
);
done();
Expand Down
8 changes: 4 additions & 4 deletions src/state/selection/reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const actionToConfigMap: TypeToDescriptionMap = {
agentVisibilityMap: initialState.agentVisibilityMap,
agentHighlightMap: initialState.agentHighlightMap,
setSelectedUIDisplayData: initialState.selectedUIDisplayData,
currentColorSettings: initialState.currentColorSettings,
currentColorSetting: initialState.currentColorSetting,
};
},
},
Expand Down Expand Up @@ -179,15 +179,15 @@ const actionToConfigMap: TypeToDescriptionMap = {
},
},
[SET_CURRENT_COLOR_SETTINGS]: {
accepts: (action: AnyAction): action is SetCurrentColorSettingsAction =>
accepts: (action: AnyAction): action is SetCurrentColorSettingAction =>
action.type === SET_CURRENT_COLOR_SETTINGS,
perform: (
state: SelectionStateBranch,
action: SetCurrentColorSettingsAction
action: SetCurrentColorSettingAction
) => {
return {
...state,
currentColorSettings: action.payload.currentColorSettings,
currentColorSetting: action.payload.currentColorSetting,
};
},
},
Expand Down
8 changes: 4 additions & 4 deletions src/state/trajectory/logics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ import {
changeTime,
getDisplayDataFromBrowserStorage,
resetAgentSelectionsAndHighlights,
setCurrentColorSettings,
setCurrentColorSetting,
setSelectedUIDisplayData,
} from "../selection/actions";
import { setSimulariumController } from "../simularium/actions";
import { getSimulariumController } from "../simularium/selectors";
import { ColorSettings } from "../selection/types";
import { ColorSetting } from "../selection/types";
import { getSelectedUIDisplayData } from "../selection/selectors";
import { initialState as initialSelectionState } from "../selection/reducer";
import { setStatus, setIsPlaying, setError } from "../viewer/actions";
Expand Down Expand Up @@ -668,8 +668,8 @@ const receiveDefaultUIDataLogic = createLogic({
compareAgentTrees(browserStoredUIData, action.payload)
) {
dispatch(
setCurrentColorSettings({
currentColorSettings: ColorSettings.UserSelected,
setCurrentColorSetting({
currentColorSetting: ColorSetting.UserSelected,
})
);
} else {
Expand Down

0 comments on commit 881e59c

Please sign in to comment.