diff --git a/apps/web/src/components/features/ShareMenu/AccessDropdown.tsx b/apps/web/src/components/features/ShareMenu/AccessDropdown.tsx index 92098012e..c46091a35 100644 --- a/apps/web/src/components/features/ShareMenu/AccessDropdown.tsx +++ b/apps/web/src/components/features/ShareMenu/AccessDropdown.tsx @@ -174,6 +174,24 @@ const collectionItems: DropdownItem[] = [ } ]; +const reportItems: DropdownItem[] = [ + { + value: 'fullAccess', + label: 'Full access', + secondaryLabel: 'Can edit and share with others.' + }, + { + value: 'canEdit', + label: 'Can edit', + secondaryLabel: 'Can edit but not share with others.' + }, + { + value: 'canView', + label: 'Can view', + secondaryLabel: 'Can view asset but not edit.' + } +]; + const workspaceItems: DropdownItem[] = [ { value: 'fullAccess', @@ -198,10 +216,11 @@ const workspaceItems: DropdownItem[] = [ ]; const itemsRecord: Record[]> = { - ['dashboard']: dashboardItems, - ['metric']: metricItems, - ['collection']: collectionItems, - ['chat']: collectionItems + dashboard: dashboardItems, + metric: metricItems, + collection: collectionItems, + chat: collectionItems, + report: reportItems }; const OWNER_ITEM: DropdownItem = { diff --git a/apps/web/src/components/ui/modal/InputScrollableModal.stories.tsx b/apps/web/src/components/ui/modal/InputScrollableModal.stories.tsx index 93babcb27..fd0fb8deb 100644 --- a/apps/web/src/components/ui/modal/InputScrollableModal.stories.tsx +++ b/apps/web/src/components/ui/modal/InputScrollableModal.stories.tsx @@ -3,9 +3,15 @@ import type { Meta, StoryObj } from '@storybook/react'; import { fn } from '@storybook/test'; import React from 'react'; import { useSet } from '@/hooks'; -import { InputSelectModal } from './InputSelectModal'; +import { InputSelectModal, type InputSelectModalProps } from './InputSelectModal'; -const meta: Meta = { +// Define the data type for the list items +type ListItemData = { + name: string; + email: string; +}; + +const meta: Meta> = { title: 'UI/Modal/InputSelectModal', component: InputSelectModal, parameters: { @@ -15,7 +21,7 @@ const meta: Meta = { }; export default meta; -type Story = StoryObj; +type Story = StoryObj>; export const Default: Story = { render: (args) => { @@ -26,7 +32,7 @@ export const Default: Story = { }; return ( - {...args} open={true} selectedRowKeys={Array.from(selectedItems)} @@ -50,17 +56,17 @@ export const Default: Story = { columns: [ { title: 'Name', - dataIndex: 'name' + dataIndex: 'name' as const }, { title: 'Email', - dataIndex: 'email' + dataIndex: 'email' as const } - ], + ] satisfies InputSelectModalProps['columns'], selectedRowKeys: [], rows: Array.from({ length: 3000 }, () => ({ id: faker.string.uuid(), - data: { name: faker.person.fullName(), email: faker.internet.email() } + data: { name: faker.person.fullName(), email: faker.internet.email() } as ListItemData })) } };