mirror of
https://github.com/langgenius/dify.git
synced 2026-05-06 18:27:19 +08:00
fix: evaluation switch button
This commit is contained in:
parent
0a934e1143
commit
bd136cadce
@ -126,7 +126,7 @@ const AppInfoDetailPanel = ({
|
||||
secondaryOperations={secondaryOperations}
|
||||
/>
|
||||
</div>
|
||||
{appDetail.type !== AppTypeEnum.EVALUATION && (
|
||||
{appDetail.workflow_type !== AppTypeEnum.EVALUATION && (
|
||||
<CardView
|
||||
appId={appDetail.id}
|
||||
isInPanel={true}
|
||||
|
||||
@ -147,12 +147,15 @@ const AppPublisher = ({
|
||||
const appURL = getPublisherAppUrl({ appBaseUrl: appBaseURL, accessToken, mode: appDetail?.mode })
|
||||
const isChatApp = [AppModeEnum.CHAT, AppModeEnum.AGENT_CHAT, AppModeEnum.COMPLETION].includes(appDetail?.mode || AppModeEnum.CHAT)
|
||||
const workflowTypeSwitchConfig = useMemo(() => {
|
||||
if (!isWorkflowTypeConversionTarget(appDetail?.type))
|
||||
if (!appDetail?.workflow_type)
|
||||
return WORKFLOW_TYPE_SWITCH_CONFIG.workflow
|
||||
|
||||
if (!isWorkflowTypeConversionTarget(appDetail?.workflow_type))
|
||||
return undefined
|
||||
|
||||
return WORKFLOW_TYPE_SWITCH_CONFIG[appDetail.type]
|
||||
}, [appDetail?.type])
|
||||
const isEvaluationWorkflowType = appDetail?.type === AppTypeEnum.EVALUATION
|
||||
return WORKFLOW_TYPE_SWITCH_CONFIG[appDetail.workflow_type]
|
||||
}, [appDetail?.workflow_type])
|
||||
const isEvaluationWorkflowType = appDetail?.workflow_type === AppTypeEnum.EVALUATION
|
||||
const {
|
||||
refetch: refetchEvaluationWorkflowAssociatedTargets,
|
||||
isFetching: isFetchingEvaluationWorkflowAssociatedTargets,
|
||||
@ -321,7 +324,7 @@ const AppPublisher = ({
|
||||
return
|
||||
}
|
||||
|
||||
if (appDetail.type === AppTypeEnum.EVALUATION && workflowTypeSwitchConfig.targetType === AppTypeEnum.WORKFLOW) {
|
||||
if (appDetail.workflow_type === AppTypeEnum.EVALUATION && workflowTypeSwitchConfig.targetType === AppTypeEnum.WORKFLOW) {
|
||||
const associatedTargetsResult = await refetchEvaluationWorkflowAssociatedTargets()
|
||||
|
||||
if (associatedTargetsResult.isError) {
|
||||
@ -340,7 +343,7 @@ const AppPublisher = ({
|
||||
await performWorkflowTypeSwitch()
|
||||
}, [
|
||||
appDetail?.id,
|
||||
appDetail?.type,
|
||||
appDetail?.workflow_type,
|
||||
performWorkflowTypeSwitch,
|
||||
refetchEvaluationWorkflowAssociatedTargets,
|
||||
t,
|
||||
|
||||
@ -21,7 +21,7 @@ const StartNodeSelectionPanel: FC<StartNodeSelectionPanelProps> = ({
|
||||
onSelectTrigger,
|
||||
}) => {
|
||||
const { t } = useTranslation()
|
||||
const appType = useAppStore(s => s.appDetail?.type)
|
||||
const appType = useAppStore(s => s.appDetail?.workflow_type)
|
||||
const [showTriggerSelector, setShowTriggerSelector] = useState(false)
|
||||
const isEvaluationWorkflowType = isEvaluationWorkflow(appType)
|
||||
|
||||
@ -62,7 +62,7 @@ const StartNodeSelectionPanel: FC<StartNodeSelectionPanelProps> = ({
|
||||
trigger={() => (
|
||||
<StartNodeOption
|
||||
icon={(
|
||||
<div className="flex h-9 w-9 items-center justify-center radius-lg border-[0.5px] border-transparent bg-util-colors-blue-brand-blue-brand-500 p-2">
|
||||
<div className="radius-lg flex h-9 w-9 items-center justify-center border-[0.5px] border-transparent bg-util-colors-blue-brand-blue-brand-500 p-2">
|
||||
<TriggerAll className="h-5 w-5 text-white" />
|
||||
</div>
|
||||
)}
|
||||
|
||||
@ -18,7 +18,7 @@ import { useIsChatMode } from './use-is-chat-mode'
|
||||
export const useAvailableNodesMetaData = () => {
|
||||
const { t } = useTranslation()
|
||||
const isChatMode = useIsChatMode()
|
||||
const appType = useAppStore(s => s.appDetail?.type)
|
||||
const appType = useAppStore(s => s.appDetail?.workflow_type)
|
||||
const docLink = useDocLink()
|
||||
const isEvaluationWorkflowType = isEvaluationWorkflow(appType)
|
||||
|
||||
|
||||
@ -57,7 +57,7 @@ const AllStartBlocks = ({
|
||||
const { t } = useTranslation()
|
||||
const [hasStartBlocksContent, setHasStartBlocksContent] = useState(false)
|
||||
const [hasPluginContent, setHasPluginContent] = useState(false)
|
||||
const appType = useAppStore(s => s.appDetail?.type)
|
||||
const appType = useAppStore(s => s.appDetail?.workflow_type)
|
||||
const { data: enable_marketplace } = useSuspenseQuery({
|
||||
...systemFeaturesQueryOptions(),
|
||||
select: s => s.enable_marketplace,
|
||||
|
||||
@ -31,7 +31,7 @@ const Blocks = ({
|
||||
}: BlocksProps) => {
|
||||
const { t } = useTranslation()
|
||||
const store = useStoreApi()
|
||||
const appType = useAppStore(s => s.appDetail?.type)
|
||||
const appType = useAppStore(s => s.appDetail?.workflow_type)
|
||||
const blocksFromHooks = useBlocks()
|
||||
const filteredAvailableBlocksTypes = useMemo(() => {
|
||||
if (!isEvaluationWorkflow(appType))
|
||||
|
||||
@ -355,8 +355,6 @@ export type App = {
|
||||
|
||||
/** Mode */
|
||||
mode: AppModeEnum
|
||||
/** Type */
|
||||
type?: AppTypeEnum
|
||||
/** Enable web app */
|
||||
enable_site: boolean
|
||||
/** Enable web API */
|
||||
@ -392,6 +390,8 @@ export type App = {
|
||||
max_active_requests?: number | null
|
||||
/** whether workflow trigger has un-published draft */
|
||||
has_draft_trigger?: boolean
|
||||
/** Type */
|
||||
workflow_type?: AppTypeEnum
|
||||
}
|
||||
|
||||
export type AppSSO = {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user