mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-04 21:04:37 +08:00
Don't show alpha apps during onboarding
This commit is contained in:
parent
bb901068cb
commit
a62702354b
@ -137,7 +137,8 @@ vi.mock("./link-existing-onboarding", () => ({
|
||||
}));
|
||||
|
||||
import { ProjectOnboardingWizard } from "./project-onboarding-wizard";
|
||||
import { normalizeProjectOnboardingState, REQUIRED_APP_IDS } from "./shared";
|
||||
import { normalizeProjectOnboardingState, orderedAppIds, REQUIRED_APP_IDS } from "./shared";
|
||||
import { ALL_APPS } from "@stackframe/stack-shared/dist/apps/apps-config";
|
||||
|
||||
afterEach(() => {
|
||||
cleanup();
|
||||
@ -156,6 +157,16 @@ describe("ProjectOnboardingWizard", () => {
|
||||
expect(normalizedState.selected_apps).toEqual(REQUIRED_APP_IDS);
|
||||
});
|
||||
|
||||
it("does not offer alpha apps during app selection", () => {
|
||||
const alphaAppIds = Object.entries(ALL_APPS)
|
||||
.filter(([, app]) => app.stage === "alpha")
|
||||
.map(([appId]) => appId);
|
||||
|
||||
for (const alphaAppId of alphaAppIds) {
|
||||
expect(orderedAppIds()).not.toContain(alphaAppId);
|
||||
}
|
||||
});
|
||||
|
||||
it("completes onboarding automatically after Stripe setup returns successfully", async () => {
|
||||
const setStatus = vi.fn(async () => {});
|
||||
const onComplete = vi.fn();
|
||||
|
||||
@ -22,6 +22,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 OAUTH_SIGN_IN_METHODS: SignInMethod[] = ["google", "github", "microsoft"];
|
||||
|
||||
export type ProjectOnboardingState = {
|
||||
@ -149,11 +150,12 @@ export function isProjectOnboardingStatus(value: unknown): value is ProjectOnboa
|
||||
}
|
||||
|
||||
export function orderedAppIds() {
|
||||
const primarySet = new Set(PRIMARY_APP_IDS);
|
||||
const secondary = ALL_APP_IDS.filter((appId) => !primarySet.has(appId)).sort((a, b) => {
|
||||
const primary = PRIMARY_APP_IDS.filter((appId) => ONBOARDING_APP_IDS.some((onboardingAppId) => onboardingAppId === appId));
|
||||
const primarySet = new Set(primary);
|
||||
const secondary = ONBOARDING_APP_IDS.filter((appId) => !primarySet.has(appId)).sort((a, b) => {
|
||||
return stringCompare(ALL_APPS[a].displayName, ALL_APPS[b].displayName);
|
||||
});
|
||||
return [...PRIMARY_APP_IDS, ...secondary];
|
||||
return [...primary, ...secondary];
|
||||
}
|
||||
|
||||
export function normalizeTrustedDomain(input: string): string {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user