From 083e22fab4d460b6de31e153b68e8bca147ddb9e Mon Sep 17 00:00:00 2001 From: Danny Rorabaugh Date: Wed, 10 Apr 2024 13:17:38 -0400 Subject: [PATCH 1/7] Consolidate root Redux elements --- docs/style_guide/ts_style_guide.md | 3 +- .../AnnouncementBanner/AnnouncementBanner.tsx | 3 +- src/components/App/AppLoggedIn.tsx | 3 +- src/components/App/SignalRHub.tsx | 7 +- src/components/AppBar/NavigationButtons.tsx | 3 +- src/components/AppBar/ProjectButtons.tsx | 2 +- src/components/AppBar/SpeakerMenu.tsx | 3 +- src/components/AppBar/UserMenu.tsx | 2 +- .../AppBar/tests/SpeakerMenu.test.tsx | 2 +- .../DataEntryTable/NewEntry/index.tsx | 2 +- .../DataEntry/DataEntryTable/index.tsx | 5 +- src/components/DataEntry/index.tsx | 7 +- src/components/DataEntry/tests/index.test.tsx | 4 +- src/components/GoalTimeline/index.tsx | 7 +- .../GoalTimeline/tests/GoalRedux.test.tsx | 2 +- .../GoalTimeline/tests/index.test.tsx | 4 +- src/components/Login/Login.tsx | 9 +- src/components/Login/Redux/LoginActions.ts | 2 +- src/components/Login/Redux/LoginReducer.ts | 2 +- .../Login/Redux/tests/LoginActions.test.tsx | 2 +- src/components/Login/Signup.tsx | 9 +- src/components/Login/tests/Login.test.tsx | 4 +- src/components/Login/tests/Signup.test.tsx | 4 +- src/components/Project/ProjectActions.ts | 6 +- src/components/Project/ProjectReducer.ts | 2 +- .../Project/tests/ProjectActions.test.tsx | 2 +- .../ProjectExport/DownloadButton.tsx | 7 +- src/components/ProjectExport/ExportButton.tsx | 7 +- .../Redux/ExportProjectActions.ts | 2 +- .../Redux/ExportProjectReducer.ts | 2 +- .../Redux/tests/ExportProjectActions.test.tsx | 2 +- .../ProjectScreen/ChooseProject.tsx | 2 +- .../ProjectScreen/CreateProject.tsx | 2 +- .../ProjectScreen/CreateProjectActions.ts | 2 +- src/components/ProjectScreen/index.tsx | 2 +- .../tests/ChooseProject.test.tsx | 2 +- .../ProjectScreen/tests/index.test.tsx | 2 +- src/components/ProjectSettings/index.tsx | 7 +- .../ProjectSettings/tests/index.test.tsx | 4 +- .../ProjectUsers/ActiveProjectUsers.tsx | 5 +- .../ProjectUsers/AddProjectUsers.tsx | 7 +- .../CancelConfirmDialogCollection.tsx | 2 +- src/components/Pronunciations/AudioPlayer.tsx | 7 +- .../Pronunciations/AudioRecorder.tsx | 3 +- .../Pronunciations/RecorderIcon.tsx | 7 +- .../Redux/PronunciationsReducer.ts | 2 +- .../tests/AudioRecorder.test.tsx | 2 +- .../ProjectUsersButtonWithConfirmation.tsx | 2 +- .../TreeView/Redux/TreeViewActions.ts | 6 +- .../TreeView/Redux/TreeViewReducer.ts | 2 +- .../Redux/tests/TreeViewActions.test.tsx | 2 +- src/components/TreeView/index.tsx | 7 +- src/components/TreeView/tests/index.test.tsx | 5 +- src/components/UserSettings/UserSettings.tsx | 2 +- .../UserSettings/tests/UserSettings.test.tsx | 2 +- src/components/WordCard/DomainChipsGrid.tsx | 3 +- .../WordCard/tests/SenseCard.test.tsx | 2 +- .../CharInv/CharacterDetail/CharacterInfo.tsx | 2 +- .../CharacterStatusControl.tsx | 2 +- .../CharacterDetail/CharacterWords.tsx | 2 +- .../CharacterDetail/FindAndReplace.tsx | 2 +- .../CharacterDetail/tests/index.test.tsx | 6 +- .../CharInv/CharacterEntry.tsx | 7 +- .../CharInv/CharacterList/index.tsx | 7 +- .../CharacterInventory/CharInv/index.tsx | 7 +- .../CharInv/tests/index.test.tsx | 4 +- .../CharacterInventory/CharInvCompleted.tsx | 3 +- .../Redux/CharacterInventoryActions.ts | 6 +- .../Redux/CharacterInventoryReducer.ts | 2 +- .../tests/CharacterInventoryActions.test.tsx | 2 +- .../tests/CharInvCompleted.test.tsx | 2 +- src/goals/DefaultGoal/BaseGoalScreen.tsx | 7 +- src/goals/DefaultGoal/DisplayProgress.tsx | 2 +- src/goals/DefaultGoal/NextGoalScreen.tsx | 7 +- .../MergeDuplicates/MergeDupsCompleted.tsx | 2 +- .../MergeDupsStep/MergeDragDrop/DragSense.tsx | 7 +- .../MergeDupsStep/MergeDragDrop/DropWord.tsx | 7 +- .../MergeDragDrop/SidebarDragSense.tsx | 3 +- .../MergeDragDrop/SidebarDrop.tsx | 7 +- .../MergeDupsStep/MergeDragDrop/index.tsx | 7 +- .../MergeDragDrop/tests/index.test.tsx | 4 +- .../MergeDupsStep/SaveDeferButtons.tsx | 2 +- .../MergeDuplicates/MergeDupsStep/index.tsx | 3 +- .../MergeDuplicates/Redux/MergeDupsActions.ts | 6 +- .../MergeDuplicates/Redux/MergeDupsReducer.ts | 2 +- .../Redux/tests/MergeDupsActions.test.tsx | 2 +- .../Redux/tests/MergeDupsDataMock.ts | 2 +- .../Redux/tests/MergeDupsReducer.test.tsx | 4 +- src/goals/Redux/GoalActions.ts | 6 +- src/goals/Redux/GoalReducer.ts | 2 +- .../ReviewEntries/ReviewEntriesCompleted.tsx | 2 +- .../Cells/EditCell/EditDialog.tsx | 9 +- .../Cells/EditCell/EditSenseDialog.tsx | 3 +- .../Cells/EditCell/tests/EditDialog.test.tsx | 4 +- .../EditCell/tests/EditSenseDialog.test.tsx | 6 +- .../ReviewEntriesTable/index.tsx | 3 +- .../ReviewEntriesTable/tests/index.test.tsx | 6 +- src/index.tsx | 2 +- src/{types => rootRedux}/hooks.ts | 5 +- src/{ => rootRedux}/rootActions.ts | 0 src/{ => rootRedux}/rootReducer.ts | 2 +- src/rootRedux/rootReduxTypes.ts | 86 +++++++++++++++++++ src/{ => rootRedux}/store.ts | 2 +- src/router/browserRouter.tsx | 2 +- src/types/Redux/actions.ts | 13 --- src/types/Redux/analytics.ts | 2 +- src/types/index.ts | 35 -------- src/utilities/testingLibraryUtilities.tsx | 7 +- 108 files changed, 322 insertions(+), 215 deletions(-) rename src/{types => rootRedux}/hooks.ts (76%) rename src/{ => rootRedux}/rootActions.ts (100%) rename src/{ => rootRedux}/rootReducer.ts (95%) create mode 100644 src/rootRedux/rootReduxTypes.ts rename src/{ => rootRedux}/store.ts (96%) delete mode 100644 src/types/Redux/actions.ts delete mode 100644 src/types/index.ts diff --git a/docs/style_guide/ts_style_guide.md b/docs/style_guide/ts_style_guide.md index 74ef6fa5fb..51a3185484 100644 --- a/docs/style_guide/ts_style_guide.md +++ b/docs/style_guide/ts_style_guide.md @@ -511,8 +511,7 @@ function Component(props: { name: string }) { **Good** ```ts -import { StoreState } from "types"; -import { useAppDispatch, useAppSelector } from "types/hooks"; +import { type StoreState, useAppDispatch, useAppSelector } from "rootRedux/hooks"; function Component(): ReactElement { const dispatch = useAppDispatch(); diff --git a/src/components/AnnouncementBanner/AnnouncementBanner.tsx b/src/components/AnnouncementBanner/AnnouncementBanner.tsx index 124c375440..f6dc6922f5 100644 --- a/src/components/AnnouncementBanner/AnnouncementBanner.tsx +++ b/src/components/AnnouncementBanner/AnnouncementBanner.tsx @@ -13,8 +13,7 @@ import { BannerType } from "api/models"; import { getBannerText } from "backend"; import { getClosedBanner, setClosedBanner } from "backend/localStorage"; import { topBarHeight } from "components/LandingPage/TopBar"; -import { StoreState } from "types"; -import { useAppSelector } from "types/hooks"; +import { type StoreState, useAppSelector } from "rootRedux/hooks"; import { Path } from "types/path"; import theme, { themeColors } from "types/theme"; diff --git a/src/components/App/AppLoggedIn.tsx b/src/components/App/AppLoggedIn.tsx index 2c49a3d655..97fdf8e53b 100644 --- a/src/components/App/AppLoggedIn.tsx +++ b/src/components/App/AppLoggedIn.tsx @@ -15,8 +15,7 @@ import Statistics from "components/Statistics/Statistics"; import UserSettings from "components/UserSettings/UserSettings"; import NextGoalScreen from "goals/DefaultGoal/NextGoalScreen"; import { updateLangFromUser } from "i18n"; -import { StoreState } from "types"; -import { useAppSelector } from "types/hooks"; +import { type StoreState, useAppSelector } from "rootRedux/hooks"; import { Path } from "types/path"; import FontContext, { ProjectFonts } from "utilities/fontContext"; import { getProjCss } from "utilities/fontCssUtilities"; diff --git a/src/components/App/SignalRHub.tsx b/src/components/App/SignalRHub.tsx index 38e7d70c68..82a0b9cb7e 100644 --- a/src/components/App/SignalRHub.tsx +++ b/src/components/App/SignalRHub.tsx @@ -18,8 +18,11 @@ import { success, } from "components/ProjectExport/Redux/ExportProjectActions"; import { ExportStatus } from "components/ProjectExport/Redux/ExportProjectReduxTypes"; -import { StoreState } from "types"; -import { useAppDispatch, useAppSelector } from "types/hooks"; +import { + type StoreState, + useAppDispatch, + useAppSelector, +} from "rootRedux/hooks"; /** A central hub for monitoring export status on SignalR */ export default function SignalRHub(): ReactElement { diff --git a/src/components/AppBar/NavigationButtons.tsx b/src/components/AppBar/NavigationButtons.tsx index 6f9a25d9ed..c3e02543c2 100644 --- a/src/components/AppBar/NavigationButtons.tsx +++ b/src/components/AppBar/NavigationButtons.tsx @@ -12,8 +12,7 @@ import { buttonMinHeight, tabColor, } from "components/AppBar/AppBarTypes"; -import { StoreState } from "types"; -import { useAppSelector } from "types/hooks"; +import { type StoreState, useAppSelector } from "rootRedux/hooks"; import { Path } from "types/path"; import { useWindowSize } from "utilities/useWindowSize"; diff --git a/src/components/AppBar/ProjectButtons.tsx b/src/components/AppBar/ProjectButtons.tsx index 95156f5db1..35300ecd9b 100644 --- a/src/components/AppBar/ProjectButtons.tsx +++ b/src/components/AppBar/ProjectButtons.tsx @@ -14,7 +14,7 @@ import { tabColor, } from "components/AppBar/AppBarTypes"; import SpeakerMenu from "components/AppBar/SpeakerMenu"; -import { StoreState } from "types"; +import { type StoreState } from "rootRedux/rootReduxTypes"; import { GoalStatus, GoalType } from "types/goals"; import { Path } from "types/path"; diff --git a/src/components/AppBar/SpeakerMenu.tsx b/src/components/AppBar/SpeakerMenu.tsx index 5b7a434794..9eacbf166b 100644 --- a/src/components/AppBar/SpeakerMenu.tsx +++ b/src/components/AppBar/SpeakerMenu.tsx @@ -23,8 +23,7 @@ import { Speaker } from "api"; import { getAllSpeakers } from "backend"; import { buttonMinHeight } from "components/AppBar/AppBarTypes"; import { setCurrentSpeaker } from "components/Project/ProjectActions"; -import { StoreState } from "types"; -import { useAppDispatch } from "types/hooks"; +import { type StoreState, useAppDispatch } from "rootRedux/hooks"; import { themeColors } from "types/theme"; const idAffix = "speaker-menu"; diff --git a/src/components/AppBar/UserMenu.tsx b/src/components/AppBar/UserMenu.tsx index 505ad69c32..56bc44fd31 100644 --- a/src/components/AppBar/UserMenu.tsx +++ b/src/components/AppBar/UserMenu.tsx @@ -25,7 +25,7 @@ import { TabProps, } from "components/AppBar/AppBarTypes"; import { clearCurrentProject } from "components/Project/ProjectActions"; -import { useAppDispatch } from "types/hooks"; +import { useAppDispatch } from "rootRedux/hooks"; import { Path } from "types/path"; import { RuntimeConfig } from "types/runtimeConfig"; import { openUserGuide } from "utilities/pathUtilities"; diff --git a/src/components/AppBar/tests/SpeakerMenu.test.tsx b/src/components/AppBar/tests/SpeakerMenu.test.tsx index 97fec9c679..9fe54ac448 100644 --- a/src/components/AppBar/tests/SpeakerMenu.test.tsx +++ b/src/components/AppBar/tests/SpeakerMenu.test.tsx @@ -7,7 +7,7 @@ import configureMockStore from "redux-mock-store"; import { Speaker } from "api/models"; import SpeakerMenu, { SpeakerMenuList } from "components/AppBar/SpeakerMenu"; import { defaultState } from "components/Project/ProjectReduxTypes"; -import { StoreState } from "types"; +import { type StoreState } from "rootRedux/rootReduxTypes"; import { randomSpeaker } from "types/project"; jest.mock("backend", () => ({ diff --git a/src/components/DataEntry/DataEntryTable/NewEntry/index.tsx b/src/components/DataEntry/DataEntryTable/NewEntry/index.tsx index 08478b014c..6091fd2427 100644 --- a/src/components/DataEntry/DataEntryTable/NewEntry/index.tsx +++ b/src/components/DataEntry/DataEntryTable/NewEntry/index.tsx @@ -22,7 +22,7 @@ import { import SenseDialog from "components/DataEntry/DataEntryTable/NewEntry/SenseDialog"; import VernDialog from "components/DataEntry/DataEntryTable/NewEntry/VernDialog"; import PronunciationsFrontend from "components/Pronunciations/PronunciationsFrontend"; -import { StoreState } from "types"; +import { type StoreState } from "rootRedux/rootReduxTypes"; import theme from "types/theme"; import { FileWithSpeakerId } from "types/word"; diff --git a/src/components/DataEntry/DataEntryTable/index.tsx b/src/components/DataEntry/DataEntryTable/index.tsx index 05b18c8f8c..d266cba138 100644 --- a/src/components/DataEntry/DataEntryTable/index.tsx +++ b/src/components/DataEntry/DataEntryTable/index.tsx @@ -31,9 +31,8 @@ import NewEntry from "components/DataEntry/DataEntryTable/NewEntry"; import RecentEntry from "components/DataEntry/DataEntryTable/RecentEntry"; import { filterWordsWithSenses } from "components/DataEntry/utilities"; import { uploadFileFromPronunciation } from "components/Pronunciations/utilities"; -import { StoreState } from "types"; -import { Hash } from "types/hash"; -import { useAppSelector } from "types/hooks"; +import { type StoreState, useAppSelector } from "rootRedux/hooks"; +import { type Hash } from "types/hash"; import theme from "types/theme"; import { FileWithSpeakerId, diff --git a/src/components/DataEntry/index.tsx b/src/components/DataEntry/index.tsx index 8a03c5a48b..bbc787aa9d 100644 --- a/src/components/DataEntry/index.tsx +++ b/src/components/DataEntry/index.tsx @@ -16,8 +16,11 @@ import ExistingDataTable from "components/DataEntry/ExistingDataTable"; import { filterWordsByDomain } from "components/DataEntry/utilities"; import TreeView from "components/TreeView"; import { closeTree, openTree } from "components/TreeView/Redux/TreeViewActions"; -import { StoreState } from "types"; -import { useAppDispatch, useAppSelector } from "types/hooks"; +import { + type StoreState, + useAppDispatch, + useAppSelector, +} from "rootRedux/hooks"; import { newSemanticDomain } from "types/semanticDomain"; import theme from "types/theme"; import { DomainWord } from "types/word"; diff --git a/src/components/DataEntry/tests/index.test.tsx b/src/components/DataEntry/tests/index.test.tsx index 212bd687ed..d3bb32c310 100644 --- a/src/components/DataEntry/tests/index.test.tsx +++ b/src/components/DataEntry/tests/index.test.tsx @@ -27,9 +27,9 @@ jest.mock("backend", () => ({ jest.mock("components/AppBar/AppBarComponent", () => "div"); jest.mock("components/DataEntry/DataEntryTable", () => "div"); jest.mock("components/TreeView", () => "div"); -jest.mock("types/hooks", () => { +jest.mock("rootRedux/hooks", () => { return { - ...jest.requireActual("types/hooks"), + ...jest.requireActual("rootRedux/hooks"), useAppDispatch: () => mockDispatch, }; }); diff --git a/src/components/GoalTimeline/index.tsx b/src/components/GoalTimeline/index.tsx index 54954cbc59..32820017cf 100644 --- a/src/components/GoalTimeline/index.tsx +++ b/src/components/GoalTimeline/index.tsx @@ -11,9 +11,12 @@ import { useTranslation } from "react-i18next"; import { getCurrentPermissions, getGraylistEntries } from "backend"; import GoalList from "components/GoalTimeline/GoalList"; import { asyncAddGoal, asyncGetUserEdits } from "goals/Redux/GoalActions"; -import { StoreState } from "types"; +import { + type StoreState, + useAppDispatch, + useAppSelector, +} from "rootRedux/hooks"; import { Goal, GoalType } from "types/goals"; -import { useAppDispatch, useAppSelector } from "types/hooks"; import { requiredPermission, goalTypeToGoal } from "utilities/goalUtilities"; import { useWindowSize } from "utilities/useWindowSize"; diff --git a/src/components/GoalTimeline/tests/GoalRedux.test.tsx b/src/components/GoalTimeline/tests/GoalRedux.test.tsx index ef6ca59c35..a8f84f226e 100644 --- a/src/components/GoalTimeline/tests/GoalRedux.test.tsx +++ b/src/components/GoalTimeline/tests/GoalRedux.test.tsx @@ -26,7 +26,7 @@ import { asyncUpdateGoal, setCurrentGoal, } from "goals/Redux/GoalActions"; -import { setupStore } from "store"; +import { setupStore } from "rootRedux/store"; import { GoalStatus, GoalType } from "types/goals"; import { Path } from "types/path"; import { newUser } from "types/user"; diff --git a/src/components/GoalTimeline/tests/index.test.tsx b/src/components/GoalTimeline/tests/index.test.tsx index ebf1024ffa..2d66616da5 100644 --- a/src/components/GoalTimeline/tests/index.test.tsx +++ b/src/components/GoalTimeline/tests/index.test.tsx @@ -19,9 +19,9 @@ jest.mock("goals/Redux/GoalActions", () => ({ asyncGetUserEdits: () => jest.fn(), })); jest.mock("components/Project/ProjectActions", () => ({})); -jest.mock("types/hooks", () => { +jest.mock("rootRedux/hooks", () => { return { - ...jest.requireActual("types/hooks"), + ...jest.requireActual("rootRedux/hooks"), useAppDispatch: () => jest.fn(), }; }); diff --git a/src/components/Login/Login.tsx b/src/components/Login/Login.tsx index 66cd2a911d..591fcf5c35 100644 --- a/src/components/Login/Login.tsx +++ b/src/components/Login/Login.tsx @@ -24,10 +24,13 @@ import { LoadingButton } from "components/Buttons"; import Captcha from "components/Login/Captcha"; import { asyncLogIn } from "components/Login/Redux/LoginActions"; import { LoginStatus } from "components/Login/Redux/LoginReduxTypes"; -import { reset } from "rootActions"; +import { + type StoreState, + useAppDispatch, + useAppSelector, +} from "rootRedux/hooks"; +import { reset } from "rootRedux/rootActions"; import router from "router/browserRouter"; -import { StoreState } from "types"; -import { useAppDispatch, useAppSelector } from "types/hooks"; import { Path } from "types/path"; import { RuntimeConfig } from "types/runtimeConfig"; import theme from "types/theme"; diff --git a/src/components/Login/Redux/LoginActions.ts b/src/components/Login/Redux/LoginActions.ts index 31025ef8af..ab8b331c40 100644 --- a/src/components/Login/Redux/LoginActions.ts +++ b/src/components/Login/Redux/LoginActions.ts @@ -11,8 +11,8 @@ import { setSignupFailureAction, setSignupSuccessAction, } from "components/Login/Redux/LoginReducer"; +import { type StoreStateDispatch } from "rootRedux/rootReduxTypes"; import router from "router/browserRouter"; -import { StoreStateDispatch } from "types/Redux/actions"; import { Path } from "types/path"; import { newUser } from "types/user"; diff --git a/src/components/Login/Redux/LoginReducer.ts b/src/components/Login/Redux/LoginReducer.ts index f1c0ccc846..3a16913682 100644 --- a/src/components/Login/Redux/LoginReducer.ts +++ b/src/components/Login/Redux/LoginReducer.ts @@ -4,7 +4,7 @@ import { LoginStatus, defaultState, } from "components/Login/Redux/LoginReduxTypes"; -import { StoreActionTypes } from "rootActions"; +import { StoreActionTypes } from "rootRedux/rootActions"; const loginSlice = createSlice({ name: "loginState", diff --git a/src/components/Login/Redux/tests/LoginActions.test.tsx b/src/components/Login/Redux/tests/LoginActions.test.tsx index dde5be13b6..206f413d7f 100644 --- a/src/components/Login/Redux/tests/LoginActions.test.tsx +++ b/src/components/Login/Redux/tests/LoginActions.test.tsx @@ -1,7 +1,7 @@ import { User } from "api/models"; import { asyncLogIn, asyncSignUp } from "components/Login/Redux/LoginActions"; import { LoginStatus } from "components/Login/Redux/LoginReduxTypes"; -import { setupStore } from "store"; +import { setupStore } from "rootRedux/store"; import { newUser } from "types/user"; jest.mock("backend", () => ({ diff --git a/src/components/Login/Signup.tsx b/src/components/Login/Signup.tsx index f58535aaa3..79e54b9265 100644 --- a/src/components/Login/Signup.tsx +++ b/src/components/Login/Signup.tsx @@ -20,10 +20,13 @@ import { LoadingDoneButton } from "components/Buttons"; import Captcha from "components/Login/Captcha"; import { asyncSignUp } from "components/Login/Redux/LoginActions"; import { LoginStatus } from "components/Login/Redux/LoginReduxTypes"; -import { reset } from "rootActions"; +import { + type StoreState, + useAppDispatch, + useAppSelector, +} from "rootRedux/hooks"; +import { reset } from "rootRedux/rootActions"; import router from "router/browserRouter"; -import { StoreState } from "types"; -import { useAppDispatch, useAppSelector } from "types/hooks"; import { Path } from "types/path"; import { RuntimeConfig } from "types/runtimeConfig"; import { diff --git a/src/components/Login/tests/Login.test.tsx b/src/components/Login/tests/Login.test.tsx index c5752fe4aa..8f14957ee0 100644 --- a/src/components/Login/tests/Login.test.tsx +++ b/src/components/Login/tests/Login.test.tsx @@ -24,9 +24,9 @@ jest.mock("components/Login/Redux/LoginActions", () => ({ asyncLogIn: (...args: any[]) => mockAsyncLogIn(...args), })); jest.mock("router/browserRouter"); -jest.mock("types/hooks", () => { +jest.mock("rootRedux/hooks", () => { return { - ...jest.requireActual("types/hooks"), + ...jest.requireActual("rootRedux/hooks"), useAppDispatch: () => jest.fn(), }; }); diff --git a/src/components/Login/tests/Signup.test.tsx b/src/components/Login/tests/Signup.test.tsx index 671caa9b80..15aa9ec0b6 100644 --- a/src/components/Login/tests/Signup.test.tsx +++ b/src/components/Login/tests/Signup.test.tsx @@ -25,9 +25,9 @@ jest.mock("components/Login/Redux/LoginActions", () => ({ asyncSignUp: (...args: any[]) => mockAsyncSignUp(...args), })); jest.mock("router/browserRouter"); -jest.mock("types/hooks", () => { +jest.mock("rootRedux/hooks", () => { return { - ...jest.requireActual("types/hooks"), + ...jest.requireActual("rootRedux/hooks"), useAppDispatch: () => jest.fn(), }; }); diff --git a/src/components/Project/ProjectActions.ts b/src/components/Project/ProjectActions.ts index 18a889fd86..ff82d9042b 100644 --- a/src/components/Project/ProjectActions.ts +++ b/src/components/Project/ProjectActions.ts @@ -15,8 +15,10 @@ import { setUsersAction, } from "components/Project/ProjectReducer"; import i18n from "i18n"; -import { type StoreState } from "types"; -import { type StoreStateDispatch } from "types/Redux/actions"; +import { + type StoreState, + type StoreStateDispatch, +} from "rootRedux/rootReduxTypes"; import { type Hash } from "types/hash"; import { newProject } from "types/project"; diff --git a/src/components/Project/ProjectReducer.ts b/src/components/Project/ProjectReducer.ts index 18bcb890ab..5729d3e728 100644 --- a/src/components/Project/ProjectReducer.ts +++ b/src/components/Project/ProjectReducer.ts @@ -1,7 +1,7 @@ import { createSlice } from "@reduxjs/toolkit"; import { defaultState } from "components/Project/ProjectReduxTypes"; -import { StoreActionTypes } from "rootActions"; +import { StoreActionTypes } from "rootRedux/rootActions"; const projectSlice = createSlice({ name: "currentProjectState", diff --git a/src/components/Project/tests/ProjectActions.test.tsx b/src/components/Project/tests/ProjectActions.test.tsx index 2243d3fe82..0890475e08 100644 --- a/src/components/Project/tests/ProjectActions.test.tsx +++ b/src/components/Project/tests/ProjectActions.test.tsx @@ -9,7 +9,7 @@ import { clearCurrentProject, } from "components/Project/ProjectActions"; import { defaultState as currentProjectState } from "components/Project/ProjectReduxTypes"; -import { type RootState, setupStore } from "store"; +import { type RootState, setupStore } from "rootRedux/store"; import { newProject } from "types/project"; import { newUser } from "types/user"; diff --git a/src/components/ProjectExport/DownloadButton.tsx b/src/components/ProjectExport/DownloadButton.tsx index 97ee558ba9..e0bff83e80 100644 --- a/src/components/ProjectExport/DownloadButton.tsx +++ b/src/components/ProjectExport/DownloadButton.tsx @@ -16,8 +16,11 @@ import { asyncResetExport, } from "components/ProjectExport/Redux/ExportProjectActions"; import { ExportStatus } from "components/ProjectExport/Redux/ExportProjectReduxTypes"; -import { StoreState } from "types"; -import { useAppDispatch, useAppSelector } from "types/hooks"; +import { + type StoreState, + useAppDispatch, + useAppSelector, +} from "rootRedux/hooks"; import { themeColors } from "types/theme"; import { getDateTimeString } from "utilities/utilities"; diff --git a/src/components/ProjectExport/ExportButton.tsx b/src/components/ProjectExport/ExportButton.tsx index 5b304500e2..aa12756ddf 100644 --- a/src/components/ProjectExport/ExportButton.tsx +++ b/src/components/ProjectExport/ExportButton.tsx @@ -7,8 +7,11 @@ import { isFrontierNonempty } from "backend"; import { LoadingButton } from "components/Buttons"; import { asyncExportProject } from "components/ProjectExport/Redux/ExportProjectActions"; import { ExportStatus } from "components/ProjectExport/Redux/ExportProjectReduxTypes"; -import { StoreState } from "types"; -import { useAppDispatch, useAppSelector } from "types/hooks"; +import { + type StoreState, + useAppDispatch, + useAppSelector, +} from "rootRedux/hooks"; interface ExportButtonProps { projectId: string; diff --git a/src/components/ProjectExport/Redux/ExportProjectActions.ts b/src/components/ProjectExport/Redux/ExportProjectActions.ts index de4fe4728a..76496ba184 100644 --- a/src/components/ProjectExport/Redux/ExportProjectActions.ts +++ b/src/components/ProjectExport/Redux/ExportProjectActions.ts @@ -8,7 +8,7 @@ import { resetExportAction, successAction, } from "components/ProjectExport/Redux//ExportProjectReducer"; -import { StoreStateDispatch } from "types/Redux/actions"; +import { StoreStateDispatch } from "rootRedux/rootReduxTypes"; // Action Creation Functions diff --git a/src/components/ProjectExport/Redux/ExportProjectReducer.ts b/src/components/ProjectExport/Redux/ExportProjectReducer.ts index 035f8fa996..f9e4d5514b 100644 --- a/src/components/ProjectExport/Redux/ExportProjectReducer.ts +++ b/src/components/ProjectExport/Redux/ExportProjectReducer.ts @@ -4,7 +4,7 @@ import { defaultState, ExportStatus, } from "components/ProjectExport/Redux/ExportProjectReduxTypes"; -import { StoreActionTypes } from "rootActions"; +import { StoreActionTypes } from "rootRedux/rootActions"; const exportProjectSlice = createSlice({ name: "exportProjectState", diff --git a/src/components/ProjectExport/Redux/tests/ExportProjectActions.test.tsx b/src/components/ProjectExport/Redux/tests/ExportProjectActions.test.tsx index 55b6d2b109..0e03482671 100644 --- a/src/components/ProjectExport/Redux/tests/ExportProjectActions.test.tsx +++ b/src/components/ProjectExport/Redux/tests/ExportProjectActions.test.tsx @@ -7,7 +7,7 @@ import { asyncResetExport, } from "components/ProjectExport/Redux/ExportProjectActions"; import { ExportStatus } from "components/ProjectExport/Redux/ExportProjectReduxTypes"; -import { RootState, setupStore } from "store"; +import { RootState, setupStore } from "rootRedux/store"; jest.mock("backend", () => ({ deleteLift: jest.fn, diff --git a/src/components/ProjectScreen/ChooseProject.tsx b/src/components/ProjectScreen/ChooseProject.tsx index 317c488349..35333e9e14 100644 --- a/src/components/ProjectScreen/ChooseProject.tsx +++ b/src/components/ProjectScreen/ChooseProject.tsx @@ -12,7 +12,7 @@ import { useNavigate } from "react-router-dom"; import { type Project } from "api/models"; import { getAllActiveProjects } from "backend"; import { asyncSetNewCurrentProject } from "components/Project/ProjectActions"; -import { useAppDispatch } from "types/hooks"; +import { useAppDispatch } from "rootRedux/hooks"; import { Path } from "types/path"; export default function ChooseProject(): ReactElement { diff --git a/src/components/ProjectScreen/CreateProject.tsx b/src/components/ProjectScreen/CreateProject.tsx index 8174810bae..40916b1dd5 100644 --- a/src/components/ProjectScreen/CreateProject.tsx +++ b/src/components/ProjectScreen/CreateProject.tsx @@ -21,7 +21,7 @@ import { asyncCreateProject, asyncFinishProject, } from "components/ProjectScreen/CreateProjectActions"; -import { useAppDispatch } from "types/hooks"; +import { useAppDispatch } from "rootRedux/hooks"; import theme from "types/theme"; import { newWritingSystem } from "types/writingSystem"; diff --git a/src/components/ProjectScreen/CreateProjectActions.ts b/src/components/ProjectScreen/CreateProjectActions.ts index d5dae4f6a9..6cdd98129a 100644 --- a/src/components/ProjectScreen/CreateProjectActions.ts +++ b/src/components/ProjectScreen/CreateProjectActions.ts @@ -2,8 +2,8 @@ import { type WritingSystem } from "api/models"; import { createProject, finishUploadLift, getProject } from "backend"; import { asyncSetNewCurrentProject } from "components/Project/ProjectActions"; import { asyncCreateUserEdits } from "goals/Redux/GoalActions"; +import { type StoreStateDispatch } from "rootRedux/rootReduxTypes"; import router from "router/browserRouter"; -import { type StoreStateDispatch } from "types/Redux/actions"; import { Path } from "types/path"; import { newProject } from "types/project"; diff --git a/src/components/ProjectScreen/index.tsx b/src/components/ProjectScreen/index.tsx index 363b8d88d2..711df8ad1d 100644 --- a/src/components/ProjectScreen/index.tsx +++ b/src/components/ProjectScreen/index.tsx @@ -5,7 +5,7 @@ import { clearCurrentProject } from "components/Project/ProjectActions"; import ChooseProject from "components/ProjectScreen/ChooseProject"; import CreateProject from "components/ProjectScreen/CreateProject"; import { resetTree } from "components/TreeView/Redux/TreeViewActions"; -import { useAppDispatch } from "types/hooks"; +import { useAppDispatch } from "rootRedux/hooks"; /** Where users create a project or choose an existing one */ export default function ProjectScreen(): ReactElement { diff --git a/src/components/ProjectScreen/tests/ChooseProject.test.tsx b/src/components/ProjectScreen/tests/ChooseProject.test.tsx index f454dd761f..9eee167b82 100644 --- a/src/components/ProjectScreen/tests/ChooseProject.test.tsx +++ b/src/components/ProjectScreen/tests/ChooseProject.test.tsx @@ -10,7 +10,7 @@ import { randomIntString } from "utilities/utilities"; jest.mock("backend", () => ({ getAllActiveProjects: () => mockGetProjects(), })); -jest.mock("types/hooks"); +jest.mock("rootRedux/hooks"); jest.mock("react-router-dom", () => ({ useNavigate: jest.fn(), })); diff --git a/src/components/ProjectScreen/tests/index.test.tsx b/src/components/ProjectScreen/tests/index.test.tsx index 4e718bee8c..6fe5ffbd22 100644 --- a/src/components/ProjectScreen/tests/index.test.tsx +++ b/src/components/ProjectScreen/tests/index.test.tsx @@ -4,7 +4,7 @@ import ProjectScreen from "components/ProjectScreen"; jest.mock("components/ProjectScreen/ChooseProject", () => "div"); jest.mock("components/ProjectScreen/CreateProject", () => "div"); -jest.mock("types/hooks", () => ({ +jest.mock("rootRedux/hooks", () => ({ useAppDispatch: () => () => mockDispatch(), })); diff --git a/src/components/ProjectSettings/index.tsx b/src/components/ProjectSettings/index.tsx index d5708a0aac..7f5fe793a6 100644 --- a/src/components/ProjectSettings/index.tsx +++ b/src/components/ProjectSettings/index.tsx @@ -52,8 +52,11 @@ import ProjectSelect from "components/ProjectSettings/ProjectSelect"; import ActiveProjectUsers from "components/ProjectUsers/ActiveProjectUsers"; import AddProjectUsers from "components/ProjectUsers/AddProjectUsers"; import ProjectSpeakersList from "components/ProjectUsers/ProjectSpeakersList"; -import { StoreState } from "types"; -import { useAppDispatch, useAppSelector } from "types/hooks"; +import { + type StoreState, + useAppDispatch, + useAppSelector, +} from "rootRedux/hooks"; import { Path } from "types/path"; export enum ProjectSettingsTab { diff --git a/src/components/ProjectSettings/tests/index.test.tsx b/src/components/ProjectSettings/tests/index.test.tsx index 7270774a2c..12e6cf5208 100644 --- a/src/components/ProjectSettings/tests/index.test.tsx +++ b/src/components/ProjectSettings/tests/index.test.tsx @@ -35,9 +35,9 @@ jest.mock("backend", () => ({ jest.mock("components/Project/ProjectActions"); // Mock "i18n", else `thrown: "Error: Error: connect ECONNREFUSED ::1:80 [...]` jest.mock("i18n", () => ({ language: "" })); -jest.mock("types/hooks", () => { +jest.mock("rootRedux/hooks", () => { return { - ...jest.requireActual("types/hooks"), + ...jest.requireActual("rootRedux/hooks"), useAppDispatch: () => jest.fn(), }; }); diff --git a/src/components/ProjectUsers/ActiveProjectUsers.tsx b/src/components/ProjectUsers/ActiveProjectUsers.tsx index 1bbf2fee50..c081929eef 100644 --- a/src/components/ProjectUsers/ActiveProjectUsers.tsx +++ b/src/components/ProjectUsers/ActiveProjectUsers.tsx @@ -25,9 +25,8 @@ import SortOptions, { UserOrder, getUserCompare, } from "components/ProjectUsers/SortOptions"; -import { StoreState } from "types"; -import { Hash } from "types/hash"; -import { useAppSelector } from "types/hooks"; +import { type StoreState, useAppSelector } from "rootRedux/hooks"; +import { type Hash } from "types/hash"; import theme from "types/theme"; export default function ActiveProjectUsers(props: { diff --git a/src/components/ProjectUsers/AddProjectUsers.tsx b/src/components/ProjectUsers/AddProjectUsers.tsx index 59c82ea0df..0f83028bdb 100644 --- a/src/components/ProjectUsers/AddProjectUsers.tsx +++ b/src/components/ProjectUsers/AddProjectUsers.tsx @@ -9,8 +9,11 @@ import * as backend from "backend"; import { asyncRefreshProjectUsers } from "components/Project/ProjectActions"; import EmailInvite from "components/ProjectUsers/EmailInvite"; import UserList from "components/ProjectUsers/UserList"; -import { StoreState } from "types"; -import { useAppDispatch, useAppSelector } from "types/hooks"; +import { + type StoreState, + useAppDispatch, + useAppSelector, +} from "rootRedux/hooks"; import { RuntimeConfig } from "types/runtimeConfig"; const customStyles = { diff --git a/src/components/ProjectUsers/CancelConfirmDialogCollection.tsx b/src/components/ProjectUsers/CancelConfirmDialogCollection.tsx index 4e271f1386..eb3b5c16cb 100644 --- a/src/components/ProjectUsers/CancelConfirmDialogCollection.tsx +++ b/src/components/ProjectUsers/CancelConfirmDialogCollection.tsx @@ -8,7 +8,7 @@ import { Role } from "api/models"; import { addOrUpdateUserRole, removeUserRole } from "backend"; import { CancelConfirmDialog } from "components/Dialogs"; import { asyncRefreshProjectUsers } from "components/Project/ProjectActions"; -import { useAppDispatch } from "types/hooks"; +import { useAppDispatch } from "rootRedux/hooks"; const idAffix = "user-options"; const idRemoveUser = `${idAffix}-remove`; diff --git a/src/components/Pronunciations/AudioPlayer.tsx b/src/components/Pronunciations/AudioPlayer.tsx index 74a2ff3a9f..b81dbba2ed 100644 --- a/src/components/Pronunciations/AudioPlayer.tsx +++ b/src/components/Pronunciations/AudioPlayer.tsx @@ -29,8 +29,11 @@ import { resetPronunciations, } from "components/Pronunciations/Redux/PronunciationsActions"; import { PronunciationsStatus } from "components/Pronunciations/Redux/PronunciationsReduxTypes"; -import { StoreState } from "types"; -import { useAppDispatch, useAppSelector } from "types/hooks"; +import { + type StoreState, + useAppDispatch, + useAppSelector, +} from "rootRedux/hooks"; interface PlayerProps { audio: Pronunciation; diff --git a/src/components/Pronunciations/AudioRecorder.tsx b/src/components/Pronunciations/AudioRecorder.tsx index 2519b67aff..562c5d503a 100644 --- a/src/components/Pronunciations/AudioRecorder.tsx +++ b/src/components/Pronunciations/AudioRecorder.tsx @@ -6,8 +6,7 @@ import Recorder from "components/Pronunciations/Recorder"; import RecorderContext from "components/Pronunciations/RecorderContext"; import RecorderIcon from "components/Pronunciations/RecorderIcon"; import { getFileNameForWord } from "components/Pronunciations/utilities"; -import { StoreState } from "types"; -import { useAppSelector } from "types/hooks"; +import { type StoreState, useAppSelector } from "rootRedux/hooks"; import { FileWithSpeakerId } from "types/word"; interface RecorderProps { diff --git a/src/components/Pronunciations/RecorderIcon.tsx b/src/components/Pronunciations/RecorderIcon.tsx index 58526d3edb..20a3479273 100644 --- a/src/components/Pronunciations/RecorderIcon.tsx +++ b/src/components/Pronunciations/RecorderIcon.tsx @@ -8,8 +8,11 @@ import { resetPronunciations, } from "components/Pronunciations/Redux/PronunciationsActions"; import { PronunciationsStatus } from "components/Pronunciations/Redux/PronunciationsReduxTypes"; -import { StoreState } from "types"; -import { useAppDispatch, useAppSelector } from "types/hooks"; +import { + type StoreState, + useAppDispatch, + useAppSelector, +} from "rootRedux/hooks"; import { themeColors } from "types/theme"; export const recordButtonId = "recordingButton"; diff --git a/src/components/Pronunciations/Redux/PronunciationsReducer.ts b/src/components/Pronunciations/Redux/PronunciationsReducer.ts index a37e046ae2..3d28fce330 100644 --- a/src/components/Pronunciations/Redux/PronunciationsReducer.ts +++ b/src/components/Pronunciations/Redux/PronunciationsReducer.ts @@ -4,7 +4,7 @@ import { defaultState, PronunciationsStatus, } from "components/Pronunciations/Redux/PronunciationsReduxTypes"; -import { StoreActionTypes } from "rootActions"; +import { StoreActionTypes } from "rootRedux/rootActions"; const pronunciationsSlice = createSlice({ name: "pronunciationsState", diff --git a/src/components/Pronunciations/tests/AudioRecorder.test.tsx b/src/components/Pronunciations/tests/AudioRecorder.test.tsx index a0f8ddbfd5..e10dfc8bf7 100644 --- a/src/components/Pronunciations/tests/AudioRecorder.test.tsx +++ b/src/components/Pronunciations/tests/AudioRecorder.test.tsx @@ -10,7 +10,7 @@ import RecorderIcon, { recordIconId, } from "components/Pronunciations/RecorderIcon"; import { PronunciationsStatus } from "components/Pronunciations/Redux/PronunciationsReduxTypes"; -import { StoreState } from "types"; +import { type StoreState } from "rootRedux/rootReduxTypes"; import theme, { themeColors } from "types/theme"; let testRenderer: ReactTestRenderer; diff --git a/src/components/SiteSettings/ProjectManagement/ProjectUsersButtonWithConfirmation.tsx b/src/components/SiteSettings/ProjectManagement/ProjectUsersButtonWithConfirmation.tsx index 321e04abb5..cf2b0cdb10 100644 --- a/src/components/SiteSettings/ProjectManagement/ProjectUsersButtonWithConfirmation.tsx +++ b/src/components/SiteSettings/ProjectManagement/ProjectUsersButtonWithConfirmation.tsx @@ -14,7 +14,7 @@ import { useTranslation } from "react-i18next"; import { asyncRefreshProjectUsers } from "components/Project/ProjectActions"; import ActiveProjectUsers from "components/ProjectUsers/ActiveProjectUsers"; import AddProjectUsers from "components/ProjectUsers/AddProjectUsers"; -import { useAppDispatch } from "types/hooks"; +import { useAppDispatch } from "rootRedux/hooks"; import theme from "types/theme"; interface ProjectUsersButtonWithConfirmationProps { diff --git a/src/components/TreeView/Redux/TreeViewActions.ts b/src/components/TreeView/Redux/TreeViewActions.ts index f193907f47..b8ec2de6f9 100644 --- a/src/components/TreeView/Redux/TreeViewActions.ts +++ b/src/components/TreeView/Redux/TreeViewActions.ts @@ -8,8 +8,10 @@ import { setDomainLanguageAction, setTreeOpenAction, } from "components/TreeView/Redux/TreeViewReducer"; -import { StoreState } from "types"; -import { StoreStateDispatch } from "types/Redux/actions"; +import { + type StoreState, + type StoreStateDispatch, +} from "rootRedux/rootReduxTypes"; // Action Creation Functions diff --git a/src/components/TreeView/Redux/TreeViewReducer.ts b/src/components/TreeView/Redux/TreeViewReducer.ts index 8de4cdedb7..78a21083b6 100644 --- a/src/components/TreeView/Redux/TreeViewReducer.ts +++ b/src/components/TreeView/Redux/TreeViewReducer.ts @@ -1,7 +1,7 @@ import { createSlice } from "@reduxjs/toolkit"; import { defaultState } from "components/TreeView/Redux/TreeViewReduxTypes"; -import { StoreActionTypes } from "rootActions"; +import { StoreActionTypes } from "rootRedux/rootActions"; const treeViewSlice = createSlice({ name: "treeViewState", diff --git a/src/components/TreeView/Redux/tests/TreeViewActions.test.tsx b/src/components/TreeView/Redux/tests/TreeViewActions.test.tsx index a92768ff60..e278be248b 100644 --- a/src/components/TreeView/Redux/tests/TreeViewActions.test.tsx +++ b/src/components/TreeView/Redux/tests/TreeViewActions.test.tsx @@ -6,7 +6,7 @@ import { setDomainLanguage, traverseTree, } from "components/TreeView/Redux/TreeViewActions"; -import { RootState, setupStore } from "store"; +import { RootState, setupStore } from "rootRedux/store"; import { newSemanticDomain, newSemanticDomainTreeNode, diff --git a/src/components/TreeView/index.tsx b/src/components/TreeView/index.tsx index 1527363fcf..81ec3cf416 100644 --- a/src/components/TreeView/index.tsx +++ b/src/components/TreeView/index.tsx @@ -16,8 +16,11 @@ import { defaultTreeNode } from "components/TreeView/Redux/TreeViewReduxTypes"; import TreeDepiction from "components/TreeView/TreeDepiction"; import TreeNavigator from "components/TreeView/TreeNavigator"; import TreeSearch from "components/TreeView/TreeSearch"; -import { StoreState } from "types"; -import { useAppDispatch, useAppSelector } from "types/hooks"; +import { + type StoreState, + useAppDispatch, + useAppSelector, +} from "rootRedux/hooks"; import { newSemanticDomain } from "types/semanticDomain"; import { semDomWritingSystems } from "types/writingSystem"; diff --git a/src/components/TreeView/tests/index.test.tsx b/src/components/TreeView/tests/index.test.tsx index 86321387e7..b6323982a3 100644 --- a/src/components/TreeView/tests/index.test.tsx +++ b/src/components/TreeView/tests/index.test.tsx @@ -20,10 +20,9 @@ jest.mock("@mui/material", () => { }; }); -jest.mock("types/hooks", () => { - const realHooks = jest.requireActual("types/hooks"); +jest.mock("rootRedux/hooks", () => { return { - ...realHooks, + ...jest.requireActual("rootRedux/hooks"), useAppDispatch: () => jest.fn(), }; }); diff --git a/src/components/UserSettings/UserSettings.tsx b/src/components/UserSettings/UserSettings.tsx index 06a65666c4..020563d743 100644 --- a/src/components/UserSettings/UserSettings.tsx +++ b/src/components/UserSettings/UserSettings.tsx @@ -19,7 +19,7 @@ import { getAvatar, getCurrentUser } from "backend/localStorage"; import { asyncLoadSemanticDomains } from "components/Project/ProjectActions"; import ClickableAvatar from "components/UserSettings/ClickableAvatar"; import { updateLangFromUser } from "i18n"; -import { useAppDispatch } from "types/hooks"; +import { useAppDispatch } from "rootRedux/hooks"; import theme from "types/theme"; import { uiWritingSystems } from "types/writingSystem"; diff --git a/src/components/UserSettings/tests/UserSettings.test.tsx b/src/components/UserSettings/tests/UserSettings.test.tsx index 8e189d67f5..93754389d7 100644 --- a/src/components/UserSettings/tests/UserSettings.test.tsx +++ b/src/components/UserSettings/tests/UserSettings.test.tsx @@ -31,7 +31,7 @@ jest.mock("backend/localStorage", () => ({ jest.mock("components/Project/ProjectActions", () => ({ asyncLoadSemanticDomains: jest.fn(), })); -jest.mock("types/hooks", () => ({ +jest.mock("rootRedux/hooks", () => ({ useAppDispatch: () => jest.fn(), })); diff --git a/src/components/WordCard/DomainChipsGrid.tsx b/src/components/WordCard/DomainChipsGrid.tsx index 667605ec09..5fb4b654a5 100644 --- a/src/components/WordCard/DomainChipsGrid.tsx +++ b/src/components/WordCard/DomainChipsGrid.tsx @@ -3,8 +3,7 @@ import { type ReactElement } from "react"; import { type SemanticDomain } from "api/models"; import DomainChip from "components/WordCard/DomainChip"; -import { type StoreState } from "types"; -import { useAppSelector } from "types/hooks"; +import { type StoreState, useAppSelector } from "rootRedux/hooks"; interface DomainChipsGridProps { semDoms: SemanticDomain[]; diff --git a/src/components/WordCard/tests/SenseCard.test.tsx b/src/components/WordCard/tests/SenseCard.test.tsx index ef34c3db80..67563abc2d 100644 --- a/src/components/WordCard/tests/SenseCard.test.tsx +++ b/src/components/WordCard/tests/SenseCard.test.tsx @@ -7,7 +7,7 @@ import { PartOfSpeechButton } from "components/Buttons"; import { defaultState } from "components/Project/ProjectReduxTypes"; import DomainChip from "components/WordCard/DomainChip"; import SenseCard from "components/WordCard/SenseCard"; -import { type StoreState } from "types"; +import { type StoreState } from "rootRedux/rootReduxTypes"; import { Hash } from "types/hash"; import { newSemanticDomain } from "types/semanticDomain"; import { newSense } from "types/word"; diff --git a/src/goals/CharacterInventory/CharInv/CharacterDetail/CharacterInfo.tsx b/src/goals/CharacterInventory/CharInv/CharacterDetail/CharacterInfo.tsx index 67591984d1..5f92edec60 100644 --- a/src/goals/CharacterInventory/CharInv/CharacterDetail/CharacterInfo.tsx +++ b/src/goals/CharacterInventory/CharInv/CharacterDetail/CharacterInfo.tsx @@ -3,7 +3,7 @@ import { ReactElement } from "react"; import { useTranslation } from "react-i18next"; import { useSelector } from "react-redux"; -import { StoreState } from "types"; +import { type StoreState } from "rootRedux/rootReduxTypes"; interface CharacterInfoProps { character: string; diff --git a/src/goals/CharacterInventory/CharInv/CharacterDetail/CharacterStatusControl.tsx b/src/goals/CharacterInventory/CharInv/CharacterDetail/CharacterStatusControl.tsx index ac23103f12..8971b0fdc9 100644 --- a/src/goals/CharacterInventory/CharInv/CharacterDetail/CharacterStatusControl.tsx +++ b/src/goals/CharacterInventory/CharInv/CharacterDetail/CharacterStatusControl.tsx @@ -4,7 +4,7 @@ import { useTranslation } from "react-i18next"; import { CharacterStatus } from "goals/CharacterInventory/CharacterInventoryTypes"; import { setCharacterStatus } from "goals/CharacterInventory/Redux/CharacterInventoryActions"; -import { useAppDispatch } from "types/hooks"; +import { useAppDispatch } from "rootRedux/hooks"; interface CharacterStatusControlProps { character: string; diff --git a/src/goals/CharacterInventory/CharInv/CharacterDetail/CharacterWords.tsx b/src/goals/CharacterInventory/CharInv/CharacterDetail/CharacterWords.tsx index f2a2f6cc66..1326f5bc37 100644 --- a/src/goals/CharacterInventory/CharInv/CharacterDetail/CharacterWords.tsx +++ b/src/goals/CharacterInventory/CharInv/CharacterDetail/CharacterWords.tsx @@ -3,7 +3,7 @@ import { ReactElement } from "react"; import { useTranslation } from "react-i18next"; import { useSelector } from "react-redux"; -import { StoreState } from "types"; +import { type StoreState } from "rootRedux/rootReduxTypes"; import { themeColors } from "types/theme"; import { TypographyWithFont } from "utilities/fontComponents"; diff --git a/src/goals/CharacterInventory/CharInv/CharacterDetail/FindAndReplace.tsx b/src/goals/CharacterInventory/CharInv/CharacterDetail/FindAndReplace.tsx index bf1cc71b72..c2c9843800 100644 --- a/src/goals/CharacterInventory/CharInv/CharacterDetail/FindAndReplace.tsx +++ b/src/goals/CharacterInventory/CharInv/CharacterDetail/FindAndReplace.tsx @@ -5,7 +5,7 @@ import { toast } from "react-toastify"; import CancelConfirmDialog from "components/Dialogs/CancelConfirmDialog"; import { findAndReplace } from "goals/CharacterInventory/Redux/CharacterInventoryActions"; -import { useAppDispatch } from "types/hooks"; +import { useAppDispatch } from "rootRedux/hooks"; import { TextFieldWithFont } from "utilities/fontComponents"; const idPrefix = "find-and-replace"; diff --git a/src/goals/CharacterInventory/CharInv/CharacterDetail/tests/index.test.tsx b/src/goals/CharacterInventory/CharInv/CharacterDetail/tests/index.test.tsx index 0bdc68eb3e..feee6e2a57 100644 --- a/src/goals/CharacterInventory/CharInv/CharacterDetail/tests/index.test.tsx +++ b/src/goals/CharacterInventory/CharInv/CharacterDetail/tests/index.test.tsx @@ -10,7 +10,7 @@ import { buttonIdSubmit, } from "goals/CharacterInventory/CharInv/CharacterDetail/FindAndReplace"; import { defaultState } from "goals/CharacterInventory/Redux/CharacterInventoryReduxTypes"; -import { type StoreState } from "types"; +import { type StoreState } from "rootRedux/rootReduxTypes"; import { testInstanceHasText } from "utilities/testRendererUtilities"; // Dialog uses portals, which are not supported in react-test-renderer. @@ -26,9 +26,9 @@ jest.mock("components/Project/ProjectActions", () => ({})); jest.mock("goals/CharacterInventory/Redux/CharacterInventoryActions", () => ({ findAndReplace: () => mockFindAndReplace(), })); -jest.mock("types/hooks", () => { +jest.mock("rootRedux/hooks", () => { return { - ...jest.requireActual("types/hooks"), + ...jest.requireActual("rootRedux/hooks"), useAppDispatch: () => (args: any) => Promise.resolve(args), }; }); diff --git a/src/goals/CharacterInventory/CharInv/CharacterEntry.tsx b/src/goals/CharacterInventory/CharInv/CharacterEntry.tsx index a5f57655f4..cfd7675c48 100644 --- a/src/goals/CharacterInventory/CharInv/CharacterEntry.tsx +++ b/src/goals/CharacterInventory/CharInv/CharacterEntry.tsx @@ -7,8 +7,11 @@ import { setRejectedCharacters, setValidCharacters, } from "goals/CharacterInventory/Redux/CharacterInventoryActions"; -import { StoreState } from "types"; -import { useAppDispatch, useAppSelector } from "types/hooks"; +import { + type StoreState, + useAppDispatch, + useAppSelector, +} from "rootRedux/hooks"; import theme from "types/theme"; import { TextFieldWithFont } from "utilities/fontComponents"; diff --git a/src/goals/CharacterInventory/CharInv/CharacterList/index.tsx b/src/goals/CharacterInventory/CharInv/CharacterList/index.tsx index b25f18bb31..7933872f3c 100644 --- a/src/goals/CharacterInventory/CharInv/CharacterList/index.tsx +++ b/src/goals/CharacterInventory/CharInv/CharacterList/index.tsx @@ -6,8 +6,11 @@ import { useTranslation } from "react-i18next"; import CharacterCard from "goals/CharacterInventory/CharInv/CharacterList/CharacterCard"; import { setSelectedCharacter } from "goals/CharacterInventory/Redux/CharacterInventoryActions"; import { CharacterSetEntry } from "goals/CharacterInventory/Redux/CharacterInventoryReduxTypes"; -import { StoreState } from "types"; -import { useAppDispatch, useAppSelector } from "types/hooks"; +import { + type StoreState, + useAppDispatch, + useAppSelector, +} from "rootRedux/hooks"; enum SortOrder { CharacterAscending, diff --git a/src/goals/CharacterInventory/CharInv/index.tsx b/src/goals/CharacterInventory/CharInv/index.tsx index 0dcce33f16..ef1eb219e3 100644 --- a/src/goals/CharacterInventory/CharInv/index.tsx +++ b/src/goals/CharacterInventory/CharInv/index.tsx @@ -22,8 +22,11 @@ import { setSelectedCharacter, uploadInventory, } from "goals/CharacterInventory/Redux/CharacterInventoryActions"; -import { StoreState } from "types"; -import { useAppDispatch, useAppSelector } from "types/hooks"; +import { + type StoreState, + useAppDispatch, + useAppSelector, +} from "rootRedux/hooks"; import theme from "types/theme"; const idPrefix = "character-inventory"; diff --git a/src/goals/CharacterInventory/CharInv/tests/index.test.tsx b/src/goals/CharacterInventory/CharInv/tests/index.test.tsx index f43e5ff6c0..0232c6e0d0 100644 --- a/src/goals/CharacterInventory/CharInv/tests/index.test.tsx +++ b/src/goals/CharacterInventory/CharInv/tests/index.test.tsx @@ -29,9 +29,9 @@ jest.mock("goals/CharacterInventory/Redux/CharacterInventoryActions", () => ({ setSelectedCharacter: () => mockSetSelectedCharacter(), uploadInventory: () => mockUploadInventory(), })); -jest.mock("types/hooks", () => { +jest.mock("rootRedux/hooks", () => { return { - ...jest.requireActual("types/hooks"), + ...jest.requireActual("rootRedux/hooks"), useAppDispatch: () => jest.fn(), }; }); diff --git a/src/goals/CharacterInventory/CharInvCompleted.tsx b/src/goals/CharacterInventory/CharInvCompleted.tsx index aac80f322b..29f8f7c186 100644 --- a/src/goals/CharacterInventory/CharInvCompleted.tsx +++ b/src/goals/CharacterInventory/CharInvCompleted.tsx @@ -14,8 +14,7 @@ import { type FindAndReplaceChange, defaultCharInvChanges, } from "goals/CharacterInventory/CharacterInventoryTypes"; -import { type StoreState } from "types"; -import { useAppSelector } from "types/hooks"; +import { type StoreState, useAppSelector } from "rootRedux/hooks"; export enum CharInvCompletedId { TypographyNoCharChanges = "no-char-changes-typography", diff --git a/src/goals/CharacterInventory/Redux/CharacterInventoryActions.ts b/src/goals/CharacterInventory/Redux/CharacterInventoryActions.ts index 9b77784098..11d0f0ba1d 100644 --- a/src/goals/CharacterInventory/Redux/CharacterInventoryActions.ts +++ b/src/goals/CharacterInventory/Redux/CharacterInventoryActions.ts @@ -29,9 +29,11 @@ import { addCharInvChangesToGoal, asyncUpdateGoal, } from "goals/Redux/GoalActions"; +import { + type StoreState, + type StoreStateDispatch, +} from "rootRedux/rootReduxTypes"; import router from "router/browserRouter"; -import { type StoreState } from "types"; -import { type StoreStateDispatch } from "types/Redux/actions"; import { type Hash } from "types/hash"; import { Path } from "types/path"; diff --git a/src/goals/CharacterInventory/Redux/CharacterInventoryReducer.ts b/src/goals/CharacterInventory/Redux/CharacterInventoryReducer.ts index f48ec4f166..68d8d3b56b 100644 --- a/src/goals/CharacterInventory/Redux/CharacterInventoryReducer.ts +++ b/src/goals/CharacterInventory/Redux/CharacterInventoryReducer.ts @@ -4,7 +4,7 @@ import { getCharacterStatus, defaultState, } from "goals/CharacterInventory/Redux/CharacterInventoryReduxTypes"; -import { StoreActionTypes } from "rootActions"; +import { StoreActionTypes } from "rootRedux/rootActions"; const characterInventorySlice = createSlice({ name: "characterInventoryState", diff --git a/src/goals/CharacterInventory/Redux/tests/CharacterInventoryActions.test.tsx b/src/goals/CharacterInventory/Redux/tests/CharacterInventoryActions.test.tsx index 51f9090c91..e2e323e03c 100644 --- a/src/goals/CharacterInventory/Redux/tests/CharacterInventoryActions.test.tsx +++ b/src/goals/CharacterInventory/Redux/tests/CharacterInventoryActions.test.tsx @@ -22,7 +22,7 @@ import { type CharacterInventoryState, type CharacterSetEntry, } from "goals/CharacterInventory/Redux/CharacterInventoryReduxTypes"; -import { type RootState, setupStore } from "store"; +import { type RootState, setupStore } from "rootRedux/store"; import { newProject } from "types/project"; import { newWord } from "types/word"; diff --git a/src/goals/CharacterInventory/tests/CharInvCompleted.test.tsx b/src/goals/CharacterInventory/tests/CharInvCompleted.test.tsx index 412dff6fb7..1beef1f68d 100644 --- a/src/goals/CharacterInventory/tests/CharInvCompleted.test.tsx +++ b/src/goals/CharacterInventory/tests/CharInvCompleted.test.tsx @@ -21,7 +21,7 @@ import { defaultCharInvChanges, } from "goals/CharacterInventory/CharacterInventoryTypes"; import { defaultState } from "goals/Redux/GoalReduxTypes"; -import { type StoreState } from "types"; +import { type StoreState } from "rootRedux/rootReduxTypes"; import { newWord as mockWord } from "types/word"; jest.mock("backend", () => ({ diff --git a/src/goals/DefaultGoal/BaseGoalScreen.tsx b/src/goals/DefaultGoal/BaseGoalScreen.tsx index 743ce37255..9453b3ebef 100644 --- a/src/goals/DefaultGoal/BaseGoalScreen.tsx +++ b/src/goals/DefaultGoal/BaseGoalScreen.tsx @@ -7,9 +7,12 @@ import DisplayProgress from "goals/DefaultGoal/DisplayProgress"; import Loading from "goals/DefaultGoal/Loading"; import { clearTree } from "goals/MergeDuplicates/Redux/MergeDupsActions"; import { setCurrentGoal } from "goals/Redux/GoalActions"; -import { type StoreState } from "types"; +import { + type StoreState, + useAppDispatch, + useAppSelector, +} from "rootRedux/hooks"; import { Goal, GoalStatus, GoalType } from "types/goals"; -import { useAppDispatch, useAppSelector } from "types/hooks"; import { Path } from "types/path"; const CharacterInventory = loadable(() => import("goals/CharacterInventory")); diff --git a/src/goals/DefaultGoal/DisplayProgress.tsx b/src/goals/DefaultGoal/DisplayProgress.tsx index 7ebd5e1d65..44e91347ce 100644 --- a/src/goals/DefaultGoal/DisplayProgress.tsx +++ b/src/goals/DefaultGoal/DisplayProgress.tsx @@ -3,7 +3,7 @@ import { ReactElement } from "react"; import { useTranslation } from "react-i18next"; import { useSelector } from "react-redux"; -import { StoreState } from "types"; +import { type StoreState } from "rootRedux/rootReduxTypes"; import { GoalType } from "types/goals"; /** diff --git a/src/goals/DefaultGoal/NextGoalScreen.tsx b/src/goals/DefaultGoal/NextGoalScreen.tsx index f001c263a9..4fcacedf29 100644 --- a/src/goals/DefaultGoal/NextGoalScreen.tsx +++ b/src/goals/DefaultGoal/NextGoalScreen.tsx @@ -4,9 +4,12 @@ import { useNavigate } from "react-router-dom"; import PageNotFound from "components/PageNotFound/component"; import MergeDupsContinueDialog from "goals/MergeDuplicates/MergeDupsContinueDialog"; import { asyncAddGoal } from "goals/Redux/GoalActions"; -import { StoreState } from "types"; +import { + type StoreState, + useAppDispatch, + useAppSelector, +} from "rootRedux/hooks"; import { GoalType } from "types/goals"; -import { useAppDispatch, useAppSelector } from "types/hooks"; import { Path } from "types/path"; import { goalTypeToGoal } from "utilities/goalUtilities"; diff --git a/src/goals/MergeDuplicates/MergeDupsCompleted.tsx b/src/goals/MergeDuplicates/MergeDupsCompleted.tsx index bd794dda97..39ef532338 100644 --- a/src/goals/MergeDuplicates/MergeDupsCompleted.tsx +++ b/src/goals/MergeDuplicates/MergeDupsCompleted.tsx @@ -9,7 +9,7 @@ import { getFrontierWords, getWord, undoMerge } from "backend"; import { FlagButton, UndoButton } from "components/Buttons"; import SenseCardContent from "goals/MergeDuplicates/MergeDupsStep/SenseCardContent"; import { MergesCompleted } from "goals/MergeDuplicates/MergeDupsTypes"; -import { StoreState } from "types"; +import { type StoreState } from "rootRedux/rootReduxTypes"; import theme from "types/theme"; import { newFlag } from "types/word"; import { TypographyWithFont } from "utilities/fontComponents"; diff --git a/src/goals/MergeDuplicates/MergeDupsStep/MergeDragDrop/DragSense.tsx b/src/goals/MergeDuplicates/MergeDupsStep/MergeDragDrop/DragSense.tsx index 48df5a3d94..d5a03246a7 100644 --- a/src/goals/MergeDuplicates/MergeDupsStep/MergeDragDrop/DragSense.tsx +++ b/src/goals/MergeDuplicates/MergeDupsStep/MergeDragDrop/DragSense.tsx @@ -6,8 +6,11 @@ import { trashId } from "goals/MergeDuplicates/MergeDupsStep/MergeDragDrop"; import SenseCardContent from "goals/MergeDuplicates/MergeDupsStep/SenseCardContent"; import { MergeTreeSense } from "goals/MergeDuplicates/MergeDupsTreeTypes"; import { setSidebar } from "goals/MergeDuplicates/Redux/MergeDupsActions"; -import { StoreState } from "types"; -import { useAppDispatch, useAppSelector } from "types/hooks"; +import { + type StoreState, + useAppDispatch, + useAppSelector, +} from "rootRedux/hooks"; import theme from "types/theme"; interface DragSenseProps { diff --git a/src/goals/MergeDuplicates/MergeDupsStep/MergeDragDrop/DropWord.tsx b/src/goals/MergeDuplicates/MergeDupsStep/MergeDragDrop/DropWord.tsx index eaf7341e21..5bc4aace65 100644 --- a/src/goals/MergeDuplicates/MergeDupsStep/MergeDragDrop/DropWord.tsx +++ b/src/goals/MergeDuplicates/MergeDupsStep/MergeDragDrop/DropWord.tsx @@ -20,8 +20,11 @@ import { flagWord, setVern, } from "goals/MergeDuplicates/Redux/MergeDupsActions"; -import { StoreState } from "types"; -import { useAppDispatch, useAppSelector } from "types/hooks"; +import { + type StoreState, + useAppDispatch, + useAppSelector, +} from "rootRedux/hooks"; import theme from "types/theme"; import { TypographyWithFont } from "utilities/fontComponents"; diff --git a/src/goals/MergeDuplicates/MergeDupsStep/MergeDragDrop/SidebarDragSense.tsx b/src/goals/MergeDuplicates/MergeDupsStep/MergeDragDrop/SidebarDragSense.tsx index cb2ccc9013..009f6dfb78 100644 --- a/src/goals/MergeDuplicates/MergeDupsStep/MergeDragDrop/SidebarDragSense.tsx +++ b/src/goals/MergeDuplicates/MergeDupsStep/MergeDragDrop/SidebarDragSense.tsx @@ -8,8 +8,7 @@ import { MergeTreeReference, MergeTreeSense, } from "goals/MergeDuplicates/MergeDupsTreeTypes"; -import { StoreState } from "types"; -import { useAppSelector } from "types/hooks"; +import { type StoreState, useAppSelector } from "rootRedux/hooks"; import theme from "types/theme"; interface SidebarDragSenseProps { diff --git a/src/goals/MergeDuplicates/MergeDupsStep/MergeDragDrop/SidebarDrop.tsx b/src/goals/MergeDuplicates/MergeDupsStep/MergeDragDrop/SidebarDrop.tsx index dc44e3e22f..263637fe03 100644 --- a/src/goals/MergeDuplicates/MergeDupsStep/MergeDragDrop/SidebarDrop.tsx +++ b/src/goals/MergeDuplicates/MergeDupsStep/MergeDragDrop/SidebarDrop.tsx @@ -6,8 +6,11 @@ import { Droppable } from "react-beautiful-dnd"; import SidebarDragSense from "goals/MergeDuplicates/MergeDupsStep/MergeDragDrop/SidebarDragSense"; import { MergeTreeSense } from "goals/MergeDuplicates/MergeDupsTreeTypes"; import { setSidebar } from "goals/MergeDuplicates/Redux/MergeDupsActions"; -import { StoreState } from "types"; -import { useAppDispatch, useAppSelector } from "types/hooks"; +import { + type StoreState, + useAppDispatch, + useAppSelector, +} from "rootRedux/hooks"; import { openUserGuide } from "utilities/pathUtilities"; export default function SidebarDrop(): ReactElement { diff --git a/src/goals/MergeDuplicates/MergeDupsStep/MergeDragDrop/index.tsx b/src/goals/MergeDuplicates/MergeDupsStep/MergeDragDrop/index.tsx index 9206b7c088..130cd15572 100644 --- a/src/goals/MergeDuplicates/MergeDupsStep/MergeDragDrop/index.tsx +++ b/src/goals/MergeDuplicates/MergeDupsStep/MergeDragDrop/index.tsx @@ -16,8 +16,11 @@ import { moveSense, orderSense, } from "goals/MergeDuplicates/Redux/MergeDupsActions"; -import { StoreState } from "types"; -import { useAppDispatch, useAppSelector } from "types/hooks"; +import { + type StoreState, + useAppDispatch, + useAppSelector, +} from "rootRedux/hooks"; import theme from "types/theme"; export const trashId = "trash-drop"; diff --git a/src/goals/MergeDuplicates/MergeDupsStep/MergeDragDrop/tests/index.test.tsx b/src/goals/MergeDuplicates/MergeDupsStep/MergeDragDrop/tests/index.test.tsx index 9263e5fb0a..0d03dabb46 100644 --- a/src/goals/MergeDuplicates/MergeDupsStep/MergeDragDrop/tests/index.test.tsx +++ b/src/goals/MergeDuplicates/MergeDupsStep/MergeDragDrop/tests/index.test.tsx @@ -39,9 +39,9 @@ jest.mock("backend", () => ({})); jest.mock("goals/MergeDuplicates/Redux/MergeDupsActions", () => ({ setSidebar: (...args: any[]) => mockSetSidebar(...args), })); -jest.mock("types/hooks", () => { +jest.mock("rootRedux/hooks", () => { return { - ...jest.requireActual("types/hooks"), + ...jest.requireActual("rootRedux/hooks"), useAppDispatch: () => jest.fn(), }; }); diff --git a/src/goals/MergeDuplicates/MergeDupsStep/SaveDeferButtons.tsx b/src/goals/MergeDuplicates/MergeDupsStep/SaveDeferButtons.tsx index 449eae3baf..3ad453b729 100644 --- a/src/goals/MergeDuplicates/MergeDupsStep/SaveDeferButtons.tsx +++ b/src/goals/MergeDuplicates/MergeDupsStep/SaveDeferButtons.tsx @@ -9,7 +9,7 @@ import { setSidebar, } from "goals/MergeDuplicates/Redux/MergeDupsActions"; import { asyncAdvanceStep } from "goals/Redux/GoalActions"; -import { useAppDispatch } from "types/hooks"; +import { useAppDispatch } from "rootRedux/hooks"; import theme from "types/theme"; export default function SaveDeferButtons(): ReactElement { diff --git a/src/goals/MergeDuplicates/MergeDupsStep/index.tsx b/src/goals/MergeDuplicates/MergeDupsStep/index.tsx index bd7bc43522..886a63629d 100644 --- a/src/goals/MergeDuplicates/MergeDupsStep/index.tsx +++ b/src/goals/MergeDuplicates/MergeDupsStep/index.tsx @@ -4,8 +4,7 @@ import { useTranslation } from "react-i18next"; import MergeDragDrop from "goals/MergeDuplicates/MergeDupsStep/MergeDragDrop"; import SaveDeferButtons from "goals/MergeDuplicates/MergeDupsStep/SaveDeferButtons"; -import { StoreState } from "types"; -import { useAppSelector } from "types/hooks"; +import { type StoreState, useAppSelector } from "rootRedux/hooks"; import theme from "types/theme"; export default function MergeDupsStep(): ReactElement { diff --git a/src/goals/MergeDuplicates/Redux/MergeDupsActions.ts b/src/goals/MergeDuplicates/Redux/MergeDupsActions.ts index 25ef8cbdf2..2deb71c833 100644 --- a/src/goals/MergeDuplicates/Redux/MergeDupsActions.ts +++ b/src/goals/MergeDuplicates/Redux/MergeDupsActions.ts @@ -38,8 +38,10 @@ import { addCompletedMergeToGoal, asyncUpdateGoal, } from "goals/Redux/GoalActions"; -import { StoreState } from "types"; -import { StoreStateDispatch } from "types/Redux/actions"; +import { + type StoreState, + type StoreStateDispatch, +} from "rootRedux/rootReduxTypes"; // Action Creation Functions diff --git a/src/goals/MergeDuplicates/Redux/MergeDupsReducer.ts b/src/goals/MergeDuplicates/Redux/MergeDupsReducer.ts index e7a5332228..a8246b220c 100644 --- a/src/goals/MergeDuplicates/Redux/MergeDupsReducer.ts +++ b/src/goals/MergeDuplicates/Redux/MergeDupsReducer.ts @@ -20,7 +20,7 @@ import { buildSenses, createMergeWords, } from "goals/MergeDuplicates/Redux/reducerUtilities"; -import { StoreActionTypes } from "rootActions"; +import { StoreActionTypes } from "rootRedux/rootActions"; import { type Hash } from "types/hash"; const mergeDuplicatesSlice = createSlice({ diff --git a/src/goals/MergeDuplicates/Redux/tests/MergeDupsActions.test.tsx b/src/goals/MergeDuplicates/Redux/tests/MergeDupsActions.test.tsx index 7aed209a05..87121e53e2 100644 --- a/src/goals/MergeDuplicates/Redux/tests/MergeDupsActions.test.tsx +++ b/src/goals/MergeDuplicates/Redux/tests/MergeDupsActions.test.tsx @@ -16,7 +16,7 @@ import { } from "goals/MergeDuplicates/Redux/MergeDupsActions"; import { defaultState as defaultMergeState } from "goals/MergeDuplicates/Redux/MergeDupsReduxTypes"; import { goalDataMock } from "goals/MergeDuplicates/Redux/tests/MergeDupsDataMock"; -import { setupStore } from "store"; +import { setupStore } from "rootRedux/store"; import { GoalType } from "types/goals"; import { multiSenseWord, newFlag, newWord } from "types/word"; diff --git a/src/goals/MergeDuplicates/Redux/tests/MergeDupsDataMock.ts b/src/goals/MergeDuplicates/Redux/tests/MergeDupsDataMock.ts index 00e759af71..e4ccc153e6 100644 --- a/src/goals/MergeDuplicates/Redux/tests/MergeDupsDataMock.ts +++ b/src/goals/MergeDuplicates/Redux/tests/MergeDupsDataMock.ts @@ -10,7 +10,7 @@ import { } from "goals/MergeDuplicates/MergeDupsTreeTypes"; import { type MergeDupsData } from "goals/MergeDuplicates/MergeDupsTypes"; import { defaultState as mergeState } from "goals/MergeDuplicates/Redux/MergeDupsReduxTypes"; -import { type RootState } from "store"; +import { type RootState } from "rootRedux/store"; import { newSense, newWord, simpleWord } from "types/word"; const wordsArrayMock = (): Word[] => [ diff --git a/src/goals/MergeDuplicates/Redux/tests/MergeDupsReducer.test.tsx b/src/goals/MergeDuplicates/Redux/tests/MergeDupsReducer.test.tsx index 69c6e6ebfa..8a5ae4b90b 100644 --- a/src/goals/MergeDuplicates/Redux/tests/MergeDupsReducer.test.tsx +++ b/src/goals/MergeDuplicates/Redux/tests/MergeDupsReducer.test.tsx @@ -28,8 +28,8 @@ import { mergeTwoSensesScenario, mergeTwoWordsScenario, } from "goals/MergeDuplicates/Redux/tests/MergeDupsDataMock"; -import { type StoreAction, StoreActionTypes } from "rootActions"; -import { setupStore } from "store"; +import { type StoreAction, StoreActionTypes } from "rootRedux/rootActions"; +import { setupStore } from "rootRedux/store"; import { type Hash } from "types/hash"; import { newFlag, testWordList } from "types/word"; diff --git a/src/goals/Redux/GoalActions.ts b/src/goals/Redux/GoalActions.ts index fa5705bc92..80d8a1ebe8 100644 --- a/src/goals/Redux/GoalActions.ts +++ b/src/goals/Redux/GoalActions.ts @@ -18,9 +18,11 @@ import { updateStepFromDataAction, } from "goals/Redux/GoalReducer"; import { EntryEdit } from "goals/ReviewEntries/ReviewEntriesTypes"; +import { + type StoreState, + type StoreStateDispatch, +} from "rootRedux/rootReduxTypes"; import router from "router/browserRouter"; -import { StoreState } from "types"; -import { StoreStateDispatch } from "types/Redux/actions"; import { Goal, GoalStatus, GoalType } from "types/goals"; import { Path } from "types/path"; import { convertEditToGoal, maxNumSteps } from "utilities/goalUtilities"; diff --git a/src/goals/Redux/GoalReducer.ts b/src/goals/Redux/GoalReducer.ts index c681c1ea1e..5b74fcab04 100644 --- a/src/goals/Redux/GoalReducer.ts +++ b/src/goals/Redux/GoalReducer.ts @@ -9,7 +9,7 @@ import { EntriesEdited, EntryEdit, } from "goals/ReviewEntries/ReviewEntriesTypes"; -import { StoreActionTypes } from "rootActions"; +import { StoreActionTypes } from "rootRedux/rootActions"; import { GoalType } from "types/goals"; const goalSlice = createSlice({ diff --git a/src/goals/ReviewEntries/ReviewEntriesCompleted.tsx b/src/goals/ReviewEntries/ReviewEntriesCompleted.tsx index 067acb0cfb..8cfa578927 100644 --- a/src/goals/ReviewEntries/ReviewEntriesCompleted.tsx +++ b/src/goals/ReviewEntries/ReviewEntriesCompleted.tsx @@ -12,7 +12,7 @@ import { EntriesEdited, EntryEdit, } from "goals/ReviewEntries/ReviewEntriesTypes"; -import { StoreState } from "types"; +import { type StoreState } from "rootRedux/rootReduxTypes"; import theme from "types/theme"; export default function ReviewEntriesCompleted(): ReactElement { diff --git a/src/goals/ReviewEntries/ReviewEntriesTable/Cells/EditCell/EditDialog.tsx b/src/goals/ReviewEntries/ReviewEntriesTable/Cells/EditCell/EditDialog.tsx index ee1d5fa16a..05b0f672ee 100644 --- a/src/goals/ReviewEntries/ReviewEntriesTable/Cells/EditCell/EditDialog.tsx +++ b/src/goals/ReviewEntries/ReviewEntriesTable/Cells/EditCell/EditDialog.tsx @@ -42,9 +42,12 @@ import { cleanWord, isSenseChanged, } from "goals/ReviewEntries/ReviewEntriesTable/Cells/EditCell/utilities"; -import { type StoreState } from "types"; -import { type StoreStateDispatch } from "types/Redux/actions"; -import { useAppDispatch, useAppSelector } from "types/hooks"; +import { + type StoreState, + useAppDispatch, + useAppSelector, +} from "rootRedux/hooks"; +import { type StoreStateDispatch } from "rootRedux/rootReduxTypes"; import { themeColors } from "types/theme"; import { type FileWithSpeakerId, diff --git a/src/goals/ReviewEntries/ReviewEntriesTable/Cells/EditCell/EditSenseDialog.tsx b/src/goals/ReviewEntries/ReviewEntriesTable/Cells/EditCell/EditSenseDialog.tsx index cb5f387770..8dec372190 100644 --- a/src/goals/ReviewEntries/ReviewEntriesTable/Cells/EditCell/EditSenseDialog.tsx +++ b/src/goals/ReviewEntries/ReviewEntriesTable/Cells/EditCell/EditSenseDialog.tsx @@ -38,8 +38,7 @@ import { areGlossesSame, cleanSense, } from "goals/ReviewEntries/ReviewEntriesTable/Cells/EditCell/utilities"; -import { type StoreState } from "types"; -import { useAppSelector } from "types/hooks"; +import { type StoreState, useAppSelector } from "rootRedux/hooks"; import { newSemanticDomainForMongoDB } from "types/semanticDomain"; import { newDefinition, newGloss } from "types/word"; import { TextFieldWithFont } from "utilities/fontComponents"; diff --git a/src/goals/ReviewEntries/ReviewEntriesTable/Cells/EditCell/tests/EditDialog.test.tsx b/src/goals/ReviewEntries/ReviewEntriesTable/Cells/EditCell/tests/EditDialog.test.tsx index 28db6f023f..e872403871 100644 --- a/src/goals/ReviewEntries/ReviewEntriesTable/Cells/EditCell/tests/EditDialog.test.tsx +++ b/src/goals/ReviewEntries/ReviewEntriesTable/Cells/EditCell/tests/EditDialog.test.tsx @@ -34,8 +34,8 @@ jest.mock( "goals/ReviewEntries/ReviewEntriesTable/Cells/EditCell/EditSenseDialog" ); jest.mock("i18n", () => ({})); -jest.mock("types/hooks", () => ({ - ...jest.requireActual("types/hooks"), +jest.mock("rootRedux/hooks", () => ({ + ...jest.requireActual("rootRedux/hooks"), useAppDispatch: () => mockDispatch, })); diff --git a/src/goals/ReviewEntries/ReviewEntriesTable/Cells/EditCell/tests/EditSenseDialog.test.tsx b/src/goals/ReviewEntries/ReviewEntriesTable/Cells/EditCell/tests/EditSenseDialog.test.tsx index 3de945432b..d0c92ddf24 100644 --- a/src/goals/ReviewEntries/ReviewEntriesTable/Cells/EditCell/tests/EditSenseDialog.test.tsx +++ b/src/goals/ReviewEntries/ReviewEntriesTable/Cells/EditCell/tests/EditSenseDialog.test.tsx @@ -8,7 +8,7 @@ import { defaultState } from "components/App/DefaultState"; import EditSenseDialog, { EditSenseDialogId, } from "goals/ReviewEntries/ReviewEntriesTable/Cells/EditCell/EditSenseDialog"; -import { type StoreState } from "types"; +import { type StoreState } from "rootRedux/rootReduxTypes"; import { newSense } from "types/word"; // Container uses Portal, not supported in react-test-renderer @@ -19,8 +19,8 @@ jest.mock("@mui/material/Dialog", () => jest.mock("@mui/material/TextField", () => "div"); jest.mock("components/TreeView", () => "div"); -jest.mock("types/hooks", () => ({ - ...jest.requireActual("types/hooks"), +jest.mock("rootRedux/hooks", () => ({ + ...jest.requireActual("rootRedux/hooks"), useAppDispatch: () => jest.fn(), })); diff --git a/src/goals/ReviewEntries/ReviewEntriesTable/index.tsx b/src/goals/ReviewEntries/ReviewEntriesTable/index.tsx index 9714f89043..9f2afbb800 100644 --- a/src/goals/ReviewEntries/ReviewEntriesTable/index.tsx +++ b/src/goals/ReviewEntries/ReviewEntriesTable/index.tsx @@ -22,9 +22,8 @@ import { topBarHeight } from "components/LandingPage/TopBar"; import * as Cell from "goals/ReviewEntries/ReviewEntriesTable/Cells"; import * as ff from "goals/ReviewEntries/ReviewEntriesTable/filterFn"; import * as sf from "goals/ReviewEntries/ReviewEntriesTable/sortingFn"; -import { type StoreState } from "types"; +import { type StoreState, useAppSelector } from "rootRedux/hooks"; import { type Hash } from "types/hash"; -import { useAppSelector } from "types/hooks"; /** Import `material-react-table` localization for given `lang`. * (See https://www.material-react-table.com/docs/guides/localization.) */ diff --git a/src/goals/ReviewEntries/ReviewEntriesTable/tests/index.test.tsx b/src/goals/ReviewEntries/ReviewEntriesTable/tests/index.test.tsx index f4644412fd..70adfc3217 100644 --- a/src/goals/ReviewEntries/ReviewEntriesTable/tests/index.test.tsx +++ b/src/goals/ReviewEntries/ReviewEntriesTable/tests/index.test.tsx @@ -11,7 +11,7 @@ import { mockWords, sortOrder, } from "goals/ReviewEntries/ReviewEntriesTable/tests/WordsMock"; -import { type StoreState } from "types"; +import { type StoreState } from "rootRedux/rootReduxTypes"; // With `columnFilterDisplayMode: "popover",`, it is necessary to mock out `Grow`. // To access filter `TextField`s, replace both `Grow`, `Modal` with `div`. @@ -38,8 +38,8 @@ jest.mock("backend", () => ({ })); jest.mock("components/Pronunciations/PronunciationsBackend"); jest.mock("i18n", () => ({})); -jest.mock("types/hooks", () => ({ - ...jest.requireActual("types/hooks"), +jest.mock("rootRedux/hooks", () => ({ + ...jest.requireActual("rootRedux/hooks"), useAppDispatch: () => jest.fn(), })); diff --git a/src/index.tsx b/src/index.tsx index d316812a60..ce9efbbfb2 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -6,7 +6,7 @@ import { PersistGate } from "redux-persist/integration/react"; import "i18n"; import App from "components/App/component"; -import { persistor, store } from "store"; +import { persistor, store } from "rootRedux/store"; import theme from "types/theme"; const container = document.getElementById("root"); diff --git a/src/types/hooks.ts b/src/rootRedux/hooks.ts similarity index 76% rename from src/types/hooks.ts rename to src/rootRedux/hooks.ts index 9fc96b4d63..5f728dfddf 100644 --- a/src/types/hooks.ts +++ b/src/rootRedux/hooks.ts @@ -4,7 +4,10 @@ import { useSelector, } from "react-redux"; -import { type AppDispatch, type RootState } from "store"; +import { type AppDispatch, type RootState } from "rootRedux/store"; + +// For use with useAppSelector +export { type StoreState } from "rootRedux/rootReduxTypes"; // Use throughout your app instead of plain `useDispatch` and `useSelector` // `useAppDispatch` and `useAppSelector` apply the additional types for TypeScript diff --git a/src/rootActions.ts b/src/rootRedux/rootActions.ts similarity index 100% rename from src/rootActions.ts rename to src/rootRedux/rootActions.ts diff --git a/src/rootReducer.ts b/src/rootRedux/rootReducer.ts similarity index 95% rename from src/rootReducer.ts rename to src/rootRedux/rootReducer.ts index 65787d8458..5c13ab60c0 100644 --- a/src/rootReducer.ts +++ b/src/rootRedux/rootReducer.ts @@ -8,7 +8,7 @@ import treeViewReducer from "components/TreeView/Redux/TreeViewReducer"; import characterInventoryReducer from "goals/CharacterInventory/Redux/CharacterInventoryReducer"; import mergeDupStepReducer from "goals/MergeDuplicates/Redux/MergeDupsReducer"; import goalsReducer from "goals/Redux/GoalReducer"; -import { type StoreState } from "types"; +import { type StoreState } from "rootRedux/rootReduxTypes"; import analyticsReducer from "types/Redux/analytics"; export const rootReducer: Reducer = combineReducers({ diff --git a/src/rootRedux/rootReduxTypes.ts b/src/rootRedux/rootReduxTypes.ts new file mode 100644 index 0000000000..d303ff301a --- /dev/null +++ b/src/rootRedux/rootReduxTypes.ts @@ -0,0 +1,86 @@ +import { type Action } from "redux"; +import { type ThunkDispatch } from "redux-thunk"; + +import { + type LoginState, + defaultState as loginState, +} from "components/Login/Redux/LoginReduxTypes"; +import { + type CurrentProjectState, + defaultState as currentProjectState, +} from "components/Project/ProjectReduxTypes"; +import { + type ExportProjectState, + defaultState as exportProjectState, +} from "components/ProjectExport/Redux/ExportProjectReduxTypes"; +import { + type PronunciationsState, + defaultState as pronunciationsState, +} from "components/Pronunciations/Redux/PronunciationsReduxTypes"; +import { + type TreeViewState, + defaultState as treeViewState, +} from "components/TreeView/Redux/TreeViewReduxTypes"; +import { + type CharacterInventoryState, + defaultState as characterInventoryState, +} from "goals/CharacterInventory/Redux/CharacterInventoryReduxTypes"; +import { + type MergeTreeState, + defaultState as mergeDuplicateGoal, +} from "goals/MergeDuplicates/Redux/MergeDupsReduxTypes"; +import { + type GoalsState, + defaultState as goalsState, +} from "goals/Redux/GoalReduxTypes"; +import { + type AnalyticsState, + defaultState as analyticsState, +} from "types/Redux/analyticsReduxTypes"; + +//root store structure +export interface StoreState { + //login + loginState: LoginState; + + //project + currentProjectState: CurrentProjectState; + exportProjectState: ExportProjectState; + + //data entry and review entries + treeViewState: TreeViewState; + pronunciationsState: PronunciationsState; + + //goal timeline and current goal + goalsState: GoalsState; + + //merge duplicates goal + mergeDuplicateGoal: MergeTreeState; + + //character inventory goal + characterInventoryState: CharacterInventoryState; + + //analytics state + analyticsState: AnalyticsState; +} + +export const defaultState: StoreState = { + loginState: { ...loginState }, + currentProjectState: { ...currentProjectState }, + exportProjectState: { ...exportProjectState }, + treeViewState: { ...treeViewState }, + pronunciationsState: { ...pronunciationsState }, + goalsState: { ...goalsState }, + mergeDuplicateGoal: { ...mergeDuplicateGoal }, + characterInventoryState: { ...characterInventoryState }, + analyticsState: { ...analyticsState }, +}; + +export interface ActionWithPayload extends Action { + payload: T; +} + +// https://redux.js.org/recipes/usage-with-typescript#usage-with-redux-thunk +// suggests a custom general type for ThunkAction, +// so in like fashion, here's one for ThunkDispatch: +export type StoreStateDispatch = ThunkDispatch; diff --git a/src/store.ts b/src/rootRedux/store.ts similarity index 96% rename from src/store.ts rename to src/rootRedux/store.ts index 1ad229bd2d..a09c36820f 100644 --- a/src/store.ts +++ b/src/rootRedux/store.ts @@ -2,7 +2,7 @@ import { type PreloadedState, configureStore } from "@reduxjs/toolkit"; import { persistStore, persistReducer } from "redux-persist"; import storage from "redux-persist/lib/storage"; -import { rootReducer } from "rootReducer"; +import { rootReducer } from "rootRedux/rootReducer"; const persistConfig = { key: "root", storage }; diff --git a/src/router/browserRouter.tsx b/src/router/browserRouter.tsx index bda27d67e6..59ad716f0d 100644 --- a/src/router/browserRouter.tsx +++ b/src/router/browserRouter.tsx @@ -1,7 +1,7 @@ import { createBrowserRouter } from "react-router-dom"; +import { store } from "rootRedux/store"; import { appRoutes } from "router/appRoutes"; -import { store } from "store"; import { changePage } from "types/Redux/analytics"; import { Path } from "types/path"; diff --git a/src/types/Redux/actions.ts b/src/types/Redux/actions.ts deleted file mode 100644 index 562bf7873b..0000000000 --- a/src/types/Redux/actions.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { Action } from "redux"; -import { ThunkDispatch } from "redux-thunk"; - -import { StoreState } from "types"; - -export interface ActionWithPayload extends Action { - payload: T; -} - -// https://redux.js.org/recipes/usage-with-typescript#usage-with-redux-thunk -// suggests a custom general type for ThunkAction, -// so in like fashion, here's one for ThunkDispatch: -export type StoreStateDispatch = ThunkDispatch; diff --git a/src/types/Redux/analytics.ts b/src/types/Redux/analytics.ts index 930d6af320..72ddc7e8ae 100644 --- a/src/types/Redux/analytics.ts +++ b/src/types/Redux/analytics.ts @@ -1,6 +1,6 @@ import { PayloadAction, createSlice } from "@reduxjs/toolkit"; -import { StoreActionTypes } from "rootActions"; +import { StoreActionTypes } from "rootRedux/rootActions"; import { defaultState } from "types/Redux/analyticsReduxTypes"; const analyticsSlice = createSlice({ diff --git a/src/types/index.ts b/src/types/index.ts deleted file mode 100644 index 7f7ff64ae4..0000000000 --- a/src/types/index.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { LoginState } from "components/Login/Redux/LoginReduxTypes"; -import { CurrentProjectState } from "components/Project/ProjectReduxTypes"; -import { ExportProjectState } from "components/ProjectExport/Redux/ExportProjectReduxTypes"; -import { PronunciationsState } from "components/Pronunciations/Redux/PronunciationsReduxTypes"; -import { TreeViewState } from "components/TreeView/Redux/TreeViewReduxTypes"; -import { CharacterInventoryState } from "goals/CharacterInventory/Redux/CharacterInventoryReduxTypes"; -import { MergeTreeState } from "goals/MergeDuplicates/Redux/MergeDupsReduxTypes"; -import { GoalsState } from "goals/Redux/GoalReduxTypes"; -import { AnalyticsState } from "types/Redux/analyticsReduxTypes"; - -//root store structure -export interface StoreState { - //login - loginState: LoginState; - - //project - currentProjectState: CurrentProjectState; - exportProjectState: ExportProjectState; - - //data entry and review entries - treeViewState: TreeViewState; - pronunciationsState: PronunciationsState; - - //goal timeline and current goal - goalsState: GoalsState; - - //merge duplicates goal - mergeDuplicateGoal: MergeTreeState; - - //character inventory goal - characterInventoryState: CharacterInventoryState; - - //analytics state - analyticsState: AnalyticsState; -} diff --git a/src/utilities/testingLibraryUtilities.tsx b/src/utilities/testingLibraryUtilities.tsx index 3eb1d7f7aa..6ccb5eac9b 100644 --- a/src/utilities/testingLibraryUtilities.tsx +++ b/src/utilities/testingLibraryUtilities.tsx @@ -5,7 +5,12 @@ import { Provider } from "react-redux"; import { PersistGate } from "redux-persist/integration/react"; import { defaultState } from "components/App/DefaultState"; -import { type AppStore, type RootState, persistor, setupStore } from "store"; +import { + type AppStore, + type RootState, + persistor, + setupStore, +} from "rootRedux/store"; /** This extends the default options for `render` from `@testing-library/react`, * allowing the user to specify other things such as `initialState`, `store`. */ From 112a4d8b17f736fd689466a0d1bc9c06a29ea799 Mon Sep 17 00:00:00 2001 From: Danny Rorabaugh Date: Wed, 10 Apr 2024 14:30:51 -0400 Subject: [PATCH 2/7] Retract one change to ease review --- src/components/AnnouncementBanner/AnnouncementBanner.tsx | 3 ++- src/components/App/AppLoggedIn.tsx | 3 ++- src/components/App/SignalRHub.tsx | 7 ++----- src/components/AppBar/NavigationButtons.tsx | 3 ++- src/components/AppBar/SpeakerMenu.tsx | 3 ++- src/components/DataEntry/DataEntryTable/index.tsx | 3 ++- src/components/DataEntry/index.tsx | 7 ++----- src/components/GoalTimeline/index.tsx | 7 ++----- src/components/Login/Login.tsx | 7 ++----- src/components/Login/Signup.tsx | 7 ++----- src/components/ProjectExport/DownloadButton.tsx | 7 ++----- src/components/ProjectExport/ExportButton.tsx | 7 ++----- src/components/ProjectSettings/index.tsx | 7 ++----- src/components/ProjectUsers/ActiveProjectUsers.tsx | 3 ++- src/components/ProjectUsers/AddProjectUsers.tsx | 7 ++----- src/components/Pronunciations/AudioPlayer.tsx | 7 ++----- src/components/Pronunciations/AudioRecorder.tsx | 3 ++- src/components/Pronunciations/RecorderIcon.tsx | 7 ++----- src/components/TreeView/index.tsx | 7 ++----- src/components/WordCard/DomainChipsGrid.tsx | 3 ++- src/goals/CharacterInventory/CharInv/CharacterEntry.tsx | 7 ++----- .../CharacterInventory/CharInv/CharacterList/index.tsx | 7 ++----- src/goals/CharacterInventory/CharInv/index.tsx | 7 ++----- src/goals/CharacterInventory/CharInvCompleted.tsx | 3 ++- src/goals/DefaultGoal/BaseGoalScreen.tsx | 7 ++----- src/goals/DefaultGoal/NextGoalScreen.tsx | 7 ++----- .../MergeDupsStep/MergeDragDrop/DragSense.tsx | 7 ++----- .../MergeDupsStep/MergeDragDrop/DropWord.tsx | 7 ++----- .../MergeDupsStep/MergeDragDrop/SidebarDragSense.tsx | 3 ++- .../MergeDupsStep/MergeDragDrop/SidebarDrop.tsx | 7 ++----- .../MergeDuplicates/MergeDupsStep/MergeDragDrop/index.tsx | 7 ++----- src/goals/MergeDuplicates/MergeDupsStep/index.tsx | 3 ++- .../ReviewEntriesTable/Cells/EditCell/EditDialog.tsx | 7 +++---- .../ReviewEntriesTable/Cells/EditCell/EditSenseDialog.tsx | 3 ++- src/goals/ReviewEntries/ReviewEntriesTable/index.tsx | 3 ++- src/rootRedux/hooks.ts | 3 --- 36 files changed, 71 insertions(+), 125 deletions(-) diff --git a/src/components/AnnouncementBanner/AnnouncementBanner.tsx b/src/components/AnnouncementBanner/AnnouncementBanner.tsx index f6dc6922f5..048cf30531 100644 --- a/src/components/AnnouncementBanner/AnnouncementBanner.tsx +++ b/src/components/AnnouncementBanner/AnnouncementBanner.tsx @@ -13,7 +13,8 @@ import { BannerType } from "api/models"; import { getBannerText } from "backend"; import { getClosedBanner, setClosedBanner } from "backend/localStorage"; import { topBarHeight } from "components/LandingPage/TopBar"; -import { type StoreState, useAppSelector } from "rootRedux/hooks"; +import { useAppSelector } from "rootRedux/hooks"; +import { type StoreState } from "rootRedux/rootReduxTypes"; import { Path } from "types/path"; import theme, { themeColors } from "types/theme"; diff --git a/src/components/App/AppLoggedIn.tsx b/src/components/App/AppLoggedIn.tsx index 97fdf8e53b..808850bbb7 100644 --- a/src/components/App/AppLoggedIn.tsx +++ b/src/components/App/AppLoggedIn.tsx @@ -15,7 +15,8 @@ import Statistics from "components/Statistics/Statistics"; import UserSettings from "components/UserSettings/UserSettings"; import NextGoalScreen from "goals/DefaultGoal/NextGoalScreen"; import { updateLangFromUser } from "i18n"; -import { type StoreState, useAppSelector } from "rootRedux/hooks"; +import { useAppSelector } from "rootRedux/hooks"; +import { type StoreState } from "rootRedux/rootReduxTypes"; import { Path } from "types/path"; import FontContext, { ProjectFonts } from "utilities/fontContext"; import { getProjCss } from "utilities/fontCssUtilities"; diff --git a/src/components/App/SignalRHub.tsx b/src/components/App/SignalRHub.tsx index 82a0b9cb7e..00e75b7ffd 100644 --- a/src/components/App/SignalRHub.tsx +++ b/src/components/App/SignalRHub.tsx @@ -18,11 +18,8 @@ import { success, } from "components/ProjectExport/Redux/ExportProjectActions"; import { ExportStatus } from "components/ProjectExport/Redux/ExportProjectReduxTypes"; -import { - type StoreState, - useAppDispatch, - useAppSelector, -} from "rootRedux/hooks"; +import { useAppDispatch, useAppSelector } from "rootRedux/hooks"; +import { type StoreState } from "rootRedux/rootReduxTypes"; /** A central hub for monitoring export status on SignalR */ export default function SignalRHub(): ReactElement { diff --git a/src/components/AppBar/NavigationButtons.tsx b/src/components/AppBar/NavigationButtons.tsx index c3e02543c2..6f806c3ae3 100644 --- a/src/components/AppBar/NavigationButtons.tsx +++ b/src/components/AppBar/NavigationButtons.tsx @@ -12,7 +12,8 @@ import { buttonMinHeight, tabColor, } from "components/AppBar/AppBarTypes"; -import { type StoreState, useAppSelector } from "rootRedux/hooks"; +import { useAppSelector } from "rootRedux/hooks"; +import { type StoreState } from "rootRedux/rootReduxTypes"; import { Path } from "types/path"; import { useWindowSize } from "utilities/useWindowSize"; diff --git a/src/components/AppBar/SpeakerMenu.tsx b/src/components/AppBar/SpeakerMenu.tsx index 9eacbf166b..8fe3b82667 100644 --- a/src/components/AppBar/SpeakerMenu.tsx +++ b/src/components/AppBar/SpeakerMenu.tsx @@ -23,7 +23,8 @@ import { Speaker } from "api"; import { getAllSpeakers } from "backend"; import { buttonMinHeight } from "components/AppBar/AppBarTypes"; import { setCurrentSpeaker } from "components/Project/ProjectActions"; -import { type StoreState, useAppDispatch } from "rootRedux/hooks"; +import { useAppDispatch } from "rootRedux/hooks"; +import { type StoreState } from "rootRedux/rootReduxTypes"; import { themeColors } from "types/theme"; const idAffix = "speaker-menu"; diff --git a/src/components/DataEntry/DataEntryTable/index.tsx b/src/components/DataEntry/DataEntryTable/index.tsx index d266cba138..4e8a8e1234 100644 --- a/src/components/DataEntry/DataEntryTable/index.tsx +++ b/src/components/DataEntry/DataEntryTable/index.tsx @@ -31,7 +31,8 @@ import NewEntry from "components/DataEntry/DataEntryTable/NewEntry"; import RecentEntry from "components/DataEntry/DataEntryTable/RecentEntry"; import { filterWordsWithSenses } from "components/DataEntry/utilities"; import { uploadFileFromPronunciation } from "components/Pronunciations/utilities"; -import { type StoreState, useAppSelector } from "rootRedux/hooks"; +import { useAppSelector } from "rootRedux/hooks"; +import { type StoreState } from "rootRedux/rootReduxTypes"; import { type Hash } from "types/hash"; import theme from "types/theme"; import { diff --git a/src/components/DataEntry/index.tsx b/src/components/DataEntry/index.tsx index bbc787aa9d..fc68dc5adb 100644 --- a/src/components/DataEntry/index.tsx +++ b/src/components/DataEntry/index.tsx @@ -16,11 +16,8 @@ import ExistingDataTable from "components/DataEntry/ExistingDataTable"; import { filterWordsByDomain } from "components/DataEntry/utilities"; import TreeView from "components/TreeView"; import { closeTree, openTree } from "components/TreeView/Redux/TreeViewActions"; -import { - type StoreState, - useAppDispatch, - useAppSelector, -} from "rootRedux/hooks"; +import { useAppDispatch, useAppSelector } from "rootRedux/hooks"; +import { type StoreState } from "rootRedux/rootReduxTypes"; import { newSemanticDomain } from "types/semanticDomain"; import theme from "types/theme"; import { DomainWord } from "types/word"; diff --git a/src/components/GoalTimeline/index.tsx b/src/components/GoalTimeline/index.tsx index 32820017cf..f248ca0615 100644 --- a/src/components/GoalTimeline/index.tsx +++ b/src/components/GoalTimeline/index.tsx @@ -11,11 +11,8 @@ import { useTranslation } from "react-i18next"; import { getCurrentPermissions, getGraylistEntries } from "backend"; import GoalList from "components/GoalTimeline/GoalList"; import { asyncAddGoal, asyncGetUserEdits } from "goals/Redux/GoalActions"; -import { - type StoreState, - useAppDispatch, - useAppSelector, -} from "rootRedux/hooks"; +import { useAppDispatch, useAppSelector } from "rootRedux/hooks"; +import { type StoreState } from "rootRedux/rootReduxTypes"; import { Goal, GoalType } from "types/goals"; import { requiredPermission, goalTypeToGoal } from "utilities/goalUtilities"; import { useWindowSize } from "utilities/useWindowSize"; diff --git a/src/components/Login/Login.tsx b/src/components/Login/Login.tsx index 591fcf5c35..2c578b86da 100644 --- a/src/components/Login/Login.tsx +++ b/src/components/Login/Login.tsx @@ -24,12 +24,9 @@ import { LoadingButton } from "components/Buttons"; import Captcha from "components/Login/Captcha"; import { asyncLogIn } from "components/Login/Redux/LoginActions"; import { LoginStatus } from "components/Login/Redux/LoginReduxTypes"; -import { - type StoreState, - useAppDispatch, - useAppSelector, -} from "rootRedux/hooks"; +import { useAppDispatch, useAppSelector } from "rootRedux/hooks"; import { reset } from "rootRedux/rootActions"; +import { type StoreState } from "rootRedux/rootReduxTypes"; import router from "router/browserRouter"; import { Path } from "types/path"; import { RuntimeConfig } from "types/runtimeConfig"; diff --git a/src/components/Login/Signup.tsx b/src/components/Login/Signup.tsx index 79e54b9265..2a94a97cbe 100644 --- a/src/components/Login/Signup.tsx +++ b/src/components/Login/Signup.tsx @@ -20,12 +20,9 @@ import { LoadingDoneButton } from "components/Buttons"; import Captcha from "components/Login/Captcha"; import { asyncSignUp } from "components/Login/Redux/LoginActions"; import { LoginStatus } from "components/Login/Redux/LoginReduxTypes"; -import { - type StoreState, - useAppDispatch, - useAppSelector, -} from "rootRedux/hooks"; +import { useAppDispatch, useAppSelector } from "rootRedux/hooks"; import { reset } from "rootRedux/rootActions"; +import { type StoreState } from "rootRedux/rootReduxTypes"; import router from "router/browserRouter"; import { Path } from "types/path"; import { RuntimeConfig } from "types/runtimeConfig"; diff --git a/src/components/ProjectExport/DownloadButton.tsx b/src/components/ProjectExport/DownloadButton.tsx index e0bff83e80..be1c5b471a 100644 --- a/src/components/ProjectExport/DownloadButton.tsx +++ b/src/components/ProjectExport/DownloadButton.tsx @@ -16,11 +16,8 @@ import { asyncResetExport, } from "components/ProjectExport/Redux/ExportProjectActions"; import { ExportStatus } from "components/ProjectExport/Redux/ExportProjectReduxTypes"; -import { - type StoreState, - useAppDispatch, - useAppSelector, -} from "rootRedux/hooks"; +import { useAppDispatch, useAppSelector } from "rootRedux/hooks"; +import { type StoreState } from "rootRedux/rootReduxTypes"; import { themeColors } from "types/theme"; import { getDateTimeString } from "utilities/utilities"; diff --git a/src/components/ProjectExport/ExportButton.tsx b/src/components/ProjectExport/ExportButton.tsx index aa12756ddf..4645e63fd1 100644 --- a/src/components/ProjectExport/ExportButton.tsx +++ b/src/components/ProjectExport/ExportButton.tsx @@ -7,11 +7,8 @@ import { isFrontierNonempty } from "backend"; import { LoadingButton } from "components/Buttons"; import { asyncExportProject } from "components/ProjectExport/Redux/ExportProjectActions"; import { ExportStatus } from "components/ProjectExport/Redux/ExportProjectReduxTypes"; -import { - type StoreState, - useAppDispatch, - useAppSelector, -} from "rootRedux/hooks"; +import { useAppDispatch, useAppSelector } from "rootRedux/hooks"; +import { type StoreState } from "rootRedux/rootReduxTypes"; interface ExportButtonProps { projectId: string; diff --git a/src/components/ProjectSettings/index.tsx b/src/components/ProjectSettings/index.tsx index 7f5fe793a6..d43ab7685b 100644 --- a/src/components/ProjectSettings/index.tsx +++ b/src/components/ProjectSettings/index.tsx @@ -52,11 +52,8 @@ import ProjectSelect from "components/ProjectSettings/ProjectSelect"; import ActiveProjectUsers from "components/ProjectUsers/ActiveProjectUsers"; import AddProjectUsers from "components/ProjectUsers/AddProjectUsers"; import ProjectSpeakersList from "components/ProjectUsers/ProjectSpeakersList"; -import { - type StoreState, - useAppDispatch, - useAppSelector, -} from "rootRedux/hooks"; +import { useAppDispatch, useAppSelector } from "rootRedux/hooks"; +import { type StoreState } from "rootRedux/rootReduxTypes"; import { Path } from "types/path"; export enum ProjectSettingsTab { diff --git a/src/components/ProjectUsers/ActiveProjectUsers.tsx b/src/components/ProjectUsers/ActiveProjectUsers.tsx index c081929eef..4f7ef2e639 100644 --- a/src/components/ProjectUsers/ActiveProjectUsers.tsx +++ b/src/components/ProjectUsers/ActiveProjectUsers.tsx @@ -25,7 +25,8 @@ import SortOptions, { UserOrder, getUserCompare, } from "components/ProjectUsers/SortOptions"; -import { type StoreState, useAppSelector } from "rootRedux/hooks"; +import { useAppSelector } from "rootRedux/hooks"; +import { type StoreState } from "rootRedux/rootReduxTypes"; import { type Hash } from "types/hash"; import theme from "types/theme"; diff --git a/src/components/ProjectUsers/AddProjectUsers.tsx b/src/components/ProjectUsers/AddProjectUsers.tsx index 0f83028bdb..a2c23c5463 100644 --- a/src/components/ProjectUsers/AddProjectUsers.tsx +++ b/src/components/ProjectUsers/AddProjectUsers.tsx @@ -9,11 +9,8 @@ import * as backend from "backend"; import { asyncRefreshProjectUsers } from "components/Project/ProjectActions"; import EmailInvite from "components/ProjectUsers/EmailInvite"; import UserList from "components/ProjectUsers/UserList"; -import { - type StoreState, - useAppDispatch, - useAppSelector, -} from "rootRedux/hooks"; +import { useAppDispatch, useAppSelector } from "rootRedux/hooks"; +import { type StoreState } from "rootRedux/rootReduxTypes"; import { RuntimeConfig } from "types/runtimeConfig"; const customStyles = { diff --git a/src/components/Pronunciations/AudioPlayer.tsx b/src/components/Pronunciations/AudioPlayer.tsx index b81dbba2ed..74da431be1 100644 --- a/src/components/Pronunciations/AudioPlayer.tsx +++ b/src/components/Pronunciations/AudioPlayer.tsx @@ -29,11 +29,8 @@ import { resetPronunciations, } from "components/Pronunciations/Redux/PronunciationsActions"; import { PronunciationsStatus } from "components/Pronunciations/Redux/PronunciationsReduxTypes"; -import { - type StoreState, - useAppDispatch, - useAppSelector, -} from "rootRedux/hooks"; +import { useAppDispatch, useAppSelector } from "rootRedux/hooks"; +import { type StoreState } from "rootRedux/rootReduxTypes"; interface PlayerProps { audio: Pronunciation; diff --git a/src/components/Pronunciations/AudioRecorder.tsx b/src/components/Pronunciations/AudioRecorder.tsx index 562c5d503a..37380838bd 100644 --- a/src/components/Pronunciations/AudioRecorder.tsx +++ b/src/components/Pronunciations/AudioRecorder.tsx @@ -6,7 +6,8 @@ import Recorder from "components/Pronunciations/Recorder"; import RecorderContext from "components/Pronunciations/RecorderContext"; import RecorderIcon from "components/Pronunciations/RecorderIcon"; import { getFileNameForWord } from "components/Pronunciations/utilities"; -import { type StoreState, useAppSelector } from "rootRedux/hooks"; +import { useAppSelector } from "rootRedux/hooks"; +import { type StoreState } from "rootRedux/rootReduxTypes"; import { FileWithSpeakerId } from "types/word"; interface RecorderProps { diff --git a/src/components/Pronunciations/RecorderIcon.tsx b/src/components/Pronunciations/RecorderIcon.tsx index 20a3479273..7b250fff44 100644 --- a/src/components/Pronunciations/RecorderIcon.tsx +++ b/src/components/Pronunciations/RecorderIcon.tsx @@ -8,11 +8,8 @@ import { resetPronunciations, } from "components/Pronunciations/Redux/PronunciationsActions"; import { PronunciationsStatus } from "components/Pronunciations/Redux/PronunciationsReduxTypes"; -import { - type StoreState, - useAppDispatch, - useAppSelector, -} from "rootRedux/hooks"; +import { useAppDispatch, useAppSelector } from "rootRedux/hooks"; +import { type StoreState } from "rootRedux/rootReduxTypes"; import { themeColors } from "types/theme"; export const recordButtonId = "recordingButton"; diff --git a/src/components/TreeView/index.tsx b/src/components/TreeView/index.tsx index 81ec3cf416..b61da5d384 100644 --- a/src/components/TreeView/index.tsx +++ b/src/components/TreeView/index.tsx @@ -16,11 +16,8 @@ import { defaultTreeNode } from "components/TreeView/Redux/TreeViewReduxTypes"; import TreeDepiction from "components/TreeView/TreeDepiction"; import TreeNavigator from "components/TreeView/TreeNavigator"; import TreeSearch from "components/TreeView/TreeSearch"; -import { - type StoreState, - useAppDispatch, - useAppSelector, -} from "rootRedux/hooks"; +import { useAppDispatch, useAppSelector } from "rootRedux/hooks"; +import { type StoreState } from "rootRedux/rootReduxTypes"; import { newSemanticDomain } from "types/semanticDomain"; import { semDomWritingSystems } from "types/writingSystem"; diff --git a/src/components/WordCard/DomainChipsGrid.tsx b/src/components/WordCard/DomainChipsGrid.tsx index 5fb4b654a5..126ff9a7d1 100644 --- a/src/components/WordCard/DomainChipsGrid.tsx +++ b/src/components/WordCard/DomainChipsGrid.tsx @@ -3,7 +3,8 @@ import { type ReactElement } from "react"; import { type SemanticDomain } from "api/models"; import DomainChip from "components/WordCard/DomainChip"; -import { type StoreState, useAppSelector } from "rootRedux/hooks"; +import { useAppSelector } from "rootRedux/hooks"; +import { type StoreState } from "rootRedux/rootReduxTypes"; interface DomainChipsGridProps { semDoms: SemanticDomain[]; diff --git a/src/goals/CharacterInventory/CharInv/CharacterEntry.tsx b/src/goals/CharacterInventory/CharInv/CharacterEntry.tsx index cfd7675c48..bc4a70a06c 100644 --- a/src/goals/CharacterInventory/CharInv/CharacterEntry.tsx +++ b/src/goals/CharacterInventory/CharInv/CharacterEntry.tsx @@ -7,11 +7,8 @@ import { setRejectedCharacters, setValidCharacters, } from "goals/CharacterInventory/Redux/CharacterInventoryActions"; -import { - type StoreState, - useAppDispatch, - useAppSelector, -} from "rootRedux/hooks"; +import { useAppDispatch, useAppSelector } from "rootRedux/hooks"; +import { type StoreState } from "rootRedux/rootReduxTypes"; import theme from "types/theme"; import { TextFieldWithFont } from "utilities/fontComponents"; diff --git a/src/goals/CharacterInventory/CharInv/CharacterList/index.tsx b/src/goals/CharacterInventory/CharInv/CharacterList/index.tsx index 7933872f3c..4e8e2e6aeb 100644 --- a/src/goals/CharacterInventory/CharInv/CharacterList/index.tsx +++ b/src/goals/CharacterInventory/CharInv/CharacterList/index.tsx @@ -6,11 +6,8 @@ import { useTranslation } from "react-i18next"; import CharacterCard from "goals/CharacterInventory/CharInv/CharacterList/CharacterCard"; import { setSelectedCharacter } from "goals/CharacterInventory/Redux/CharacterInventoryActions"; import { CharacterSetEntry } from "goals/CharacterInventory/Redux/CharacterInventoryReduxTypes"; -import { - type StoreState, - useAppDispatch, - useAppSelector, -} from "rootRedux/hooks"; +import { useAppDispatch, useAppSelector } from "rootRedux/hooks"; +import { type StoreState } from "rootRedux/rootReduxTypes"; enum SortOrder { CharacterAscending, diff --git a/src/goals/CharacterInventory/CharInv/index.tsx b/src/goals/CharacterInventory/CharInv/index.tsx index ef1eb219e3..6ed98ad16f 100644 --- a/src/goals/CharacterInventory/CharInv/index.tsx +++ b/src/goals/CharacterInventory/CharInv/index.tsx @@ -22,11 +22,8 @@ import { setSelectedCharacter, uploadInventory, } from "goals/CharacterInventory/Redux/CharacterInventoryActions"; -import { - type StoreState, - useAppDispatch, - useAppSelector, -} from "rootRedux/hooks"; +import { useAppDispatch, useAppSelector } from "rootRedux/hooks"; +import { type StoreState } from "rootRedux/rootReduxTypes"; import theme from "types/theme"; const idPrefix = "character-inventory"; diff --git a/src/goals/CharacterInventory/CharInvCompleted.tsx b/src/goals/CharacterInventory/CharInvCompleted.tsx index 29f8f7c186..0d717147f7 100644 --- a/src/goals/CharacterInventory/CharInvCompleted.tsx +++ b/src/goals/CharacterInventory/CharInvCompleted.tsx @@ -14,7 +14,8 @@ import { type FindAndReplaceChange, defaultCharInvChanges, } from "goals/CharacterInventory/CharacterInventoryTypes"; -import { type StoreState, useAppSelector } from "rootRedux/hooks"; +import { useAppSelector } from "rootRedux/hooks"; +import { type StoreState } from "rootRedux/rootReduxTypes"; export enum CharInvCompletedId { TypographyNoCharChanges = "no-char-changes-typography", diff --git a/src/goals/DefaultGoal/BaseGoalScreen.tsx b/src/goals/DefaultGoal/BaseGoalScreen.tsx index 9453b3ebef..dfc449e46a 100644 --- a/src/goals/DefaultGoal/BaseGoalScreen.tsx +++ b/src/goals/DefaultGoal/BaseGoalScreen.tsx @@ -7,11 +7,8 @@ import DisplayProgress from "goals/DefaultGoal/DisplayProgress"; import Loading from "goals/DefaultGoal/Loading"; import { clearTree } from "goals/MergeDuplicates/Redux/MergeDupsActions"; import { setCurrentGoal } from "goals/Redux/GoalActions"; -import { - type StoreState, - useAppDispatch, - useAppSelector, -} from "rootRedux/hooks"; +import { useAppDispatch, useAppSelector } from "rootRedux/hooks"; +import { type StoreState } from "rootRedux/rootReduxTypes"; import { Goal, GoalStatus, GoalType } from "types/goals"; import { Path } from "types/path"; diff --git a/src/goals/DefaultGoal/NextGoalScreen.tsx b/src/goals/DefaultGoal/NextGoalScreen.tsx index 4fcacedf29..91a168a070 100644 --- a/src/goals/DefaultGoal/NextGoalScreen.tsx +++ b/src/goals/DefaultGoal/NextGoalScreen.tsx @@ -4,11 +4,8 @@ import { useNavigate } from "react-router-dom"; import PageNotFound from "components/PageNotFound/component"; import MergeDupsContinueDialog from "goals/MergeDuplicates/MergeDupsContinueDialog"; import { asyncAddGoal } from "goals/Redux/GoalActions"; -import { - type StoreState, - useAppDispatch, - useAppSelector, -} from "rootRedux/hooks"; +import { useAppDispatch, useAppSelector } from "rootRedux/hooks"; +import { type StoreState } from "rootRedux/rootReduxTypes"; import { GoalType } from "types/goals"; import { Path } from "types/path"; import { goalTypeToGoal } from "utilities/goalUtilities"; diff --git a/src/goals/MergeDuplicates/MergeDupsStep/MergeDragDrop/DragSense.tsx b/src/goals/MergeDuplicates/MergeDupsStep/MergeDragDrop/DragSense.tsx index d5a03246a7..12af348b21 100644 --- a/src/goals/MergeDuplicates/MergeDupsStep/MergeDragDrop/DragSense.tsx +++ b/src/goals/MergeDuplicates/MergeDupsStep/MergeDragDrop/DragSense.tsx @@ -6,11 +6,8 @@ import { trashId } from "goals/MergeDuplicates/MergeDupsStep/MergeDragDrop"; import SenseCardContent from "goals/MergeDuplicates/MergeDupsStep/SenseCardContent"; import { MergeTreeSense } from "goals/MergeDuplicates/MergeDupsTreeTypes"; import { setSidebar } from "goals/MergeDuplicates/Redux/MergeDupsActions"; -import { - type StoreState, - useAppDispatch, - useAppSelector, -} from "rootRedux/hooks"; +import { useAppDispatch, useAppSelector } from "rootRedux/hooks"; +import { type StoreState } from "rootRedux/rootReduxTypes"; import theme from "types/theme"; interface DragSenseProps { diff --git a/src/goals/MergeDuplicates/MergeDupsStep/MergeDragDrop/DropWord.tsx b/src/goals/MergeDuplicates/MergeDupsStep/MergeDragDrop/DropWord.tsx index 5bc4aace65..b476acec2c 100644 --- a/src/goals/MergeDuplicates/MergeDupsStep/MergeDragDrop/DropWord.tsx +++ b/src/goals/MergeDuplicates/MergeDupsStep/MergeDragDrop/DropWord.tsx @@ -20,11 +20,8 @@ import { flagWord, setVern, } from "goals/MergeDuplicates/Redux/MergeDupsActions"; -import { - type StoreState, - useAppDispatch, - useAppSelector, -} from "rootRedux/hooks"; +import { useAppDispatch, useAppSelector } from "rootRedux/hooks"; +import { type StoreState } from "rootRedux/rootReduxTypes"; import theme from "types/theme"; import { TypographyWithFont } from "utilities/fontComponents"; diff --git a/src/goals/MergeDuplicates/MergeDupsStep/MergeDragDrop/SidebarDragSense.tsx b/src/goals/MergeDuplicates/MergeDupsStep/MergeDragDrop/SidebarDragSense.tsx index 009f6dfb78..cbbf441499 100644 --- a/src/goals/MergeDuplicates/MergeDupsStep/MergeDragDrop/SidebarDragSense.tsx +++ b/src/goals/MergeDuplicates/MergeDupsStep/MergeDragDrop/SidebarDragSense.tsx @@ -8,7 +8,8 @@ import { MergeTreeReference, MergeTreeSense, } from "goals/MergeDuplicates/MergeDupsTreeTypes"; -import { type StoreState, useAppSelector } from "rootRedux/hooks"; +import { useAppSelector } from "rootRedux/hooks"; +import { type StoreState } from "rootRedux/rootReduxTypes"; import theme from "types/theme"; interface SidebarDragSenseProps { diff --git a/src/goals/MergeDuplicates/MergeDupsStep/MergeDragDrop/SidebarDrop.tsx b/src/goals/MergeDuplicates/MergeDupsStep/MergeDragDrop/SidebarDrop.tsx index 263637fe03..fe051af357 100644 --- a/src/goals/MergeDuplicates/MergeDupsStep/MergeDragDrop/SidebarDrop.tsx +++ b/src/goals/MergeDuplicates/MergeDupsStep/MergeDragDrop/SidebarDrop.tsx @@ -6,11 +6,8 @@ import { Droppable } from "react-beautiful-dnd"; import SidebarDragSense from "goals/MergeDuplicates/MergeDupsStep/MergeDragDrop/SidebarDragSense"; import { MergeTreeSense } from "goals/MergeDuplicates/MergeDupsTreeTypes"; import { setSidebar } from "goals/MergeDuplicates/Redux/MergeDupsActions"; -import { - type StoreState, - useAppDispatch, - useAppSelector, -} from "rootRedux/hooks"; +import { useAppDispatch, useAppSelector } from "rootRedux/hooks"; +import { type StoreState } from "rootRedux/rootReduxTypes"; import { openUserGuide } from "utilities/pathUtilities"; export default function SidebarDrop(): ReactElement { diff --git a/src/goals/MergeDuplicates/MergeDupsStep/MergeDragDrop/index.tsx b/src/goals/MergeDuplicates/MergeDupsStep/MergeDragDrop/index.tsx index 130cd15572..dc90679438 100644 --- a/src/goals/MergeDuplicates/MergeDupsStep/MergeDragDrop/index.tsx +++ b/src/goals/MergeDuplicates/MergeDupsStep/MergeDragDrop/index.tsx @@ -16,11 +16,8 @@ import { moveSense, orderSense, } from "goals/MergeDuplicates/Redux/MergeDupsActions"; -import { - type StoreState, - useAppDispatch, - useAppSelector, -} from "rootRedux/hooks"; +import { useAppDispatch, useAppSelector } from "rootRedux/hooks"; +import { type StoreState } from "rootRedux/rootReduxTypes"; import theme from "types/theme"; export const trashId = "trash-drop"; diff --git a/src/goals/MergeDuplicates/MergeDupsStep/index.tsx b/src/goals/MergeDuplicates/MergeDupsStep/index.tsx index 886a63629d..43cafcd5f6 100644 --- a/src/goals/MergeDuplicates/MergeDupsStep/index.tsx +++ b/src/goals/MergeDuplicates/MergeDupsStep/index.tsx @@ -4,7 +4,8 @@ import { useTranslation } from "react-i18next"; import MergeDragDrop from "goals/MergeDuplicates/MergeDupsStep/MergeDragDrop"; import SaveDeferButtons from "goals/MergeDuplicates/MergeDupsStep/SaveDeferButtons"; -import { type StoreState, useAppSelector } from "rootRedux/hooks"; +import { useAppSelector } from "rootRedux/hooks"; +import { type StoreState } from "rootRedux/rootReduxTypes"; import theme from "types/theme"; export default function MergeDupsStep(): ReactElement { diff --git a/src/goals/ReviewEntries/ReviewEntriesTable/Cells/EditCell/EditDialog.tsx b/src/goals/ReviewEntries/ReviewEntriesTable/Cells/EditCell/EditDialog.tsx index 05b0f672ee..b325a07583 100644 --- a/src/goals/ReviewEntries/ReviewEntriesTable/Cells/EditCell/EditDialog.tsx +++ b/src/goals/ReviewEntries/ReviewEntriesTable/Cells/EditCell/EditDialog.tsx @@ -42,12 +42,11 @@ import { cleanWord, isSenseChanged, } from "goals/ReviewEntries/ReviewEntriesTable/Cells/EditCell/utilities"; +import { useAppDispatch, useAppSelector } from "rootRedux/hooks"; import { type StoreState, - useAppDispatch, - useAppSelector, -} from "rootRedux/hooks"; -import { type StoreStateDispatch } from "rootRedux/rootReduxTypes"; + type StoreStateDispatch, +} from "rootRedux/rootReduxTypes"; import { themeColors } from "types/theme"; import { type FileWithSpeakerId, diff --git a/src/goals/ReviewEntries/ReviewEntriesTable/Cells/EditCell/EditSenseDialog.tsx b/src/goals/ReviewEntries/ReviewEntriesTable/Cells/EditCell/EditSenseDialog.tsx index 8dec372190..bdabf89151 100644 --- a/src/goals/ReviewEntries/ReviewEntriesTable/Cells/EditCell/EditSenseDialog.tsx +++ b/src/goals/ReviewEntries/ReviewEntriesTable/Cells/EditCell/EditSenseDialog.tsx @@ -38,7 +38,8 @@ import { areGlossesSame, cleanSense, } from "goals/ReviewEntries/ReviewEntriesTable/Cells/EditCell/utilities"; -import { type StoreState, useAppSelector } from "rootRedux/hooks"; +import { useAppSelector } from "rootRedux/hooks"; +import { type StoreState } from "rootRedux/rootReduxTypes"; import { newSemanticDomainForMongoDB } from "types/semanticDomain"; import { newDefinition, newGloss } from "types/word"; import { TextFieldWithFont } from "utilities/fontComponents"; diff --git a/src/goals/ReviewEntries/ReviewEntriesTable/index.tsx b/src/goals/ReviewEntries/ReviewEntriesTable/index.tsx index 9f2afbb800..90027427cb 100644 --- a/src/goals/ReviewEntries/ReviewEntriesTable/index.tsx +++ b/src/goals/ReviewEntries/ReviewEntriesTable/index.tsx @@ -22,7 +22,8 @@ import { topBarHeight } from "components/LandingPage/TopBar"; import * as Cell from "goals/ReviewEntries/ReviewEntriesTable/Cells"; import * as ff from "goals/ReviewEntries/ReviewEntriesTable/filterFn"; import * as sf from "goals/ReviewEntries/ReviewEntriesTable/sortingFn"; -import { type StoreState, useAppSelector } from "rootRedux/hooks"; +import { useAppSelector } from "rootRedux/hooks"; +import { type StoreState } from "rootRedux/rootReduxTypes"; import { type Hash } from "types/hash"; /** Import `material-react-table` localization for given `lang`. diff --git a/src/rootRedux/hooks.ts b/src/rootRedux/hooks.ts index 5f728dfddf..94c7a082d7 100644 --- a/src/rootRedux/hooks.ts +++ b/src/rootRedux/hooks.ts @@ -6,9 +6,6 @@ import { import { type AppDispatch, type RootState } from "rootRedux/store"; -// For use with useAppSelector -export { type StoreState } from "rootRedux/rootReduxTypes"; - // Use throughout your app instead of plain `useDispatch` and `useSelector` // `useAppDispatch` and `useAppSelector` apply the additional types for TypeScript // that are introduced by added middleware, such as `thunk` From e3ef20023d601cb3703368496e38ff106f5fecad Mon Sep 17 00:00:00 2001 From: Danny Rorabaugh Date: Wed, 10 Apr 2024 14:39:03 -0400 Subject: [PATCH 3/7] Update style-guide example --- docs/style_guide/ts_style_guide.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/style_guide/ts_style_guide.md b/docs/style_guide/ts_style_guide.md index 51a3185484..5d1a073ce2 100644 --- a/docs/style_guide/ts_style_guide.md +++ b/docs/style_guide/ts_style_guide.md @@ -511,7 +511,8 @@ function Component(props: { name: string }) { **Good** ```ts -import { type StoreState, useAppDispatch, useAppSelector } from "rootRedux/hooks"; +import { useAppDispatch, useAppSelector } from "rootRedux/hooks"; +import { type StoreState } from "rootRedux/rootReduxTypes"; function Component(): ReactElement { const dispatch = useAppDispatch(); From 549a994ccd1cc57f6a130d151eaf4d5ddd515784 Mon Sep 17 00:00:00 2001 From: Danny Rorabaugh Date: Wed, 10 Apr 2024 14:43:18 -0400 Subject: [PATCH 4/7] Update comment url --- src/rootRedux/rootReduxTypes.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rootRedux/rootReduxTypes.ts b/src/rootRedux/rootReduxTypes.ts index d303ff301a..a2e88962f3 100644 --- a/src/rootRedux/rootReduxTypes.ts +++ b/src/rootRedux/rootReduxTypes.ts @@ -80,7 +80,7 @@ export interface ActionWithPayload extends Action { payload: T; } -// https://redux.js.org/recipes/usage-with-typescript#usage-with-redux-thunk +// https://redux.js.org/usage/usage-with-typescript#type-checking-redux-thunks // suggests a custom general type for ThunkAction, // so in like fashion, here's one for ThunkDispatch: export type StoreStateDispatch = ThunkDispatch; From 3f16fb280c876976acc934ac22214690531e7cf2 Mon Sep 17 00:00:00 2001 From: Danny Rorabaugh Date: Fri, 26 Apr 2024 09:07:52 -0400 Subject: [PATCH 5/7] Fix merge error --- src/components/Pronunciations/tests/AudioPlayer.test.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/Pronunciations/tests/AudioPlayer.test.tsx b/src/components/Pronunciations/tests/AudioPlayer.test.tsx index 6af228d0db..4d6ee6dcd6 100644 --- a/src/components/Pronunciations/tests/AudioPlayer.test.tsx +++ b/src/components/Pronunciations/tests/AudioPlayer.test.tsx @@ -10,7 +10,7 @@ import AudioPlayer, { playMenuId, } from "components/Pronunciations/AudioPlayer"; import { PronunciationsStatus } from "components/Pronunciations/Redux/PronunciationsReduxTypes"; -import { type StoreState } from "types"; +import { type StoreState } from "rootRedux/rootReduxTypes"; import { newPronunciation } from "types/word"; // Mock out Menu to avoid issues with setting its anchor. @@ -24,9 +24,9 @@ jest.mock("@mui/material", () => { jest.mock("backend", () => ({ getSpeaker: () => mockGetSpeaker(), })); -jest.mock("types/hooks", () => { +jest.mock("rootRedux/hooks", () => { return { - ...jest.requireActual("types/hooks"), + ...jest.requireActual("rootRedux/hooks"), useAppDispatch: () => mockDispatch, }; }); From 243b61340126b608ee1f8db389b5022299bc2441 Mon Sep 17 00:00:00 2001 From: Danny Rorabaugh Date: Fri, 26 Apr 2024 09:37:48 -0400 Subject: [PATCH 6/7] Tidy comments --- src/rootRedux/rootReduxTypes.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/rootRedux/rootReduxTypes.ts b/src/rootRedux/rootReduxTypes.ts index a2e88962f3..751d90c141 100644 --- a/src/rootRedux/rootReduxTypes.ts +++ b/src/rootRedux/rootReduxTypes.ts @@ -38,7 +38,7 @@ import { defaultState as analyticsState, } from "types/Redux/analyticsReduxTypes"; -//root store structure +/** Redux store structure */ export interface StoreState { //login loginState: LoginState; @@ -64,6 +64,7 @@ export interface StoreState { analyticsState: AnalyticsState; } +/** Default values for the Redux store */ export const defaultState: StoreState = { loginState: { ...loginState }, currentProjectState: { ...currentProjectState }, From caf638ce9cd505dc28500871e71abb9c5e665998 Mon Sep 17 00:00:00 2001 From: "D. Ror" Date: Wed, 12 Jun 2024 07:44:09 -0400 Subject: [PATCH 7/7] Simplify rootRedux file names --- docs/style_guide/ts_style_guide.md | 2 +- src/components/AnnouncementBanner/AnnouncementBanner.tsx | 2 +- src/components/App/AppLoggedIn.tsx | 2 +- src/components/App/SignalRHub.tsx | 2 +- src/components/AppBar/NavigationButtons.tsx | 2 +- src/components/AppBar/ProjectButtons.tsx | 2 +- src/components/AppBar/SpeakerMenu.tsx | 2 +- src/components/AppBar/tests/SpeakerMenu.test.tsx | 2 +- src/components/DataEntry/DataEntryTable/NewEntry/index.tsx | 2 +- src/components/DataEntry/DataEntryTable/index.tsx | 2 +- src/components/DataEntry/index.tsx | 2 +- src/components/GoalTimeline/index.tsx | 2 +- src/components/Login/Login.tsx | 4 ++-- src/components/Login/Redux/LoginActions.ts | 2 +- src/components/Login/Redux/LoginReducer.ts | 2 +- src/components/Login/Signup.tsx | 4 ++-- src/components/Project/ProjectActions.ts | 5 +---- src/components/Project/ProjectReducer.ts | 2 +- src/components/ProjectExport/DownloadButton.tsx | 2 +- src/components/ProjectExport/ExportButton.tsx | 2 +- src/components/ProjectExport/Redux/ExportProjectActions.ts | 2 +- src/components/ProjectExport/Redux/ExportProjectReducer.ts | 2 +- src/components/ProjectScreen/CreateProjectActions.ts | 2 +- src/components/ProjectSettings/index.tsx | 2 +- src/components/ProjectUsers/ActiveProjectUsers.tsx | 2 +- src/components/ProjectUsers/AddProjectUsers.tsx | 2 +- src/components/Pronunciations/AudioPlayer.tsx | 2 +- src/components/Pronunciations/AudioRecorder.tsx | 2 +- src/components/Pronunciations/RecorderIcon.tsx | 2 +- src/components/Pronunciations/Redux/PronunciationsReducer.ts | 2 +- src/components/Pronunciations/tests/AudioPlayer.test.tsx | 2 +- src/components/Pronunciations/tests/AudioRecorder.test.tsx | 2 +- src/components/TreeView/Redux/TreeViewActions.ts | 5 +---- src/components/TreeView/Redux/TreeViewReducer.ts | 2 +- src/components/TreeView/index.tsx | 2 +- src/components/WordCard/DomainChipsGrid.tsx | 2 +- src/components/WordCard/tests/SenseCard.test.tsx | 2 +- .../CharInv/CharacterDetail/CharacterInfo.tsx | 2 +- .../CharInv/CharacterDetail/CharacterWords.tsx | 2 +- .../CharInv/CharacterDetail/tests/index.test.tsx | 2 +- src/goals/CharacterInventory/CharInv/CharacterEntry.tsx | 2 +- src/goals/CharacterInventory/CharInv/CharacterList/index.tsx | 2 +- src/goals/CharacterInventory/CharInv/index.tsx | 2 +- src/goals/CharacterInventory/CharInvCompleted.tsx | 2 +- .../CharacterInventory/Redux/CharacterInventoryActions.ts | 5 +---- .../CharacterInventory/Redux/CharacterInventoryReducer.ts | 2 +- src/goals/CharacterInventory/tests/CharInvCompleted.test.tsx | 2 +- src/goals/DefaultGoal/BaseGoalScreen.tsx | 2 +- src/goals/DefaultGoal/DisplayProgress.tsx | 2 +- src/goals/DefaultGoal/NextGoalScreen.tsx | 2 +- src/goals/MergeDuplicates/MergeDupsCompleted.tsx | 2 +- .../MergeDupsStep/MergeDragDrop/DragSense.tsx | 2 +- .../MergeDuplicates/MergeDupsStep/MergeDragDrop/DropWord.tsx | 2 +- .../MergeDupsStep/MergeDragDrop/SidebarDragSense.tsx | 2 +- .../MergeDupsStep/MergeDragDrop/SidebarDrop.tsx | 2 +- .../MergeDuplicates/MergeDupsStep/MergeDragDrop/index.tsx | 2 +- src/goals/MergeDuplicates/MergeDupsStep/index.tsx | 2 +- src/goals/MergeDuplicates/Redux/MergeDupsActions.ts | 5 +---- src/goals/MergeDuplicates/Redux/MergeDupsReducer.ts | 2 +- .../MergeDuplicates/Redux/tests/MergeDupsReducer.test.tsx | 2 +- src/goals/Redux/GoalActions.ts | 5 +---- src/goals/Redux/GoalReducer.ts | 2 +- src/goals/ReviewEntries/ReviewEntriesCompleted.tsx | 2 +- .../ReviewEntriesTable/Cells/EditCell/EditDialog.tsx | 5 +---- .../ReviewEntriesTable/Cells/EditCell/EditSenseDialog.tsx | 2 +- .../Cells/EditCell/tests/EditSenseDialog.test.tsx | 2 +- src/goals/ReviewEntries/ReviewEntriesTable/index.tsx | 2 +- .../ReviewEntries/ReviewEntriesTable/tests/index.test.tsx | 2 +- src/rootRedux/{rootActions.ts => actions.ts} | 0 src/rootRedux/{rootReducer.ts => reducer.ts} | 2 +- src/rootRedux/store.ts | 2 +- src/rootRedux/{rootReduxTypes.ts => types.ts} | 0 src/types/Redux/analytics.ts | 2 +- 73 files changed, 73 insertions(+), 91 deletions(-) rename src/rootRedux/{rootActions.ts => actions.ts} (100%) rename src/rootRedux/{rootReducer.ts => reducer.ts} (95%) rename src/rootRedux/{rootReduxTypes.ts => types.ts} (100%) diff --git a/docs/style_guide/ts_style_guide.md b/docs/style_guide/ts_style_guide.md index 45fbca6173..27207a9e13 100644 --- a/docs/style_guide/ts_style_guide.md +++ b/docs/style_guide/ts_style_guide.md @@ -541,7 +541,7 @@ function Component(props: { name: string }) { ```ts import { useAppDispatch, useAppSelector } from "rootRedux/hooks"; -import { type StoreState } from "rootRedux/rootReduxTypes"; +import { type StoreState } from "rootRedux/types"; function Component(): ReactElement { const dispatch = useAppDispatch(); diff --git a/src/components/AnnouncementBanner/AnnouncementBanner.tsx b/src/components/AnnouncementBanner/AnnouncementBanner.tsx index 048cf30531..769199275c 100644 --- a/src/components/AnnouncementBanner/AnnouncementBanner.tsx +++ b/src/components/AnnouncementBanner/AnnouncementBanner.tsx @@ -14,7 +14,7 @@ import { getBannerText } from "backend"; import { getClosedBanner, setClosedBanner } from "backend/localStorage"; import { topBarHeight } from "components/LandingPage/TopBar"; import { useAppSelector } from "rootRedux/hooks"; -import { type StoreState } from "rootRedux/rootReduxTypes"; +import { type StoreState } from "rootRedux/types"; import { Path } from "types/path"; import theme, { themeColors } from "types/theme"; diff --git a/src/components/App/AppLoggedIn.tsx b/src/components/App/AppLoggedIn.tsx index 808850bbb7..e213ab63eb 100644 --- a/src/components/App/AppLoggedIn.tsx +++ b/src/components/App/AppLoggedIn.tsx @@ -16,7 +16,7 @@ import UserSettings from "components/UserSettings/UserSettings"; import NextGoalScreen from "goals/DefaultGoal/NextGoalScreen"; import { updateLangFromUser } from "i18n"; import { useAppSelector } from "rootRedux/hooks"; -import { type StoreState } from "rootRedux/rootReduxTypes"; +import { type StoreState } from "rootRedux/types"; import { Path } from "types/path"; import FontContext, { ProjectFonts } from "utilities/fontContext"; import { getProjCss } from "utilities/fontCssUtilities"; diff --git a/src/components/App/SignalRHub.tsx b/src/components/App/SignalRHub.tsx index 00e75b7ffd..cae21be276 100644 --- a/src/components/App/SignalRHub.tsx +++ b/src/components/App/SignalRHub.tsx @@ -19,7 +19,7 @@ import { } from "components/ProjectExport/Redux/ExportProjectActions"; import { ExportStatus } from "components/ProjectExport/Redux/ExportProjectReduxTypes"; import { useAppDispatch, useAppSelector } from "rootRedux/hooks"; -import { type StoreState } from "rootRedux/rootReduxTypes"; +import { type StoreState } from "rootRedux/types"; /** A central hub for monitoring export status on SignalR */ export default function SignalRHub(): ReactElement { diff --git a/src/components/AppBar/NavigationButtons.tsx b/src/components/AppBar/NavigationButtons.tsx index 6f806c3ae3..e7fa37d740 100644 --- a/src/components/AppBar/NavigationButtons.tsx +++ b/src/components/AppBar/NavigationButtons.tsx @@ -13,7 +13,7 @@ import { tabColor, } from "components/AppBar/AppBarTypes"; import { useAppSelector } from "rootRedux/hooks"; -import { type StoreState } from "rootRedux/rootReduxTypes"; +import { type StoreState } from "rootRedux/types"; import { Path } from "types/path"; import { useWindowSize } from "utilities/useWindowSize"; diff --git a/src/components/AppBar/ProjectButtons.tsx b/src/components/AppBar/ProjectButtons.tsx index 35300ecd9b..af9293a686 100644 --- a/src/components/AppBar/ProjectButtons.tsx +++ b/src/components/AppBar/ProjectButtons.tsx @@ -14,7 +14,7 @@ import { tabColor, } from "components/AppBar/AppBarTypes"; import SpeakerMenu from "components/AppBar/SpeakerMenu"; -import { type StoreState } from "rootRedux/rootReduxTypes"; +import { type StoreState } from "rootRedux/types"; import { GoalStatus, GoalType } from "types/goals"; import { Path } from "types/path"; diff --git a/src/components/AppBar/SpeakerMenu.tsx b/src/components/AppBar/SpeakerMenu.tsx index 9756a92303..b84f02be4a 100644 --- a/src/components/AppBar/SpeakerMenu.tsx +++ b/src/components/AppBar/SpeakerMenu.tsx @@ -24,7 +24,7 @@ import { getAllSpeakers } from "backend"; import { buttonMinHeight } from "components/AppBar/AppBarTypes"; import { setCurrentSpeaker } from "components/Project/ProjectActions"; import { useAppDispatch } from "rootRedux/hooks"; -import { type StoreState } from "rootRedux/rootReduxTypes"; +import { type StoreState } from "rootRedux/types"; import { themeColors } from "types/theme"; const idAffix = "speaker-menu"; diff --git a/src/components/AppBar/tests/SpeakerMenu.test.tsx b/src/components/AppBar/tests/SpeakerMenu.test.tsx index 9fe54ac448..cc4408b998 100644 --- a/src/components/AppBar/tests/SpeakerMenu.test.tsx +++ b/src/components/AppBar/tests/SpeakerMenu.test.tsx @@ -7,7 +7,7 @@ import configureMockStore from "redux-mock-store"; import { Speaker } from "api/models"; import SpeakerMenu, { SpeakerMenuList } from "components/AppBar/SpeakerMenu"; import { defaultState } from "components/Project/ProjectReduxTypes"; -import { type StoreState } from "rootRedux/rootReduxTypes"; +import { type StoreState } from "rootRedux/types"; import { randomSpeaker } from "types/project"; jest.mock("backend", () => ({ diff --git a/src/components/DataEntry/DataEntryTable/NewEntry/index.tsx b/src/components/DataEntry/DataEntryTable/NewEntry/index.tsx index c9243f3891..00fd98edf3 100644 --- a/src/components/DataEntry/DataEntryTable/NewEntry/index.tsx +++ b/src/components/DataEntry/DataEntryTable/NewEntry/index.tsx @@ -22,7 +22,7 @@ import { import SenseDialog from "components/DataEntry/DataEntryTable/NewEntry/SenseDialog"; import VernDialog from "components/DataEntry/DataEntryTable/NewEntry/VernDialog"; import PronunciationsFrontend from "components/Pronunciations/PronunciationsFrontend"; -import { type StoreState } from "rootRedux/rootReduxTypes"; +import { type StoreState } from "rootRedux/types"; import theme from "types/theme"; import { FileWithSpeakerId } from "types/word"; diff --git a/src/components/DataEntry/DataEntryTable/index.tsx b/src/components/DataEntry/DataEntryTable/index.tsx index 4e8a8e1234..b7500316f4 100644 --- a/src/components/DataEntry/DataEntryTable/index.tsx +++ b/src/components/DataEntry/DataEntryTable/index.tsx @@ -32,7 +32,7 @@ import RecentEntry from "components/DataEntry/DataEntryTable/RecentEntry"; import { filterWordsWithSenses } from "components/DataEntry/utilities"; import { uploadFileFromPronunciation } from "components/Pronunciations/utilities"; import { useAppSelector } from "rootRedux/hooks"; -import { type StoreState } from "rootRedux/rootReduxTypes"; +import { type StoreState } from "rootRedux/types"; import { type Hash } from "types/hash"; import theme from "types/theme"; import { diff --git a/src/components/DataEntry/index.tsx b/src/components/DataEntry/index.tsx index fc68dc5adb..eb8e423721 100644 --- a/src/components/DataEntry/index.tsx +++ b/src/components/DataEntry/index.tsx @@ -17,7 +17,7 @@ import { filterWordsByDomain } from "components/DataEntry/utilities"; import TreeView from "components/TreeView"; import { closeTree, openTree } from "components/TreeView/Redux/TreeViewActions"; import { useAppDispatch, useAppSelector } from "rootRedux/hooks"; -import { type StoreState } from "rootRedux/rootReduxTypes"; +import { type StoreState } from "rootRedux/types"; import { newSemanticDomain } from "types/semanticDomain"; import theme from "types/theme"; import { DomainWord } from "types/word"; diff --git a/src/components/GoalTimeline/index.tsx b/src/components/GoalTimeline/index.tsx index f248ca0615..f8912b3591 100644 --- a/src/components/GoalTimeline/index.tsx +++ b/src/components/GoalTimeline/index.tsx @@ -12,7 +12,7 @@ import { getCurrentPermissions, getGraylistEntries } from "backend"; import GoalList from "components/GoalTimeline/GoalList"; import { asyncAddGoal, asyncGetUserEdits } from "goals/Redux/GoalActions"; import { useAppDispatch, useAppSelector } from "rootRedux/hooks"; -import { type StoreState } from "rootRedux/rootReduxTypes"; +import { type StoreState } from "rootRedux/types"; import { Goal, GoalType } from "types/goals"; import { requiredPermission, goalTypeToGoal } from "utilities/goalUtilities"; import { useWindowSize } from "utilities/useWindowSize"; diff --git a/src/components/Login/Login.tsx b/src/components/Login/Login.tsx index 2c578b86da..a185fa7393 100644 --- a/src/components/Login/Login.tsx +++ b/src/components/Login/Login.tsx @@ -24,9 +24,9 @@ import { LoadingButton } from "components/Buttons"; import Captcha from "components/Login/Captcha"; import { asyncLogIn } from "components/Login/Redux/LoginActions"; import { LoginStatus } from "components/Login/Redux/LoginReduxTypes"; +import { reset } from "rootRedux/actions"; import { useAppDispatch, useAppSelector } from "rootRedux/hooks"; -import { reset } from "rootRedux/rootActions"; -import { type StoreState } from "rootRedux/rootReduxTypes"; +import { type StoreState } from "rootRedux/types"; import router from "router/browserRouter"; import { Path } from "types/path"; import { RuntimeConfig } from "types/runtimeConfig"; diff --git a/src/components/Login/Redux/LoginActions.ts b/src/components/Login/Redux/LoginActions.ts index ab8b331c40..3d6b3c1cec 100644 --- a/src/components/Login/Redux/LoginActions.ts +++ b/src/components/Login/Redux/LoginActions.ts @@ -11,7 +11,7 @@ import { setSignupFailureAction, setSignupSuccessAction, } from "components/Login/Redux/LoginReducer"; -import { type StoreStateDispatch } from "rootRedux/rootReduxTypes"; +import { type StoreStateDispatch } from "rootRedux/types"; import router from "router/browserRouter"; import { Path } from "types/path"; import { newUser } from "types/user"; diff --git a/src/components/Login/Redux/LoginReducer.ts b/src/components/Login/Redux/LoginReducer.ts index 3a16913682..87d6a7c93c 100644 --- a/src/components/Login/Redux/LoginReducer.ts +++ b/src/components/Login/Redux/LoginReducer.ts @@ -4,7 +4,7 @@ import { LoginStatus, defaultState, } from "components/Login/Redux/LoginReduxTypes"; -import { StoreActionTypes } from "rootRedux/rootActions"; +import { StoreActionTypes } from "rootRedux/actions"; const loginSlice = createSlice({ name: "loginState", diff --git a/src/components/Login/Signup.tsx b/src/components/Login/Signup.tsx index e0d76bd29b..fb8bd44333 100644 --- a/src/components/Login/Signup.tsx +++ b/src/components/Login/Signup.tsx @@ -20,9 +20,9 @@ import { LoadingDoneButton } from "components/Buttons"; import Captcha from "components/Login/Captcha"; import { asyncSignUp } from "components/Login/Redux/LoginActions"; import { LoginStatus } from "components/Login/Redux/LoginReduxTypes"; +import { reset } from "rootRedux/actions"; import { useAppDispatch, useAppSelector } from "rootRedux/hooks"; -import { reset } from "rootRedux/rootActions"; -import { type StoreState } from "rootRedux/rootReduxTypes"; +import { type StoreState } from "rootRedux/types"; import router from "router/browserRouter"; import { Path } from "types/path"; import { RuntimeConfig } from "types/runtimeConfig"; diff --git a/src/components/Project/ProjectActions.ts b/src/components/Project/ProjectActions.ts index ff82d9042b..672b9bf341 100644 --- a/src/components/Project/ProjectActions.ts +++ b/src/components/Project/ProjectActions.ts @@ -15,10 +15,7 @@ import { setUsersAction, } from "components/Project/ProjectReducer"; import i18n from "i18n"; -import { - type StoreState, - type StoreStateDispatch, -} from "rootRedux/rootReduxTypes"; +import { type StoreState, type StoreStateDispatch } from "rootRedux/types"; import { type Hash } from "types/hash"; import { newProject } from "types/project"; diff --git a/src/components/Project/ProjectReducer.ts b/src/components/Project/ProjectReducer.ts index 5729d3e728..e17e067f6c 100644 --- a/src/components/Project/ProjectReducer.ts +++ b/src/components/Project/ProjectReducer.ts @@ -1,7 +1,7 @@ import { createSlice } from "@reduxjs/toolkit"; import { defaultState } from "components/Project/ProjectReduxTypes"; -import { StoreActionTypes } from "rootRedux/rootActions"; +import { StoreActionTypes } from "rootRedux/actions"; const projectSlice = createSlice({ name: "currentProjectState", diff --git a/src/components/ProjectExport/DownloadButton.tsx b/src/components/ProjectExport/DownloadButton.tsx index be1c5b471a..f354f5b0d1 100644 --- a/src/components/ProjectExport/DownloadButton.tsx +++ b/src/components/ProjectExport/DownloadButton.tsx @@ -17,7 +17,7 @@ import { } from "components/ProjectExport/Redux/ExportProjectActions"; import { ExportStatus } from "components/ProjectExport/Redux/ExportProjectReduxTypes"; import { useAppDispatch, useAppSelector } from "rootRedux/hooks"; -import { type StoreState } from "rootRedux/rootReduxTypes"; +import { type StoreState } from "rootRedux/types"; import { themeColors } from "types/theme"; import { getDateTimeString } from "utilities/utilities"; diff --git a/src/components/ProjectExport/ExportButton.tsx b/src/components/ProjectExport/ExportButton.tsx index 4645e63fd1..b362c98eb1 100644 --- a/src/components/ProjectExport/ExportButton.tsx +++ b/src/components/ProjectExport/ExportButton.tsx @@ -8,7 +8,7 @@ import { LoadingButton } from "components/Buttons"; import { asyncExportProject } from "components/ProjectExport/Redux/ExportProjectActions"; import { ExportStatus } from "components/ProjectExport/Redux/ExportProjectReduxTypes"; import { useAppDispatch, useAppSelector } from "rootRedux/hooks"; -import { type StoreState } from "rootRedux/rootReduxTypes"; +import { type StoreState } from "rootRedux/types"; interface ExportButtonProps { projectId: string; diff --git a/src/components/ProjectExport/Redux/ExportProjectActions.ts b/src/components/ProjectExport/Redux/ExportProjectActions.ts index 76496ba184..c6e6f3d09b 100644 --- a/src/components/ProjectExport/Redux/ExportProjectActions.ts +++ b/src/components/ProjectExport/Redux/ExportProjectActions.ts @@ -8,7 +8,7 @@ import { resetExportAction, successAction, } from "components/ProjectExport/Redux//ExportProjectReducer"; -import { StoreStateDispatch } from "rootRedux/rootReduxTypes"; +import { StoreStateDispatch } from "rootRedux/types"; // Action Creation Functions diff --git a/src/components/ProjectExport/Redux/ExportProjectReducer.ts b/src/components/ProjectExport/Redux/ExportProjectReducer.ts index f9e4d5514b..76d1bcdb4e 100644 --- a/src/components/ProjectExport/Redux/ExportProjectReducer.ts +++ b/src/components/ProjectExport/Redux/ExportProjectReducer.ts @@ -4,7 +4,7 @@ import { defaultState, ExportStatus, } from "components/ProjectExport/Redux/ExportProjectReduxTypes"; -import { StoreActionTypes } from "rootRedux/rootActions"; +import { StoreActionTypes } from "rootRedux/actions"; const exportProjectSlice = createSlice({ name: "exportProjectState", diff --git a/src/components/ProjectScreen/CreateProjectActions.ts b/src/components/ProjectScreen/CreateProjectActions.ts index 6cdd98129a..d487fb43de 100644 --- a/src/components/ProjectScreen/CreateProjectActions.ts +++ b/src/components/ProjectScreen/CreateProjectActions.ts @@ -2,7 +2,7 @@ import { type WritingSystem } from "api/models"; import { createProject, finishUploadLift, getProject } from "backend"; import { asyncSetNewCurrentProject } from "components/Project/ProjectActions"; import { asyncCreateUserEdits } from "goals/Redux/GoalActions"; -import { type StoreStateDispatch } from "rootRedux/rootReduxTypes"; +import { type StoreStateDispatch } from "rootRedux/types"; import router from "router/browserRouter"; import { Path } from "types/path"; import { newProject } from "types/project"; diff --git a/src/components/ProjectSettings/index.tsx b/src/components/ProjectSettings/index.tsx index 196e4ffe49..57081c5ba6 100644 --- a/src/components/ProjectSettings/index.tsx +++ b/src/components/ProjectSettings/index.tsx @@ -54,7 +54,7 @@ import ActiveProjectUsers from "components/ProjectUsers/ActiveProjectUsers"; import AddProjectUsers from "components/ProjectUsers/AddProjectUsers"; import ProjectSpeakersList from "components/ProjectUsers/ProjectSpeakersList"; import { useAppDispatch, useAppSelector } from "rootRedux/hooks"; -import { type StoreState } from "rootRedux/rootReduxTypes"; +import { type StoreState } from "rootRedux/types"; import { Path } from "types/path"; export enum ProjectSettingsTab { diff --git a/src/components/ProjectUsers/ActiveProjectUsers.tsx b/src/components/ProjectUsers/ActiveProjectUsers.tsx index 4f7ef2e639..4d7eb701ca 100644 --- a/src/components/ProjectUsers/ActiveProjectUsers.tsx +++ b/src/components/ProjectUsers/ActiveProjectUsers.tsx @@ -26,7 +26,7 @@ import SortOptions, { getUserCompare, } from "components/ProjectUsers/SortOptions"; import { useAppSelector } from "rootRedux/hooks"; -import { type StoreState } from "rootRedux/rootReduxTypes"; +import { type StoreState } from "rootRedux/types"; import { type Hash } from "types/hash"; import theme from "types/theme"; diff --git a/src/components/ProjectUsers/AddProjectUsers.tsx b/src/components/ProjectUsers/AddProjectUsers.tsx index a2c23c5463..1f04640c28 100644 --- a/src/components/ProjectUsers/AddProjectUsers.tsx +++ b/src/components/ProjectUsers/AddProjectUsers.tsx @@ -10,7 +10,7 @@ import { asyncRefreshProjectUsers } from "components/Project/ProjectActions"; import EmailInvite from "components/ProjectUsers/EmailInvite"; import UserList from "components/ProjectUsers/UserList"; import { useAppDispatch, useAppSelector } from "rootRedux/hooks"; -import { type StoreState } from "rootRedux/rootReduxTypes"; +import { type StoreState } from "rootRedux/types"; import { RuntimeConfig } from "types/runtimeConfig"; const customStyles = { diff --git a/src/components/Pronunciations/AudioPlayer.tsx b/src/components/Pronunciations/AudioPlayer.tsx index ae15cd41f1..765ec36cc6 100644 --- a/src/components/Pronunciations/AudioPlayer.tsx +++ b/src/components/Pronunciations/AudioPlayer.tsx @@ -30,7 +30,7 @@ import { } from "components/Pronunciations/Redux/PronunciationsActions"; import { PronunciationsStatus } from "components/Pronunciations/Redux/PronunciationsReduxTypes"; import { useAppDispatch, useAppSelector } from "rootRedux/hooks"; -import { type StoreState } from "rootRedux/rootReduxTypes"; +import { type StoreState } from "rootRedux/types"; /** Number of ms for a touchscreen press to be considered a long-press. * 600 ms is too short: it can still register as a click. */ diff --git a/src/components/Pronunciations/AudioRecorder.tsx b/src/components/Pronunciations/AudioRecorder.tsx index 4c746e7167..33dbd12a9d 100644 --- a/src/components/Pronunciations/AudioRecorder.tsx +++ b/src/components/Pronunciations/AudioRecorder.tsx @@ -7,7 +7,7 @@ import RecorderContext from "components/Pronunciations/RecorderContext"; import RecorderIcon from "components/Pronunciations/RecorderIcon"; import { getFileNameForWord } from "components/Pronunciations/utilities"; import { useAppSelector } from "rootRedux/hooks"; -import { type StoreState } from "rootRedux/rootReduxTypes"; +import { type StoreState } from "rootRedux/types"; import { FileWithSpeakerId } from "types/word"; interface RecorderProps { diff --git a/src/components/Pronunciations/RecorderIcon.tsx b/src/components/Pronunciations/RecorderIcon.tsx index 328c2e3b8a..0ef7babf4f 100644 --- a/src/components/Pronunciations/RecorderIcon.tsx +++ b/src/components/Pronunciations/RecorderIcon.tsx @@ -9,7 +9,7 @@ import { } from "components/Pronunciations/Redux/PronunciationsActions"; import { PronunciationsStatus } from "components/Pronunciations/Redux/PronunciationsReduxTypes"; import { useAppDispatch, useAppSelector } from "rootRedux/hooks"; -import { type StoreState } from "rootRedux/rootReduxTypes"; +import { type StoreState } from "rootRedux/types"; import { themeColors } from "types/theme"; export const recordButtonId = "recordingButton"; diff --git a/src/components/Pronunciations/Redux/PronunciationsReducer.ts b/src/components/Pronunciations/Redux/PronunciationsReducer.ts index 3d28fce330..1f830ca572 100644 --- a/src/components/Pronunciations/Redux/PronunciationsReducer.ts +++ b/src/components/Pronunciations/Redux/PronunciationsReducer.ts @@ -4,7 +4,7 @@ import { defaultState, PronunciationsStatus, } from "components/Pronunciations/Redux/PronunciationsReduxTypes"; -import { StoreActionTypes } from "rootRedux/rootActions"; +import { StoreActionTypes } from "rootRedux/actions"; const pronunciationsSlice = createSlice({ name: "pronunciationsState", diff --git a/src/components/Pronunciations/tests/AudioPlayer.test.tsx b/src/components/Pronunciations/tests/AudioPlayer.test.tsx index 4d6ee6dcd6..acd768ebe3 100644 --- a/src/components/Pronunciations/tests/AudioPlayer.test.tsx +++ b/src/components/Pronunciations/tests/AudioPlayer.test.tsx @@ -10,7 +10,7 @@ import AudioPlayer, { playMenuId, } from "components/Pronunciations/AudioPlayer"; import { PronunciationsStatus } from "components/Pronunciations/Redux/PronunciationsReduxTypes"; -import { type StoreState } from "rootRedux/rootReduxTypes"; +import { type StoreState } from "rootRedux/types"; import { newPronunciation } from "types/word"; // Mock out Menu to avoid issues with setting its anchor. diff --git a/src/components/Pronunciations/tests/AudioRecorder.test.tsx b/src/components/Pronunciations/tests/AudioRecorder.test.tsx index e10dfc8bf7..0d6827d169 100644 --- a/src/components/Pronunciations/tests/AudioRecorder.test.tsx +++ b/src/components/Pronunciations/tests/AudioRecorder.test.tsx @@ -10,7 +10,7 @@ import RecorderIcon, { recordIconId, } from "components/Pronunciations/RecorderIcon"; import { PronunciationsStatus } from "components/Pronunciations/Redux/PronunciationsReduxTypes"; -import { type StoreState } from "rootRedux/rootReduxTypes"; +import { type StoreState } from "rootRedux/types"; import theme, { themeColors } from "types/theme"; let testRenderer: ReactTestRenderer; diff --git a/src/components/TreeView/Redux/TreeViewActions.ts b/src/components/TreeView/Redux/TreeViewActions.ts index b8ec2de6f9..77c9c582fb 100644 --- a/src/components/TreeView/Redux/TreeViewActions.ts +++ b/src/components/TreeView/Redux/TreeViewActions.ts @@ -8,10 +8,7 @@ import { setDomainLanguageAction, setTreeOpenAction, } from "components/TreeView/Redux/TreeViewReducer"; -import { - type StoreState, - type StoreStateDispatch, -} from "rootRedux/rootReduxTypes"; +import { type StoreState, type StoreStateDispatch } from "rootRedux/types"; // Action Creation Functions diff --git a/src/components/TreeView/Redux/TreeViewReducer.ts b/src/components/TreeView/Redux/TreeViewReducer.ts index 78a21083b6..9d37c5792e 100644 --- a/src/components/TreeView/Redux/TreeViewReducer.ts +++ b/src/components/TreeView/Redux/TreeViewReducer.ts @@ -1,7 +1,7 @@ import { createSlice } from "@reduxjs/toolkit"; import { defaultState } from "components/TreeView/Redux/TreeViewReduxTypes"; -import { StoreActionTypes } from "rootRedux/rootActions"; +import { StoreActionTypes } from "rootRedux/actions"; const treeViewSlice = createSlice({ name: "treeViewState", diff --git a/src/components/TreeView/index.tsx b/src/components/TreeView/index.tsx index 019a9005a6..ce713b7421 100644 --- a/src/components/TreeView/index.tsx +++ b/src/components/TreeView/index.tsx @@ -17,7 +17,7 @@ import TreeDepiction from "components/TreeView/TreeDepiction"; import TreeNavigator from "components/TreeView/TreeNavigator"; import TreeSearch from "components/TreeView/TreeSearch"; import { useAppDispatch, useAppSelector } from "rootRedux/hooks"; -import { type StoreState } from "rootRedux/rootReduxTypes"; +import { type StoreState } from "rootRedux/types"; import { newSemanticDomain } from "types/semanticDomain"; import { semDomWritingSystems } from "types/writingSystem"; diff --git a/src/components/WordCard/DomainChipsGrid.tsx b/src/components/WordCard/DomainChipsGrid.tsx index 126ff9a7d1..c7b0152960 100644 --- a/src/components/WordCard/DomainChipsGrid.tsx +++ b/src/components/WordCard/DomainChipsGrid.tsx @@ -4,7 +4,7 @@ import { type ReactElement } from "react"; import { type SemanticDomain } from "api/models"; import DomainChip from "components/WordCard/DomainChip"; import { useAppSelector } from "rootRedux/hooks"; -import { type StoreState } from "rootRedux/rootReduxTypes"; +import { type StoreState } from "rootRedux/types"; interface DomainChipsGridProps { semDoms: SemanticDomain[]; diff --git a/src/components/WordCard/tests/SenseCard.test.tsx b/src/components/WordCard/tests/SenseCard.test.tsx index 138078e43f..82afac082b 100644 --- a/src/components/WordCard/tests/SenseCard.test.tsx +++ b/src/components/WordCard/tests/SenseCard.test.tsx @@ -7,7 +7,7 @@ import { PartOfSpeechButton } from "components/Buttons"; import { defaultState } from "components/Project/ProjectReduxTypes"; import DomainChip from "components/WordCard/DomainChip"; import SenseCard from "components/WordCard/SenseCard"; -import { type StoreState } from "rootRedux/rootReduxTypes"; +import { type StoreState } from "rootRedux/types"; import { Hash } from "types/hash"; import { newSemanticDomain } from "types/semanticDomain"; import { newSense } from "types/word"; diff --git a/src/goals/CharacterInventory/CharInv/CharacterDetail/CharacterInfo.tsx b/src/goals/CharacterInventory/CharInv/CharacterDetail/CharacterInfo.tsx index 5f92edec60..69878d4acc 100644 --- a/src/goals/CharacterInventory/CharInv/CharacterDetail/CharacterInfo.tsx +++ b/src/goals/CharacterInventory/CharInv/CharacterDetail/CharacterInfo.tsx @@ -3,7 +3,7 @@ import { ReactElement } from "react"; import { useTranslation } from "react-i18next"; import { useSelector } from "react-redux"; -import { type StoreState } from "rootRedux/rootReduxTypes"; +import { type StoreState } from "rootRedux/types"; interface CharacterInfoProps { character: string; diff --git a/src/goals/CharacterInventory/CharInv/CharacterDetail/CharacterWords.tsx b/src/goals/CharacterInventory/CharInv/CharacterDetail/CharacterWords.tsx index 1326f5bc37..5213ac2811 100644 --- a/src/goals/CharacterInventory/CharInv/CharacterDetail/CharacterWords.tsx +++ b/src/goals/CharacterInventory/CharInv/CharacterDetail/CharacterWords.tsx @@ -3,7 +3,7 @@ import { ReactElement } from "react"; import { useTranslation } from "react-i18next"; import { useSelector } from "react-redux"; -import { type StoreState } from "rootRedux/rootReduxTypes"; +import { type StoreState } from "rootRedux/types"; import { themeColors } from "types/theme"; import { TypographyWithFont } from "utilities/fontComponents"; diff --git a/src/goals/CharacterInventory/CharInv/CharacterDetail/tests/index.test.tsx b/src/goals/CharacterInventory/CharInv/CharacterDetail/tests/index.test.tsx index 5aca0b78ef..76c87f1378 100644 --- a/src/goals/CharacterInventory/CharInv/CharacterDetail/tests/index.test.tsx +++ b/src/goals/CharacterInventory/CharInv/CharacterDetail/tests/index.test.tsx @@ -10,7 +10,7 @@ import { buttonIdSubmit, } from "goals/CharacterInventory/CharInv/CharacterDetail/FindAndReplace"; import { defaultState } from "goals/CharacterInventory/Redux/CharacterInventoryReduxTypes"; -import { type StoreState } from "rootRedux/rootReduxTypes"; +import { type StoreState } from "rootRedux/types"; import { testInstanceHasText } from "utilities/testRendererUtilities"; // Dialog uses portals, which are not supported in react-test-renderer. diff --git a/src/goals/CharacterInventory/CharInv/CharacterEntry.tsx b/src/goals/CharacterInventory/CharInv/CharacterEntry.tsx index bc4a70a06c..d342dd16a2 100644 --- a/src/goals/CharacterInventory/CharInv/CharacterEntry.tsx +++ b/src/goals/CharacterInventory/CharInv/CharacterEntry.tsx @@ -8,7 +8,7 @@ import { setValidCharacters, } from "goals/CharacterInventory/Redux/CharacterInventoryActions"; import { useAppDispatch, useAppSelector } from "rootRedux/hooks"; -import { type StoreState } from "rootRedux/rootReduxTypes"; +import { type StoreState } from "rootRedux/types"; import theme from "types/theme"; import { TextFieldWithFont } from "utilities/fontComponents"; diff --git a/src/goals/CharacterInventory/CharInv/CharacterList/index.tsx b/src/goals/CharacterInventory/CharInv/CharacterList/index.tsx index 4e8e2e6aeb..5608e58b5c 100644 --- a/src/goals/CharacterInventory/CharInv/CharacterList/index.tsx +++ b/src/goals/CharacterInventory/CharInv/CharacterList/index.tsx @@ -7,7 +7,7 @@ import CharacterCard from "goals/CharacterInventory/CharInv/CharacterList/Charac import { setSelectedCharacter } from "goals/CharacterInventory/Redux/CharacterInventoryActions"; import { CharacterSetEntry } from "goals/CharacterInventory/Redux/CharacterInventoryReduxTypes"; import { useAppDispatch, useAppSelector } from "rootRedux/hooks"; -import { type StoreState } from "rootRedux/rootReduxTypes"; +import { type StoreState } from "rootRedux/types"; enum SortOrder { CharacterAscending, diff --git a/src/goals/CharacterInventory/CharInv/index.tsx b/src/goals/CharacterInventory/CharInv/index.tsx index 6ed98ad16f..f7d8a06a99 100644 --- a/src/goals/CharacterInventory/CharInv/index.tsx +++ b/src/goals/CharacterInventory/CharInv/index.tsx @@ -23,7 +23,7 @@ import { uploadInventory, } from "goals/CharacterInventory/Redux/CharacterInventoryActions"; import { useAppDispatch, useAppSelector } from "rootRedux/hooks"; -import { type StoreState } from "rootRedux/rootReduxTypes"; +import { type StoreState } from "rootRedux/types"; import theme from "types/theme"; const idPrefix = "character-inventory"; diff --git a/src/goals/CharacterInventory/CharInvCompleted.tsx b/src/goals/CharacterInventory/CharInvCompleted.tsx index eaea927886..695103afed 100644 --- a/src/goals/CharacterInventory/CharInvCompleted.tsx +++ b/src/goals/CharacterInventory/CharInvCompleted.tsx @@ -15,7 +15,7 @@ import { defaultCharInvChanges, } from "goals/CharacterInventory/CharacterInventoryTypes"; import { useAppSelector } from "rootRedux/hooks"; -import { type StoreState } from "rootRedux/rootReduxTypes"; +import { type StoreState } from "rootRedux/types"; export enum CharInvCompletedId { TypographyNoCharChanges = "no-char-changes-typography", diff --git a/src/goals/CharacterInventory/Redux/CharacterInventoryActions.ts b/src/goals/CharacterInventory/Redux/CharacterInventoryActions.ts index 11d0f0ba1d..7f4e7afc88 100644 --- a/src/goals/CharacterInventory/Redux/CharacterInventoryActions.ts +++ b/src/goals/CharacterInventory/Redux/CharacterInventoryActions.ts @@ -29,10 +29,7 @@ import { addCharInvChangesToGoal, asyncUpdateGoal, } from "goals/Redux/GoalActions"; -import { - type StoreState, - type StoreStateDispatch, -} from "rootRedux/rootReduxTypes"; +import { type StoreState, type StoreStateDispatch } from "rootRedux/types"; import router from "router/browserRouter"; import { type Hash } from "types/hash"; import { Path } from "types/path"; diff --git a/src/goals/CharacterInventory/Redux/CharacterInventoryReducer.ts b/src/goals/CharacterInventory/Redux/CharacterInventoryReducer.ts index 68d8d3b56b..c3b94d8b6d 100644 --- a/src/goals/CharacterInventory/Redux/CharacterInventoryReducer.ts +++ b/src/goals/CharacterInventory/Redux/CharacterInventoryReducer.ts @@ -4,7 +4,7 @@ import { getCharacterStatus, defaultState, } from "goals/CharacterInventory/Redux/CharacterInventoryReduxTypes"; -import { StoreActionTypes } from "rootRedux/rootActions"; +import { StoreActionTypes } from "rootRedux/actions"; const characterInventorySlice = createSlice({ name: "characterInventoryState", diff --git a/src/goals/CharacterInventory/tests/CharInvCompleted.test.tsx b/src/goals/CharacterInventory/tests/CharInvCompleted.test.tsx index 1beef1f68d..ef63cdfba5 100644 --- a/src/goals/CharacterInventory/tests/CharInvCompleted.test.tsx +++ b/src/goals/CharacterInventory/tests/CharInvCompleted.test.tsx @@ -21,7 +21,7 @@ import { defaultCharInvChanges, } from "goals/CharacterInventory/CharacterInventoryTypes"; import { defaultState } from "goals/Redux/GoalReduxTypes"; -import { type StoreState } from "rootRedux/rootReduxTypes"; +import { type StoreState } from "rootRedux/types"; import { newWord as mockWord } from "types/word"; jest.mock("backend", () => ({ diff --git a/src/goals/DefaultGoal/BaseGoalScreen.tsx b/src/goals/DefaultGoal/BaseGoalScreen.tsx index dfc449e46a..0841794444 100644 --- a/src/goals/DefaultGoal/BaseGoalScreen.tsx +++ b/src/goals/DefaultGoal/BaseGoalScreen.tsx @@ -8,7 +8,7 @@ import Loading from "goals/DefaultGoal/Loading"; import { clearTree } from "goals/MergeDuplicates/Redux/MergeDupsActions"; import { setCurrentGoal } from "goals/Redux/GoalActions"; import { useAppDispatch, useAppSelector } from "rootRedux/hooks"; -import { type StoreState } from "rootRedux/rootReduxTypes"; +import { type StoreState } from "rootRedux/types"; import { Goal, GoalStatus, GoalType } from "types/goals"; import { Path } from "types/path"; diff --git a/src/goals/DefaultGoal/DisplayProgress.tsx b/src/goals/DefaultGoal/DisplayProgress.tsx index 44e91347ce..ea04b97a14 100644 --- a/src/goals/DefaultGoal/DisplayProgress.tsx +++ b/src/goals/DefaultGoal/DisplayProgress.tsx @@ -3,7 +3,7 @@ import { ReactElement } from "react"; import { useTranslation } from "react-i18next"; import { useSelector } from "react-redux"; -import { type StoreState } from "rootRedux/rootReduxTypes"; +import { type StoreState } from "rootRedux/types"; import { GoalType } from "types/goals"; /** diff --git a/src/goals/DefaultGoal/NextGoalScreen.tsx b/src/goals/DefaultGoal/NextGoalScreen.tsx index 91a168a070..49b2353a40 100644 --- a/src/goals/DefaultGoal/NextGoalScreen.tsx +++ b/src/goals/DefaultGoal/NextGoalScreen.tsx @@ -5,7 +5,7 @@ import PageNotFound from "components/PageNotFound/component"; import MergeDupsContinueDialog from "goals/MergeDuplicates/MergeDupsContinueDialog"; import { asyncAddGoal } from "goals/Redux/GoalActions"; import { useAppDispatch, useAppSelector } from "rootRedux/hooks"; -import { type StoreState } from "rootRedux/rootReduxTypes"; +import { type StoreState } from "rootRedux/types"; import { GoalType } from "types/goals"; import { Path } from "types/path"; import { goalTypeToGoal } from "utilities/goalUtilities"; diff --git a/src/goals/MergeDuplicates/MergeDupsCompleted.tsx b/src/goals/MergeDuplicates/MergeDupsCompleted.tsx index 39ef532338..1b00f72cdf 100644 --- a/src/goals/MergeDuplicates/MergeDupsCompleted.tsx +++ b/src/goals/MergeDuplicates/MergeDupsCompleted.tsx @@ -9,7 +9,7 @@ import { getFrontierWords, getWord, undoMerge } from "backend"; import { FlagButton, UndoButton } from "components/Buttons"; import SenseCardContent from "goals/MergeDuplicates/MergeDupsStep/SenseCardContent"; import { MergesCompleted } from "goals/MergeDuplicates/MergeDupsTypes"; -import { type StoreState } from "rootRedux/rootReduxTypes"; +import { type StoreState } from "rootRedux/types"; import theme from "types/theme"; import { newFlag } from "types/word"; import { TypographyWithFont } from "utilities/fontComponents"; diff --git a/src/goals/MergeDuplicates/MergeDupsStep/MergeDragDrop/DragSense.tsx b/src/goals/MergeDuplicates/MergeDupsStep/MergeDragDrop/DragSense.tsx index 12af348b21..fcbe4e8660 100644 --- a/src/goals/MergeDuplicates/MergeDupsStep/MergeDragDrop/DragSense.tsx +++ b/src/goals/MergeDuplicates/MergeDupsStep/MergeDragDrop/DragSense.tsx @@ -7,7 +7,7 @@ import SenseCardContent from "goals/MergeDuplicates/MergeDupsStep/SenseCardConte import { MergeTreeSense } from "goals/MergeDuplicates/MergeDupsTreeTypes"; import { setSidebar } from "goals/MergeDuplicates/Redux/MergeDupsActions"; import { useAppDispatch, useAppSelector } from "rootRedux/hooks"; -import { type StoreState } from "rootRedux/rootReduxTypes"; +import { type StoreState } from "rootRedux/types"; import theme from "types/theme"; interface DragSenseProps { diff --git a/src/goals/MergeDuplicates/MergeDupsStep/MergeDragDrop/DropWord.tsx b/src/goals/MergeDuplicates/MergeDupsStep/MergeDragDrop/DropWord.tsx index 95075865a7..2d80007ec7 100644 --- a/src/goals/MergeDuplicates/MergeDupsStep/MergeDragDrop/DropWord.tsx +++ b/src/goals/MergeDuplicates/MergeDupsStep/MergeDragDrop/DropWord.tsx @@ -26,7 +26,7 @@ import { setVern, } from "goals/MergeDuplicates/Redux/MergeDupsActions"; import { useAppDispatch, useAppSelector } from "rootRedux/hooks"; -import { type StoreState } from "rootRedux/rootReduxTypes"; +import { type StoreState } from "rootRedux/types"; import theme from "types/theme"; import { TypographyWithFont } from "utilities/fontComponents"; diff --git a/src/goals/MergeDuplicates/MergeDupsStep/MergeDragDrop/SidebarDragSense.tsx b/src/goals/MergeDuplicates/MergeDupsStep/MergeDragDrop/SidebarDragSense.tsx index cbbf441499..0708d9dbe1 100644 --- a/src/goals/MergeDuplicates/MergeDupsStep/MergeDragDrop/SidebarDragSense.tsx +++ b/src/goals/MergeDuplicates/MergeDupsStep/MergeDragDrop/SidebarDragSense.tsx @@ -9,7 +9,7 @@ import { MergeTreeSense, } from "goals/MergeDuplicates/MergeDupsTreeTypes"; import { useAppSelector } from "rootRedux/hooks"; -import { type StoreState } from "rootRedux/rootReduxTypes"; +import { type StoreState } from "rootRedux/types"; import theme from "types/theme"; interface SidebarDragSenseProps { diff --git a/src/goals/MergeDuplicates/MergeDupsStep/MergeDragDrop/SidebarDrop.tsx b/src/goals/MergeDuplicates/MergeDupsStep/MergeDragDrop/SidebarDrop.tsx index fe051af357..aa11fc5853 100644 --- a/src/goals/MergeDuplicates/MergeDupsStep/MergeDragDrop/SidebarDrop.tsx +++ b/src/goals/MergeDuplicates/MergeDupsStep/MergeDragDrop/SidebarDrop.tsx @@ -7,7 +7,7 @@ import SidebarDragSense from "goals/MergeDuplicates/MergeDupsStep/MergeDragDrop/ import { MergeTreeSense } from "goals/MergeDuplicates/MergeDupsTreeTypes"; import { setSidebar } from "goals/MergeDuplicates/Redux/MergeDupsActions"; import { useAppDispatch, useAppSelector } from "rootRedux/hooks"; -import { type StoreState } from "rootRedux/rootReduxTypes"; +import { type StoreState } from "rootRedux/types"; import { openUserGuide } from "utilities/pathUtilities"; export default function SidebarDrop(): ReactElement { diff --git a/src/goals/MergeDuplicates/MergeDupsStep/MergeDragDrop/index.tsx b/src/goals/MergeDuplicates/MergeDupsStep/MergeDragDrop/index.tsx index dc90679438..4831fedff3 100644 --- a/src/goals/MergeDuplicates/MergeDupsStep/MergeDragDrop/index.tsx +++ b/src/goals/MergeDuplicates/MergeDupsStep/MergeDragDrop/index.tsx @@ -17,7 +17,7 @@ import { orderSense, } from "goals/MergeDuplicates/Redux/MergeDupsActions"; import { useAppDispatch, useAppSelector } from "rootRedux/hooks"; -import { type StoreState } from "rootRedux/rootReduxTypes"; +import { type StoreState } from "rootRedux/types"; import theme from "types/theme"; export const trashId = "trash-drop"; diff --git a/src/goals/MergeDuplicates/MergeDupsStep/index.tsx b/src/goals/MergeDuplicates/MergeDupsStep/index.tsx index 43cafcd5f6..6b1c2b01ac 100644 --- a/src/goals/MergeDuplicates/MergeDupsStep/index.tsx +++ b/src/goals/MergeDuplicates/MergeDupsStep/index.tsx @@ -5,7 +5,7 @@ import { useTranslation } from "react-i18next"; import MergeDragDrop from "goals/MergeDuplicates/MergeDupsStep/MergeDragDrop"; import SaveDeferButtons from "goals/MergeDuplicates/MergeDupsStep/SaveDeferButtons"; import { useAppSelector } from "rootRedux/hooks"; -import { type StoreState } from "rootRedux/rootReduxTypes"; +import { type StoreState } from "rootRedux/types"; import theme from "types/theme"; export default function MergeDupsStep(): ReactElement { diff --git a/src/goals/MergeDuplicates/Redux/MergeDupsActions.ts b/src/goals/MergeDuplicates/Redux/MergeDupsActions.ts index 2deb71c833..b09a04b158 100644 --- a/src/goals/MergeDuplicates/Redux/MergeDupsActions.ts +++ b/src/goals/MergeDuplicates/Redux/MergeDupsActions.ts @@ -38,10 +38,7 @@ import { addCompletedMergeToGoal, asyncUpdateGoal, } from "goals/Redux/GoalActions"; -import { - type StoreState, - type StoreStateDispatch, -} from "rootRedux/rootReduxTypes"; +import { type StoreState, type StoreStateDispatch } from "rootRedux/types"; // Action Creation Functions diff --git a/src/goals/MergeDuplicates/Redux/MergeDupsReducer.ts b/src/goals/MergeDuplicates/Redux/MergeDupsReducer.ts index 5f415f8b36..0169862abe 100644 --- a/src/goals/MergeDuplicates/Redux/MergeDupsReducer.ts +++ b/src/goals/MergeDuplicates/Redux/MergeDupsReducer.ts @@ -26,7 +26,7 @@ import { getDeletedMergeWords, isEmptyMerge, } from "goals/MergeDuplicates/Redux/reducerUtilities"; -import { StoreActionTypes } from "rootRedux/rootActions"; +import { StoreActionTypes } from "rootRedux/actions"; import { type Hash } from "types/hash"; const mergeDuplicatesSlice = createSlice({ diff --git a/src/goals/MergeDuplicates/Redux/tests/MergeDupsReducer.test.tsx b/src/goals/MergeDuplicates/Redux/tests/MergeDupsReducer.test.tsx index 8a5ae4b90b..d4e62a6d01 100644 --- a/src/goals/MergeDuplicates/Redux/tests/MergeDupsReducer.test.tsx +++ b/src/goals/MergeDuplicates/Redux/tests/MergeDupsReducer.test.tsx @@ -28,7 +28,7 @@ import { mergeTwoSensesScenario, mergeTwoWordsScenario, } from "goals/MergeDuplicates/Redux/tests/MergeDupsDataMock"; -import { type StoreAction, StoreActionTypes } from "rootRedux/rootActions"; +import { type StoreAction, StoreActionTypes } from "rootRedux/actions"; import { setupStore } from "rootRedux/store"; import { type Hash } from "types/hash"; import { newFlag, testWordList } from "types/word"; diff --git a/src/goals/Redux/GoalActions.ts b/src/goals/Redux/GoalActions.ts index 80d8a1ebe8..a2c3bd6afd 100644 --- a/src/goals/Redux/GoalActions.ts +++ b/src/goals/Redux/GoalActions.ts @@ -18,10 +18,7 @@ import { updateStepFromDataAction, } from "goals/Redux/GoalReducer"; import { EntryEdit } from "goals/ReviewEntries/ReviewEntriesTypes"; -import { - type StoreState, - type StoreStateDispatch, -} from "rootRedux/rootReduxTypes"; +import { type StoreState, type StoreStateDispatch } from "rootRedux/types"; import router from "router/browserRouter"; import { Goal, GoalStatus, GoalType } from "types/goals"; import { Path } from "types/path"; diff --git a/src/goals/Redux/GoalReducer.ts b/src/goals/Redux/GoalReducer.ts index 5b74fcab04..23c802ba4a 100644 --- a/src/goals/Redux/GoalReducer.ts +++ b/src/goals/Redux/GoalReducer.ts @@ -9,7 +9,7 @@ import { EntriesEdited, EntryEdit, } from "goals/ReviewEntries/ReviewEntriesTypes"; -import { StoreActionTypes } from "rootRedux/rootActions"; +import { StoreActionTypes } from "rootRedux/actions"; import { GoalType } from "types/goals"; const goalSlice = createSlice({ diff --git a/src/goals/ReviewEntries/ReviewEntriesCompleted.tsx b/src/goals/ReviewEntries/ReviewEntriesCompleted.tsx index 8cfa578927..1fb4a23666 100644 --- a/src/goals/ReviewEntries/ReviewEntriesCompleted.tsx +++ b/src/goals/ReviewEntries/ReviewEntriesCompleted.tsx @@ -12,7 +12,7 @@ import { EntriesEdited, EntryEdit, } from "goals/ReviewEntries/ReviewEntriesTypes"; -import { type StoreState } from "rootRedux/rootReduxTypes"; +import { type StoreState } from "rootRedux/types"; import theme from "types/theme"; export default function ReviewEntriesCompleted(): ReactElement { diff --git a/src/goals/ReviewEntries/ReviewEntriesTable/Cells/EditCell/EditDialog.tsx b/src/goals/ReviewEntries/ReviewEntriesTable/Cells/EditCell/EditDialog.tsx index b325a07583..da2cfaa718 100644 --- a/src/goals/ReviewEntries/ReviewEntriesTable/Cells/EditCell/EditDialog.tsx +++ b/src/goals/ReviewEntries/ReviewEntriesTable/Cells/EditCell/EditDialog.tsx @@ -43,10 +43,7 @@ import { isSenseChanged, } from "goals/ReviewEntries/ReviewEntriesTable/Cells/EditCell/utilities"; import { useAppDispatch, useAppSelector } from "rootRedux/hooks"; -import { - type StoreState, - type StoreStateDispatch, -} from "rootRedux/rootReduxTypes"; +import { type StoreState, type StoreStateDispatch } from "rootRedux/types"; import { themeColors } from "types/theme"; import { type FileWithSpeakerId, diff --git a/src/goals/ReviewEntries/ReviewEntriesTable/Cells/EditCell/EditSenseDialog.tsx b/src/goals/ReviewEntries/ReviewEntriesTable/Cells/EditCell/EditSenseDialog.tsx index bdabf89151..31e251547b 100644 --- a/src/goals/ReviewEntries/ReviewEntriesTable/Cells/EditCell/EditSenseDialog.tsx +++ b/src/goals/ReviewEntries/ReviewEntriesTable/Cells/EditCell/EditSenseDialog.tsx @@ -39,7 +39,7 @@ import { cleanSense, } from "goals/ReviewEntries/ReviewEntriesTable/Cells/EditCell/utilities"; import { useAppSelector } from "rootRedux/hooks"; -import { type StoreState } from "rootRedux/rootReduxTypes"; +import { type StoreState } from "rootRedux/types"; import { newSemanticDomainForMongoDB } from "types/semanticDomain"; import { newDefinition, newGloss } from "types/word"; import { TextFieldWithFont } from "utilities/fontComponents"; diff --git a/src/goals/ReviewEntries/ReviewEntriesTable/Cells/EditCell/tests/EditSenseDialog.test.tsx b/src/goals/ReviewEntries/ReviewEntriesTable/Cells/EditCell/tests/EditSenseDialog.test.tsx index d0c92ddf24..9ecfdbca90 100644 --- a/src/goals/ReviewEntries/ReviewEntriesTable/Cells/EditCell/tests/EditSenseDialog.test.tsx +++ b/src/goals/ReviewEntries/ReviewEntriesTable/Cells/EditCell/tests/EditSenseDialog.test.tsx @@ -8,7 +8,7 @@ import { defaultState } from "components/App/DefaultState"; import EditSenseDialog, { EditSenseDialogId, } from "goals/ReviewEntries/ReviewEntriesTable/Cells/EditCell/EditSenseDialog"; -import { type StoreState } from "rootRedux/rootReduxTypes"; +import { type StoreState } from "rootRedux/types"; import { newSense } from "types/word"; // Container uses Portal, not supported in react-test-renderer diff --git a/src/goals/ReviewEntries/ReviewEntriesTable/index.tsx b/src/goals/ReviewEntries/ReviewEntriesTable/index.tsx index 4b1c59682c..622f6d96bb 100644 --- a/src/goals/ReviewEntries/ReviewEntriesTable/index.tsx +++ b/src/goals/ReviewEntries/ReviewEntriesTable/index.tsx @@ -23,7 +23,7 @@ import * as Cell from "goals/ReviewEntries/ReviewEntriesTable/Cells"; import * as ff from "goals/ReviewEntries/ReviewEntriesTable/filterFn"; import * as sf from "goals/ReviewEntries/ReviewEntriesTable/sortingFn"; import { useAppSelector } from "rootRedux/hooks"; -import { type StoreState } from "rootRedux/rootReduxTypes"; +import { type StoreState } from "rootRedux/types"; import { type Hash } from "types/hash"; /** Import `material-react-table` localization for given `lang`. diff --git a/src/goals/ReviewEntries/ReviewEntriesTable/tests/index.test.tsx b/src/goals/ReviewEntries/ReviewEntriesTable/tests/index.test.tsx index 70adfc3217..179279f474 100644 --- a/src/goals/ReviewEntries/ReviewEntriesTable/tests/index.test.tsx +++ b/src/goals/ReviewEntries/ReviewEntriesTable/tests/index.test.tsx @@ -11,7 +11,7 @@ import { mockWords, sortOrder, } from "goals/ReviewEntries/ReviewEntriesTable/tests/WordsMock"; -import { type StoreState } from "rootRedux/rootReduxTypes"; +import { type StoreState } from "rootRedux/types"; // With `columnFilterDisplayMode: "popover",`, it is necessary to mock out `Grow`. // To access filter `TextField`s, replace both `Grow`, `Modal` with `div`. diff --git a/src/rootRedux/rootActions.ts b/src/rootRedux/actions.ts similarity index 100% rename from src/rootRedux/rootActions.ts rename to src/rootRedux/actions.ts diff --git a/src/rootRedux/rootReducer.ts b/src/rootRedux/reducer.ts similarity index 95% rename from src/rootRedux/rootReducer.ts rename to src/rootRedux/reducer.ts index 5c13ab60c0..920c615645 100644 --- a/src/rootRedux/rootReducer.ts +++ b/src/rootRedux/reducer.ts @@ -8,7 +8,7 @@ import treeViewReducer from "components/TreeView/Redux/TreeViewReducer"; import characterInventoryReducer from "goals/CharacterInventory/Redux/CharacterInventoryReducer"; import mergeDupStepReducer from "goals/MergeDuplicates/Redux/MergeDupsReducer"; import goalsReducer from "goals/Redux/GoalReducer"; -import { type StoreState } from "rootRedux/rootReduxTypes"; +import { type StoreState } from "rootRedux/types"; import analyticsReducer from "types/Redux/analytics"; export const rootReducer: Reducer = combineReducers({ diff --git a/src/rootRedux/store.ts b/src/rootRedux/store.ts index a09c36820f..c821939bac 100644 --- a/src/rootRedux/store.ts +++ b/src/rootRedux/store.ts @@ -2,7 +2,7 @@ import { type PreloadedState, configureStore } from "@reduxjs/toolkit"; import { persistStore, persistReducer } from "redux-persist"; import storage from "redux-persist/lib/storage"; -import { rootReducer } from "rootRedux/rootReducer"; +import { rootReducer } from "rootRedux/reducer"; const persistConfig = { key: "root", storage }; diff --git a/src/rootRedux/rootReduxTypes.ts b/src/rootRedux/types.ts similarity index 100% rename from src/rootRedux/rootReduxTypes.ts rename to src/rootRedux/types.ts diff --git a/src/types/Redux/analytics.ts b/src/types/Redux/analytics.ts index 72ddc7e8ae..d125bdf8d1 100644 --- a/src/types/Redux/analytics.ts +++ b/src/types/Redux/analytics.ts @@ -1,6 +1,6 @@ import { PayloadAction, createSlice } from "@reduxjs/toolkit"; -import { StoreActionTypes } from "rootRedux/rootActions"; +import { StoreActionTypes } from "rootRedux/actions"; import { defaultState } from "types/Redux/analyticsReduxTypes"; const analyticsSlice = createSlice({