feat: support workflow version specification in workflow and chat APIs (#23188)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -29,9 +29,12 @@ const useContextMenu = (props: ContextMenuProps) => {
|
||||
key: VersionHistoryContextMenuOptions.edit,
|
||||
name: t('workflow.versionHistory.nameThisVersion'),
|
||||
},
|
||||
{
|
||||
key: VersionHistoryContextMenuOptions.copyId,
|
||||
name: t('workflow.versionHistory.copyId'),
|
||||
},
|
||||
]
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [isNamedVersion])
|
||||
}, [isNamedVersion, t])
|
||||
|
||||
return {
|
||||
deleteOperation,
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
import React, { useCallback, useState } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { RiArrowDownDoubleLine, RiCloseLine, RiLoader2Line } from '@remixicon/react'
|
||||
import copy from 'copy-to-clipboard'
|
||||
import { useNodesSyncDraft, useWorkflowRun } from '../../hooks'
|
||||
import { useStore, useWorkflowStore } from '../../store'
|
||||
import { VersionHistoryContextMenuOptions, WorkflowVersionFilterOptions } from '../../types'
|
||||
@@ -99,8 +100,15 @@ const VersionHistoryPanel = () => {
|
||||
case VersionHistoryContextMenuOptions.delete:
|
||||
setDeleteConfirmOpen(true)
|
||||
break
|
||||
case VersionHistoryContextMenuOptions.copyId:
|
||||
copy(item.id)
|
||||
Toast.notify({
|
||||
type: 'success',
|
||||
message: t('workflow.versionHistory.action.copyIdSuccess'),
|
||||
})
|
||||
break
|
||||
}
|
||||
}, [])
|
||||
}, [t])
|
||||
|
||||
const handleCancel = useCallback((operation: VersionHistoryContextMenuOptions) => {
|
||||
switch (operation) {
|
||||
|
||||
@@ -55,7 +55,6 @@ const VersionHistoryItem: React.FC<VersionHistoryItemProps> = ({
|
||||
useEffect(() => {
|
||||
if (isDraft)
|
||||
onClick(item)
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [])
|
||||
|
||||
const handleClickItem = () => {
|
||||
|
||||
Reference in New Issue
Block a user