fix: keep error toasts visible until dismissed (#30420)
Error toasts now stay on screen until the user closes them, to meet WCAG 2.2.1 Timing Adjustable. Success, info, and warning toasts keep Sonner's default timer. Fixes [DEQ-463](https://linear.app/codercom/issue/DEQ-463/timed-toast-without-user-control) (Open Cursor Desktop failure) and [DEQ-310](https://linear.app/codercom/issue/DEQ-310/timed-toast-without-user-control) (adding a user who is already in a group). Sonner has no default duration per toast type, so this adds `site/src/components/Toaster/toast.ts`, a thin wrapper around Sonner's `toast`: - `toast.error` defaults to `duration: Infinity`. A caller can still set its own `duration`. - `toast.promise` failures get the same default. Sonner renders a rejected promise without calling `toast.error`, and the group member flow (DEQ-310) uses `toast.promise`. - All other methods pass straight through. All `toast` imports now go through the wrapper. A Biome `noRestrictedImports` rule blocks importing `toast` directly from `sonner`, following the existing `@pierre/diffs` rule. Tests that mocked `sonner` now mock the wrapper. Most of the 130-file diff is the import swap. ### Proof Error toast on the create token page (duplicate name), with the pointer off the toast so Sonner doesn't pause the timer. Shots are taken once the enter animation has finished: | | 1 second after the error | 11 seconds after the error | |---|---|---| | Before |  |  | | After |  |  | Also checked in the running app: the close button dismisses the error toast, and a "Token created" success toast still disappears on its own. `toast.test.tsx` covers the error and rejected `toast.promise` cases staying visible, dismissing them with the close button, and success toasts still timing out. With the persistent duration removed, the two error cases fail. <details> <summary>Decision log</summary> - A first version set `duration: Infinity` on the shared `<Toaster>` for every toast type. Product feedback: only error toasts were reported, so success and info toasts should keep their timer. - The wrapper sets the duration when each toast is created. The alternative was to watch toasts from `<Toaster>` with `useSonner` and change them afterward. That would add subscription and timer-ordering issues. - I didn't change Sonner's exported `toast` object in place. The wrapper plus a lint rule is explicit and enforced. - The experimental chat board undo toast (`runPlan.ts`) uses `toast()` with a timer that matches its undo window, so it isn't affected. - Not reproduced end to end: the Groups flow needs a Premium license, and the Cursor flow needs the app installed. Both use the `toast.promise` and `toast.error` paths the tests cover. </details> --- _Generated by Coder Agents on behalf of @chrifro._
This commit is contained in:
1 parent
bc445defd6
commit
d68b2c8b25
134 files changed
+263
-135
No files matched your search
+15
@@ -69,6 +69,10 @@
|
||||
]
|
||||
},
|
||||
// "#/components/Stack/Stack": "Use Tailwind flex utilities instead (e.g., <div className='flex flex-col gap-4'>).",
|
||||
"sonner": {
|
||||
"message": "Import toast from #/components/Toaster/toast.",
|
||||
"importNames": ["toast"]
|
||||
},
|
||||
"lodash": "Use lodash/<name> instead."
|
||||
}
|
||||
}
|
||||
@@ -115,6 +119,17 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
// toast.ts is the single choke point allowed to import Sonner's toast.
|
||||
"includes": ["**/components/Toaster/toast.ts"],
|
||||
"linter": {
|
||||
"rules": {
|
||||
"style": {
|
||||
"noRestrictedImports": "off"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json"
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
import { render, screen, waitFor } from "@testing-library/react";
|
||||
import userEvent from "@testing-library/user-event";
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { Toaster } from "./Toaster";
|
||||
import { toast } from "./toast";
|
||||
|
||||
const SONNER_DEFAULT_DURATION_MS = 4_000;
|
||||
|
||||
describe("toast", () => {
|
||||
beforeEach(() => {
|
||||
vi.useFakeTimers({ shouldAdvanceTime: true });
|
||||
render(<Toaster />);
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
toast.dismiss();
|
||||
vi.useRealTimers();
|
||||
});
|
||||
|
||||
it("keeps error toasts visible until the user dismisses them", async () => {
|
||||
const user = userEvent.setup({ advanceTimers: vi.advanceTimersByTime });
|
||||
toast.error('Failed to open "Cursor Desktop".', {
|
||||
description: "The app must be installed first.",
|
||||
});
|
||||
expect(
|
||||
await screen.findByText('Failed to open "Cursor Desktop".'),
|
||||
).toBeInTheDocument();
|
||||
|
||||
await vi.advanceTimersByTimeAsync(SONNER_DEFAULT_DURATION_MS * 10);
|
||||
expect(
|
||||
screen.getByText('Failed to open "Cursor Desktop".'),
|
||||
).toBeInTheDocument();
|
||||
|
||||
await user.click(screen.getByRole("button", { name: "Close toast" }));
|
||||
await vi.advanceTimersByTimeAsync(1_000);
|
||||
await waitFor(() =>
|
||||
expect(
|
||||
screen.queryByText('Failed to open "Cursor Desktop".'),
|
||||
).not.toBeInTheDocument(),
|
||||
);
|
||||
});
|
||||
|
||||
it("keeps the error toast of a rejected promise visible", async () => {
|
||||
toast.promise(Promise.reject(new Error("already a member")), {
|
||||
loading: "Adding member...",
|
||||
error: (err) => ({
|
||||
message: "Failed to add member.",
|
||||
description: err instanceof Error ? err.message : undefined,
|
||||
}),
|
||||
});
|
||||
expect(
|
||||
await screen.findByText("Failed to add member."),
|
||||
).toBeInTheDocument();
|
||||
|
||||
await vi.advanceTimersByTimeAsync(SONNER_DEFAULT_DURATION_MS * 10);
|
||||
expect(screen.getByText("Failed to add member.")).toBeInTheDocument();
|
||||
expect(screen.getByText("already a member")).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("still auto-dismisses success toasts", async () => {
|
||||
toast.success("Member added.");
|
||||
expect(await screen.findByText("Member added.")).toBeInTheDocument();
|
||||
|
||||
await vi.advanceTimersByTimeAsync(SONNER_DEFAULT_DURATION_MS * 2);
|
||||
await waitFor(() =>
|
||||
expect(screen.queryByText("Member added.")).not.toBeInTheDocument(),
|
||||
);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,45 @@
|
||||
import { isValidElement } from "react";
|
||||
import { type ExternalToast, toast as sonnerToast } from "sonner";
|
||||
|
||||
// Error toasts stay until the user dismisses them so everyone has enough time
|
||||
// to read and act on them (WCAG 2.2.1 Timing Adjustable). Other toast types
|
||||
// keep Sonner's timer.
|
||||
const persistentToast = {
|
||||
duration: Number.POSITIVE_INFINITY,
|
||||
} satisfies ExternalToast;
|
||||
|
||||
const error: typeof sonnerToast.error = (message, data) =>
|
||||
sonnerToast.error(message, { ...persistentToast, ...data });
|
||||
|
||||
// Sonner renders a rejected promise as an error toast without calling
|
||||
// toast.error, so the error result needs the persistent duration too.
|
||||
const promise: typeof sonnerToast.promise = (promiseToTrack, data) => {
|
||||
if (data?.error === undefined) {
|
||||
return sonnerToast.promise(promiseToTrack, data);
|
||||
}
|
||||
const errorResult = data.error;
|
||||
return sonnerToast.promise(promiseToTrack, {
|
||||
...data,
|
||||
error: async (err: unknown) => {
|
||||
const result =
|
||||
typeof errorResult === "function"
|
||||
? await errorResult(err)
|
||||
: errorResult;
|
||||
if (
|
||||
typeof result === "object" &&
|
||||
result !== null &&
|
||||
!isValidElement(result) &&
|
||||
"message" in result
|
||||
) {
|
||||
return { ...persistentToast, ...result };
|
||||
}
|
||||
return { ...persistentToast, message: result };
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
export const toast: typeof sonnerToast = Object.assign(
|
||||
(...args: Parameters<typeof sonnerToast>) => sonnerToast(...args),
|
||||
sonnerToast,
|
||||
{ error, promise },
|
||||
);
|
||||
@@ -1,6 +1,5 @@
|
||||
import { createContext, useCallback, useContext } from "react";
|
||||
import { useMutation, useQuery, useQueryClient } from "react-query";
|
||||
import { toast } from "sonner";
|
||||
import { isApiError } from "#/api/errors";
|
||||
import { checkAuthorization } from "#/api/queries/authCheck";
|
||||
import {
|
||||
@@ -11,6 +10,7 @@ import {
|
||||
updateProfile as updateProfileOptions,
|
||||
} from "#/api/queries/users";
|
||||
import type { UpdateUserProfileRequest, User } from "#/api/typesGenerated";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import { useEmbeddedMetadata } from "#/hooks/useEmbeddedMetadata";
|
||||
import { type Permissions, permissionChecks } from "#/modules/permissions";
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
import { renderHook } from "@testing-library/react";
|
||||
import { act } from "react";
|
||||
import { toast } from "sonner";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import { createDeferred } from "#/testHelpers/deferred";
|
||||
import {
|
||||
COPY_FAILED_MESSAGE,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useCallback, useEffect, useRef, useState } from "react";
|
||||
import { toast } from "sonner";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
|
||||
const CLIPBOARD_TIMEOUT_MS = 1_000;
|
||||
export const COPY_FAILED_MESSAGE = "Failed to copy text to clipboard";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import { toast } from "sonner";
|
||||
import { watchBuildLogsByBuildId } from "#/api/api";
|
||||
import type { ProvisionerJobLog } from "#/api/typesGenerated";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
|
||||
export const useWorkspaceBuildLogs = (
|
||||
// buildId is optional because sometimes the build is not loaded yet
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { toast } from "sonner";
|
||||
import type {
|
||||
Workspace,
|
||||
WorkspaceAgent,
|
||||
WorkspaceApp,
|
||||
} from "#/api/typesGenerated";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
|
||||
// This is a magic undocumented string that is replaced
|
||||
// with a brand-new session token from the backend.
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import type React from "react";
|
||||
import { useMutation } from "react-query";
|
||||
import { toast } from "sonner";
|
||||
import { API } from "#/api/api";
|
||||
import { getErrorMessage } from "#/api/errors";
|
||||
import type {
|
||||
@@ -8,6 +7,7 @@ import type {
|
||||
WorkspaceAgent,
|
||||
WorkspaceApp,
|
||||
} from "#/api/typesGenerated";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import { useProxy } from "#/contexts/ProxyContext";
|
||||
import {
|
||||
getAppHref,
|
||||
|
||||
@@ -8,7 +8,6 @@ import {
|
||||
} from "lucide-react";
|
||||
import { useState } from "react";
|
||||
import { Link } from "react-router";
|
||||
import { toast } from "sonner";
|
||||
import type * as TypesGen from "#/api/typesGenerated";
|
||||
import { Avatar } from "#/components/Avatar/Avatar";
|
||||
import { Button } from "#/components/Button/Button";
|
||||
@@ -26,6 +25,7 @@ import {
|
||||
} from "#/components/DropdownMenu/DropdownMenu";
|
||||
import { ExternalImage } from "#/components/ExternalImage/ExternalImage";
|
||||
import { Latency } from "#/components/Latency/Latency";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import type { ProxyContextValue } from "#/contexts/ProxyContext";
|
||||
import { getLatencyColor } from "#/utils/latency";
|
||||
import {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { RadioIcon } from "lucide-react";
|
||||
import { useState } from "react";
|
||||
import { Link } from "react-router";
|
||||
import { toast } from "sonner";
|
||||
import type * as TypesGen from "#/api/typesGenerated";
|
||||
import { Abbr } from "#/components/Abbr/Abbr";
|
||||
import { ChevronDownIcon } from "#/components/AnimatedIcons/ChevronDown";
|
||||
@@ -18,6 +17,7 @@ import {
|
||||
import { ExternalImage } from "#/components/ExternalImage/ExternalImage";
|
||||
import { Latency } from "#/components/Latency/Latency";
|
||||
import { Skeleton } from "#/components/Skeleton/Skeleton";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import type { ProxyContextValue } from "#/contexts/ProxyContext";
|
||||
import { useAuthenticated } from "#/hooks/useAuthenticated";
|
||||
import { getLatencyColor } from "#/utils/latency";
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { saveAs } from "file-saver";
|
||||
import { DownloadIcon } from "lucide-react";
|
||||
import { useState } from "react";
|
||||
import { toast } from "sonner";
|
||||
import { getErrorDetail } from "#/api/errors";
|
||||
import type {
|
||||
GroupSyncSettings,
|
||||
@@ -9,6 +8,7 @@ import type {
|
||||
RoleSyncSettings,
|
||||
} from "#/api/typesGenerated";
|
||||
import { Button, type ButtonProps } from "#/components/Button/Button";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
|
||||
type ExportableSyncSettings =
|
||||
| GroupSyncSettings
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { useCallback, useEffect } from "react";
|
||||
import { useMutation, useQuery, useQueryClient } from "react-query";
|
||||
import { toast } from "sonner";
|
||||
import { watchInboxNotifications } from "#/api/api";
|
||||
import { getErrorDetail, getErrorMessage } from "#/api/errors";
|
||||
import type {
|
||||
ListInboxNotificationsResponse,
|
||||
UpdateInboxNotificationReadStatusResponse,
|
||||
} from "#/api/typesGenerated";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import { InboxPopover } from "./InboxPopover";
|
||||
|
||||
const NOTIFICATIONS_QUERY_KEY = ["notifications"];
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { cn } from "cn";
|
||||
import { ContainerIcon, ExternalLinkIcon } from "lucide-react";
|
||||
import { useMutation, useQueryClient } from "react-query";
|
||||
import { toast } from "sonner";
|
||||
import { API } from "#/api/api";
|
||||
import { getErrorDetail, getErrorMessage } from "#/api/errors";
|
||||
import {
|
||||
@@ -27,6 +26,7 @@ import {
|
||||
} from "#/components/Dialog/Dialog";
|
||||
import { Skeleton } from "#/components/Skeleton/Skeleton";
|
||||
import { Spinner } from "#/components/Spinner/Spinner";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import {
|
||||
Tooltip,
|
||||
TooltipContent,
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { cn } from "cn";
|
||||
import dayjs from "dayjs";
|
||||
import { useEffect, useLayoutEffect, useRef, useState } from "react";
|
||||
import { toast } from "sonner";
|
||||
import { watchAgentMetadata } from "#/api/api";
|
||||
import type {
|
||||
ServerSentEvent,
|
||||
@@ -9,6 +8,7 @@ import type {
|
||||
WorkspaceAgentMetadata,
|
||||
} from "#/api/typesGenerated";
|
||||
import { Skeleton } from "#/components/Skeleton/Skeleton";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import {
|
||||
Tooltip,
|
||||
TooltipContent,
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { saveAs } from "file-saver";
|
||||
import { ChevronDownIcon, DownloadIcon, PackageIcon } from "lucide-react";
|
||||
import { useState } from "react";
|
||||
import { toast } from "sonner";
|
||||
import { getErrorDetail } from "#/api/errors";
|
||||
import { Button } from "#/components/Button/Button";
|
||||
import {
|
||||
@@ -10,6 +9,7 @@ import {
|
||||
DropdownMenuItem,
|
||||
DropdownMenuTrigger,
|
||||
} from "#/components/DropdownMenu/DropdownMenu";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
|
||||
type DownloadableLogSet = {
|
||||
label: string;
|
||||
|
||||
@@ -2,9 +2,9 @@ import { renderHook, waitFor } from "@testing-library/react";
|
||||
import { HttpResponse, http } from "msw";
|
||||
import { act } from "react";
|
||||
import { QueryClientProvider } from "react-query";
|
||||
import { toast } from "sonner";
|
||||
import * as API from "#/api/api";
|
||||
import type { WorkspaceAgentListContainersResponse } from "#/api/typesGenerated";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import {
|
||||
MockWorkspaceAgent,
|
||||
MockWorkspaceAgentDevcontainer,
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { useEffect, useEffectEvent } from "react";
|
||||
import { useQuery, useQueryClient } from "react-query";
|
||||
import { toast } from "sonner";
|
||||
import { watchAgentContainers } from "#/api/api";
|
||||
import {
|
||||
workspaceAgentContainers,
|
||||
@@ -11,6 +10,7 @@ import type {
|
||||
WorkspaceAgentDevcontainer,
|
||||
WorkspaceAgentListContainersResponse,
|
||||
} from "#/api/typesGenerated";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
|
||||
export function useAgentContainers(
|
||||
agent: WorkspaceAgent,
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { renderHook, waitFor } from "@testing-library/react";
|
||||
import { act } from "react";
|
||||
import { toast } from "sonner";
|
||||
import type { MockInstance } from "vitest";
|
||||
import * as apiModule from "#/api/api";
|
||||
import type { WorkspaceAgentLog } from "#/api/typesGenerated";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import { MockWorkspaceAgent } from "#/testHelpers/entities";
|
||||
import {
|
||||
createMockWebSocket,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import { toast } from "sonner";
|
||||
import { watchWorkspaceAgentLogs } from "#/api/api";
|
||||
import type { WorkspaceAgentLog } from "#/api/typesGenerated";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
|
||||
type UseAgentLogsOptions = Readonly<{
|
||||
agentId: string;
|
||||
|
||||
@@ -15,7 +15,6 @@ import {
|
||||
useRef,
|
||||
useState,
|
||||
} from "react";
|
||||
import { toast } from "sonner";
|
||||
import {
|
||||
ExponentialBackoff,
|
||||
type Websocket,
|
||||
@@ -28,6 +27,7 @@ import {
|
||||
ContextMenuItem,
|
||||
ContextMenuTrigger,
|
||||
} from "#/components/ContextMenu/ContextMenu";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import { useClipboard } from "#/hooks/useClipboard";
|
||||
import { isMac } from "#/utils/platform";
|
||||
import { terminalWebsocketUrl } from "#/utils/terminal";
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { useState } from "react";
|
||||
import { useMutation, useQuery, useQueryClient } from "react-query";
|
||||
import { toast } from "sonner";
|
||||
import { getErrorDetail, getErrorMessage } from "#/api/errors";
|
||||
import { roles } from "#/api/queries/roles";
|
||||
import {
|
||||
@@ -14,6 +13,7 @@ import {
|
||||
import type { User } from "#/api/typesGenerated";
|
||||
import { ConfirmDialog } from "#/components/Dialog/ConfirmDialog/ConfirmDialog";
|
||||
import { DeleteDialog } from "#/components/Dialog/DeleteDialog/DeleteDialog";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import { RoleSelectorDialog } from "#/modules/roles/RoleSelectorDialog";
|
||||
import { generateRandomBase64String } from "#/utils/random";
|
||||
import { ResetPasswordDialog } from "./ResetPasswordDialog";
|
||||
|
||||
@@ -3,7 +3,6 @@ import { saveAs } from "file-saver";
|
||||
import JSZip from "jszip";
|
||||
import { useEffect, useMemo, useRef, useState } from "react";
|
||||
import { useQueries, useQuery } from "react-query";
|
||||
import { toast } from "sonner";
|
||||
import { getErrorDetail } from "#/api/errors";
|
||||
import { agentLogs, buildLogs } from "#/api/queries/workspaces";
|
||||
import type { Workspace, WorkspaceAgent } from "#/api/typesGenerated";
|
||||
@@ -13,6 +12,7 @@ import {
|
||||
type ConfirmDialogProps,
|
||||
} from "#/components/Dialog/ConfirmDialog/ConfirmDialog";
|
||||
import { Skeleton } from "#/components/Skeleton/Skeleton";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import { getWorkspaceAgents } from "#/utils/workspace";
|
||||
|
||||
type DownloadLogsDialogProps = Pick<
|
||||
|
||||
@@ -11,7 +11,6 @@ import {
|
||||
import { useEffect, useState } from "react";
|
||||
import { useMutation, useQuery, useQueryClient } from "react-query";
|
||||
import { Link as RouterLink } from "react-router";
|
||||
import { toast } from "sonner";
|
||||
import { ParameterValidationError } from "#/api/api";
|
||||
import {
|
||||
type ApiError,
|
||||
@@ -33,6 +32,7 @@ import {
|
||||
DropdownMenuSeparator,
|
||||
DropdownMenuTrigger,
|
||||
} from "#/components/DropdownMenu/DropdownMenu";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import { WorkspaceErrorDialog } from "../ErrorDialog/WorkspaceErrorDialog";
|
||||
import { UpdateBuildParametersDialog } from "../WorkspaceUpdateDialogs";
|
||||
import { ChangeWorkspaceVersionDialog } from "./ChangeWorkspaceVersionDialog";
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { CircleAlertIcon, RotateCcwIcon } from "lucide-react";
|
||||
import { useState } from "react";
|
||||
import { useQuery } from "react-query";
|
||||
import { toast } from "sonner";
|
||||
import { getErrorDetail, getErrorMessage } from "#/api/errors";
|
||||
import { templateVersion } from "#/api/queries/templates";
|
||||
import type { Workspace } from "#/api/typesGenerated";
|
||||
@@ -17,6 +16,7 @@ import {
|
||||
} from "#/components/HelpPopover/HelpPopover";
|
||||
import { Link } from "#/components/Link/Link";
|
||||
import { Skeleton } from "#/components/Skeleton/Skeleton";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import { linkToTemplate, useLinks } from "#/modules/navigation";
|
||||
import {
|
||||
useWorkspaceUpdate,
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { useState } from "react";
|
||||
import { useMutation, useQuery, useQueryClient } from "react-query";
|
||||
import { toast } from "sonner";
|
||||
import {
|
||||
setWorkspaceGroupRole,
|
||||
setWorkspaceUserRole,
|
||||
@@ -13,6 +12,7 @@ import type {
|
||||
WorkspaceRole,
|
||||
WorkspaceUser,
|
||||
} from "#/api/typesGenerated";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
|
||||
/**
|
||||
* Encapsulates all data fetching and mutations for workspace sharing.
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { useState } from "react";
|
||||
import { useMutation, useQuery, useQueryClient } from "react-query";
|
||||
import { toast } from "sonner";
|
||||
import { getErrorMessage } from "#/api/errors";
|
||||
import {
|
||||
aiGatewayKeysList,
|
||||
@@ -9,6 +8,7 @@ import {
|
||||
} from "#/api/queries/aiGatewayKeys";
|
||||
import type { AIGatewayKey } from "#/api/typesGenerated";
|
||||
import { ConfirmDialog } from "#/components/Dialog/ConfirmDialog/ConfirmDialog";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import { useAuthenticated } from "#/hooks/useAuthenticated";
|
||||
import { useFeatureVisibility } from "#/modules/dashboard/useFeatureVisibility";
|
||||
import { RequirePermission } from "#/modules/permissions/RequirePermission";
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { useFormik } from "formik";
|
||||
import { useState } from "react";
|
||||
import TextareaAutosize from "react-textarea-autosize";
|
||||
import { toast } from "sonner";
|
||||
import type * as TypesGen from "#/api/typesGenerated";
|
||||
import { Alert, AlertDescription } from "#/components/Alert/Alert";
|
||||
import { ErrorAlert } from "#/components/Alert/ErrorAlert";
|
||||
@@ -14,6 +13,7 @@ import {
|
||||
} from "#/components/SettingsHeader/SettingsHeader";
|
||||
import { Spinner } from "#/components/Spinner/Spinner";
|
||||
import { Switch } from "#/components/Switch/Switch";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import { TextPreviewDialog } from "#/pages/AgentsPage/components/TextPreviewDialog";
|
||||
import { OrganizationSettingsSection } from "#/pages/AISettingsPage/components/OrganizationSettingsSection";
|
||||
import { SettingsSection } from "#/pages/AISettingsPage/components/SettingsSection";
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { useState } from "react";
|
||||
import type { UseMutateFunction } from "react-query";
|
||||
import TextareaAutosize from "react-textarea-autosize";
|
||||
import { toast } from "sonner";
|
||||
import { getErrorMessage } from "#/api/errors";
|
||||
import type * as TypesGen from "#/api/typesGenerated";
|
||||
import { Alert, AlertDescription } from "#/components/Alert/Alert";
|
||||
@@ -9,6 +8,7 @@ import { ErrorAlert } from "#/components/Alert/ErrorAlert";
|
||||
import { Button } from "#/components/Button/Button";
|
||||
import { Loader } from "#/components/Loader/Loader";
|
||||
import { Spinner } from "#/components/Spinner/Spinner";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import { countInvisibleCharacters } from "#/utils/invisibleUnicode";
|
||||
|
||||
type OrganizationInstructionsSettingsProps = {
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { useEffect } from "react";
|
||||
import { useMutation, useQuery, useQueryClient } from "react-query";
|
||||
import { useNavigate, useSearchParams } from "react-router";
|
||||
import { toast } from "sonner";
|
||||
import { getErrorMessage } from "#/api/errors";
|
||||
import { createMCPServerConfig } from "#/api/queries/chats";
|
||||
import { organizationsPermissions } from "#/api/queries/organizations";
|
||||
import { ErrorAlert } from "#/components/Alert/ErrorAlert";
|
||||
import { Loader } from "#/components/Loader/Loader";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import { useAuthenticated } from "#/hooks/useAuthenticated";
|
||||
import { useDashboard } from "#/modules/dashboard/useDashboard";
|
||||
import { RequirePermission } from "#/modules/permissions/RequirePermission";
|
||||
|
||||
+1
-1
@@ -5,7 +5,6 @@ import {
|
||||
useParams,
|
||||
useSearchParams,
|
||||
} from "react-router";
|
||||
import { toast } from "sonner";
|
||||
import { getErrorMessage, isApiError } from "#/api/errors";
|
||||
import {
|
||||
deleteMCPServerConfig,
|
||||
@@ -15,6 +14,7 @@ import {
|
||||
import { organizationsPermissions } from "#/api/queries/organizations";
|
||||
import { ErrorAlert } from "#/components/Alert/ErrorAlert";
|
||||
import { Loader } from "#/components/Loader/Loader";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import { useAuthenticated } from "#/hooks/useAuthenticated";
|
||||
import { useDashboard } from "#/modules/dashboard/useDashboard";
|
||||
import { RequirePermission } from "#/modules/permissions/RequirePermission";
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { useMutation, useQuery, useQueryClient } from "react-query";
|
||||
import { toast } from "sonner";
|
||||
import {
|
||||
mcpServerConfigACL,
|
||||
updateMCPServerConfigACL,
|
||||
} from "#/api/queries/chats";
|
||||
import type * as TypesGen from "#/api/typesGenerated";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import { getGroupSubtitle, isGroup } from "#/modules/groups";
|
||||
import {
|
||||
ResourceSharingDialog,
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { useMutation, useQuery, useQueryClient } from "react-query";
|
||||
import { useNavigate, useSearchParams } from "react-router";
|
||||
import { toast } from "sonner";
|
||||
import { getErrorDetail, getErrorMessage } from "#/api/errors";
|
||||
import { chatModels, createChatModel } from "#/api/queries/chats";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import {
|
||||
canManageProviderModels,
|
||||
deriveProviderStates,
|
||||
|
||||
@@ -2,7 +2,6 @@ import { isAxiosError } from "axios";
|
||||
import { useState } from "react";
|
||||
import { useMutation, useQuery, useQueryClient } from "react-query";
|
||||
import { Navigate, useNavigate, useParams } from "react-router";
|
||||
import { toast } from "sonner";
|
||||
import { getErrorDetail, getErrorMessage } from "#/api/errors";
|
||||
import {
|
||||
chatModel,
|
||||
@@ -11,6 +10,7 @@ import {
|
||||
updateChatModel,
|
||||
} from "#/api/queries/chats";
|
||||
import { Loader } from "#/components/Loader/Loader";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import { deriveProviderStates } from "#/modules/aiModels/providerStates";
|
||||
import { pageTitle } from "#/utils/page";
|
||||
import {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { useMutation, useQuery, useQueryClient } from "react-query";
|
||||
import { toast } from "sonner";
|
||||
import { chatModelACL, updateChatModelACL } from "#/api/queries/chats";
|
||||
import type * as TypesGen from "#/api/typesGenerated";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import { getGroupSubtitle, isGroup } from "#/modules/groups";
|
||||
import {
|
||||
ResourceSharingDialog,
|
||||
|
||||
@@ -2,12 +2,12 @@ import { ArrowLeftIcon } from "lucide-react";
|
||||
import { useState } from "react";
|
||||
import { useMutation, useQueryClient } from "react-query";
|
||||
import { Link, useNavigate } from "react-router";
|
||||
import { toast } from "sonner";
|
||||
import { getErrorMessage } from "#/api/errors";
|
||||
import { createAIProviderMutation } from "#/api/queries/aiProviders";
|
||||
import { Avatar } from "#/components/Avatar/Avatar";
|
||||
import { Button } from "#/components/Button/Button";
|
||||
import { SettingsHeaderTitle } from "#/components/SettingsHeader/SettingsHeader";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import { getProviderIcon } from "#/modules/aiModels/ProviderIcon";
|
||||
import type { AddableProvider } from "../components/addableProviderTypes";
|
||||
import { ProviderForm } from "../components/ProviderForm";
|
||||
|
||||
+1
-1
@@ -3,7 +3,6 @@ import { ArrowLeftIcon } from "lucide-react";
|
||||
import { useState } from "react";
|
||||
import { useMutation, useQuery, useQueryClient } from "react-query";
|
||||
import { Link, Navigate, useNavigate, useParams } from "react-router";
|
||||
import { toast } from "sonner";
|
||||
import { getErrorMessage } from "#/api/errors";
|
||||
import {
|
||||
aiProvider,
|
||||
@@ -18,6 +17,7 @@ import { DeleteDialog } from "#/components/Dialog/DeleteDialog/DeleteDialog";
|
||||
import { Loader } from "#/components/Loader/Loader";
|
||||
import { SettingsHeaderTitle } from "#/components/SettingsHeader/SettingsHeader";
|
||||
import { Switch } from "#/components/Switch/Switch";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import { getProviderIcon } from "#/modules/aiModels/ProviderIcon";
|
||||
import { pageTitle } from "#/utils/page";
|
||||
import { ProviderForm } from "../components/ProviderForm";
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { useState } from "react";
|
||||
import { useMutation, useQuery, useQueryClient } from "react-query";
|
||||
import { useSearchParams } from "react-router";
|
||||
import { toast } from "sonner";
|
||||
import { getErrorDetail, getErrorMessage } from "#/api/errors";
|
||||
import { organizationsPermissions } from "#/api/queries/organizations";
|
||||
import { templates, updateTemplateMeta } from "#/api/queries/templates";
|
||||
import type * as TypesGen from "#/api/typesGenerated";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import { useAuthenticated } from "#/hooks/useAuthenticated";
|
||||
import { useDashboard } from "#/modules/dashboard/useDashboard";
|
||||
import { RequirePermission } from "#/modules/permissions/RequirePermission";
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import type { Meta, StoryObj } from "@storybook/react-vite";
|
||||
import { hashKey } from "react-query";
|
||||
import { Outlet, useNavigate } from "react-router";
|
||||
import { toast } from "sonner";
|
||||
import { expect, spyOn, userEvent, waitFor, within } from "storybook/test";
|
||||
import {
|
||||
reactRouterOutlet,
|
||||
@@ -25,6 +24,7 @@ import {
|
||||
import { preferenceSettingsKey } from "#/api/queries/users";
|
||||
import { workspaceByIdKey, workspacesKey } from "#/api/queries/workspaces";
|
||||
import type * as TypesGen from "#/api/typesGenerated";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import {
|
||||
MockChat,
|
||||
MockChatMessage,
|
||||
|
||||
@@ -6,7 +6,6 @@ import {
|
||||
useQueryClient,
|
||||
} from "react-query";
|
||||
import { useOutletContext, useParams } from "react-router";
|
||||
import { toast } from "sonner";
|
||||
import type { UrlTransform } from "streamdown";
|
||||
import { getErrorMessage, getErrorStatus, isApiError } from "#/api/errors";
|
||||
import { chatProviderConfigs } from "#/api/queries/aiProviders";
|
||||
@@ -36,6 +35,7 @@ import { userSkills } from "#/api/queries/userSkills";
|
||||
import { preferenceSettings } from "#/api/queries/users";
|
||||
import { workspaceById, workspaceByIdKey } from "#/api/queries/workspaces";
|
||||
import type * as TypesGen from "#/api/typesGenerated";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import { useProxy } from "#/contexts/ProxyContext";
|
||||
import { useAuthenticated } from "#/hooks/useAuthenticated";
|
||||
import { useAIGatewayEnabled } from "#/hooks/useEmbeddedMetadata";
|
||||
|
||||
@@ -2,7 +2,6 @@ import { act, screen, waitFor, within } from "@testing-library/react";
|
||||
import userEvent from "@testing-library/user-event";
|
||||
import { HttpResponse, http } from "msw";
|
||||
import { onlineManager } from "react-query";
|
||||
import { toast } from "sonner";
|
||||
import {
|
||||
afterEach,
|
||||
beforeAll,
|
||||
@@ -15,6 +14,7 @@ import {
|
||||
import { API } from "#/api/api";
|
||||
import { chatProjectsKey } from "#/api/queries/chatProjects";
|
||||
import type * as TypesGen from "#/api/typesGenerated";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import { TooltipProvider } from "#/components/Tooltip/Tooltip";
|
||||
import {
|
||||
buildDebugWorkspaceBuildPath,
|
||||
|
||||
@@ -8,7 +8,6 @@ import {
|
||||
useParams,
|
||||
useSearchParams,
|
||||
} from "react-router";
|
||||
import { toast } from "sonner";
|
||||
import { getErrorMessage, isApiError } from "#/api/errors";
|
||||
import { chatProject } from "#/api/queries/chatProjects";
|
||||
import {
|
||||
@@ -27,6 +26,7 @@ import { Button } from "#/components/Button/Button";
|
||||
import { Link } from "#/components/Link/Link";
|
||||
import { Loader } from "#/components/Loader/Loader";
|
||||
import { Spinner } from "#/components/Spinner/Spinner";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import { useWebpushNotifications } from "#/contexts/useWebpushNotifications";
|
||||
import { useAuthenticated } from "#/hooks/useAuthenticated";
|
||||
import { useAIGatewayEnabled } from "#/hooks/useEmbeddedMetadata";
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { useFormik } from "formik";
|
||||
import { useId, useState } from "react";
|
||||
import { useMutation, useQueryClient } from "react-query";
|
||||
import { toast } from "sonner";
|
||||
import { getErrorDetail, getErrorMessage } from "#/api/errors";
|
||||
import {
|
||||
deleteUserChatProviderKey,
|
||||
@@ -16,6 +15,7 @@ import { EmptyState } from "#/components/EmptyState/EmptyState";
|
||||
import { FormField } from "#/components/FormField/FormField";
|
||||
import { Loader } from "#/components/Loader/Loader";
|
||||
import { Spinner } from "#/components/Spinner/Spinner";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import { getFormHelpers } from "#/utils/formUtils";
|
||||
import { SectionHeader } from "./components/SectionHeader";
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ import { saveAs } from "file-saver";
|
||||
import JSZip from "jszip";
|
||||
import { useState } from "react";
|
||||
import { useMutation, useQuery, useQueryClient } from "react-query";
|
||||
import { toast } from "sonner";
|
||||
import { getErrorDetail, getErrorMessage } from "#/api/errors";
|
||||
import {
|
||||
createUserSkill,
|
||||
@@ -13,6 +12,7 @@ import {
|
||||
userSkills,
|
||||
} from "#/api/queries/userSkills";
|
||||
import type { UserSkillMetadata } from "#/api/typesGenerated";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import {
|
||||
AgentSettingsPersonalSkillsPageView,
|
||||
type PersonalSkillDeleteState,
|
||||
|
||||
@@ -2,13 +2,13 @@ import { act, render, screen, waitFor, within } from "@testing-library/react";
|
||||
import userEvent from "@testing-library/user-event";
|
||||
import { QueryClient, QueryClientProvider } from "react-query";
|
||||
import { createMemoryRouter, RouterProvider } from "react-router";
|
||||
import { toast } from "sonner";
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { API } from "#/api/api";
|
||||
import {
|
||||
chatModels,
|
||||
userChatPersonalModelOverrides,
|
||||
} from "#/api/queries/chats";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import { TooltipProvider } from "#/components/Tooltip/Tooltip";
|
||||
import { ThemeOverride } from "#/contexts/ThemeProvider";
|
||||
import {
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { useMutation, useQuery, useQueryClient } from "react-query";
|
||||
import { toast } from "sonner";
|
||||
import { getErrorDetail, getErrorMessage } from "#/api/errors";
|
||||
import {
|
||||
chatModels,
|
||||
@@ -11,6 +10,7 @@ import type {
|
||||
Organization,
|
||||
} from "#/api/typesGenerated";
|
||||
import { getOrganizationLabel } from "#/components/OrganizationAutocomplete/OrganizationAutocomplete";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import { useSearchParamsKey } from "#/hooks/useSearchParamsKey";
|
||||
import { useDashboard } from "#/modules/dashboard/useDashboard";
|
||||
import {
|
||||
|
||||
@@ -14,7 +14,6 @@ import {
|
||||
useParams,
|
||||
useSearchParams,
|
||||
} from "react-router";
|
||||
import { toast } from "sonner";
|
||||
import { watchChats } from "#/api/api";
|
||||
import { getErrorMessage } from "#/api/errors";
|
||||
import {
|
||||
@@ -42,6 +41,7 @@ import {
|
||||
userChatPersonalModelOverrides,
|
||||
} from "#/api/queries/chats";
|
||||
import type * as TypesGen from "#/api/typesGenerated";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import { useAuthenticated } from "#/hooks/useAuthenticated";
|
||||
import {
|
||||
getDefaultOrganizationId,
|
||||
|
||||
@@ -7,10 +7,10 @@ import {
|
||||
} from "@testing-library/react";
|
||||
import userEvent from "@testing-library/user-event";
|
||||
import { createRef } from "react";
|
||||
import { toast } from "sonner";
|
||||
import { afterEach, beforeAll, describe, expect, it, vi } from "vitest";
|
||||
import { AppProviders } from "#/App";
|
||||
import type * as TypesGen from "#/api/typesGenerated";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import { MockMCPServerConfig } from "#/testHelpers/chatEntities";
|
||||
import { createMockFile } from "#/testHelpers/files";
|
||||
import { mobileViewportMediaQuery } from "#/utils/mobile";
|
||||
|
||||
@@ -22,7 +22,6 @@ import type React from "react";
|
||||
import { useEffect, useId, useImperativeHandle, useRef, useState } from "react";
|
||||
import { useMutation, useQuery, useQueryClient } from "react-query";
|
||||
import { Link } from "react-router";
|
||||
import { toast } from "sonner";
|
||||
import { getErrorMessage } from "#/api/errors";
|
||||
import { disconnectMCPServerOAuth2 } from "#/api/queries/chats";
|
||||
import { preferenceSettings } from "#/api/queries/users";
|
||||
@@ -50,6 +49,7 @@ import { Separator } from "#/components/Separator/Separator";
|
||||
import { Skeleton } from "#/components/Skeleton/Skeleton";
|
||||
import { Spinner } from "#/components/Spinner/Spinner";
|
||||
import { Switch } from "#/components/Switch/Switch";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import {
|
||||
Tooltip,
|
||||
TooltipContent,
|
||||
|
||||
@@ -4,7 +4,6 @@ import { HttpResponse, http } from "msw";
|
||||
import { StrictMode } from "react";
|
||||
import { QueryClient } from "react-query";
|
||||
import { MemoryRouter } from "react-router";
|
||||
import { toast } from "sonner";
|
||||
import {
|
||||
afterEach,
|
||||
beforeAll,
|
||||
@@ -24,6 +23,7 @@ import {
|
||||
import { permittedOrganizationsKey } from "#/api/queries/organizations";
|
||||
import { preferenceSettingsKey } from "#/api/queries/users";
|
||||
import type * as TypesGen from "#/api/typesGenerated";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import { MockMCPServerConfig } from "#/testHelpers/chatEntities";
|
||||
import {
|
||||
MockChatModel,
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { useEffect, useEffectEvent, useRef, useState } from "react";
|
||||
import { useQuery } from "react-query";
|
||||
import { toast } from "sonner";
|
||||
import { isApiError } from "#/api/errors";
|
||||
import { chatProviderConfigs } from "#/api/queries/aiProviders";
|
||||
import {
|
||||
@@ -13,6 +12,7 @@ import type * as TypesGen from "#/api/typesGenerated";
|
||||
import { Alert, AlertDescription, AlertTitle } from "#/components/Alert/Alert";
|
||||
import { ErrorAlert } from "#/components/Alert/ErrorAlert";
|
||||
import { ConfirmDialog } from "#/components/Dialog/ConfirmDialog/ConfirmDialog";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import { useDashboard } from "#/modules/dashboard/useDashboard";
|
||||
import { getWorkspaceAgents } from "#/utils/workspace";
|
||||
import {
|
||||
|
||||
@@ -16,7 +16,6 @@ import {
|
||||
useLocation,
|
||||
useOutletContext,
|
||||
} from "react-router";
|
||||
import { toast } from "sonner";
|
||||
import { getErrorMessage } from "#/api/errors";
|
||||
import { Button } from "#/components/Button/Button";
|
||||
import {
|
||||
@@ -27,6 +26,7 @@ import {
|
||||
} from "#/components/DropdownMenu/DropdownMenu";
|
||||
import { ProductLogo } from "#/components/Icons/ProductLogo";
|
||||
import { Spinner } from "#/components/Spinner/Spinner";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import { useWebpushNotifications } from "#/contexts/useWebpushNotifications";
|
||||
import type { AgentsPageOutletContext } from "../AgentsPageLayout";
|
||||
import { getChimeEnabled, setChimeEnabled } from "../utils/chime";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { cn } from "cn";
|
||||
import { AlertTriangleIcon, ClipboardPasteIcon, XIcon } from "lucide-react";
|
||||
import { toast } from "sonner";
|
||||
import { Spinner } from "#/components/Spinner/Spinner";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import {
|
||||
Tooltip,
|
||||
TooltipContent,
|
||||
|
||||
@@ -15,7 +15,6 @@ import {
|
||||
import { useId, useState } from "react";
|
||||
import { useIsMutating, useMutation, useQueryClient } from "react-query";
|
||||
import { useNavigate } from "react-router";
|
||||
import { toast } from "sonner";
|
||||
import { getErrorMessage } from "#/api/errors";
|
||||
import {
|
||||
archiveAndDeleteChat,
|
||||
@@ -44,6 +43,7 @@ import {
|
||||
DropdownMenuSubTrigger,
|
||||
DropdownMenuTrigger,
|
||||
} from "#/components/DropdownMenu/DropdownMenu";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import { useClipboard } from "#/hooks/useClipboard";
|
||||
import {
|
||||
type ArchiveAndDeleteAction,
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
vi.mock("sonner", () => ({
|
||||
vi.mock("#/components/Toaster/toast", () => ({
|
||||
toast: {
|
||||
info: vi.fn(),
|
||||
error: vi.fn(),
|
||||
},
|
||||
}));
|
||||
|
||||
import { toast } from "sonner";
|
||||
import type { ChatMessage } from "#/api/typesGenerated";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import type { ModelSelectorOption } from "#/modules/aiModels/ModelSelector";
|
||||
import {
|
||||
MockChatMessage,
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { toast } from "sonner";
|
||||
import type { CreateChatMessageRequestWithClearablePlanMode } from "#/api/api";
|
||||
import { getErrorMessage } from "#/api/errors";
|
||||
import { buildOptimisticEditedMessage } from "#/api/queries/chatMessageEdits";
|
||||
import { planModeFieldsForCreateMessage } from "#/api/queries/chats";
|
||||
import type * as TypesGen from "#/api/typesGenerated";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import type { ModelSelectorOption } from "#/modules/aiModels/ModelSelector";
|
||||
import { BuiltInCommandPendingError } from "../../hooks/useConversationEditingState";
|
||||
import {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { cn } from "cn";
|
||||
import { Profiler, useEffect, useRef, useState } from "react";
|
||||
import { useMutation, useQuery, useQueryClient } from "react-query";
|
||||
import { toast } from "sonner";
|
||||
import type { UrlTransform } from "streamdown";
|
||||
import {
|
||||
chatPromptsQuery,
|
||||
@@ -11,6 +10,7 @@ import {
|
||||
} from "#/api/queries/chats";
|
||||
import { workspaces } from "#/api/queries/workspaces";
|
||||
import type * as TypesGen from "#/api/typesGenerated";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import { useAuthenticated } from "#/hooks/useAuthenticated";
|
||||
import type { ModelSelectorOption } from "#/modules/aiModels/ModelSelector";
|
||||
import { getWorkspaceAgents } from "#/utils/workspace";
|
||||
|
||||
@@ -6,7 +6,6 @@ import {
|
||||
} from "lucide-react";
|
||||
import { useState } from "react";
|
||||
import { useMutation, useQuery, useQueryClient } from "react-query";
|
||||
import { toast } from "sonner";
|
||||
import {
|
||||
chatACL,
|
||||
setChatGroupRole,
|
||||
@@ -39,6 +38,7 @@ import {
|
||||
TableHeader,
|
||||
TableRow,
|
||||
} from "#/components/Table/Table";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import { useAuthenticated } from "#/hooks/useAuthenticated";
|
||||
import { useClipboard } from "#/hooks/useClipboard";
|
||||
import { getGroupSubtitle, isGroup } from "#/modules/groups";
|
||||
|
||||
@@ -2,11 +2,11 @@ import { act, screen, waitFor, within } from "@testing-library/react";
|
||||
import userEvent from "@testing-library/user-event";
|
||||
import { useState } from "react";
|
||||
import { Outlet, useParams } from "react-router";
|
||||
import { toast } from "sonner";
|
||||
import { afterEach, describe, expect, it, vi } from "vitest";
|
||||
import { API } from "#/api/api";
|
||||
import { archiveAndDeleteChatKey, chatEntityKey } from "#/api/queries/chats";
|
||||
import type { Chat, WorkspaceBuild } from "#/api/typesGenerated";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import { MockChat, MockChatDiffStatus } from "#/testHelpers/chatEntities";
|
||||
import { createDeferred } from "#/testHelpers/deferred";
|
||||
import {
|
||||
|
||||
@@ -19,7 +19,6 @@ import {
|
||||
useQueryClient,
|
||||
} from "react-query";
|
||||
import { Link, useLocation, useOutletContext } from "react-router";
|
||||
import { toast } from "sonner";
|
||||
import { getErrorMessage } from "#/api/errors";
|
||||
import { checkAuthorization } from "#/api/queries/authCheck";
|
||||
import {
|
||||
@@ -39,6 +38,7 @@ import {
|
||||
DropdownMenuTrigger,
|
||||
} from "#/components/DropdownMenu/DropdownMenu";
|
||||
import { Popover, PopoverTrigger } from "#/components/Popover/Popover";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import { useAuthenticated } from "#/hooks/useAuthenticated";
|
||||
import type { AgentsPageOutletContext } from "../AgentsPageLayout";
|
||||
import { prNumber } from "../utils/pullRequest";
|
||||
|
||||
@@ -10,11 +10,11 @@ import userEvent from "@testing-library/user-event";
|
||||
import { HttpResponse, http } from "msw";
|
||||
import { QueryClientProvider } from "react-query";
|
||||
import { MemoryRouter, Route, Routes, useLocation } from "react-router";
|
||||
import { toast } from "sonner";
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { API } from "#/api/api";
|
||||
import type * as TypesGen from "#/api/typesGenerated";
|
||||
import type { Chat } from "#/api/typesGenerated";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import { TooltipProvider } from "#/components/Tooltip/Tooltip";
|
||||
import { ThemeOverride } from "#/contexts/ThemeProvider";
|
||||
import { DashboardContext } from "#/modules/dashboard/DashboardProvider";
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { useState } from "react";
|
||||
import { useMutation, useQuery, useQueryClient } from "react-query";
|
||||
import { useLocation, useNavigate, useParams } from "react-router";
|
||||
import { toast } from "sonner";
|
||||
import { getErrorMessage } from "#/api/errors";
|
||||
import {
|
||||
chatProjects,
|
||||
@@ -12,6 +11,7 @@ import {
|
||||
import { userChatProviderConfigs } from "#/api/queries/chats";
|
||||
import type { Chat, ChatModel, ChatProject } from "#/api/typesGenerated";
|
||||
import { DeleteDialog } from "#/components/Dialog/DeleteDialog/DeleteDialog";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import {
|
||||
getDefaultOrganizationId,
|
||||
useDashboard,
|
||||
|
||||
@@ -24,7 +24,6 @@ import {
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import { useMutation, useQueryClient } from "react-query";
|
||||
import { Link, type Location, NavLink } from "react-router";
|
||||
import { toast } from "sonner";
|
||||
import { getErrorMessage } from "#/api/errors";
|
||||
import { reorderPinnedChat } from "#/api/queries/chats";
|
||||
import type {
|
||||
@@ -39,6 +38,7 @@ import { ProductLogo } from "#/components/Icons/ProductLogo";
|
||||
import { Kbd, KbdGroup } from "#/components/Kbd/Kbd";
|
||||
import { ScrollArea } from "#/components/ScrollArea/ScrollArea";
|
||||
import { Skeleton } from "#/components/Skeleton/Skeleton";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import {
|
||||
Tooltip,
|
||||
TooltipContent,
|
||||
|
||||
@@ -8,7 +8,6 @@ import {
|
||||
import { useEffect, useState } from "react";
|
||||
import { useIsMutating, useMutation, useQueryClient } from "react-query";
|
||||
import { NavLink, useLocation } from "react-router";
|
||||
import { toast } from "sonner";
|
||||
import { getErrorMessage } from "#/api/errors";
|
||||
import {
|
||||
archiveChat,
|
||||
@@ -20,10 +19,10 @@ import {
|
||||
unarchiveChat,
|
||||
unpinChat,
|
||||
} from "#/api/queries/chats";
|
||||
|
||||
import type { Chat } from "#/api/typesGenerated";
|
||||
import { Button } from "#/components/Button/Button";
|
||||
import { Spinner } from "#/components/Spinner/Spinner";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import { shortRelativeTime } from "#/utils/time";
|
||||
import { clearPersistedRightPanelState } from "../../../utils/rightPanelTabStorage";
|
||||
import { clearPersistedSidebarTabId } from "../../../utils/sidebarTabStorage";
|
||||
|
||||
@@ -14,7 +14,6 @@ import {
|
||||
RowsIcon,
|
||||
} from "lucide-react";
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import { toast } from "sonner";
|
||||
import type * as TypesGen from "#/api/typesGenerated";
|
||||
import type {
|
||||
ChatDiffStatus,
|
||||
@@ -27,6 +26,7 @@ import {
|
||||
DropdownMenuItem,
|
||||
DropdownMenuTrigger,
|
||||
} from "#/components/DropdownMenu/DropdownMenu";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import {
|
||||
Tooltip,
|
||||
TooltipContent,
|
||||
|
||||
@@ -2,7 +2,6 @@ import { cn } from "cn";
|
||||
import { EllipsisVerticalIcon } from "lucide-react";
|
||||
import { useMutation, useQuery, useQueryClient } from "react-query";
|
||||
import { Link, useLocation } from "react-router";
|
||||
import { toast } from "sonner";
|
||||
import { getErrorMessage } from "#/api/errors";
|
||||
import {
|
||||
archiveChat,
|
||||
@@ -17,6 +16,7 @@ import { Avatar } from "#/components/Avatar/Avatar";
|
||||
import { Badge } from "#/components/Badge/Badge";
|
||||
import { Button } from "#/components/Button/Button";
|
||||
import { Skeleton } from "#/components/Skeleton/Skeleton";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import { formatCostMicros } from "#/utils/currency";
|
||||
import type { AgentsPageOutletContext } from "../../AgentsPageLayout";
|
||||
import { buildAgentChatPath } from "../../utils/navigation";
|
||||
|
||||
@@ -2,10 +2,10 @@ import { fireEvent, render, screen, waitFor } from "@testing-library/react";
|
||||
import userEvent from "@testing-library/user-event";
|
||||
import { QueryClientProvider } from "react-query";
|
||||
import { MemoryRouter, Outlet, Route, Routes, useLocation } from "react-router";
|
||||
import { toast } from "sonner";
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { API } from "#/api/api";
|
||||
import type { Chat } from "#/api/typesGenerated";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import { ThemeOverride } from "#/contexts/ThemeProvider";
|
||||
import { MockChat, mockChatCost } from "#/testHelpers/chatEntities";
|
||||
import {
|
||||
|
||||
@@ -2,7 +2,6 @@ import { EllipsisVerticalIcon } from "lucide-react";
|
||||
import { useRef, useState } from "react";
|
||||
import { useMutation, useQuery, useQueryClient } from "react-query";
|
||||
import { useLocation, useNavigate } from "react-router";
|
||||
import { toast } from "sonner";
|
||||
import { getErrorMessage } from "#/api/errors";
|
||||
import {
|
||||
deleteChatProject,
|
||||
@@ -19,6 +18,7 @@ import {
|
||||
DropdownMenuSeparator,
|
||||
DropdownMenuTrigger,
|
||||
} from "#/components/DropdownMenu/DropdownMenu";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import { useAuthenticated } from "#/hooks/useAuthenticated";
|
||||
import { useDashboard } from "#/modules/dashboard/useDashboard";
|
||||
import { draftStorageKeys } from "../AgentCreateForm";
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import type { Meta, StoryObj } from "@storybook/react-vite";
|
||||
import { toast } from "sonner";
|
||||
import { expect, fn, spyOn, userEvent, waitFor, within } from "storybook/test";
|
||||
import type { Mock } from "vitest";
|
||||
import { API } from "#/api/api";
|
||||
import { chatDebugRunKey, chatDebugRunsKey } from "#/api/queries/chats";
|
||||
import type * as TypesGen from "#/api/typesGenerated";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import { DebugPanel } from "./DebugPanel";
|
||||
import { CHAT_ID, MockRun, MockStep } from "./debugFixtures";
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@ import {
|
||||
useQuery,
|
||||
useQueryClient,
|
||||
} from "react-query";
|
||||
import { toast } from "sonner";
|
||||
import { getErrorDetail, getErrorMessage } from "#/api/errors";
|
||||
import {
|
||||
chatDebugRun,
|
||||
@@ -19,6 +18,7 @@ import { Alert } from "#/components/Alert/Alert";
|
||||
import { Button } from "#/components/Button/Button";
|
||||
import { ScrollArea } from "#/components/ScrollArea/ScrollArea";
|
||||
import { Spinner } from "#/components/Spinner/Spinner";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import { DebugRunList } from "./DebugRunList";
|
||||
import {
|
||||
buildChatDebugExport,
|
||||
|
||||
@@ -2,7 +2,6 @@ import { cn } from "cn";
|
||||
import { ChevronDownIcon, DownloadIcon } from "lucide-react";
|
||||
import { useId, useState } from "react";
|
||||
import { useQuery } from "react-query";
|
||||
import { toast } from "sonner";
|
||||
import { getErrorDetail, getErrorMessage } from "#/api/errors";
|
||||
import { chatDebugRun } from "#/api/queries/chats";
|
||||
import type { ChatDebugRunSummary } from "#/api/typesGenerated";
|
||||
@@ -15,6 +14,7 @@ import {
|
||||
CollapsibleTrigger,
|
||||
} from "#/components/Collapsible/Collapsible";
|
||||
import { Spinner } from "#/components/Spinner/Spinner";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import { DebugStepCard } from "./DebugStepCard";
|
||||
import {
|
||||
buildDebugExportBlob,
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { useMutation, useQueryClient } from "react-query";
|
||||
import { useNavigate } from "react-router";
|
||||
import { toast } from "sonner";
|
||||
import { API, ParameterValidationError } from "#/api/api";
|
||||
import { getErrorMessage } from "#/api/errors";
|
||||
import { startWorkspace } from "#/api/queries/workspaces";
|
||||
@@ -12,6 +11,7 @@ import type {
|
||||
import { Button } from "#/components/Button/Button";
|
||||
import { Link } from "#/components/Link/Link";
|
||||
import { Spinner } from "#/components/Spinner/Spinner";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
|
||||
/** Build statuses in which the workspace is not running and not in flight. */
|
||||
const stoppedWorkspaceStatuses: readonly WorkspaceStatus[] = [
|
||||
|
||||
@@ -10,7 +10,6 @@ import {
|
||||
import { useEffect, useState } from "react";
|
||||
import { useMutation } from "react-query";
|
||||
import { Link } from "react-router";
|
||||
import { toast } from "sonner";
|
||||
import { API } from "#/api/api";
|
||||
import { getErrorMessage } from "#/api/errors";
|
||||
import type {
|
||||
@@ -26,6 +25,7 @@ import {
|
||||
DropdownMenuTrigger,
|
||||
} from "#/components/DropdownMenu/DropdownMenu";
|
||||
import { ExternalImage } from "#/components/ExternalImage/ExternalImage";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import {
|
||||
Tooltip,
|
||||
TooltipContent,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import RFB from "@novnc/novnc/lib/rfb";
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import { toast } from "sonner";
|
||||
import { watchChatDesktop } from "#/api/api";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import { useClipboard } from "#/hooks/useClipboard";
|
||||
export type DesktopConnectionStatus =
|
||||
| "idle"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
vi.mock("sonner", () => ({
|
||||
vi.mock("#/components/Toaster/toast", () => ({
|
||||
toast: {
|
||||
error: vi.fn(),
|
||||
info: vi.fn(),
|
||||
@@ -9,13 +9,13 @@ vi.mock("sonner", () => ({
|
||||
},
|
||||
}));
|
||||
|
||||
import { toast } from "sonner";
|
||||
import { ArchiveAndDeleteError } from "#/api/queries/chats";
|
||||
import {
|
||||
PrebuildsSystemUserID,
|
||||
type Workspace,
|
||||
type WorkspaceBuild,
|
||||
} from "#/api/typesGenerated";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import {
|
||||
isWorkspaceAutoCreated,
|
||||
notifyArchiveAndDeleteFailed,
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import type { QueryClient } from "react-query";
|
||||
import { toast } from "sonner";
|
||||
import { API } from "#/api/api";
|
||||
import { getErrorMessage, isWorkspaceNotFound } from "#/api/errors";
|
||||
import { ArchiveAndDeleteError } from "#/api/queries/chats";
|
||||
@@ -10,6 +9,7 @@ import {
|
||||
type Workspace,
|
||||
type WorkspaceBuild,
|
||||
} from "#/api/typesGenerated";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
|
||||
/**
|
||||
* Returns the moment a workspace's identity transferred to its
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { afterEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
vi.mock("sonner", () => ({
|
||||
vi.mock("#/components/Toaster/toast", () => ({
|
||||
toast: {
|
||||
error: vi.fn(),
|
||||
},
|
||||
}));
|
||||
|
||||
import { toast } from "sonner";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import {
|
||||
handleAttachmentDownloadClick,
|
||||
isChatAttachmentFile,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { toast } from "sonner";
|
||||
import { getErrorMessage, isApiErrorResponse } from "#/api/errors";
|
||||
import type * as TypesGen from "#/api/typesGenerated";
|
||||
import { ChatAttachmentMediaTypes } from "#/api/typesGenerated";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import { decodeDataURL } from "./dataUrls";
|
||||
|
||||
const undisplayableAttachmentDetail = "File exists but could not be displayed.";
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { useMutation, useQuery } from "react-query";
|
||||
import { useNavigate } from "react-router";
|
||||
import { toast } from "sonner";
|
||||
import { getErrorDetail, getErrorMessage } from "#/api/errors";
|
||||
import { uploadFile } from "#/api/queries/files";
|
||||
import {
|
||||
@@ -8,6 +7,7 @@ import {
|
||||
templateVersionLogs,
|
||||
templateVersionVariables,
|
||||
} from "#/api/queries/templates";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import { useDashboard } from "#/modules/dashboard/useDashboard";
|
||||
import { CreateTemplateForm } from "./CreateTemplateForm";
|
||||
import type { CreateTemplatePageViewProps } from "./types";
|
||||
|
||||
@@ -2,7 +2,6 @@ import { useFormik } from "formik";
|
||||
import { useState } from "react";
|
||||
import { useMutation, useQuery } from "react-query";
|
||||
import { useNavigate } from "react-router";
|
||||
import { toast } from "sonner";
|
||||
import { API } from "#/api/api";
|
||||
import { getErrorDetail } from "#/api/errors";
|
||||
import { ErrorAlert } from "#/components/Alert/ErrorAlert";
|
||||
@@ -10,6 +9,7 @@ import { CodeExample } from "#/components/CodeExample/CodeExample";
|
||||
import { ConfirmDialog } from "#/components/Dialog/ConfirmDialog/ConfirmDialog";
|
||||
import { FullPageHorizontalForm } from "#/components/FullPageForm/FullPageHorizontalForm";
|
||||
import { Loader } from "#/components/Loader/Loader";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import { pageTitle } from "#/utils/page";
|
||||
import { CreateTokenForm } from "./CreateTokenForm";
|
||||
import { type CreateTokenData, NANO_DAY } from "./utils";
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { useMutation, useQuery, useQueryClient } from "react-query";
|
||||
import { useNavigate } from "react-router";
|
||||
import { toast } from "sonner";
|
||||
import { getErrorDetail, getErrorMessage } from "#/api/errors";
|
||||
import { roles } from "#/api/queries/roles";
|
||||
import { authMethods, createUser } from "#/api/queries/users";
|
||||
import { ErrorAlert } from "#/components/Alert/ErrorAlert";
|
||||
import { Loader } from "#/components/Loader/Loader";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import { useDashboard } from "#/modules/dashboard/useDashboard";
|
||||
import { useFeatureVisibility } from "#/modules/dashboard/useFeatureVisibility";
|
||||
import { pageTitle } from "#/utils/page";
|
||||
|
||||
+1
-1
@@ -1,11 +1,11 @@
|
||||
import { useMutation, useQueryClient } from "react-query";
|
||||
import { toast } from "sonner";
|
||||
import { getErrorDetail, getErrorMessage } from "#/api/errors";
|
||||
import {
|
||||
appearanceConfigKey,
|
||||
updateAppearance,
|
||||
} from "#/api/queries/appearance";
|
||||
import type { UpdateAppearanceConfig } from "#/api/typesGenerated";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import { useAuthenticated } from "#/hooks/useAuthenticated";
|
||||
import { useDashboard } from "#/modules/dashboard/useDashboard";
|
||||
import { RequirePermission } from "#/modules/permissions/RequirePermission";
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { useState } from "react";
|
||||
import { useMutation, useQuery, useQueryClient } from "react-query";
|
||||
import { toast } from "sonner";
|
||||
import { getErrorDetail, getErrorMessage } from "#/api/errors";
|
||||
import { deploymentIdpSyncFieldValues } from "#/api/queries/deployment";
|
||||
import {
|
||||
@@ -14,6 +13,7 @@ import {
|
||||
SettingsHeaderDocsLink,
|
||||
SettingsHeaderTitle,
|
||||
} from "#/components/SettingsHeader/SettingsHeader";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import { useAuthenticated } from "#/hooks/useAuthenticated";
|
||||
import { useDashboard } from "#/modules/dashboard/useDashboard";
|
||||
import { useFeatureVisibility } from "#/modules/dashboard/useFeatureVisibility";
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { useMutation } from "react-query";
|
||||
import { useNavigate } from "react-router";
|
||||
import { toast } from "sonner";
|
||||
import { API } from "#/api/api";
|
||||
import { getErrorDetail } from "#/api/errors";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import { pageTitle } from "#/utils/page";
|
||||
import { AddNewLicensePageView } from "./AddNewLicensePageView";
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,5 @@
|
||||
import { ChevronLeftIcon } from "lucide-react";
|
||||
import { Link as RouterLink } from "react-router";
|
||||
import { toast } from "sonner";
|
||||
import { getErrorDetail } from "#/api/errors";
|
||||
import { ErrorAlert } from "#/components/Alert/ErrorAlert";
|
||||
import { Button } from "#/components/Button/Button";
|
||||
@@ -11,6 +10,7 @@ import {
|
||||
SettingsHeaderTitle,
|
||||
} from "#/components/SettingsHeader/SettingsHeader";
|
||||
import { Textarea } from "#/components/Textarea/Textarea";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import { Fieldset } from "../Fieldset";
|
||||
import { DividerWithText } from "./DividerWithText";
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import { useMutation, useQuery, useQueryClient } from "react-query";
|
||||
import { useSearchParams } from "react-router";
|
||||
import { toast } from "sonner";
|
||||
import { API } from "#/api/api";
|
||||
import { getErrorDetail, getErrorMessage } from "#/api/errors";
|
||||
import { entitlements, refreshEntitlements } from "#/api/queries/entitlements";
|
||||
import { insightsUserStatusCounts } from "#/api/queries/insights";
|
||||
import { licenses, licensesKey } from "#/api/queries/licenses";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import { useEmbeddedMetadata } from "#/hooks/useEmbeddedMetadata";
|
||||
import { pageTitle } from "#/utils/page";
|
||||
import LicensesSettingsPageView from "./LicensesSettingsPageView";
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { useMutation, useQueryClient } from "react-query";
|
||||
import { toast } from "sonner";
|
||||
import { getErrorDetail, getErrorMessage } from "#/api/errors";
|
||||
import {
|
||||
type selectTemplatesByGroup,
|
||||
@@ -15,6 +14,7 @@ import {
|
||||
SelectTrigger,
|
||||
SelectValue,
|
||||
} from "#/components/Select/Select";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import {
|
||||
castNotificationMethod,
|
||||
methodIcons,
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { useMutation } from "react-query";
|
||||
import { toast } from "sonner";
|
||||
import { API } from "#/api/api";
|
||||
import { getErrorDetail } from "#/api/errors";
|
||||
import { Button } from "#/components/Button/Button";
|
||||
import { Spinner } from "#/components/Spinner/Spinner";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
|
||||
type TroubleshootingProps = {
|
||||
canEdit?: boolean;
|
||||
|
||||
+1
-1
@@ -2,12 +2,12 @@ import { ArrowLeftIcon } from "lucide-react";
|
||||
import { useState } from "react";
|
||||
import { useMutation, useQueryClient } from "react-query";
|
||||
import { Link, useNavigate, useSearchParams } from "react-router";
|
||||
import { toast } from "sonner";
|
||||
import { getErrorDetail, getErrorMessage } from "#/api/errors";
|
||||
import { postApp } from "#/api/queries/oauth2";
|
||||
import { Avatar } from "#/components/Avatar/Avatar";
|
||||
import { Button } from "#/components/Button/Button";
|
||||
import { SettingsHeaderTitle } from "#/components/SettingsHeader/SettingsHeader";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import { useAuthenticated } from "#/hooks/useAuthenticated";
|
||||
import { pageTitle } from "#/utils/page";
|
||||
import { OAuth2AppForm } from "./OAuth2AppForm";
|
||||
|
||||
+1
-1
@@ -9,7 +9,6 @@ import {
|
||||
useParams,
|
||||
useSearchParams,
|
||||
} from "react-router";
|
||||
import { toast } from "sonner";
|
||||
import { getErrorDetail, getErrorMessage } from "#/api/errors";
|
||||
import * as oauth2 from "#/api/queries/oauth2";
|
||||
import type * as TypesGen from "#/api/typesGenerated";
|
||||
@@ -34,6 +33,7 @@ import {
|
||||
} from "#/components/Table/Table";
|
||||
import { TableEmpty } from "#/components/TableEmpty/TableEmpty";
|
||||
import { TableLoader } from "#/components/TableLoader/TableLoader";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import { useAuthenticated } from "#/hooks/useAuthenticated";
|
||||
import { createDayString } from "#/utils/createDayString";
|
||||
import { pageTitle } from "#/utils/page";
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import dayjs from "dayjs";
|
||||
import { useMutation, useQuery, useQueryClient } from "react-query";
|
||||
import { useNavigate } from "react-router";
|
||||
import { toast } from "sonner";
|
||||
import { getErrorDetail, getErrorMessage } from "#/api/errors";
|
||||
import { createTrialLicense, licenses } from "#/api/queries/licenses";
|
||||
import { Link } from "#/components/Link/Link";
|
||||
@@ -11,6 +10,7 @@ import {
|
||||
SettingsHeaderDocsLink,
|
||||
SettingsHeaderTitle,
|
||||
} from "#/components/SettingsHeader/SettingsHeader";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import { useAuthenticated } from "#/hooks/useAuthenticated";
|
||||
import { useDashboard } from "#/modules/dashboard/useDashboard";
|
||||
import { DATABASE_DOCS_LINK } from "#/modules/licenses/trialLicense";
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { useState } from "react";
|
||||
import { useMutation, useQuery, useQueryClient } from "react-query";
|
||||
import { useNavigate, useParams } from "react-router";
|
||||
import { toast } from "sonner";
|
||||
import { getErrorDetail, getErrorMessage } from "#/api/errors";
|
||||
import { deploymentConfig } from "#/api/queries/deployment";
|
||||
import {
|
||||
@@ -12,6 +11,7 @@ import {
|
||||
} from "#/api/queries/users";
|
||||
import { ErrorAlert } from "#/components/Alert/ErrorAlert";
|
||||
import { Loader } from "#/components/Loader/Loader";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import { useAuthenticated } from "#/hooks/useAuthenticated";
|
||||
import { useDashboard } from "#/modules/dashboard/useDashboard";
|
||||
import {
|
||||
|
||||
@@ -4,7 +4,6 @@ import { EllipsisVerticalIcon } from "lucide-react";
|
||||
import { useEffect, useState } from "react";
|
||||
import { useMutation, useQuery, useQueryClient } from "react-query";
|
||||
import { useOutletContext } from "react-router";
|
||||
import { toast } from "sonner";
|
||||
import { getErrorDetail, getErrorMessage } from "#/api/errors";
|
||||
import {
|
||||
groupAIBudget,
|
||||
@@ -38,6 +37,7 @@ import {
|
||||
TableRow,
|
||||
} from "#/components/Table/Table";
|
||||
import { TableEmpty } from "#/components/TableEmpty/TableEmpty";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import { useAuthenticated } from "#/hooks/useAuthenticated";
|
||||
import { useFeatureVisibility } from "#/modules/dashboard/useFeatureVisibility";
|
||||
import { formatBudgetUSD } from "#/utils/currency";
|
||||
|
||||
@@ -9,7 +9,6 @@ import {
|
||||
useParams,
|
||||
useSearchParams,
|
||||
} from "react-router";
|
||||
import { toast } from "sonner";
|
||||
import { getErrorDetail, getErrorMessage } from "#/api/errors";
|
||||
import {
|
||||
addMembers,
|
||||
@@ -41,6 +40,7 @@ import type { PaginationResult } from "#/components/PaginationWidget/PaginationC
|
||||
import { SettingsHeaderTitle } from "#/components/SettingsHeader/SettingsHeader";
|
||||
import { Spinner } from "#/components/Spinner/Spinner";
|
||||
import { LinkTabs, LinkTabsList, TabLink } from "#/components/Tabs/Tabs";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import { usePaginatedQuery } from "#/hooks/usePaginatedQuery";
|
||||
import { isEveryoneGroup } from "#/modules/groups";
|
||||
import { pageTitle } from "#/utils/page";
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { useMutation, useQuery, useQueryClient } from "react-query";
|
||||
import { useNavigate, useOutletContext, useParams } from "react-router";
|
||||
import { toast } from "sonner";
|
||||
import { getErrorDetail, getErrorMessage } from "#/api/errors";
|
||||
import {
|
||||
groupAIBudget,
|
||||
@@ -9,6 +8,7 @@ import {
|
||||
} from "#/api/queries/groups";
|
||||
import { ErrorAlert } from "#/components/Alert/ErrorAlert";
|
||||
import { Spinner } from "#/components/Spinner/Spinner";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import { useFeatureVisibility } from "#/modules/dashboard/useFeatureVisibility";
|
||||
import { RequirePermission } from "#/modules/permissions/RequirePermission";
|
||||
import { dollarsToMicros, microsToDollars } from "#/utils/currency";
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { useEffect } from "react";
|
||||
import { useQuery } from "react-query";
|
||||
import { useSearchParams } from "react-router";
|
||||
import { toast } from "sonner";
|
||||
import { getErrorDetail, getErrorMessage } from "#/api/errors";
|
||||
import {
|
||||
organizationGroupsAISpend,
|
||||
@@ -11,6 +10,7 @@ import { organizationsPermissions } from "#/api/queries/organizations";
|
||||
import { EmptyState } from "#/components/EmptyState/EmptyState";
|
||||
import { useFilter } from "#/components/Filter/Filter";
|
||||
import { Loader } from "#/components/Loader/Loader";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import { useAuthenticated } from "#/hooks/useAuthenticated";
|
||||
import { usePaginatedQuery } from "#/hooks/usePaginatedQuery";
|
||||
import { useFeatureVisibility } from "#/modules/dashboard/useFeatureVisibility";
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { cn } from "cn";
|
||||
import { useId, useMemo, useState } from "react";
|
||||
import { useMutation, useQuery, useQueryClient } from "react-query";
|
||||
import { toast } from "sonner";
|
||||
import { getErrorDetail } from "#/api/errors";
|
||||
import { groupAIBudget, groupsForUser } from "#/api/queries/groups";
|
||||
import {
|
||||
@@ -46,6 +45,7 @@ import {
|
||||
import { Label } from "#/components/Label/Label";
|
||||
import { Separator } from "#/components/Separator/Separator";
|
||||
import { Spinner } from "#/components/Spinner/Spinner";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import { aiBudgetRangeError, maxAIBudgetDollars } from "#/modules/groups";
|
||||
import {
|
||||
dollarsToMicros,
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { BellIcon, BellOffIcon } from "lucide-react";
|
||||
import { useMutation, useQuery, useQueryClient } from "react-query";
|
||||
import { toast } from "sonner";
|
||||
import { healthSettings, updateHealthSettings } from "#/api/queries/debug";
|
||||
import type { HealthSection } from "#/api/typesGenerated";
|
||||
import { Button } from "#/components/Button/Button";
|
||||
import { Skeleton } from "#/components/Skeleton/Skeleton";
|
||||
import { Spinner } from "#/components/Spinner/Spinner";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
|
||||
export const MuteWarningsButton = (props: { healthcheck: HealthSection }) => {
|
||||
const queryClient = useQueryClient();
|
||||
|
||||
@@ -3,7 +3,6 @@ import { useFormik } from "formik";
|
||||
import { ArrowLeftIcon } from "lucide-react";
|
||||
import { useMutation, useQueryClient } from "react-query";
|
||||
import { Link, useNavigate } from "react-router";
|
||||
import { toast } from "sonner";
|
||||
import * as Yup from "yup";
|
||||
import { isApiValidationError } from "#/api/errors";
|
||||
import { createOrganization } from "#/api/queries/organizations";
|
||||
@@ -21,6 +20,7 @@ import {
|
||||
} from "#/components/SettingsHeader/SettingsHeader";
|
||||
import { Spinner } from "#/components/Spinner/Spinner";
|
||||
import { Textarea } from "#/components/Textarea/Textarea";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import { PremiumPaywall } from "#/modules/paywall/PremiumPaywall";
|
||||
import type { Permissions } from "#/modules/permissions";
|
||||
import { docs } from "#/utils/docs";
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { useMutation, useQuery, useQueryClient } from "react-query";
|
||||
import { Link, useNavigate, useParams } from "react-router";
|
||||
import { toast } from "sonner";
|
||||
import { getErrorDetail, getErrorMessage } from "#/api/errors";
|
||||
import {
|
||||
createOrganizationRole,
|
||||
@@ -12,6 +11,7 @@ import { ErrorAlert } from "#/components/Alert/ErrorAlert";
|
||||
import { Button } from "#/components/Button/Button";
|
||||
import { EmptyState } from "#/components/EmptyState/EmptyState";
|
||||
import { Loader } from "#/components/Loader/Loader";
|
||||
import { toast } from "#/components/Toaster/toast";
|
||||
import { useOrganizationSettings } from "#/modules/management/OrganizationSettingsLayout";
|
||||
import { RequirePermission } from "#/modules/permissions/RequirePermission";
|
||||
import { pageTitle } from "#/utils/page";
|
||||
|
||||
Loaded 100 of 134 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user