mirror of
https://github.com/langgenius/dify.git
synced 2026-05-03 00:48:04 +08:00
fix(trigger): add event node status & min-height in modal
This commit is contained in:
@ -1,7 +1,10 @@
|
||||
import NodeStatus, { NodeStatusEnum } from '@/app/components/base/node-status'
|
||||
import { INVALID_SUBSCRIPTION_ID } from '@/app/components/plugins/plugin-detail-panel/subscription-list/selector-entry'
|
||||
import type { NodeProps } from '@/app/components/workflow/types'
|
||||
import type { FC } from 'react'
|
||||
import React from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import type { PluginTriggerNodeType } from './types'
|
||||
import type { NodeProps } from '@/app/components/workflow/types'
|
||||
import useConfig from './use-config'
|
||||
|
||||
const formatConfigValue = (rawValue: any): string => {
|
||||
@ -38,9 +41,10 @@ const Node: FC<NodeProps<PluginTriggerNodeType>> = ({
|
||||
data,
|
||||
}) => {
|
||||
const { isAuthenticated } = useConfig(id, data)
|
||||
const { config = {} } = data
|
||||
const { config = {}, subscription_id } = data
|
||||
const configKeys = Object.keys(config)
|
||||
|
||||
const { t } = useTranslation()
|
||||
// Only show config when authenticated and has config values
|
||||
if (!isAuthenticated || configKeys.length === 0)
|
||||
return null
|
||||
@ -48,7 +52,8 @@ const Node: FC<NodeProps<PluginTriggerNodeType>> = ({
|
||||
return (
|
||||
<div className="mb-1 px-3 py-1">
|
||||
<div className="space-y-0.5">
|
||||
{configKeys.map((key, index) => (
|
||||
{(!subscription_id || subscription_id === INVALID_SUBSCRIPTION_ID) && <NodeStatus status={NodeStatusEnum.warning} message={t('pluginTrigger.node.status.warning')} />}
|
||||
{subscription_id && subscription_id !== INVALID_SUBSCRIPTION_ID && configKeys.map((key, index) => (
|
||||
<div
|
||||
key={index}
|
||||
className="flex h-6 items-center justify-between space-x-1 rounded-md bg-workflow-block-parma-bg px-1 text-xs font-normal text-text-secondary"
|
||||
|
||||
Reference in New Issue
Block a user