mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-30 21:01:54 +08:00
Hide sub-apps from dashboard onboarding wizard
Filter out apps with a parentAppId (e.g. clickmaps, session-replays, fraud-protection) from ONBOARDING_APP_IDS so they don't appear in the project onboarding app-selection step. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
cc68e36260
commit
615c0ec905
@ -141,7 +141,7 @@ vi.mock("./link-existing-onboarding", () => ({
|
||||
|
||||
import { ProjectOnboardingWizard } from "./project-onboarding-wizard";
|
||||
import { normalizeProjectOnboardingState, orderedAppIds, REQUIRED_APP_IDS } from "./shared";
|
||||
import { ALL_APPS } from "@hexclave/shared/dist/apps/apps-config";
|
||||
import { ALL_APPS, getParentAppId, type AppId } from "@hexclave/shared/dist/apps/apps-config";
|
||||
|
||||
afterEach(() => {
|
||||
cleanup();
|
||||
@ -171,6 +171,14 @@ describe("ProjectOnboardingWizard", () => {
|
||||
}
|
||||
});
|
||||
|
||||
it("does not offer sub-apps during app selection", () => {
|
||||
const subAppIds = (Object.keys(ALL_APPS) as AppId[]).filter((appId) => getParentAppId(appId) != null);
|
||||
|
||||
for (const subAppId of subAppIds) {
|
||||
expect(orderedAppIds()).not.toContain(subAppId);
|
||||
}
|
||||
});
|
||||
|
||||
it("completes onboarding automatically after Stripe setup returns successfully", async () => {
|
||||
const setStatus = vi.fn(async () => {});
|
||||
const onComplete = vi.fn();
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { hexclaveAppInternalsSymbol } from "@/lib/hexclave-app-internals";
|
||||
import { AdminOwnedProject } from "@hexclave/next";
|
||||
import { ALL_APPS, type AppId } from "@hexclave/shared/dist/apps/apps-config";
|
||||
import { ALL_APPS, getParentAppId, type AppId } from "@hexclave/shared/dist/apps/apps-config";
|
||||
import { projectOnboardingStatusValues, type ProjectOnboardingStatus } from "@hexclave/shared/dist/schema-fields";
|
||||
import { sharedProviders } from "@hexclave/shared/dist/utils/oauth";
|
||||
import { stringCompare } from "@hexclave/shared/dist/utils/strings";
|
||||
@ -23,7 +23,7 @@ export const SIGN_IN_METHODS: Array<{ id: SignInMethod, label: string }> = [
|
||||
export const REQUIRED_APP_IDS: AppId[] = ["authentication", "emails"];
|
||||
export const PRIMARY_APP_IDS: AppId[] = ["authentication", "emails", "payments", "analytics"];
|
||||
export const ALL_APP_IDS = Object.keys(ALL_APPS) as AppId[];
|
||||
export const ONBOARDING_APP_IDS = ALL_APP_IDS.filter((appId) => ALL_APPS[appId].stage !== "alpha");
|
||||
export const ONBOARDING_APP_IDS = ALL_APP_IDS.filter((appId) => ALL_APPS[appId].stage !== "alpha" && getParentAppId(appId) == null);
|
||||
export const OAUTH_SIGN_IN_METHODS = ["google", "github", "microsoft"] satisfies SignInMethod[];
|
||||
export const SHARED_OAUTH_SIGN_IN_METHODS = sharedProviders.filter((provider): provider is (typeof sharedProviders)[number] & SignInMethod => {
|
||||
return OAUTH_SIGN_IN_METHODS.some((method) => method === provider);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user