update broken types

This commit is contained in:
Nate Kelley 2025-08-04 10:24:22 -06:00
parent fad6670e83
commit 2435c1a5e3
No known key found for this signature in database
GPG Key ID: FD90372AB8D98B4F
2 changed files with 37 additions and 12 deletions

View File

@ -174,6 +174,24 @@ const collectionItems: DropdownItem<ShareRole>[] = [
}
];
const reportItems: DropdownItem<ShareRole>[] = [
{
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<WorkspaceShareRole>[] = [
{
value: 'fullAccess',
@ -198,10 +216,11 @@ const workspaceItems: DropdownItem<WorkspaceShareRole>[] = [
];
const itemsRecord: Record<ShareAssetType, DropdownItem<ShareRole>[]> = {
['dashboard']: dashboardItems,
['metric']: metricItems,
['collection']: collectionItems,
['chat']: collectionItems
dashboard: dashboardItems,
metric: metricItems,
collection: collectionItems,
chat: collectionItems,
report: reportItems
};
const OWNER_ITEM: DropdownItem<DropdownValue> = {

View File

@ -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<typeof InputSelectModal> = {
// Define the data type for the list items
type ListItemData = {
name: string;
email: string;
};
const meta: Meta<typeof InputSelectModal<ListItemData>> = {
title: 'UI/Modal/InputSelectModal',
component: InputSelectModal,
parameters: {
@ -15,7 +21,7 @@ const meta: Meta<typeof InputSelectModal> = {
};
export default meta;
type Story = StoryObj<typeof InputSelectModal>;
type Story = StoryObj<typeof InputSelectModal<ListItemData>>;
export const Default: Story = {
render: (args) => {
@ -26,7 +32,7 @@ export const Default: Story = {
};
return (
<InputSelectModal
<InputSelectModal<ListItemData>
{...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<ListItemData>['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
}))
}
};