ability to click classifier during workflow execution (#23079)
This commit is contained in:
@@ -64,55 +64,56 @@ const ClassList: FC<Props> = ({
|
|||||||
const handleSideWidth = 3
|
const handleSideWidth = 3
|
||||||
// Todo Remove; edit topic name
|
// Todo Remove; edit topic name
|
||||||
return (
|
return (
|
||||||
<ReactSortable
|
<>
|
||||||
list={list.map(item => ({ ...item }))}
|
<ReactSortable
|
||||||
setList={handleSortTopic}
|
list={list.map(item => ({ ...item }))}
|
||||||
handle='.handle'
|
setList={handleSortTopic}
|
||||||
ghostClass='bg-components-panel-bg'
|
handle='.handle'
|
||||||
animation={150}
|
ghostClass='bg-components-panel-bg'
|
||||||
disabled={readonly}
|
animation={150}
|
||||||
className='space-y-2'
|
disabled={readonly}
|
||||||
>
|
className='space-y-2'
|
||||||
{
|
>
|
||||||
list.map((item, index) => {
|
{
|
||||||
const canDrag = (() => {
|
list.map((item, index) => {
|
||||||
if (readonly)
|
const canDrag = (() => {
|
||||||
return false
|
if (readonly)
|
||||||
|
return false
|
||||||
|
|
||||||
return topicCount >= 2
|
return topicCount >= 2
|
||||||
})()
|
})()
|
||||||
return (
|
return (
|
||||||
<div key={item.id}
|
<div key={item.id}
|
||||||
className={cn(
|
className={cn(
|
||||||
'group relative rounded-[10px] bg-components-panel-bg',
|
'group relative rounded-[10px] bg-components-panel-bg',
|
||||||
`-ml-${handleSideWidth} min-h-[40px] px-0 py-0`,
|
`-ml-${handleSideWidth} min-h-[40px] px-0 py-0`,
|
||||||
)}>
|
)}>
|
||||||
<div >
|
<div >
|
||||||
<Item
|
<Item
|
||||||
className={cn(canDrag && 'handle')}
|
className={cn(canDrag && 'handle')}
|
||||||
headerClassName={cn(canDrag && 'cursor-grab')}
|
headerClassName={cn(canDrag && 'cursor-grab')}
|
||||||
nodeId={nodeId}
|
nodeId={nodeId}
|
||||||
key={list[index].id}
|
key={list[index].id}
|
||||||
payload={item}
|
payload={item}
|
||||||
onChange={handleClassChange(index)}
|
onChange={handleClassChange(index)}
|
||||||
onRemove={handleRemoveClass(index)}
|
onRemove={handleRemoveClass(index)}
|
||||||
index={index + 1}
|
index={index + 1}
|
||||||
readonly={readonly}
|
readonly={readonly}
|
||||||
filterVar={filterVar}
|
filterVar={filterVar}
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
)
|
||||||
)
|
})
|
||||||
})
|
}
|
||||||
}
|
</ReactSortable>
|
||||||
{!readonly && (
|
{!readonly && (
|
||||||
<AddButton
|
<AddButton
|
||||||
onClick={handleAddClass}
|
onClick={handleAddClass}
|
||||||
text={t(`${i18nPrefix}.addClass`)}
|
text={t(`${i18nPrefix}.addClass`)}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
</>
|
||||||
</ReactSortable>
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
export default React.memo(ClassList)
|
export default React.memo(ClassList)
|
||||||
|
Reference in New Issue
Block a user