Refactor and consolidate store imports (#774)
* Refactor and consolitdate store imports - Created a new index file in the core stores directory to export all stores from a single module. - Updated imports to use consolidated store exports. * Remove unnecessary import * Update imports * Use named exports * Change store import after merge --------- Co-authored-by: philon- <philon-@users.noreply.github.com>
This commit is contained in:
co-authored by
philon-
parent
ed0a99dbd9
commit
d453ff809a
@@ -6,9 +6,7 @@ import { KeyBackupReminder } from "@components/KeyBackupReminder.tsx";
|
|||||||
import { ErrorPage } from "@components/UI/ErrorPage.tsx";
|
import { ErrorPage } from "@components/UI/ErrorPage.tsx";
|
||||||
import Footer from "@components/UI/Footer.tsx";
|
import Footer from "@components/UI/Footer.tsx";
|
||||||
import { useTheme } from "@core/hooks/useTheme.ts";
|
import { useTheme } from "@core/hooks/useTheme.ts";
|
||||||
import { useAppStore } from "@core/stores/appStore.ts";
|
import { SidebarProvider, useAppStore, useDeviceStore } from "@core/stores";
|
||||||
import { useDeviceStore } from "@core/stores/deviceStore.ts";
|
|
||||||
import { SidebarProvider } from "@core/stores/sidebarStore.tsx";
|
|
||||||
import { Dashboard } from "@pages/Dashboard/index.tsx";
|
import { Dashboard } from "@pages/Dashboard/index.tsx";
|
||||||
import { Outlet } from "@tanstack/react-router";
|
import { Outlet } from "@tanstack/react-router";
|
||||||
import { TanStackRouterDevtools } from "@tanstack/react-router-devtools";
|
import { TanStackRouterDevtools } from "@tanstack/react-router-devtools";
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import type { Device } from "@core/stores/deviceStore.ts";
|
import { type Device, DeviceContext } from "@core/stores";
|
||||||
import { DeviceContext } from "@core/stores/deviceStore.ts";
|
|
||||||
import type { ReactNode } from "react";
|
import type { ReactNode } from "react";
|
||||||
|
|
||||||
export interface DeviceWrapperProps {
|
export interface DeviceWrapperProps {
|
||||||
|
|||||||
@@ -8,8 +8,7 @@ import {
|
|||||||
CommandList,
|
CommandList,
|
||||||
} from "@components/UI/Command.tsx";
|
} from "@components/UI/Command.tsx";
|
||||||
import { usePinnedItems } from "@core/hooks/usePinnedItems.ts";
|
import { usePinnedItems } from "@core/hooks/usePinnedItems.ts";
|
||||||
import { useAppStore } from "@core/stores/appStore.ts";
|
import { useAppStore, useDevice, useDeviceStore } from "@core/stores";
|
||||||
import { useDevice, useDeviceStore } from "@core/stores/deviceStore.ts";
|
|
||||||
import { cn } from "@core/utils/cn.ts";
|
import { cn } from "@core/utils/cn.ts";
|
||||||
import { useNavigate } from "@tanstack/react-router";
|
import { useNavigate } from "@tanstack/react-router";
|
||||||
import { useCommandState } from "cmdk";
|
import { useCommandState } from "cmdk";
|
||||||
|
|||||||
+1
-1
@@ -6,7 +6,7 @@ import {
|
|||||||
DialogHeader,
|
DialogHeader,
|
||||||
DialogTitle,
|
DialogTitle,
|
||||||
} from "@components/UI/Dialog.tsx";
|
} from "@components/UI/Dialog.tsx";
|
||||||
import { useDevice } from "@core/stores/deviceStore.ts";
|
import { useDevice } from "@core/stores";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
|
||||||
export interface ClientNotificationDialogProps {
|
export interface ClientNotificationDialogProps {
|
||||||
|
|||||||
+2
-2
@@ -2,9 +2,9 @@ import { DeleteMessagesDialog } from "@components/Dialog/DeleteMessagesDialog/De
|
|||||||
import { fireEvent, render, screen } from "@testing-library/react";
|
import { fireEvent, render, screen } from "@testing-library/react";
|
||||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||||
// Ensure the path is correct for import
|
// Ensure the path is correct for import
|
||||||
import { useMessageStore } from "../../../core/stores/messageStore/index.ts";
|
import { useMessageStore } from "@core/stores";
|
||||||
|
|
||||||
vi.mock("@core/stores/messageStore", () => ({
|
vi.mock("@core/stores", () => ({
|
||||||
useMessageStore: vi.fn(() => ({
|
useMessageStore: vi.fn(() => ({
|
||||||
deleteAllMessages: vi.fn(),
|
deleteAllMessages: vi.fn(),
|
||||||
})),
|
})),
|
||||||
|
|||||||
@@ -8,9 +8,9 @@ import {
|
|||||||
DialogHeader,
|
DialogHeader,
|
||||||
DialogTitle,
|
DialogTitle,
|
||||||
} from "@components/UI/Dialog.tsx";
|
} from "@components/UI/Dialog.tsx";
|
||||||
|
import { useMessageStore } from "@core/stores";
|
||||||
import { AlertTriangleIcon } from "lucide-react";
|
import { AlertTriangleIcon } from "lucide-react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { useMessageStore } from "../../../core/stores/messageStore/index.ts";
|
|
||||||
|
|
||||||
export interface DeleteMessagesDialogProps {
|
export interface DeleteMessagesDialogProps {
|
||||||
open: boolean;
|
open: boolean;
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import {
|
|||||||
DialogHeader,
|
DialogHeader,
|
||||||
DialogTitle,
|
DialogTitle,
|
||||||
} from "@components/UI/Dialog.tsx";
|
} from "@components/UI/Dialog.tsx";
|
||||||
import { useDevice } from "@core/stores/deviceStore.ts";
|
import { useDevice } from "@core/stores";
|
||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { zodResolver } from "@hookform/resolvers/zod";
|
||||||
import { Protobuf } from "@meshtastic/core";
|
import { Protobuf } from "@meshtastic/core";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import { RefreshKeysDialog } from "@components/Dialog/RefreshKeysDialog/RefreshK
|
|||||||
import { RemoveNodeDialog } from "@components/Dialog/RemoveNodeDialog.tsx";
|
import { RemoveNodeDialog } from "@components/Dialog/RemoveNodeDialog.tsx";
|
||||||
import { ShutdownDialog } from "@components/Dialog/ShutdownDialog.tsx";
|
import { ShutdownDialog } from "@components/Dialog/ShutdownDialog.tsx";
|
||||||
import { UnsafeRolesDialog } from "@components/Dialog/UnsafeRolesDialog/UnsafeRolesDialog.tsx";
|
import { UnsafeRolesDialog } from "@components/Dialog/UnsafeRolesDialog/UnsafeRolesDialog.tsx";
|
||||||
import { useDevice } from "@core/stores/deviceStore.ts";
|
import { useDevice } from "@core/stores";
|
||||||
|
|
||||||
export const DialogManager = () => {
|
export const DialogManager = () => {
|
||||||
const { channels, config, dialog, setDialogOpen } = useDevice();
|
const { channels, config, dialog, setDialogOpen } = useDevice();
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import {
|
|||||||
import { Input } from "@components/UI/Input.tsx";
|
import { Input } from "@components/UI/Input.tsx";
|
||||||
import { Label } from "@components/UI/Label.tsx";
|
import { Label } from "@components/UI/Label.tsx";
|
||||||
import { Switch } from "@components/UI/Switch.tsx";
|
import { Switch } from "@components/UI/Switch.tsx";
|
||||||
import { useDevice } from "@core/stores/deviceStore.ts";
|
import { useDevice } from "@core/stores";
|
||||||
import { Protobuf } from "@meshtastic/core";
|
import { Protobuf } from "@meshtastic/core";
|
||||||
import { toByteArray } from "base64-js";
|
import { toByteArray } from "base64-js";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { useDevice } from "@core/stores/deviceStore.ts";
|
import { useDevice } from "@core/stores";
|
||||||
import type { Protobuf, Types } from "@meshtastic/core";
|
import type { Protobuf, Types } from "@meshtastic/core";
|
||||||
import { numberToHexUnpadded } from "@noble/curves/abstract/utils";
|
import { numberToHexUnpadded } from "@noble/curves/abstract/utils";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
|||||||
@@ -27,8 +27,7 @@ import {
|
|||||||
import { useFavoriteNode } from "@core/hooks/useFavoriteNode.ts";
|
import { useFavoriteNode } from "@core/hooks/useFavoriteNode.ts";
|
||||||
import { useIgnoreNode } from "@core/hooks/useIgnoreNode.ts";
|
import { useIgnoreNode } from "@core/hooks/useIgnoreNode.ts";
|
||||||
import { toast } from "@core/hooks/useToast.ts";
|
import { toast } from "@core/hooks/useToast.ts";
|
||||||
import { useAppStore } from "@core/stores/appStore.ts";
|
import { useAppStore, useDevice } from "@core/stores";
|
||||||
import { useDevice } from "@core/stores/deviceStore.ts";
|
|
||||||
import { cn } from "@core/utils/cn.ts";
|
import { cn } from "@core/utils/cn.ts";
|
||||||
import { Protobuf } from "@meshtastic/core";
|
import { Protobuf } from "@meshtastic/core";
|
||||||
import { numberToHexUnpadded } from "@noble/curves/abstract/utils";
|
import { numberToHexUnpadded } from "@noble/curves/abstract/utils";
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import { fromByteArray } from "base64-js";
|
|||||||
import { DownloadIcon, PrinterIcon } from "lucide-react";
|
import { DownloadIcon, PrinterIcon } from "lucide-react";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { useDevice } from "../../core/stores/deviceStore.ts";
|
import { useDevice } from "../../core/stores";
|
||||||
import { Button } from "../UI/Button.tsx";
|
import { Button } from "../UI/Button.tsx";
|
||||||
|
|
||||||
export interface PkiBackupDialogProps {
|
export interface PkiBackupDialogProps {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { fireEvent, render, screen, waitFor } from "@testing-library/react";
|
import { fireEvent, render, screen } from "@testing-library/react";
|
||||||
import type {
|
import type {
|
||||||
ButtonHTMLAttributes,
|
ButtonHTMLAttributes,
|
||||||
ClassAttributes,
|
ClassAttributes,
|
||||||
@@ -19,7 +19,7 @@ let mockConnection: {
|
|||||||
rebootOta: rebootOtaMock,
|
rebootOta: rebootOtaMock,
|
||||||
};
|
};
|
||||||
|
|
||||||
vi.mock("@core/stores/deviceStore.ts", () => ({
|
vi.mock("@core/stores", () => ({
|
||||||
useDevice: () => ({
|
useDevice: () => ({
|
||||||
connection: mockConnection,
|
connection: mockConnection,
|
||||||
}),
|
}),
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { Button } from "@components/UI/Button.tsx";
|
import { Button } from "@components/UI/Button.tsx";
|
||||||
|
import { Checkbox } from "@components/UI/Checkbox/index.tsx";
|
||||||
import {
|
import {
|
||||||
Dialog,
|
Dialog,
|
||||||
DialogClose,
|
DialogClose,
|
||||||
@@ -10,11 +11,10 @@ import {
|
|||||||
import { Input } from "@components/UI/Input.tsx";
|
import { Input } from "@components/UI/Input.tsx";
|
||||||
import { Label } from "@components/UI/Label.tsx";
|
import { Label } from "@components/UI/Label.tsx";
|
||||||
import { Separator } from "@components/UI/Seperator.tsx";
|
import { Separator } from "@components/UI/Seperator.tsx";
|
||||||
import { useDevice } from "@core/stores/deviceStore.ts";
|
import { useDevice } from "@core/stores";
|
||||||
import { ClockIcon, OctagonXIcon, RefreshCwIcon } from "lucide-react";
|
import { ClockIcon, OctagonXIcon, RefreshCwIcon } from "lucide-react";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { Checkbox } from "../UI/Checkbox/index.tsx";
|
|
||||||
|
|
||||||
export interface RebootDialogProps {
|
export interface RebootDialogProps {
|
||||||
open: boolean;
|
open: boolean;
|
||||||
|
|||||||
@@ -1,11 +1,16 @@
|
|||||||
import { DeviceContext, useDeviceStore } from "@core/stores/deviceStore.ts";
|
import { DeviceContext, useDeviceStore, useMessageStore } from "@core/stores";
|
||||||
import { render } from "@testing-library/react";
|
import { render } from "@testing-library/react";
|
||||||
import { afterEach, beforeEach, expect, test, vi } from "vitest";
|
import { afterEach, beforeEach, expect, test, vi } from "vitest";
|
||||||
import { useMessageStore } from "../../../core/stores/messageStore/index.ts";
|
|
||||||
import { RefreshKeysDialog } from "./RefreshKeysDialog.tsx";
|
import { RefreshKeysDialog } from "./RefreshKeysDialog.tsx";
|
||||||
import { useRefreshKeysDialog } from "./useRefreshKeysDialog.ts";
|
import { useRefreshKeysDialog } from "./useRefreshKeysDialog.ts";
|
||||||
|
|
||||||
vi.mock("@core/stores/messageStore");
|
vi.mock("@core/stores", async () => {
|
||||||
|
const actual = (await vi.importActual("@core/stores")) as typeof import("@core/stores");
|
||||||
|
return {
|
||||||
|
...actual,
|
||||||
|
useMessageStore: vi.fn(),
|
||||||
|
};
|
||||||
|
});
|
||||||
vi.mock("./useRefreshKeysDialog");
|
vi.mock("./useRefreshKeysDialog");
|
||||||
|
|
||||||
const mockUseMessageStore = vi.mocked(useMessageStore);
|
const mockUseMessageStore = vi.mocked(useMessageStore);
|
||||||
|
|||||||
@@ -6,8 +6,7 @@ import {
|
|||||||
DialogHeader,
|
DialogHeader,
|
||||||
DialogTitle,
|
DialogTitle,
|
||||||
} from "@components/UI/Dialog.tsx";
|
} from "@components/UI/Dialog.tsx";
|
||||||
import { useDevice } from "@core/stores/deviceStore.ts";
|
import { useDevice, useMessageStore } from "@core/stores";
|
||||||
import { useMessageStore } from "@core/stores/messageStore/index.ts";
|
|
||||||
import { LockKeyholeOpenIcon } from "lucide-react";
|
import { LockKeyholeOpenIcon } from "lucide-react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { useRefreshKeysDialog } from "./useRefreshKeysDialog.ts";
|
import { useRefreshKeysDialog } from "./useRefreshKeysDialog.ts";
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import { useDevice } from "@core/stores/deviceStore.ts";
|
import { useDevice, useMessageStore } from "@core/stores";
|
||||||
import { useMessageStore } from "@core/stores/messageStore/index.ts";
|
|
||||||
import { useCallback } from "react";
|
import { useCallback } from "react";
|
||||||
|
|
||||||
export function useRefreshKeysDialog() {
|
export function useRefreshKeysDialog() {
|
||||||
|
|||||||
@@ -9,9 +9,8 @@ import {
|
|||||||
DialogTitle,
|
DialogTitle,
|
||||||
} from "@components/UI/Dialog.tsx";
|
} from "@components/UI/Dialog.tsx";
|
||||||
import { Label } from "@components/UI/Label.tsx";
|
import { Label } from "@components/UI/Label.tsx";
|
||||||
import { useDevice } from "@core/stores/deviceStore.ts";
|
import { useAppStore, useDevice } from "@core/stores";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { useAppStore } from "../../core/stores/appStore.ts";
|
|
||||||
|
|
||||||
export interface RemoveNodeDialogProps {
|
export interface RemoveNodeDialogProps {
|
||||||
open: boolean;
|
open: boolean;
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import {
|
|||||||
DialogTitle,
|
DialogTitle,
|
||||||
} from "@components/UI/Dialog.tsx";
|
} from "@components/UI/Dialog.tsx";
|
||||||
import { Input } from "@components/UI/Input.tsx";
|
import { Input } from "@components/UI/Input.tsx";
|
||||||
import { useDevice } from "@core/stores/deviceStore.ts";
|
import { useDevice } from "@core/stores";
|
||||||
import { ClockIcon, PowerIcon } from "lucide-react";
|
import { ClockIcon, PowerIcon } from "lucide-react";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { useDevice } from "@core/stores/deviceStore.ts";
|
import { useDevice } from "@core/stores";
|
||||||
import type { Protobuf, Types } from "@meshtastic/core";
|
import type { Protobuf, Types } from "@meshtastic/core";
|
||||||
import { numberToHexUnpadded } from "@noble/curves/abstract/utils";
|
import { numberToHexUnpadded } from "@noble/curves/abstract/utils";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import {
|
|||||||
DialogTitle,
|
DialogTitle,
|
||||||
} from "@components/UI/Dialog.tsx";
|
} from "@components/UI/Dialog.tsx";
|
||||||
import { Link } from "@components/UI/Typography/Link.tsx";
|
import { Link } from "@components/UI/Typography/Link.tsx";
|
||||||
import { useDevice } from "@core/stores/deviceStore.ts";
|
import { useDevice } from "@core/stores";
|
||||||
import { eventBus } from "@core/utils/eventBus.ts";
|
import { eventBus } from "@core/utils/eventBus.ts";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { useDevice } from "@core/stores/deviceStore.ts";
|
import { useDevice } from "@core/stores";
|
||||||
import { eventBus } from "@core/utils/eventBus.ts";
|
import { eventBus } from "@core/utils/eventBus.ts";
|
||||||
import { useCallback } from "react";
|
import { useCallback } from "react";
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import { FieldWrapper } from "@components/Form/FormWrapper.tsx";
|
|||||||
import { Button } from "@components/UI/Button.tsx";
|
import { Button } from "@components/UI/Button.tsx";
|
||||||
import { Heading } from "@components/UI/Typography/Heading.tsx";
|
import { Heading } from "@components/UI/Typography/Heading.tsx";
|
||||||
import { Subtle } from "@components/UI/Typography/Subtle.tsx";
|
import { Subtle } from "@components/UI/Typography/Subtle.tsx";
|
||||||
import { useAppStore } from "@core/stores/appStore.ts";
|
import { useAppStore } from "@core/stores";
|
||||||
import { dotPaths } from "@core/utils/dotPath.ts";
|
import { dotPaths } from "@core/utils/dotPath.ts";
|
||||||
import { useEffect } from "react";
|
import { useEffect } from "react";
|
||||||
import {
|
import {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { useBackupReminder } from "@core/hooks/useKeyBackupReminder.tsx";
|
import { useBackupReminder } from "@core/hooks/useKeyBackupReminder.tsx";
|
||||||
import { useDevice } from "@core/stores/deviceStore.ts";
|
import { useDevice } from "@core/stores";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
|
||||||
export const KeyBackupReminder = () => {
|
export const KeyBackupReminder = () => {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { create } from "@bufbuild/protobuf";
|
|||||||
import { PkiRegenerateDialog } from "@components/Dialog/PkiRegenerateDialog.tsx";
|
import { PkiRegenerateDialog } from "@components/Dialog/PkiRegenerateDialog.tsx";
|
||||||
import { DynamicForm } from "@components/Form/DynamicForm.tsx";
|
import { DynamicForm } from "@components/Form/DynamicForm.tsx";
|
||||||
import { useToast } from "@core/hooks/useToast.ts";
|
import { useToast } from "@core/hooks/useToast.ts";
|
||||||
import { useDevice } from "@core/stores/deviceStore.ts";
|
import { useDevice } from "@core/stores";
|
||||||
import { Protobuf } from "@meshtastic/core";
|
import { Protobuf } from "@meshtastic/core";
|
||||||
import { fromByteArray, toByteArray } from "base64-js";
|
import { fromByteArray, toByteArray } from "base64-js";
|
||||||
import cryptoRandomString from "crypto-random-string";
|
import cryptoRandomString from "crypto-random-string";
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import {
|
|||||||
DynamicForm,
|
DynamicForm,
|
||||||
type DynamicFormFormInit,
|
type DynamicFormFormInit,
|
||||||
} from "@components/Form/DynamicForm.tsx";
|
} from "@components/Form/DynamicForm.tsx";
|
||||||
import { useDevice } from "@core/stores/deviceStore.ts";
|
import { useDevice } from "@core/stores";
|
||||||
import { deepCompareConfig } from "@core/utils/deepCompareConfig.ts";
|
import { deepCompareConfig } from "@core/utils/deepCompareConfig.ts";
|
||||||
import { Protobuf } from "@meshtastic/core";
|
import { Protobuf } from "@meshtastic/core";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import {
|
|||||||
DynamicForm,
|
DynamicForm,
|
||||||
type DynamicFormFormInit,
|
type DynamicFormFormInit,
|
||||||
} from "@components/Form/DynamicForm.tsx";
|
} from "@components/Form/DynamicForm.tsx";
|
||||||
import { useDevice } from "@core/stores/deviceStore.ts";
|
import { useDevice } from "@core/stores";
|
||||||
import { deepCompareConfig } from "@core/utils/deepCompareConfig.ts";
|
import { deepCompareConfig } from "@core/utils/deepCompareConfig.ts";
|
||||||
import { Protobuf } from "@meshtastic/core";
|
import { Protobuf } from "@meshtastic/core";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import {
|
|||||||
DynamicForm,
|
DynamicForm,
|
||||||
type DynamicFormFormInit,
|
type DynamicFormFormInit,
|
||||||
} from "@components/Form/DynamicForm.tsx";
|
} from "@components/Form/DynamicForm.tsx";
|
||||||
import { useDevice } from "@core/stores/deviceStore.ts";
|
import { useDevice } from "@core/stores";
|
||||||
import { deepCompareConfig } from "@core/utils/deepCompareConfig.ts";
|
import { deepCompareConfig } from "@core/utils/deepCompareConfig.ts";
|
||||||
import { Protobuf } from "@meshtastic/core";
|
import { Protobuf } from "@meshtastic/core";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import {
|
|||||||
DynamicForm,
|
DynamicForm,
|
||||||
type DynamicFormFormInit,
|
type DynamicFormFormInit,
|
||||||
} from "@components/Form/DynamicForm.tsx";
|
} from "@components/Form/DynamicForm.tsx";
|
||||||
import { useDevice } from "@core/stores/deviceStore.ts";
|
import { useDevice } from "@core/stores";
|
||||||
import { deepCompareConfig } from "@core/utils/deepCompareConfig.ts";
|
import { deepCompareConfig } from "@core/utils/deepCompareConfig.ts";
|
||||||
import { Protobuf } from "@meshtastic/core";
|
import { Protobuf } from "@meshtastic/core";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import {
|
|||||||
DynamicForm,
|
DynamicForm,
|
||||||
type DynamicFormFormInit,
|
type DynamicFormFormInit,
|
||||||
} from "@components/Form/DynamicForm.tsx";
|
} from "@components/Form/DynamicForm.tsx";
|
||||||
import { useDevice } from "@core/stores/deviceStore.ts";
|
import { useDevice } from "@core/stores";
|
||||||
import { deepCompareConfig } from "@core/utils/deepCompareConfig.ts";
|
import { deepCompareConfig } from "@core/utils/deepCompareConfig.ts";
|
||||||
import {
|
import {
|
||||||
convertIntToIpAddress,
|
convertIntToIpAddress,
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import {
|
|||||||
type FlagName,
|
type FlagName,
|
||||||
usePositionFlags,
|
usePositionFlags,
|
||||||
} from "@core/hooks/usePositionFlags.ts";
|
} from "@core/hooks/usePositionFlags.ts";
|
||||||
import { useDevice } from "@core/stores/deviceStore.ts";
|
import { useDevice } from "@core/stores";
|
||||||
import { deepCompareConfig } from "@core/utils/deepCompareConfig.ts";
|
import { deepCompareConfig } from "@core/utils/deepCompareConfig.ts";
|
||||||
import { Protobuf } from "@meshtastic/core";
|
import { Protobuf } from "@meshtastic/core";
|
||||||
import { useCallback } from "react";
|
import { useCallback } from "react";
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import {
|
|||||||
DynamicForm,
|
DynamicForm,
|
||||||
type DynamicFormFormInit,
|
type DynamicFormFormInit,
|
||||||
} from "@components/Form/DynamicForm.tsx";
|
} from "@components/Form/DynamicForm.tsx";
|
||||||
import { useDevice } from "@core/stores/deviceStore.ts";
|
import { useDevice } from "@core/stores";
|
||||||
import { deepCompareConfig } from "@core/utils/deepCompareConfig.ts";
|
import { deepCompareConfig } from "@core/utils/deepCompareConfig.ts";
|
||||||
import { Protobuf } from "@meshtastic/core";
|
import { Protobuf } from "@meshtastic/core";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
|||||||
@@ -12,8 +12,7 @@ import {
|
|||||||
DynamicForm,
|
DynamicForm,
|
||||||
type DynamicFormFormInit,
|
type DynamicFormFormInit,
|
||||||
} from "@components/Form/DynamicForm.tsx";
|
} from "@components/Form/DynamicForm.tsx";
|
||||||
import { useAppStore } from "@core/stores/appStore.ts";
|
import { useAppStore, useDevice } from "@core/stores";
|
||||||
import { useDevice } from "@core/stores/deviceStore.ts";
|
|
||||||
import { deepCompareConfig } from "@core/utils/deepCompareConfig.ts";
|
import { deepCompareConfig } from "@core/utils/deepCompareConfig.ts";
|
||||||
import { getX25519PrivateKey, getX25519PublicKey } from "@core/utils/x25519.ts";
|
import { getX25519PrivateKey, getX25519PublicKey } from "@core/utils/x25519.ts";
|
||||||
import { Protobuf } from "@meshtastic/core";
|
import { Protobuf } from "@meshtastic/core";
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
import { Mono } from "@components/generic/Mono.tsx";
|
import { Mono } from "@components/generic/Mono.tsx";
|
||||||
import { Button } from "@components/UI/Button.tsx";
|
import { Button } from "@components/UI/Button.tsx";
|
||||||
import { useAppStore } from "@core/stores/appStore.ts";
|
import { useAppStore, useDeviceStore, useMessageStore } from "@core/stores";
|
||||||
import { useDeviceStore } from "@core/stores/deviceStore.ts";
|
|
||||||
import { useMessageStore } from "@core/stores/messageStore/index.ts";
|
|
||||||
import { subscribeAll } from "@core/subscriptions.ts";
|
import { subscribeAll } from "@core/subscriptions.ts";
|
||||||
import { randId } from "@core/utils/randId.ts";
|
import { randId } from "@core/utils/randId.ts";
|
||||||
import { MeshDevice } from "@meshtastic/core";
|
import { MeshDevice } from "@meshtastic/core";
|
||||||
|
|||||||
@@ -4,14 +4,12 @@ import { TransportHTTP } from "@meshtastic/transport-http";
|
|||||||
import { fireEvent, render, screen, waitFor } from "@testing-library/react";
|
import { fireEvent, render, screen, waitFor } from "@testing-library/react";
|
||||||
import { describe, expect, it, vi } from "vitest";
|
import { describe, expect, it, vi } from "vitest";
|
||||||
|
|
||||||
vi.mock("@core/stores/appStore.ts", () => ({
|
vi.mock("@core/stores", () => ({
|
||||||
useAppStore: vi.fn(() => ({ setSelectedDevice: vi.fn() })),
|
useAppStore: vi.fn(() => ({ setSelectedDevice: vi.fn() })),
|
||||||
}));
|
|
||||||
|
|
||||||
vi.mock("@core/stores/deviceStore.ts", () => ({
|
|
||||||
useDeviceStore: vi.fn(() => ({
|
useDeviceStore: vi.fn(() => ({
|
||||||
addDevice: vi.fn(() => ({ addConnection: vi.fn() })),
|
addDevice: vi.fn(() => ({ addConnection: vi.fn() })),
|
||||||
})),
|
})),
|
||||||
|
useMessageStore: vi.fn()
|
||||||
}));
|
}));
|
||||||
|
|
||||||
vi.mock("@core/utils/randId.ts", () => ({
|
vi.mock("@core/utils/randId.ts", () => ({
|
||||||
|
|||||||
@@ -4,9 +4,7 @@ import { Input } from "@components/UI/Input.tsx";
|
|||||||
import { Label } from "@components/UI/Label.tsx";
|
import { Label } from "@components/UI/Label.tsx";
|
||||||
import { Switch } from "@components/UI/Switch.tsx";
|
import { Switch } from "@components/UI/Switch.tsx";
|
||||||
import { Link } from "@components/UI/Typography/Link.tsx";
|
import { Link } from "@components/UI/Typography/Link.tsx";
|
||||||
import { useAppStore } from "@core/stores/appStore.ts";
|
import { useAppStore, useDeviceStore, useMessageStore } from "@core/stores";
|
||||||
import { useDeviceStore } from "@core/stores/deviceStore.ts";
|
|
||||||
import { useMessageStore } from "@core/stores/messageStore/index.ts";
|
|
||||||
import { subscribeAll } from "@core/subscriptions.ts";
|
import { subscribeAll } from "@core/subscriptions.ts";
|
||||||
import { randId } from "@core/utils/randId.ts";
|
import { randId } from "@core/utils/randId.ts";
|
||||||
import { MeshDevice } from "@meshtastic/core";
|
import { MeshDevice } from "@meshtastic/core";
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
import { Mono } from "@components/generic/Mono.tsx";
|
import { Mono } from "@components/generic/Mono.tsx";
|
||||||
import { Button } from "@components/UI/Button.tsx";
|
import { Button } from "@components/UI/Button.tsx";
|
||||||
import { useAppStore } from "@core/stores/appStore.ts";
|
import { useAppStore, useDeviceStore, useMessageStore } from "@core/stores";
|
||||||
import { useDeviceStore } from "@core/stores/deviceStore.ts";
|
|
||||||
import { useMessageStore } from "@core/stores/messageStore/index.ts";
|
|
||||||
import { subscribeAll } from "@core/subscriptions.ts";
|
import { subscribeAll } from "@core/subscriptions.ts";
|
||||||
import { randId } from "@core/utils/randId.ts";
|
import { randId } from "@core/utils/randId.ts";
|
||||||
import { MeshDevice } from "@meshtastic/core";
|
import { MeshDevice } from "@meshtastic/core";
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Button } from "@components/UI/Button.tsx";
|
import { Button } from "@components/UI/Button.tsx";
|
||||||
import { Input } from "@components/UI/Input.tsx";
|
import { Input } from "@components/UI/Input.tsx";
|
||||||
import { useMessageStore } from "@core/stores/messageStore/index.ts";
|
import { useMessageStore } from "@core/stores";
|
||||||
import type { Types } from "@meshtastic/core";
|
import type { Types } from "@meshtastic/core";
|
||||||
import { SendIcon } from "lucide-react";
|
import { SendIcon } from "lucide-react";
|
||||||
import { startTransition, useState } from "react";
|
import { startTransition, useState } from "react";
|
||||||
|
|||||||
@@ -6,11 +6,7 @@ import {
|
|||||||
TooltipProvider,
|
TooltipProvider,
|
||||||
TooltipTrigger,
|
TooltipTrigger,
|
||||||
} from "@components/UI/Tooltip.tsx";
|
} from "@components/UI/Tooltip.tsx";
|
||||||
import { useDevice } from "@core/stores/deviceStore.ts";
|
import { MessageState, useDevice, useMessageStore } from "@core/stores";
|
||||||
import {
|
|
||||||
MessageState,
|
|
||||||
useMessageStore,
|
|
||||||
} from "@core/stores/messageStore/index.ts";
|
|
||||||
import type { Message } from "@core/stores/messageStore/types.ts";
|
import type { Message } from "@core/stores/messageStore/types.ts";
|
||||||
import { cn } from "@core/utils/cn.ts";
|
import { cn } from "@core/utils/cn.ts";
|
||||||
import { type Protobuf, Types } from "@meshtastic/core";
|
import { type Protobuf, Types } from "@meshtastic/core";
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import { TraceRoute } from "@components/PageComponents/Messages/TraceRoute.tsx";
|
import { TraceRoute } from "@components/PageComponents/Messages/TraceRoute.tsx";
|
||||||
import { mockDeviceStore } from "@core/stores/deviceStore.mock.ts";
|
import { mockDeviceStore } from "@core/stores/deviceStore/deviceStore.mock.ts";
|
||||||
import { useDevice } from "@core/stores/deviceStore.ts";
|
import { useDevice } from "@core/stores";
|
||||||
import { Protobuf } from "@meshtastic/core";
|
import { Protobuf } from "@meshtastic/core";
|
||||||
import { render, screen } from "@testing-library/react";
|
import { render, screen } from "@testing-library/react";
|
||||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||||
|
|
||||||
vi.mock("@core/stores/deviceStore");
|
vi.mock("@core/stores");
|
||||||
|
|
||||||
describe("TraceRoute", () => {
|
describe("TraceRoute", () => {
|
||||||
const fromUser = {
|
const fromUser = {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { useDevice } from "@core/stores/deviceStore.ts";
|
import { useDevice } from "@core/stores";
|
||||||
import type { Protobuf } from "@meshtastic/core";
|
import type { Protobuf } from "@meshtastic/core";
|
||||||
import { numberToHexUnpadded } from "@noble/curves/abstract/utils";
|
import { numberToHexUnpadded } from "@noble/curves/abstract/utils";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import {
|
|||||||
DynamicForm,
|
DynamicForm,
|
||||||
type DynamicFormFormInit,
|
type DynamicFormFormInit,
|
||||||
} from "@components/Form/DynamicForm.tsx";
|
} from "@components/Form/DynamicForm.tsx";
|
||||||
import { useDevice } from "@core/stores/deviceStore.ts";
|
import { useDevice } from "@core/stores";
|
||||||
import { deepCompareConfig } from "@core/utils/deepCompareConfig.ts";
|
import { deepCompareConfig } from "@core/utils/deepCompareConfig.ts";
|
||||||
import { Protobuf } from "@meshtastic/core";
|
import { Protobuf } from "@meshtastic/core";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import {
|
|||||||
DynamicForm,
|
DynamicForm,
|
||||||
type DynamicFormFormInit,
|
type DynamicFormFormInit,
|
||||||
} from "@components/Form/DynamicForm.tsx";
|
} from "@components/Form/DynamicForm.tsx";
|
||||||
import { useDevice } from "@core/stores/deviceStore.ts";
|
import { useDevice } from "@core/stores";
|
||||||
import { deepCompareConfig } from "@core/utils/deepCompareConfig.ts";
|
import { deepCompareConfig } from "@core/utils/deepCompareConfig.ts";
|
||||||
import { Protobuf } from "@meshtastic/core";
|
import { Protobuf } from "@meshtastic/core";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import {
|
|||||||
DynamicForm,
|
DynamicForm,
|
||||||
type DynamicFormFormInit,
|
type DynamicFormFormInit,
|
||||||
} from "@components/Form/DynamicForm.tsx";
|
} from "@components/Form/DynamicForm.tsx";
|
||||||
import { useDevice } from "@core/stores/deviceStore.ts";
|
import { useDevice } from "@core/stores";
|
||||||
import { deepCompareConfig } from "@core/utils/deepCompareConfig.ts";
|
import { deepCompareConfig } from "@core/utils/deepCompareConfig.ts";
|
||||||
import { Protobuf } from "@meshtastic/core";
|
import { Protobuf } from "@meshtastic/core";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import {
|
|||||||
DynamicForm,
|
DynamicForm,
|
||||||
type DynamicFormFormInit,
|
type DynamicFormFormInit,
|
||||||
} from "@components/Form/DynamicForm.tsx";
|
} from "@components/Form/DynamicForm.tsx";
|
||||||
import { useDevice } from "@core/stores/deviceStore.ts";
|
import { useDevice } from "@core/stores";
|
||||||
import { deepCompareConfig } from "@core/utils/deepCompareConfig.ts";
|
import { deepCompareConfig } from "@core/utils/deepCompareConfig.ts";
|
||||||
import { Protobuf } from "@meshtastic/core";
|
import { Protobuf } from "@meshtastic/core";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import {
|
|||||||
DynamicForm,
|
DynamicForm,
|
||||||
type DynamicFormFormInit,
|
type DynamicFormFormInit,
|
||||||
} from "@components/Form/DynamicForm.tsx";
|
} from "@components/Form/DynamicForm.tsx";
|
||||||
import { useDevice } from "@core/stores/deviceStore.ts";
|
import { useDevice } from "@core/stores";
|
||||||
import { deepCompareConfig } from "@core/utils/deepCompareConfig.ts";
|
import { deepCompareConfig } from "@core/utils/deepCompareConfig.ts";
|
||||||
import { Protobuf } from "@meshtastic/core";
|
import { Protobuf } from "@meshtastic/core";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import {
|
|||||||
DynamicForm,
|
DynamicForm,
|
||||||
type DynamicFormFormInit,
|
type DynamicFormFormInit,
|
||||||
} from "@components/Form/DynamicForm.tsx";
|
} from "@components/Form/DynamicForm.tsx";
|
||||||
import { useDevice } from "@core/stores/deviceStore.ts";
|
import { useDevice } from "@core/stores";
|
||||||
import { deepCompareConfig } from "@core/utils/deepCompareConfig.ts";
|
import { deepCompareConfig } from "@core/utils/deepCompareConfig.ts";
|
||||||
import { Protobuf } from "@meshtastic/core";
|
import { Protobuf } from "@meshtastic/core";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import {
|
|||||||
DynamicForm,
|
DynamicForm,
|
||||||
type DynamicFormFormInit,
|
type DynamicFormFormInit,
|
||||||
} from "@components/Form/DynamicForm.tsx";
|
} from "@components/Form/DynamicForm.tsx";
|
||||||
import { useDevice } from "@core/stores/deviceStore.ts";
|
import { useDevice } from "@core/stores";
|
||||||
import { deepCompareConfig } from "@core/utils/deepCompareConfig.ts";
|
import { deepCompareConfig } from "@core/utils/deepCompareConfig.ts";
|
||||||
import { Protobuf } from "@meshtastic/core";
|
import { Protobuf } from "@meshtastic/core";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import {
|
|||||||
DynamicForm,
|
DynamicForm,
|
||||||
type DynamicFormFormInit,
|
type DynamicFormFormInit,
|
||||||
} from "@components/Form/DynamicForm.tsx";
|
} from "@components/Form/DynamicForm.tsx";
|
||||||
import { useDevice } from "@core/stores/deviceStore.ts";
|
import { useDevice } from "@core/stores";
|
||||||
import { deepCompareConfig } from "@core/utils/deepCompareConfig.ts";
|
import { deepCompareConfig } from "@core/utils/deepCompareConfig.ts";
|
||||||
import { Protobuf } from "@meshtastic/core";
|
import { Protobuf } from "@meshtastic/core";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import {
|
|||||||
DynamicForm,
|
DynamicForm,
|
||||||
type DynamicFormFormInit,
|
type DynamicFormFormInit,
|
||||||
} from "@components/Form/DynamicForm.tsx";
|
} from "@components/Form/DynamicForm.tsx";
|
||||||
import { useDevice } from "@core/stores/deviceStore.ts";
|
import { useDevice } from "@core/stores";
|
||||||
import { deepCompareConfig } from "@core/utils/deepCompareConfig.ts";
|
import { deepCompareConfig } from "@core/utils/deepCompareConfig.ts";
|
||||||
import { Protobuf } from "@meshtastic/core";
|
import { Protobuf } from "@meshtastic/core";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import {
|
|||||||
DynamicForm,
|
DynamicForm,
|
||||||
type DynamicFormFormInit,
|
type DynamicFormFormInit,
|
||||||
} from "@components/Form/DynamicForm.tsx";
|
} from "@components/Form/DynamicForm.tsx";
|
||||||
import { useDevice } from "@core/stores/deviceStore.ts";
|
import { useDevice } from "@core/stores";
|
||||||
import { deepCompareConfig } from "@core/utils/deepCompareConfig.ts";
|
import { deepCompareConfig } from "@core/utils/deepCompareConfig.ts";
|
||||||
import { Protobuf } from "@meshtastic/core";
|
import { Protobuf } from "@meshtastic/core";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import {
|
|||||||
DynamicForm,
|
DynamicForm,
|
||||||
type DynamicFormFormInit,
|
type DynamicFormFormInit,
|
||||||
} from "@components/Form/DynamicForm.tsx";
|
} from "@components/Form/DynamicForm.tsx";
|
||||||
import { useDevice } from "@core/stores/deviceStore.ts";
|
import { useDevice } from "@core/stores";
|
||||||
import { deepCompareConfig } from "@core/utils/deepCompareConfig.ts";
|
import { deepCompareConfig } from "@core/utils/deepCompareConfig.ts";
|
||||||
import { Protobuf } from "@meshtastic/core";
|
import { Protobuf } from "@meshtastic/core";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import {
|
|||||||
DynamicForm,
|
DynamicForm,
|
||||||
type DynamicFormFormInit,
|
type DynamicFormFormInit,
|
||||||
} from "@components/Form/DynamicForm.tsx";
|
} from "@components/Form/DynamicForm.tsx";
|
||||||
import { useDevice } from "@core/stores/deviceStore.ts";
|
import { useDevice } from "@core/stores";
|
||||||
import { deepCompareConfig } from "@core/utils/deepCompareConfig.ts";
|
import { deepCompareConfig } from "@core/utils/deepCompareConfig.ts";
|
||||||
import { Protobuf } from "@meshtastic/core";
|
import { Protobuf } from "@meshtastic/core";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
|||||||
@@ -2,10 +2,7 @@ import { SidebarButton } from "@components/UI/Sidebar/SidebarButton.tsx";
|
|||||||
import { SidebarSection } from "@components/UI/Sidebar/SidebarSection.tsx";
|
import { SidebarSection } from "@components/UI/Sidebar/SidebarSection.tsx";
|
||||||
import { Spinner } from "@components/UI/Spinner.tsx";
|
import { Spinner } from "@components/UI/Spinner.tsx";
|
||||||
import { Subtle } from "@components/UI/Typography/Subtle.tsx";
|
import { Subtle } from "@components/UI/Typography/Subtle.tsx";
|
||||||
import { useAppStore } from "@core/stores/appStore.ts";
|
import { type Page, useAppStore, useDevice, useSidebar } from "@core/stores";
|
||||||
import type { Page } from "@core/stores/deviceStore.ts";
|
|
||||||
import { useDevice } from "@core/stores/deviceStore.ts";
|
|
||||||
import { useSidebar } from "@core/stores/sidebarStore.tsx";
|
|
||||||
import { cn } from "@core/utils/cn.ts";
|
import { cn } from "@core/utils/cn.ts";
|
||||||
import { useLocation, useNavigate } from "@tanstack/react-router";
|
import { useLocation, useNavigate } from "@tanstack/react-router";
|
||||||
import {
|
import {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Button } from "@components/UI/Button.tsx";
|
import { Button } from "@components/UI/Button.tsx";
|
||||||
import { useSidebar } from "@core/stores/sidebarStore.tsx";
|
import { useSidebar } from "@core/stores";
|
||||||
import { cn } from "@core/utils/cn.ts";
|
import { cn } from "@core/utils/cn.ts";
|
||||||
import type { LucideIcon } from "lucide-react";
|
import type { LucideIcon } from "lucide-react";
|
||||||
import type React from "react";
|
import type React from "react";
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Heading } from "@components/UI/Typography/Heading.tsx";
|
import { Heading } from "@components/UI/Typography/Heading.tsx";
|
||||||
import { useSidebar } from "@core/stores/sidebarStore.tsx";
|
import { useSidebar } from "@core/stores";
|
||||||
import { cn } from "@core/utils/cn.ts";
|
import { cn } from "@core/utils/cn.ts";
|
||||||
import type React from "react";
|
import type React from "react";
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { MessageState, MessageType } from "@core/stores/messageStore/index.ts";
|
import { MessageState, MessageType } from "@core/stores";
|
||||||
import type { Message } from "@core/stores/messageStore/types.ts";
|
import type { Message } from "@core/stores/messageStore/types.ts";
|
||||||
import type { Types } from "@meshtastic/core";
|
import type { Types } from "@meshtastic/core";
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ const mockUpdateFavorite = vi.fn();
|
|||||||
const mockGetNode = vi.fn(() => mockNode);
|
const mockGetNode = vi.fn(() => mockNode);
|
||||||
const mockToast = vi.fn();
|
const mockToast = vi.fn();
|
||||||
|
|
||||||
vi.mock("@core/stores/deviceStore.ts", () => ({
|
vi.mock("@core/stores", () => ({
|
||||||
useDevice: () => ({
|
useDevice: () => ({
|
||||||
updateFavorite: mockUpdateFavorite,
|
updateFavorite: mockUpdateFavorite,
|
||||||
getNode: mockGetNode,
|
getNode: mockGetNode,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { useToast } from "@core/hooks/useToast.ts";
|
import { useToast } from "@core/hooks/useToast.ts";
|
||||||
import { useDevice } from "@core/stores/deviceStore.ts";
|
import { useDevice } from "@core/stores";
|
||||||
import { useCallback } from "react";
|
import { useCallback } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ const mockUpdateIgnore = vi.fn();
|
|||||||
const mockGetNode = vi.fn(() => mockNode);
|
const mockGetNode = vi.fn(() => mockNode);
|
||||||
const mockToast = vi.fn();
|
const mockToast = vi.fn();
|
||||||
|
|
||||||
vi.mock("@core/stores/deviceStore.ts", () => ({
|
vi.mock("@core/stores", () => ({
|
||||||
useDevice: () => ({
|
useDevice: () => ({
|
||||||
updateIgnored: mockUpdateIgnore,
|
updateIgnored: mockUpdateIgnore,
|
||||||
getNode: mockGetNode,
|
getNode: mockGetNode,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { useToast } from "@core/hooks/useToast.ts";
|
import { useToast } from "@core/hooks/useToast.ts";
|
||||||
import { useDevice } from "@core/stores/deviceStore.ts";
|
import { useDevice } from "@core/stores";
|
||||||
import { useCallback } from "react";
|
import { useCallback } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import {
|
|||||||
useDevice,
|
useDevice,
|
||||||
type ValidConfigType,
|
type ValidConfigType,
|
||||||
type ValidModuleConfigType,
|
type ValidModuleConfigType,
|
||||||
} from "@core/stores/deviceStore.ts";
|
} from "@core/stores";
|
||||||
|
|
||||||
type UseWaitForConfigProps =
|
type UseWaitForConfigProps =
|
||||||
| { configCase: ValidConfigType; moduleConfigCase?: never }
|
| { configCase: ValidConfigType; moduleConfigCase?: never }
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
import type { Protobuf } from "@meshtastic/core";
|
import type { Protobuf } from "@meshtastic/core";
|
||||||
import { vi } from "vitest";
|
import { vi } from "vitest";
|
||||||
import type { Device } from "./deviceStore.ts";
|
import type { Device } from "./index.ts";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* You can spread this base mock in your tests and override only the
|
* You can spread this base mock in your tests and override only the
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
export { useAppStore } from "@core/stores/appStore";
|
||||||
|
|
||||||
|
export {
|
||||||
|
type Device,
|
||||||
|
DeviceContext,
|
||||||
|
useDevice,
|
||||||
|
useDeviceStore,
|
||||||
|
type ValidConfigType,
|
||||||
|
type ValidModuleConfigType,
|
||||||
|
} from "@core/stores/deviceStore";
|
||||||
|
|
||||||
|
export {
|
||||||
|
MessageState,
|
||||||
|
type MessageStore,
|
||||||
|
MessageType,
|
||||||
|
useMessageStore,
|
||||||
|
} from "@core/stores/messageStore";
|
||||||
|
|
||||||
|
export {
|
||||||
|
SidebarProvider,
|
||||||
|
useSidebar,
|
||||||
|
} from "@core/stores/sidebarStore";
|
||||||
@@ -13,7 +13,7 @@ import type {
|
|||||||
MessageLogMap,
|
MessageLogMap,
|
||||||
} from "./types.ts";
|
} from "./types.ts";
|
||||||
|
|
||||||
vi.mock("../storage/indexDB.ts", () => {
|
vi.mock("../utils/indexDB.ts", () => {
|
||||||
const memoryStorage: Record<string, string> = {};
|
const memoryStorage: Record<string, string> = {};
|
||||||
return {
|
return {
|
||||||
storageWithMapSupport: {
|
storageWithMapSupport: {
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
import type {
|
import type { MessageState, MessageType } from "@core/stores";
|
||||||
MessageState,
|
|
||||||
MessageType,
|
|
||||||
} from "@core/stores/messageStore/index.ts";
|
|
||||||
import type { Types } from "@meshtastic/core";
|
import type { Types } from "@meshtastic/core";
|
||||||
|
|
||||||
type NodeNum = number;
|
type NodeNum = number;
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
import { ensureDefaultUser } from "@core/dto/NodeNumToNodeInfoDTO.ts";
|
import { ensureDefaultUser } from "@core/dto/NodeNumToNodeInfoDTO.ts";
|
||||||
import PacketToMessageDTO from "@core/dto/PacketToMessageDTO.ts";
|
import PacketToMessageDTO from "@core/dto/PacketToMessageDTO.ts";
|
||||||
import type { Device } from "@core/stores/deviceStore.ts";
|
import { type Device, type MessageStore, MessageType } from "@core/stores";
|
||||||
import { type MeshDevice, Protobuf } from "@meshtastic/core";
|
import { type MeshDevice, Protobuf } from "@meshtastic/core";
|
||||||
import { type MessageStore, MessageType } from "./stores/messageStore/index.ts";
|
|
||||||
|
|
||||||
export const subscribeAll = (
|
export const subscribeAll = (
|
||||||
device: Device,
|
device: Device,
|
||||||
|
|||||||
@@ -6,8 +6,7 @@ import { Suspense } from "react";
|
|||||||
import { createRoot } from "react-dom/client";
|
import { createRoot } from "react-dom/client";
|
||||||
import "./i18n-config.ts";
|
import "./i18n-config.ts";
|
||||||
import { router } from "@app/routes.tsx";
|
import { router } from "@app/routes.tsx";
|
||||||
import { useAppStore } from "@core/stores/appStore.ts";
|
import { useAppStore, useMessageStore } from "@core/stores";
|
||||||
import { useMessageStore } from "@core/stores/messageStore/index.ts";
|
|
||||||
import { type createRouter, RouterProvider } from "@tanstack/react-router";
|
import { type createRouter, RouterProvider } from "@tanstack/react-router";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import {
|
|||||||
TabsList,
|
TabsList,
|
||||||
TabsTrigger,
|
TabsTrigger,
|
||||||
} from "@components/UI/Tabs.tsx";
|
} from "@components/UI/Tabs.tsx";
|
||||||
import { useDevice } from "@core/stores/deviceStore.ts";
|
import { useDevice } from "@core/stores";
|
||||||
import type { Protobuf } from "@meshtastic/core";
|
import type { Protobuf } from "@meshtastic/core";
|
||||||
import { Types } from "@meshtastic/core";
|
import { Types } from "@meshtastic/core";
|
||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import {
|
|||||||
TabsList,
|
TabsList,
|
||||||
TabsTrigger,
|
TabsTrigger,
|
||||||
} from "@components/UI/Tabs.tsx";
|
} from "@components/UI/Tabs.tsx";
|
||||||
import { useDevice, type ValidConfigType } from "@core/stores/deviceStore.ts";
|
import { useDevice, type ValidConfigType } from "@core/stores";
|
||||||
import { type ComponentType, Suspense, useMemo } from "react";
|
import { type ComponentType, Suspense, useMemo } from "react";
|
||||||
import type { UseFormReturn } from "react-hook-form";
|
import type { UseFormReturn } from "react-hook-form";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
|||||||
@@ -17,10 +17,7 @@ import {
|
|||||||
TabsList,
|
TabsList,
|
||||||
TabsTrigger,
|
TabsTrigger,
|
||||||
} from "@components/UI/Tabs.tsx";
|
} from "@components/UI/Tabs.tsx";
|
||||||
import {
|
import { useDevice, type ValidModuleConfigType } from "@core/stores";
|
||||||
useDevice,
|
|
||||||
type ValidModuleConfigType,
|
|
||||||
} from "@core/stores/deviceStore.ts";
|
|
||||||
import { type ComponentType, Suspense, useMemo } from "react";
|
import { type ComponentType, Suspense, useMemo } from "react";
|
||||||
import type { UseFormReturn } from "react-hook-form";
|
import type { UseFormReturn } from "react-hook-form";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
|||||||
@@ -3,8 +3,7 @@ import { Sidebar } from "@components/Sidebar.tsx";
|
|||||||
import { SidebarButton } from "@components/UI/Sidebar/SidebarButton.tsx";
|
import { SidebarButton } from "@components/UI/Sidebar/SidebarButton.tsx";
|
||||||
import { SidebarSection } from "@components/UI/Sidebar/SidebarSection.tsx";
|
import { SidebarSection } from "@components/UI/Sidebar/SidebarSection.tsx";
|
||||||
import { useToast } from "@core/hooks/useToast.ts";
|
import { useToast } from "@core/hooks/useToast.ts";
|
||||||
import { useAppStore } from "@core/stores/appStore.ts";
|
import { useAppStore, useDevice } from "@core/stores";
|
||||||
import { useDevice } from "@core/stores/deviceStore.ts";
|
|
||||||
import { cn } from "@core/utils/cn.ts";
|
import { cn } from "@core/utils/cn.ts";
|
||||||
import { DeviceConfig } from "@pages/Config/DeviceConfig.tsx";
|
import { DeviceConfig } from "@pages/Config/DeviceConfig.tsx";
|
||||||
import { ModuleConfig } from "@pages/Config/ModuleConfig.tsx";
|
import { ModuleConfig } from "@pages/Config/ModuleConfig.tsx";
|
||||||
|
|||||||
@@ -3,8 +3,7 @@ import { Button } from "@components/UI/Button.tsx";
|
|||||||
import { Separator } from "@components/UI/Seperator.tsx";
|
import { Separator } from "@components/UI/Seperator.tsx";
|
||||||
import { Heading } from "@components/UI/Typography/Heading.tsx";
|
import { Heading } from "@components/UI/Typography/Heading.tsx";
|
||||||
import { Subtle } from "@components/UI/Typography/Subtle.tsx";
|
import { Subtle } from "@components/UI/Typography/Subtle.tsx";
|
||||||
import { useAppStore } from "@core/stores/appStore.ts";
|
import { useAppStore, useDeviceStore } from "@core/stores";
|
||||||
import { useDeviceStore } from "@core/stores/deviceStore.ts";
|
|
||||||
import { ListPlusIcon, PlusIcon, UsersIcon } from "lucide-react";
|
import { ListPlusIcon, PlusIcon, UsersIcon } from "lucide-react";
|
||||||
import { useMemo } from "react";
|
import { useMemo } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import {
|
|||||||
import { BaseMap } from "@components/Map.tsx";
|
import { BaseMap } from "@components/Map.tsx";
|
||||||
import { PageLayout } from "@components/PageLayout.tsx";
|
import { PageLayout } from "@components/PageLayout.tsx";
|
||||||
import { Sidebar } from "@components/Sidebar.tsx";
|
import { Sidebar } from "@components/Sidebar.tsx";
|
||||||
import { useDevice } from "@core/stores/deviceStore.ts";
|
import { useDevice } from "@core/stores";
|
||||||
import { cn } from "@core/utils/cn.ts";
|
import { cn } from "@core/utils/cn.ts";
|
||||||
import type { Protobuf } from "@meshtastic/core";
|
import type { Protobuf } from "@meshtastic/core";
|
||||||
import { bbox, lineString } from "@turf/turf";
|
import { bbox, lineString } from "@turf/turf";
|
||||||
|
|||||||
@@ -8,13 +8,13 @@ import { Input } from "@components/UI/Input.tsx";
|
|||||||
import { SidebarButton } from "@components/UI/Sidebar/SidebarButton.tsx";
|
import { SidebarButton } from "@components/UI/Sidebar/SidebarButton.tsx";
|
||||||
import { SidebarSection } from "@components/UI/Sidebar/SidebarSection.tsx";
|
import { SidebarSection } from "@components/UI/Sidebar/SidebarSection.tsx";
|
||||||
import { useToast } from "@core/hooks/useToast.ts";
|
import { useToast } from "@core/hooks/useToast.ts";
|
||||||
import { useDevice } from "@core/stores/deviceStore.ts";
|
|
||||||
import {
|
import {
|
||||||
MessageState,
|
MessageState,
|
||||||
MessageType,
|
MessageType,
|
||||||
|
useDevice,
|
||||||
useMessageStore,
|
useMessageStore,
|
||||||
} from "@core/stores/messageStore/index.ts";
|
useSidebar,
|
||||||
import { useSidebar } from "@core/stores/sidebarStore.tsx";
|
} from "@core/stores";
|
||||||
import { cn } from "@core/utils/cn.ts";
|
import { cn } from "@core/utils/cn.ts";
|
||||||
import { randId } from "@core/utils/randId.ts";
|
import { randId } from "@core/utils/randId.ts";
|
||||||
import { Protobuf, Types } from "@meshtastic/core";
|
import { Protobuf, Types } from "@meshtastic/core";
|
||||||
|
|||||||
@@ -17,8 +17,7 @@ import { Sidebar } from "@components/Sidebar.tsx";
|
|||||||
import { Avatar } from "@components/UI/Avatar.tsx";
|
import { Avatar } from "@components/UI/Avatar.tsx";
|
||||||
import { Input } from "@components/UI/Input.tsx";
|
import { Input } from "@components/UI/Input.tsx";
|
||||||
import useLang from "@core/hooks/useLang.ts";
|
import useLang from "@core/hooks/useLang.ts";
|
||||||
import { useAppStore } from "@core/stores/appStore.ts";
|
import { useAppStore, useDevice } from "@core/stores";
|
||||||
import { useDevice } from "@core/stores/deviceStore.ts";
|
|
||||||
import { Protobuf, type Types } from "@meshtastic/core";
|
import { Protobuf, type Types } from "@meshtastic/core";
|
||||||
import { numberToHexUnpadded } from "@noble/curves/abstract/utils";
|
import { numberToHexUnpadded } from "@noble/curves/abstract/utils";
|
||||||
import { LockIcon, LockOpenIcon } from "lucide-react";
|
import { LockIcon, LockOpenIcon } from "lucide-react";
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { DialogManager } from "@components/Dialog/DialogManager.tsx";
|
import { DialogManager } from "@components/Dialog/DialogManager.tsx";
|
||||||
import type { useAppStore } from "@core/stores/appStore.ts";
|
import type { useAppStore, useMessageStore } from "@core/stores";
|
||||||
import type { useMessageStore } from "@core/stores/messageStore/index.ts";
|
|
||||||
import ChannelsPage from "@pages/Channels.tsx";
|
import ChannelsPage from "@pages/Channels.tsx";
|
||||||
import ConfigPage from "@pages/Config/index.tsx";
|
import ConfigPage from "@pages/Config/index.tsx";
|
||||||
import { Dashboard } from "@pages/Dashboard/index.tsx";
|
import { Dashboard } from "@pages/Dashboard/index.tsx";
|
||||||
|
|||||||
Reference in New Issue
Block a user