2023-05-23 03:54:42 -04:00
|
|
|
import LabelListItemComponent from '../../js/features/history/components/change-list/label-list-item'
|
|
|
|
import { ScopeDecorator } from '../decorators/scope'
|
|
|
|
import { HistoryProvider } from '../../js/features/history/context/history-context'
|
|
|
|
import { disableControlsOf } from '../utils/arg-types'
|
2024-10-10 03:26:18 -04:00
|
|
|
import { bsVersionDecorator } from '../../../.storybook/utils/with-bootstrap-switcher'
|
2023-05-23 03:54:42 -04:00
|
|
|
|
|
|
|
const labels = [
|
|
|
|
{
|
|
|
|
id: '643561cdfa2b2beac88f0024',
|
|
|
|
comment: 'tag-1',
|
|
|
|
version: 1,
|
|
|
|
user_id: '123',
|
|
|
|
created_at: '2023-04-11T13:34:05.856Z',
|
|
|
|
user_display_name: 'john.doe',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: '643561d1fa2b2beac88f0025',
|
|
|
|
comment: 'tag-2',
|
|
|
|
version: 1,
|
|
|
|
user_id: '123',
|
|
|
|
created_at: '2023-04-11T13:34:09.280Z',
|
|
|
|
user_display_name: 'john.doe',
|
|
|
|
},
|
|
|
|
]
|
|
|
|
|
|
|
|
export const LabelVersion = (
|
|
|
|
args: React.ComponentProps<typeof LabelListItemComponent>
|
|
|
|
) => {
|
|
|
|
return (
|
|
|
|
<HistoryProvider>
|
|
|
|
<LabelListItemComponent {...args} />
|
|
|
|
</HistoryProvider>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export default {
|
|
|
|
title: 'History / Change list',
|
|
|
|
component: LabelListItemComponent,
|
|
|
|
args: {
|
|
|
|
labels,
|
|
|
|
version: 1,
|
|
|
|
currentUserId: '1',
|
|
|
|
projectId: '123',
|
|
|
|
comparing: false,
|
2023-09-05 05:21:29 -04:00
|
|
|
selectionState: false,
|
2023-05-23 03:54:42 -04:00
|
|
|
selectable: false,
|
|
|
|
setSelection: () => {},
|
|
|
|
dropdownOpen: false,
|
|
|
|
dropdownActive: false,
|
|
|
|
setActiveDropdownItem: () => {},
|
|
|
|
closeDropdownForItem: () => {},
|
|
|
|
},
|
2024-10-10 03:26:18 -04:00
|
|
|
argTypes: {
|
|
|
|
...disableControlsOf(
|
|
|
|
'labels',
|
|
|
|
'version',
|
|
|
|
'currentUserId',
|
|
|
|
'projectId',
|
|
|
|
'setSelection',
|
|
|
|
'dropdownOpen',
|
|
|
|
'dropdownActive',
|
|
|
|
'setActiveDropdownItem',
|
|
|
|
'closeDropdownForItem'
|
|
|
|
),
|
|
|
|
...bsVersionDecorator.argTypes,
|
|
|
|
},
|
2023-05-23 03:54:42 -04:00
|
|
|
decorators: [
|
|
|
|
ScopeDecorator,
|
|
|
|
(Story: React.ComponentType) => (
|
|
|
|
<div className="history-react">
|
|
|
|
<div className="change-list">
|
|
|
|
<div className="history-version-list-container">
|
|
|
|
<Story />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
),
|
|
|
|
],
|
|
|
|
}
|