A full-featured CRM built with React, shadcn/ui, and Supabase.
add stories on ContactCreate
ThieryMicheld990c39be9d6
diff --git a/src/components/atomic-crm/contacts/ContactCreate.stories.tsx b/src/components/atomic-crm/contacts/ContactCreate.stories.tsxnew file mode 100644index 00000000..8b0fd2cb--- /dev/null+++ b/src/components/atomic-crm/contacts/ContactCreate.stories.tsx@@ -0,0 +1,46 @@+import type { Meta, StoryObj } from "@storybook/react-vite";++import {+ createCrmDb,+ CrmStoryProvider,+} from "@/test/browser/atomic-crm/crmUiHarness";+import { ContactCreate } from "./ContactCreate";++const meta = {+ title: "Atomic CRM/Contacts/Contact Create",+ parameters: {+ layout: "fullscreen",+ },+} satisfies Meta;++export default meta;++type Story = StoryObj<typeof meta>;++export const ConcatCreateBasic: Story = {+ render: () => (+ <CrmStoryProvider+ resource="contacts"+ initialEntries={["/contacts/create"]}+ scenarioOptions={{ db: createCrmDb(), silent: false }}+ >+ <ContactCreate />+ </CrmStoryProvider>+ ),+};++export const ConcatCreateBasicWithError: Story = {+ render: () => (+ <CrmStoryProvider+ resource="contacts"+ initialEntries={["/contacts/create"]}+ scenarioOptions={{+ db: createCrmDb(),+ creationError: "Simulated create error",+ silent: false,+ }}+ >+ <ContactCreate />+ </CrmStoryProvider>+ ),+};diff --git a/src/components/atomic-crm/contacts/__screenshots__/ContactList.integration.test.tsx/Contact-list-integration-renders-the-empty-state-in-the-desktop-list-1.png b/src/components/atomic-crm/contacts/__screenshots__/ContactList.integration.test.tsx/Contact-list-integration-renders-the-empty-state-in-the-desktop-list-1.pngnew file mode 100644index 00000000..c1aa6d58Binary files /dev/null and b/src/components/atomic-crm/contacts/__screenshots__/ContactList.integration.test.tsx/Contact-list-integration-renders-the-empty-state-in-the-desktop-list-1.png differdiff --git a/src/components/atomic-crm/providers/fakerest/dataProvider.ts b/src/components/atomic-crm/providers/fakerest/dataProvider.tsindex 92b19b06..4469fd47 100644--- a/src/components/atomic-crm/providers/fakerest/dataProvider.ts+++ b/src/components/atomic-crm/providers/fakerest/dataProvider.ts@@ -116,6 +116,7 @@ export interface CreateFakeRestDataProviderOptions {db?: Db;latency?: number;authProvider?: Pick<typeof defaultAuthProvider, "getIdentity">;+ silent?: boolean;}const processConfigLogo = async (logo: any): Promise<string> => {@@ -142,8 +143,9 @@ export const createDataProvider = ({db = generateData(),latency = 300,authProvider,+ silent = false,}: CreateFakeRestDataProviderOptions = {}): CrmDataProvider => {- const baseDataProvider = fakeRestDataProvider(db, true, latency);+ const baseDataProvider = fakeRestDataProvider(db, !silent, latency);let taskUpdateType = TASK_DONE_NOT_CHANGED;const getIdentity = async () =>authProvider?.getIdentity?.() ?? defaultAuthProvider.getIdentity?.();diff --git a/src/components/atomic-crm/tasks/__screenshots__/TaskCreateSheet.integration.test.tsx/TaskCreateSheet-integration-creates-a-task-for-a-selected-contact-and-updates-last-seen-1.png b/src/components/atomic-crm/tasks/__screenshots__/TaskCreateSheet.integration.test.tsx/TaskCreateSheet-integration-creates-a-task-for-a-selected-contact-and-updates-last-seen-1.pngnew file mode 100644index 00000000..bef54772Binary files /dev/null and b/src/components/atomic-crm/tasks/__screenshots__/TaskCreateSheet.integration.test.tsx/TaskCreateSheet-integration-creates-a-task-for-a-selected-contact-and-updates-last-seen-1.png differ