mirror of
https://github.com/langgenius/dify.git
synced 2026-01-23 04:02:21 +08:00
fix(trigger): check subscription removed
Some checks are pending
Build and Push API & Web / build (api, DIFY_API_IMAGE_NAME, linux/amd64, build-api-amd64) (push) Waiting to run
Build and Push API & Web / build (api, DIFY_API_IMAGE_NAME, linux/arm64, build-api-arm64) (push) Waiting to run
Build and Push API & Web / build (web, DIFY_WEB_IMAGE_NAME, linux/amd64, build-web-amd64) (push) Waiting to run
Build and Push API & Web / build (web, DIFY_WEB_IMAGE_NAME, linux/arm64, build-web-arm64) (push) Waiting to run
Build and Push API & Web / create-manifest (api, DIFY_API_IMAGE_NAME, merge-api-images) (push) Blocked by required conditions
Build and Push API & Web / create-manifest (web, DIFY_WEB_IMAGE_NAME, merge-web-images) (push) Blocked by required conditions
Some checks are pending
Build and Push API & Web / build (api, DIFY_API_IMAGE_NAME, linux/amd64, build-api-amd64) (push) Waiting to run
Build and Push API & Web / build (api, DIFY_API_IMAGE_NAME, linux/arm64, build-api-arm64) (push) Waiting to run
Build and Push API & Web / build (web, DIFY_WEB_IMAGE_NAME, linux/amd64, build-web-amd64) (push) Waiting to run
Build and Push API & Web / build (web, DIFY_WEB_IMAGE_NAME, linux/arm64, build-web-arm64) (push) Waiting to run
Build and Push API & Web / create-manifest (api, DIFY_API_IMAGE_NAME, merge-api-images) (push) Blocked by required conditions
Build and Push API & Web / create-manifest (web, DIFY_WEB_IMAGE_NAME, merge-web-images) (push) Blocked by required conditions
This commit is contained in:
parent
c90df5c12c
commit
9a3ca0ce3b
@ -17,11 +17,15 @@ type SubscriptionTriggerButtonProps = {
|
||||
onClick?: () => void
|
||||
isOpen?: boolean
|
||||
className?: string
|
||||
onSelect: (v: SimpleSubscription, callback?: () => void) => void
|
||||
}
|
||||
|
||||
export const INVALID_SUBSCRIPTION_ID = 'INVALID_SUBSCRIPTION_ID'
|
||||
|
||||
const SubscriptionTriggerButton: React.FC<SubscriptionTriggerButtonProps> = ({
|
||||
selectedId,
|
||||
onClick,
|
||||
onSelect,
|
||||
isOpen = false,
|
||||
className,
|
||||
}) => {
|
||||
@ -45,6 +49,7 @@ const SubscriptionTriggerButton: React.FC<SubscriptionTriggerButtonProps> = ({
|
||||
const selectedSubscription = subscriptions?.find(sub => sub.id === selectedId)
|
||||
|
||||
if (!selectedSubscription) {
|
||||
onSelect({ id: INVALID_SUBSCRIPTION_ID, name: '' } as SimpleSubscription)
|
||||
return {
|
||||
label: t('pluginTrigger.subscription.subscriptionRemoved'),
|
||||
color: 'red' as const,
|
||||
@ -100,6 +105,7 @@ export const SubscriptionSelectorEntry = ({ selectedId, onSelect }: {
|
||||
selectedId={selectedId}
|
||||
onClick={() => setIsOpen(!isOpen)}
|
||||
isOpen={isOpen}
|
||||
onSelect={onSelect}
|
||||
/>
|
||||
</div>
|
||||
</PortalToFollowElemTrigger>
|
||||
|
||||
@ -1,11 +1,12 @@
|
||||
import { BlockEnum, VarType } from '../../types'
|
||||
import type { NodeDefault, Var } from '../../types'
|
||||
import { genNodeMetaData } from '../../utils'
|
||||
import type { PluginTriggerNodeType } from './types'
|
||||
import { getMatchedSchemaType } from '../_base/components/variable/use-match-schema-type'
|
||||
import { INVALID_SUBSCRIPTION_ID } from '@/app/components/plugins/plugin-detail-panel/subscription-list/selector-entry'
|
||||
import type { SchemaTypeDefinition } from '@/service/use-common'
|
||||
import { type Field, type StructuredOutput, Type } from '../llm/types'
|
||||
import type { NodeDefault, Var } from '../../types'
|
||||
import { BlockEnum, VarType } from '../../types'
|
||||
import { genNodeMetaData } from '../../utils'
|
||||
import { getMatchedSchemaType } from '../_base/components/variable/use-match-schema-type'
|
||||
import { VarKindType } from '../_base/types'
|
||||
import { type Field, type StructuredOutput, Type } from '../llm/types'
|
||||
import type { PluginTriggerNodeType } from './types'
|
||||
|
||||
const normalizeJsonSchemaType = (schema: any): string | undefined => {
|
||||
if (!schema) return undefined
|
||||
@ -233,7 +234,7 @@ const nodeDefault: NodeDefault<PluginTriggerNodeType> = {
|
||||
} = {}) {
|
||||
let errorMessage = ''
|
||||
|
||||
if (!payload.subscription_id)
|
||||
if (!payload.subscription_id || payload.subscription_id === INVALID_SUBSCRIPTION_ID)
|
||||
errorMessage = t('workflow.nodes.triggerPlugin.subscriptionRequired')
|
||||
|
||||
const {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user