mirror of
https://github.com/langgenius/dify.git
synced 2026-05-03 17:08:03 +08:00
fix: web style
This commit is contained in:
@ -111,7 +111,6 @@ const MCPServerModal = ({
|
||||
isShow={show}
|
||||
onClose={onHide}
|
||||
className={cn('relative max-w-[520px]! p-0!')}
|
||||
highPriority
|
||||
>
|
||||
<div className="absolute right-5 top-5 z-10 cursor-pointer p-1.5" onClick={onHide}>
|
||||
<RiCloseLine className="h-5 w-5 text-text-tertiary" />
|
||||
|
||||
@ -451,7 +451,7 @@ export const CommentThread: FC<CommentThreadProps> = memo(({
|
||||
</button>
|
||||
)}
|
||||
/>
|
||||
<TooltipContent placement="top" popupClassName="!px-2 !py-1.5">
|
||||
<TooltipContent placement="top" className="!px-2 !py-1.5">
|
||||
{t('comments.aria.deleteComment', { ns: 'workflow' })}
|
||||
</TooltipContent>
|
||||
</Tooltip>
|
||||
@ -469,7 +469,7 @@ export const CommentThread: FC<CommentThreadProps> = memo(({
|
||||
</button>
|
||||
)}
|
||||
/>
|
||||
<TooltipContent placement="top" popupClassName="!px-2 !py-1.5">
|
||||
<TooltipContent placement="top" className="!px-2 !py-1.5">
|
||||
{t('comments.aria.resolveComment', { ns: 'workflow' })}
|
||||
</TooltipContent>
|
||||
</Tooltip>
|
||||
@ -488,7 +488,7 @@ export const CommentThread: FC<CommentThreadProps> = memo(({
|
||||
</button>
|
||||
)}
|
||||
/>
|
||||
<TooltipContent placement="top" popupClassName="!px-2 !py-1.5">
|
||||
<TooltipContent placement="top" className="!px-2 !py-1.5">
|
||||
{t('comments.aria.previousComment', { ns: 'workflow' })}
|
||||
</TooltipContent>
|
||||
</Tooltip>
|
||||
@ -506,7 +506,7 @@ export const CommentThread: FC<CommentThreadProps> = memo(({
|
||||
</button>
|
||||
)}
|
||||
/>
|
||||
<TooltipContent placement="top" popupClassName="!px-2 !py-1.5">
|
||||
<TooltipContent placement="top" className="!px-2 !py-1.5">
|
||||
{t('comments.aria.nextComment', { ns: 'workflow' })}
|
||||
</TooltipContent>
|
||||
</Tooltip>
|
||||
|
||||
@ -156,7 +156,7 @@ const OnlineUsers = () => {
|
||||
<TooltipContent
|
||||
placement="bottom"
|
||||
sideOffset={4}
|
||||
popupClassName="flex h-[28px] w-[85px] items-center justify-center gap-1 rounded-md border-[0.5px] border-components-panel-border bg-components-tooltip-bg px-3 py-[6px] shadow-lg shadow-shadow-shadow-5 backdrop-blur-[10px]"
|
||||
className="flex h-[28px] w-[85px] items-center justify-center gap-1 rounded-md border-[0.5px] border-components-panel-border bg-components-tooltip-bg px-3 py-[6px] shadow-lg shadow-shadow-shadow-5 backdrop-blur-[10px]"
|
||||
>
|
||||
{renderDisplayName(
|
||||
user,
|
||||
|
||||
@ -1,10 +1,13 @@
|
||||
import type { AnswerNodeType } from '@/app/components/workflow/nodes/answer/types'
|
||||
import type { HumanInputNodeType } from '@/app/components/workflow/nodes/human-input/types'
|
||||
import type { LLMNodeType } from '@/app/components/workflow/nodes/llm/types'
|
||||
import type { Node, PromptItem } from '@/app/components/workflow/types'
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { BlockEnum, EditionType, PromptRole } from '@/app/components/workflow/types'
|
||||
import { AppModeEnum } from '@/types/app'
|
||||
import { getNodeUsedVars, updateNodeVars } from '../utils'
|
||||
|
||||
const createNode = (data: Node['data']): Node => ({
|
||||
const createNode = <T>(data: Node<T>['data']): Node<T> => ({
|
||||
id: 'node-1',
|
||||
type: 'custom',
|
||||
position: { x: 0, y: 0 },
|
||||
@ -20,7 +23,7 @@ const createPromptItem = (overrides: Partial<PromptItem> = {}): PromptItem => ({
|
||||
describe('variable utils', () => {
|
||||
describe('getNodeUsedVars', () => {
|
||||
it('should read variables from llm jinja prompt text', () => {
|
||||
const node = createNode({
|
||||
const node = createNode<LLMNodeType>({
|
||||
type: BlockEnum.LLM,
|
||||
title: 'LLM',
|
||||
desc: '',
|
||||
@ -42,7 +45,7 @@ describe('variable utils', () => {
|
||||
})
|
||||
|
||||
it('should read variables from human input email body', () => {
|
||||
const node = createNode({
|
||||
const node = createNode<HumanInputNodeType>({
|
||||
type: BlockEnum.HumanInput,
|
||||
title: 'Human Input',
|
||||
desc: '',
|
||||
@ -76,7 +79,7 @@ describe('variable utils', () => {
|
||||
|
||||
describe('updateNodeVars', () => {
|
||||
it('should replace answer prompt references', () => {
|
||||
const node = createNode({
|
||||
const node = createNode<AnswerNodeType>({
|
||||
type: BlockEnum.Answer,
|
||||
title: 'Answer',
|
||||
desc: '',
|
||||
@ -86,11 +89,11 @@ describe('variable utils', () => {
|
||||
|
||||
const updatedNode = updateNodeVars(node, ['env', 'API_KEY'], ['env', 'RENAMED_KEY'])
|
||||
|
||||
expect(updatedNode.data.answer).toBe('Answer {{#env.RENAMED_KEY#}}')
|
||||
expect((updatedNode.data as AnswerNodeType).answer).toBe('Answer {{#env.RENAMED_KEY#}}')
|
||||
})
|
||||
|
||||
it('should replace llm jinja prompt references', () => {
|
||||
const node = createNode({
|
||||
const node = createNode<LLMNodeType>({
|
||||
type: BlockEnum.LLM,
|
||||
title: 'LLM',
|
||||
desc: '',
|
||||
@ -111,14 +114,14 @@ describe('variable utils', () => {
|
||||
|
||||
const updatedNode = updateNodeVars(node, ['env', 'API_KEY'], ['env', 'RENAMED_KEY'])
|
||||
|
||||
expect((updatedNode.data.prompt_template as PromptItem[])[0]).toMatchObject({
|
||||
expect(((updatedNode.data as LLMNodeType).prompt_template as PromptItem[])[0]).toMatchObject({
|
||||
text: '{{#env.RENAMED_KEY#}}',
|
||||
jinja2_text: 'Hello {{#env.RENAMED_KEY#}}',
|
||||
})
|
||||
})
|
||||
|
||||
it('should replace human input email template references', () => {
|
||||
const node = createNode({
|
||||
const node = createNode<HumanInputNodeType>({
|
||||
type: BlockEnum.HumanInput,
|
||||
title: 'Human Input',
|
||||
desc: '',
|
||||
@ -144,7 +147,7 @@ describe('variable utils', () => {
|
||||
|
||||
const updatedNode = updateNodeVars(node, ['env', 'API_KEY'], ['env', 'RENAMED_KEY'])
|
||||
|
||||
expect(updatedNode.data.delivery_methods[0]?.config).toMatchObject({
|
||||
expect((updatedNode.data as HumanInputNodeType).delivery_methods[0]?.config).toMatchObject({
|
||||
subject: 'Subject {{#conversation.memory#}}',
|
||||
body: 'Body {{#env.RENAMED_KEY#}}',
|
||||
})
|
||||
|
||||
@ -27,11 +27,11 @@ import type {
|
||||
EnvironmentVariable,
|
||||
Node,
|
||||
NodeOutPutVar,
|
||||
PromptItem,
|
||||
ToolWithProvider,
|
||||
ValueSelector,
|
||||
Var,
|
||||
} from '@/app/components/workflow/types'
|
||||
import type { PromptItem } from '@/models/debug'
|
||||
import type { RAGPipelineVariable } from '@/models/pipeline'
|
||||
import type { SchemaTypeDefinition } from '@/service/use-common'
|
||||
import { uniq } from 'es-toolkit/array'
|
||||
|
||||
Reference in New Issue
Block a user