mirror of https://github.com/buster-so/buster.git
update broken types
This commit is contained in:
parent
fad6670e83
commit
2435c1a5e3
|
@ -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> = {
|
||||
|
|
|
@ -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
|
||||
}))
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue