chore: catch up Storybook preview, coverage, and story hygiene
Stories were throwing without AuthModal/CreateFlow providers, autodocs was a no-op, and several DS/create-flow screens had no stories.
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
import { CommunityStructureSelectScreen } from "../../app/(app)/create/screens/select/CommunityStructureSelectScreen";
|
||||
|
||||
export default {
|
||||
title: "Pages/Create Flow/Community structure",
|
||||
component: CommunityStructureSelectScreen,
|
||||
parameters: { layout: "fullscreen" },
|
||||
};
|
||||
|
||||
export const Default = {};
|
||||
@@ -0,0 +1,17 @@
|
||||
import { ConflictManagementScreen } from "../../app/(app)/create/screens/card/ConflictManagementScreen";
|
||||
|
||||
export default {
|
||||
title: "Pages/Create Flow/Conflict management",
|
||||
component: ConflictManagementScreen,
|
||||
parameters: {
|
||||
layout: "fullscreen",
|
||||
docs: {
|
||||
description: {
|
||||
component:
|
||||
"Conflict management step: card stack, customize modals, responsive layout.",
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const Default = {};
|
||||
@@ -0,0 +1,9 @@
|
||||
import { CoreValuesSelectScreen } from "../../app/(app)/create/screens/select/CoreValuesSelectScreen";
|
||||
|
||||
export default {
|
||||
title: "Pages/Create Flow/Core values",
|
||||
component: CoreValuesSelectScreen,
|
||||
parameters: { layout: "fullscreen" },
|
||||
};
|
||||
|
||||
export const Default = {};
|
||||
@@ -1,7 +1,7 @@
|
||||
import { InformationalScreen } from "../../app/(app)/create/screens/informational/InformationalScreen";
|
||||
|
||||
export default {
|
||||
title: "Pages/Create/Informational",
|
||||
title: "Pages/Create Flow/Informational",
|
||||
component: InformationalScreen,
|
||||
parameters: { layout: "fullscreen" },
|
||||
};
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
import { MembershipMethodsScreen } from "../../app/(app)/create/screens/card/MembershipMethodsScreen";
|
||||
|
||||
export default {
|
||||
title: "Pages/Create Flow/Membership methods",
|
||||
component: MembershipMethodsScreen,
|
||||
parameters: {
|
||||
layout: "fullscreen",
|
||||
docs: {
|
||||
description: {
|
||||
component:
|
||||
"Membership methods step: card stack, customize modals, responsive layout.",
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const Default = {};
|
||||
@@ -0,0 +1,67 @@
|
||||
import { useEffect, useRef } from "react";
|
||||
import { PublishedStakeholdersManagePanel } from "../../app/(app)/create/screens/select/PublishedStakeholdersManagePanel";
|
||||
|
||||
function StakeholdersFetchMock({ children }) {
|
||||
const origRef = useRef(undefined);
|
||||
if (origRef.current === undefined) {
|
||||
origRef.current = globalThis.fetch;
|
||||
globalThis.fetch = async (input, init) => {
|
||||
const url =
|
||||
typeof input === "string"
|
||||
? input
|
||||
: input instanceof URL
|
||||
? input.href
|
||||
: input.url;
|
||||
if (url.includes("/stakeholders")) {
|
||||
if (init?.method && init.method !== "GET") {
|
||||
return new Response(JSON.stringify({ ok: true }), {
|
||||
status: 200,
|
||||
headers: { "Content-Type": "application/json" },
|
||||
});
|
||||
}
|
||||
return new Response(JSON.stringify({ stakeholders: [] }), {
|
||||
status: 200,
|
||||
headers: { "Content-Type": "application/json" },
|
||||
});
|
||||
}
|
||||
return origRef.current(input, init);
|
||||
};
|
||||
}
|
||||
useEffect(() => {
|
||||
return () => {
|
||||
if (origRef.current) {
|
||||
globalThis.fetch = origRef.current;
|
||||
}
|
||||
};
|
||||
}, []);
|
||||
return children;
|
||||
}
|
||||
|
||||
export default {
|
||||
title: "Pages/Create Flow/Published stakeholders",
|
||||
component: PublishedStakeholdersManagePanel,
|
||||
parameters: {
|
||||
layout: "fullscreen",
|
||||
docs: {
|
||||
description: {
|
||||
component:
|
||||
"Manage invites on a published rule. Fetch is stubbed empty in this story.",
|
||||
},
|
||||
},
|
||||
},
|
||||
decorators: [
|
||||
(Story) => (
|
||||
<StakeholdersFetchMock>
|
||||
<div className="min-h-screen bg-[var(--color-surface-default-primary)] p-8">
|
||||
<Story />
|
||||
</div>
|
||||
</StakeholdersFetchMock>
|
||||
),
|
||||
],
|
||||
};
|
||||
|
||||
export const Default = {
|
||||
args: {
|
||||
ruleId: "storybook-rule",
|
||||
},
|
||||
};
|
||||
@@ -1,7 +1,7 @@
|
||||
import { CommunityReviewScreen } from "../../app/(app)/create/screens/review/CommunityReviewScreen";
|
||||
|
||||
export default {
|
||||
title: "Pages/Create/Review",
|
||||
title: "Pages/Create Flow/Review",
|
||||
component: CommunityReviewScreen,
|
||||
parameters: { layout: "fullscreen" },
|
||||
};
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { CommunitySizeSelectScreen } from "../../app/(app)/create/screens/select/CommunitySizeSelectScreen";
|
||||
|
||||
export default {
|
||||
title: "Pages/Create/CommunitySize",
|
||||
title: "Pages/Create Flow/Community size",
|
||||
component: CommunitySizeSelectScreen,
|
||||
parameters: { layout: "fullscreen" },
|
||||
};
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { CreateFlowTextFieldScreen } from "../../app/(app)/create/screens/text/CreateFlowTextFieldScreen";
|
||||
|
||||
export default {
|
||||
title: "Pages/Create/CommunityName",
|
||||
title: "Pages/Create Flow/Community name",
|
||||
component: CreateFlowTextFieldScreen,
|
||||
parameters: { layout: "fullscreen" },
|
||||
};
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { CommunityUploadScreen } from "../../app/(app)/create/screens/upload/CommunityUploadScreen";
|
||||
|
||||
export default {
|
||||
title: "Pages/Create/CommunityUpload",
|
||||
title: "Pages/Create Flow/Community upload",
|
||||
component: CommunityUploadScreen,
|
||||
parameters: { layout: "fullscreen" },
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user