Refresh HiveGrid Cloud reference snapshot
This commit is contained in:
1 parent
5e99e14772
commit
7f88026f79
5955 files changed
+1177325
-188362
No files matched your search
@@ -0,0 +1,7 @@
|
||||
import { redirect, type LoaderFunctionArgs } from "react-router";
|
||||
import UrlUtils from "~/utils/app/UrlUtils";
|
||||
|
||||
export { default, ErrorBoundary } from "../settings/integrations/api/index";
|
||||
|
||||
export const loader = ({ request, params }: LoaderFunctionArgs) =>
|
||||
redirect(`${UrlUtils.currentTenantUrl(params, "settings/integrations/api")}${new URL(request.url).search}`);
|
||||
@@ -0,0 +1,7 @@
|
||||
import { redirect, type LoaderFunctionArgs } from "react-router";
|
||||
import UrlUtils from "~/utils/app/UrlUtils";
|
||||
|
||||
export { default } from "../settings/integrations/api/keys";
|
||||
|
||||
export const loader = ({ request, params }: LoaderFunctionArgs) =>
|
||||
redirect(`${UrlUtils.currentTenantUrl(params, "settings/integrations/api/keys")}${new URL(request.url).search}`);
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
import { redirect, type LoaderFunctionArgs } from "react-router";
|
||||
import UrlUtils from "~/utils/app/UrlUtils";
|
||||
|
||||
export { action, default } from "../../settings/integrations/api/keys/$id";
|
||||
|
||||
export const loader = ({ request, params }: LoaderFunctionArgs) =>
|
||||
redirect(`${UrlUtils.currentTenantUrl(params, `settings/integrations/api/keys/${params.id ?? ""}`)}${new URL(request.url).search}`);
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
import { redirect, type LoaderFunctionArgs } from "react-router";
|
||||
import UrlUtils from "~/utils/app/UrlUtils";
|
||||
|
||||
export { action, default } from "../../settings/integrations/api/keys/new";
|
||||
|
||||
export const loader = ({ request, params }: LoaderFunctionArgs) =>
|
||||
redirect(`${UrlUtils.currentTenantUrl(params, "settings/integrations/api/keys/new")}${new URL(request.url).search}`);
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
import type { LoaderFunctionArgs } from "react-router";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { loader as overviewLoader } from "./index";
|
||||
import { loader as keysLoader } from "./keys";
|
||||
import { loader as keyDetailLoader } from "./keys/$id";
|
||||
import { loader as newKeyLoader } from "./keys/new";
|
||||
import { loader as logsLoader } from "./logs";
|
||||
|
||||
type LegacyLoader = (args: LoaderFunctionArgs) => Response | Promise<Response>;
|
||||
|
||||
async function expectSettingsRedirect(loader: LegacyLoader, path: string, expectedLocation: string, params: Record<string, string>) {
|
||||
const response = await loader({
|
||||
request: new Request(`https://app.example.test${path}`),
|
||||
params,
|
||||
context: {},
|
||||
} as unknown as LoaderFunctionArgs);
|
||||
|
||||
expect(response.status).toBe(302);
|
||||
expect(response.headers.get("Location")).toBe(expectedLocation);
|
||||
}
|
||||
|
||||
describe("legacy tenant API routes", () => {
|
||||
it.each([
|
||||
[overviewLoader, "/acme/api?period=7d", "/acme/settings/integrations/api?period=7d", { tenant: "acme" }],
|
||||
[logsLoader, "/acme/api/logs?page=2", "/acme/settings/integrations/api/logs?page=2", { tenant: "acme" }],
|
||||
[keysLoader, "/acme/api/keys", "/acme/settings/integrations/api/keys", { tenant: "acme" }],
|
||||
[newKeyLoader, "/acme/api/keys/new", "/acme/settings/integrations/api/keys/new", { tenant: "acme" }],
|
||||
[keyDetailLoader, "/acme/api/keys/key-1", "/acme/settings/integrations/api/keys/key-1", { tenant: "acme", id: "key-1" }],
|
||||
])("redirects %s into the settings workspace", async (loader, path, expectedLocation, params) => {
|
||||
await expectSettingsRedirect(loader as LegacyLoader, path as string, expectedLocation as string, params as Record<string, string>);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,7 @@
|
||||
import { redirect, type LoaderFunctionArgs } from "react-router";
|
||||
import UrlUtils from "~/utils/app/UrlUtils";
|
||||
|
||||
export { default } from "../settings/integrations/api/logs";
|
||||
|
||||
export const loader = ({ request, params }: LoaderFunctionArgs) =>
|
||||
redirect(`${UrlUtils.currentTenantUrl(params, "settings/integrations/api/logs")}${new URL(request.url).search}`);
|
||||
Reference in new issue
Block a user