mirror of
https://github.com/langgenius/dify.git
synced 2026-05-12 07:37:09 +08:00
Merge branch 'main' into jzh
This commit is contained in:
commit
4b9a26a5e6
@ -74,11 +74,22 @@ class AppGenerateResponseConverter(ABC):
|
||||
for resource in metadata["retriever_resources"]:
|
||||
updated_resources.append(
|
||||
{
|
||||
"dataset_id": resource.get("dataset_id"),
|
||||
"dataset_name": resource.get("dataset_name"),
|
||||
"document_id": resource.get("document_id"),
|
||||
"segment_id": resource.get("segment_id", ""),
|
||||
"position": resource["position"],
|
||||
"data_source_type": resource.get("data_source_type"),
|
||||
"document_name": resource["document_name"],
|
||||
"score": resource["score"],
|
||||
"hit_count": resource.get("hit_count"),
|
||||
"word_count": resource.get("word_count"),
|
||||
"segment_position": resource.get("segment_position"),
|
||||
"index_node_hash": resource.get("index_node_hash"),
|
||||
"content": resource["content"],
|
||||
"page": resource.get("page"),
|
||||
"title": resource.get("title"),
|
||||
"files": resource.get("files"),
|
||||
"summary": resource.get("summary"),
|
||||
}
|
||||
)
|
||||
|
||||
@ -44,11 +44,22 @@ class TestAgentChatAppGenerateResponseConverterBlocking:
|
||||
metadata={
|
||||
"retriever_resources": [
|
||||
{
|
||||
"dataset_id": "dataset-1",
|
||||
"dataset_name": "Dataset 1",
|
||||
"document_id": "document-1",
|
||||
"segment_id": "s1",
|
||||
"position": 1,
|
||||
"data_source_type": "file",
|
||||
"document_name": "doc",
|
||||
"score": 0.9,
|
||||
"hit_count": 2,
|
||||
"word_count": 128,
|
||||
"segment_position": 3,
|
||||
"index_node_hash": "abc1234",
|
||||
"content": "content",
|
||||
"page": 5,
|
||||
"title": "Citation Title",
|
||||
"files": [{"id": "file-1"}],
|
||||
}
|
||||
],
|
||||
"annotation_reply": {"id": "a"},
|
||||
@ -107,11 +118,22 @@ class TestAgentChatAppGenerateResponseConverterStream:
|
||||
metadata={
|
||||
"retriever_resources": [
|
||||
{
|
||||
"dataset_id": "dataset-1",
|
||||
"dataset_name": "Dataset 1",
|
||||
"document_id": "document-1",
|
||||
"segment_id": "s1",
|
||||
"position": 1,
|
||||
"data_source_type": "file",
|
||||
"document_name": "doc",
|
||||
"score": 0.9,
|
||||
"hit_count": 2,
|
||||
"word_count": 128,
|
||||
"segment_position": 3,
|
||||
"index_node_hash": "abc1234",
|
||||
"content": "content",
|
||||
"page": 5,
|
||||
"title": "Citation Title",
|
||||
"files": [{"id": "file-1"}],
|
||||
"summary": "summary",
|
||||
"extra": "ignored",
|
||||
}
|
||||
@ -151,11 +173,22 @@ class TestAgentChatAppGenerateResponseConverterStream:
|
||||
assert "usage" not in metadata
|
||||
assert metadata["retriever_resources"] == [
|
||||
{
|
||||
"dataset_id": "dataset-1",
|
||||
"dataset_name": "Dataset 1",
|
||||
"document_id": "document-1",
|
||||
"segment_id": "s1",
|
||||
"position": 1,
|
||||
"data_source_type": "file",
|
||||
"document_name": "doc",
|
||||
"score": 0.9,
|
||||
"hit_count": 2,
|
||||
"word_count": 128,
|
||||
"segment_position": 3,
|
||||
"index_node_hash": "abc1234",
|
||||
"content": "content",
|
||||
"page": 5,
|
||||
"title": "Citation Title",
|
||||
"files": [{"id": "file-1"}],
|
||||
"summary": "summary",
|
||||
}
|
||||
]
|
||||
|
||||
@ -38,11 +38,22 @@ class TestCompletionAppGenerateResponseConverter:
|
||||
metadata = {
|
||||
"retriever_resources": [
|
||||
{
|
||||
"dataset_id": "dataset-1",
|
||||
"dataset_name": "Dataset 1",
|
||||
"document_id": "document-1",
|
||||
"segment_id": "s",
|
||||
"position": 1,
|
||||
"data_source_type": "file",
|
||||
"document_name": "doc",
|
||||
"score": 0.9,
|
||||
"hit_count": 2,
|
||||
"word_count": 128,
|
||||
"segment_position": 3,
|
||||
"index_node_hash": "abc1234",
|
||||
"content": "c",
|
||||
"page": 5,
|
||||
"title": "Citation Title",
|
||||
"files": [{"id": "file-1"}],
|
||||
"summary": "sum",
|
||||
"extra": "x",
|
||||
}
|
||||
@ -66,7 +77,12 @@ class TestCompletionAppGenerateResponseConverter:
|
||||
|
||||
assert "annotation_reply" not in result["metadata"]
|
||||
assert "usage" not in result["metadata"]
|
||||
assert result["metadata"]["retriever_resources"][0]["dataset_id"] == "dataset-1"
|
||||
assert result["metadata"]["retriever_resources"][0]["document_id"] == "document-1"
|
||||
assert result["metadata"]["retriever_resources"][0]["segment_id"] == "s"
|
||||
assert result["metadata"]["retriever_resources"][0]["data_source_type"] == "file"
|
||||
assert result["metadata"]["retriever_resources"][0]["segment_position"] == 3
|
||||
assert result["metadata"]["retriever_resources"][0]["index_node_hash"] == "abc1234"
|
||||
assert "extra" not in result["metadata"]["retriever_resources"][0]
|
||||
|
||||
def test_convert_blocking_simple_response_metadata_not_dict(self):
|
||||
|
||||
@ -163,25 +163,16 @@ describe('ThinkBlock', () => {
|
||||
expect(screen.getByText(/Thought/)).toBeInTheDocument()
|
||||
})
|
||||
|
||||
it('should NOT stop timer when isResponding is undefined (outside ChatContextProvider)', () => {
|
||||
// Render without ChatContextProvider
|
||||
it('should stop timer when isResponding is undefined (historical conversation outside active response)', () => {
|
||||
// Render without ChatContextProvider — simulates historical conversation
|
||||
render(
|
||||
<ThinkBlock data-think={true}>
|
||||
<p>Content without ENDTHINKFLAG</p>
|
||||
</ThinkBlock>,
|
||||
)
|
||||
|
||||
// Initial state should show "Thinking..."
|
||||
expect(screen.getByText(/Thinking\.\.\./)).toBeInTheDocument()
|
||||
|
||||
// Advance timer
|
||||
act(() => {
|
||||
vi.advanceTimersByTime(2000)
|
||||
})
|
||||
|
||||
// Timer should still be running (showing "Thinking..." not "Thought")
|
||||
expect(screen.getByText(/Thinking\.\.\./)).toBeInTheDocument()
|
||||
expect(screen.getByText(/\(2\.0s\)/)).toBeInTheDocument()
|
||||
// Timer should be stopped immediately — isResponding undefined means not in active response
|
||||
expect(screen.getByText(/Thought/)).toBeInTheDocument()
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
@ -39,9 +39,10 @@ const removeEndThink = (children: any): any => {
|
||||
|
||||
const useThinkTimer = (children: any) => {
|
||||
const { isResponding } = useChatContext()
|
||||
const endThinkDetected = hasEndThink(children)
|
||||
const [startTime] = useState(() => Date.now())
|
||||
const [elapsedTime, setElapsedTime] = useState(0)
|
||||
const [isComplete, setIsComplete] = useState(false)
|
||||
const [isComplete, setIsComplete] = useState(() => endThinkDetected)
|
||||
const timerRef = useRef<NodeJS.Timeout | null>(null)
|
||||
|
||||
useEffect(() => {
|
||||
@ -61,11 +62,10 @@ const useThinkTimer = (children: any) => {
|
||||
useEffect(() => {
|
||||
// Stop timer when:
|
||||
// 1. Content has [ENDTHINKFLAG] marker (normal completion)
|
||||
// 2. isResponding is explicitly false (user clicked stop button)
|
||||
// Note: Don't stop when isResponding is undefined (component used outside ChatContextProvider)
|
||||
if (hasEndThink(children) || isResponding === false)
|
||||
// 2. isResponding is not true (false = user clicked stop, undefined = historical conversation)
|
||||
if (endThinkDetected || !isResponding)
|
||||
setIsComplete(true)
|
||||
}, [children, isResponding])
|
||||
}, [endThinkDetected, isResponding])
|
||||
|
||||
return { elapsedTime, isComplete }
|
||||
}
|
||||
|
||||
@ -14,23 +14,11 @@ vi.mock('@/service/tag', () => ({
|
||||
fetchTagList,
|
||||
}))
|
||||
|
||||
// Mock ahooks to avoid timer-related issues in tests
|
||||
vi.mock('ahooks', () => {
|
||||
return {
|
||||
useDebounceFn: (fn: (...args: unknown[]) => void) => {
|
||||
const ref = React.useRef(fn)
|
||||
ref.current = fn
|
||||
const stableRun = React.useRef((...args: unknown[]) => {
|
||||
// Schedule to run after current event handler finishes,
|
||||
// allowing React to process pending state updates first
|
||||
Promise.resolve().then(() => ref.current(...args))
|
||||
})
|
||||
return { run: stableRun.current }
|
||||
},
|
||||
useMount: (fn: () => void) => {
|
||||
React.useEffect(() => {
|
||||
fn()
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [])
|
||||
},
|
||||
}
|
||||
@ -228,7 +216,6 @@ describe('TagFilter', () => {
|
||||
const searchInput = screen.getByRole('textbox')
|
||||
await user.type(searchInput, 'Front')
|
||||
|
||||
// With debounce mocked to be synchronous, results should be immediate
|
||||
expect(screen.getByText('Frontend')).toBeInTheDocument()
|
||||
expect(screen.queryByText('Backend')).not.toBeInTheDocument()
|
||||
expect(screen.queryByText('API Design')).not.toBeInTheDocument()
|
||||
@ -257,22 +244,14 @@ describe('TagFilter', () => {
|
||||
const searchInput = screen.getByRole('textbox')
|
||||
await user.type(searchInput, 'Front')
|
||||
|
||||
// Wait for the debounced search to filter
|
||||
await waitFor(() => {
|
||||
expect(screen.queryByText('Backend')).not.toBeInTheDocument()
|
||||
})
|
||||
expect(screen.queryByText('Backend')).not.toBeInTheDocument()
|
||||
|
||||
// Clear the search using the Input's clear button
|
||||
const clearButton = screen.getByTestId('input-clear')
|
||||
await user.click(clearButton)
|
||||
|
||||
// The input value should be cleared
|
||||
expect(searchInput).toHaveValue('')
|
||||
|
||||
// After the clear + microtask re-render, all app tags should be visible again
|
||||
await waitFor(() => {
|
||||
expect(screen.getByText('Backend')).toBeInTheDocument()
|
||||
})
|
||||
expect(screen.getByText('Backend')).toBeInTheDocument()
|
||||
expect(screen.getByText('Frontend')).toBeInTheDocument()
|
||||
expect(screen.getByText('API Design')).toBeInTheDocument()
|
||||
})
|
||||
|
||||
@ -1,15 +1,15 @@
|
||||
import type { FC } from 'react'
|
||||
import type { Tag } from '@/app/components/base/tag-management/constant'
|
||||
import { useDebounceFn, useMount } from 'ahooks'
|
||||
import { useMount } from 'ahooks'
|
||||
import { useMemo, useState } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { Tag01, Tag03 } from '@/app/components/base/icons/src/vender/line/financeAndECommerce'
|
||||
import Input from '@/app/components/base/input'
|
||||
import {
|
||||
PortalToFollowElem,
|
||||
PortalToFollowElemContent,
|
||||
PortalToFollowElemTrigger,
|
||||
} from '@/app/components/base/portal-to-follow-elem'
|
||||
Popover,
|
||||
PopoverContent,
|
||||
PopoverTrigger,
|
||||
} from '@/app/components/base/ui/popover'
|
||||
import { fetchTagList } from '@/service/tag'
|
||||
import { cn } from '@/utils/classnames'
|
||||
|
||||
@ -33,18 +33,10 @@ const TagFilter: FC<TagFilterProps> = ({
|
||||
const setShowTagManagementModal = useTagStore(s => s.setShowTagManagementModal)
|
||||
|
||||
const [keywords, setKeywords] = useState('')
|
||||
const [searchKeywords, setSearchKeywords] = useState('')
|
||||
const { run: handleSearch } = useDebounceFn(() => {
|
||||
setSearchKeywords(keywords)
|
||||
}, { wait: 500 })
|
||||
const handleKeywordsChange = (value: string) => {
|
||||
setKeywords(value)
|
||||
handleSearch()
|
||||
}
|
||||
|
||||
const filteredTagList = useMemo(() => {
|
||||
return tagList.filter(tag => tag.type === type && tag.name.includes(searchKeywords))
|
||||
}, [type, tagList, searchKeywords])
|
||||
return tagList.filter(tag => tag.type === type && tag.name.includes(keywords))
|
||||
}, [type, tagList, keywords])
|
||||
|
||||
const currentTag = useMemo(() => {
|
||||
return tagList.find(tag => tag.id === value[0])
|
||||
@ -64,61 +56,61 @@ const TagFilter: FC<TagFilterProps> = ({
|
||||
})
|
||||
|
||||
return (
|
||||
<PortalToFollowElem
|
||||
<Popover
|
||||
open={open}
|
||||
onOpenChange={setOpen}
|
||||
placement="bottom-start"
|
||||
offset={4}
|
||||
>
|
||||
<div className="relative">
|
||||
<PortalToFollowElemTrigger
|
||||
onClick={() => setOpen(v => !v)}
|
||||
className="block"
|
||||
>
|
||||
<div className={cn(
|
||||
'flex h-8 cursor-pointer select-none items-center gap-1 rounded-lg border-[0.5px] border-transparent bg-components-input-bg-normal px-2',
|
||||
!open && !!value.length && 'shadow-xs',
|
||||
open && !!value.length && 'shadow-xs',
|
||||
)}
|
||||
>
|
||||
<div className="p-[1px]">
|
||||
<Tag01 className="h-3.5 w-3.5 text-text-tertiary" data-testid="tag-filter-trigger-icon" />
|
||||
</div>
|
||||
<div className="text-[13px] leading-[18px] text-text-secondary">
|
||||
{!value.length && t('tag.placeholder', { ns: 'common' })}
|
||||
{!!value.length && currentTag?.name}
|
||||
</div>
|
||||
{value.length > 1 && (
|
||||
<div className="text-xs font-medium leading-[18px] text-text-tertiary">{`+${value.length - 1}`}</div>
|
||||
)}
|
||||
{!value.length && (
|
||||
<PopoverTrigger
|
||||
render={(
|
||||
<button
|
||||
type="button"
|
||||
className={cn(
|
||||
'flex h-8 cursor-pointer select-none items-center gap-1 rounded-lg border-[0.5px] border-transparent bg-components-input-bg-normal px-2 text-left',
|
||||
!!value.length && 'pr-6 shadow-xs',
|
||||
)}
|
||||
>
|
||||
<div className="p-[1px]">
|
||||
<span className="i-ri-arrow-down-s-line h-3.5 w-3.5 text-text-tertiary" data-testid="tag-filter-arrow-down-icon" />
|
||||
<Tag01 className="h-3.5 w-3.5 text-text-tertiary" data-testid="tag-filter-trigger-icon" />
|
||||
</div>
|
||||
)}
|
||||
{!!value.length && (
|
||||
<div
|
||||
className="group/clear cursor-pointer p-[1px]"
|
||||
onClick={(e) => {
|
||||
e.stopPropagation()
|
||||
onChange([])
|
||||
}}
|
||||
data-testid="tag-filter-clear-button"
|
||||
>
|
||||
<span className="i-custom-vender-solid-general-x-circle h-3.5 w-3.5 text-text-tertiary group-hover/clear:text-text-secondary" />
|
||||
<div className="min-w-0 truncate text-[13px] leading-[18px] text-text-secondary">
|
||||
{!value.length && t('tag.placeholder', { ns: 'common' })}
|
||||
{!!value.length && currentTag?.name}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</PortalToFollowElemTrigger>
|
||||
<PortalToFollowElemContent className="z-[1002]">
|
||||
<div className="relative w-[240px] rounded-lg border-[0.5px] border-components-panel-border bg-components-panel-bg-blur shadow-lg backdrop-blur-[5px]">
|
||||
{value.length > 1 && (
|
||||
<div className="shrink-0 text-xs font-medium leading-[18px] text-text-tertiary">{`+${value.length - 1}`}</div>
|
||||
)}
|
||||
{!value.length && (
|
||||
<div className="shrink-0 p-[1px]">
|
||||
<span className="i-ri-arrow-down-s-line h-3.5 w-3.5 text-text-tertiary" data-testid="tag-filter-arrow-down-icon" />
|
||||
</div>
|
||||
)}
|
||||
</button>
|
||||
)}
|
||||
/>
|
||||
{!!value.length && (
|
||||
<button
|
||||
type="button"
|
||||
className="group/clear absolute right-2 top-1/2 -translate-y-1/2 p-[1px]"
|
||||
onClick={() => onChange([])}
|
||||
data-testid="tag-filter-clear-button"
|
||||
>
|
||||
<span className="i-custom-vender-solid-general-x-circle h-3.5 w-3.5 text-text-tertiary group-hover/clear:text-text-secondary" />
|
||||
</button>
|
||||
)}
|
||||
<PopoverContent
|
||||
placement="bottom-start"
|
||||
sideOffset={4}
|
||||
popupClassName="w-[240px] rounded-lg border-[0.5px] border-components-panel-border bg-components-panel-bg-blur shadow-lg backdrop-blur-[5px]"
|
||||
>
|
||||
<div className="relative">
|
||||
<div className="p-2">
|
||||
<Input
|
||||
showLeftIcon
|
||||
showClearIcon
|
||||
value={keywords}
|
||||
onChange={e => handleKeywordsChange(e.target.value)}
|
||||
onClear={() => handleKeywordsChange('')}
|
||||
onChange={e => setKeywords(e.target.value)}
|
||||
onClear={() => setKeywords('')}
|
||||
/>
|
||||
</div>
|
||||
<div className="max-h-72 overflow-auto p-1">
|
||||
@ -155,9 +147,9 @@ const TagFilter: FC<TagFilterProps> = ({
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</PortalToFollowElemContent>
|
||||
</PopoverContent>
|
||||
</div>
|
||||
</PortalToFollowElem>
|
||||
</Popover>
|
||||
|
||||
)
|
||||
}
|
||||
|
||||
@ -3,7 +3,7 @@ import * as React from 'react'
|
||||
import { useCallback } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { trackEvent } from '@/app/components/base/amplitude'
|
||||
import Toast from '@/app/components/base/toast'
|
||||
import { toast } from '@/app/components/base/ui/toast'
|
||||
import { useRouter } from '@/next/navigation'
|
||||
import { useCreatePipelineDataset } from '@/service/knowledge/use-create-dataset'
|
||||
import { useInvalidDatasetList } from '@/service/knowledge/use-dataset'
|
||||
@ -20,9 +20,9 @@ const CreateCard = () => {
|
||||
onSuccess: (data) => {
|
||||
if (data) {
|
||||
const { id } = data
|
||||
Toast.notify({
|
||||
toast.add({
|
||||
type: 'success',
|
||||
message: t('creation.successTip', { ns: 'datasetPipeline' }),
|
||||
title: t('creation.successTip', { ns: 'datasetPipeline' }),
|
||||
})
|
||||
invalidDatasetList()
|
||||
trackEvent('create_datasets_from_scratch', {
|
||||
@ -32,9 +32,9 @@ const CreateCard = () => {
|
||||
}
|
||||
},
|
||||
onError: () => {
|
||||
Toast.notify({
|
||||
toast.add({
|
||||
type: 'error',
|
||||
message: t('creation.errorTip', { ns: 'datasetPipeline' }),
|
||||
title: t('creation.errorTip', { ns: 'datasetPipeline' }),
|
||||
})
|
||||
},
|
||||
})
|
||||
|
||||
@ -9,7 +9,7 @@ import AppIconPicker from '@/app/components/base/app-icon-picker'
|
||||
import Button from '@/app/components/base/button'
|
||||
import Input from '@/app/components/base/input'
|
||||
import Textarea from '@/app/components/base/textarea'
|
||||
import Toast from '@/app/components/base/toast'
|
||||
import { toast } from '@/app/components/base/ui/toast'
|
||||
import { useInvalidCustomizedTemplateList, useUpdateTemplateInfo } from '@/service/use-pipeline'
|
||||
|
||||
type EditPipelineInfoProps = {
|
||||
@ -67,9 +67,9 @@ const EditPipelineInfo = ({
|
||||
|
||||
const handleSave = useCallback(async () => {
|
||||
if (!name) {
|
||||
Toast.notify({
|
||||
toast.add({
|
||||
type: 'error',
|
||||
message: 'Please enter a name for the Knowledge Base.',
|
||||
title: t('editPipelineInfoNameRequired', { ns: 'datasetPipeline' }),
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
@ -5,7 +5,7 @@ import { useTranslation } from 'react-i18next'
|
||||
import { trackEvent } from '@/app/components/base/amplitude'
|
||||
import Confirm from '@/app/components/base/confirm'
|
||||
import Modal from '@/app/components/base/modal'
|
||||
import Toast from '@/app/components/base/toast'
|
||||
import { toast } from '@/app/components/base/ui/toast'
|
||||
import { usePluginDependencies } from '@/app/components/workflow/plugin-dependency/hooks'
|
||||
import { useRouter } from '@/next/navigation'
|
||||
import { useCreatePipelineDatasetFromCustomized } from '@/service/knowledge/use-create-dataset'
|
||||
@ -50,9 +50,9 @@ const TemplateCard = ({
|
||||
const handleUseTemplate = useCallback(async () => {
|
||||
const { data: pipelineTemplateInfo } = await getPipelineTemplateInfo()
|
||||
if (!pipelineTemplateInfo) {
|
||||
Toast.notify({
|
||||
toast.add({
|
||||
type: 'error',
|
||||
message: t('creation.errorTip', { ns: 'datasetPipeline' }),
|
||||
title: t('creation.errorTip', { ns: 'datasetPipeline' }),
|
||||
})
|
||||
return
|
||||
}
|
||||
@ -61,9 +61,9 @@ const TemplateCard = ({
|
||||
}
|
||||
await createDataset(request, {
|
||||
onSuccess: async (newDataset) => {
|
||||
Toast.notify({
|
||||
toast.add({
|
||||
type: 'success',
|
||||
message: t('creation.successTip', { ns: 'datasetPipeline' }),
|
||||
title: t('creation.successTip', { ns: 'datasetPipeline' }),
|
||||
})
|
||||
invalidDatasetList()
|
||||
if (newDataset.pipeline_id)
|
||||
@ -76,9 +76,9 @@ const TemplateCard = ({
|
||||
push(`/datasets/${newDataset.dataset_id}/pipeline`)
|
||||
},
|
||||
onError: () => {
|
||||
Toast.notify({
|
||||
toast.add({
|
||||
type: 'error',
|
||||
message: t('creation.errorTip', { ns: 'datasetPipeline' }),
|
||||
title: t('creation.errorTip', { ns: 'datasetPipeline' }),
|
||||
})
|
||||
},
|
||||
})
|
||||
@ -109,15 +109,15 @@ const TemplateCard = ({
|
||||
onSuccess: (res) => {
|
||||
const blob = new Blob([res.data], { type: 'application/yaml' })
|
||||
downloadBlob({ data: blob, fileName: `${pipeline.name}.pipeline` })
|
||||
Toast.notify({
|
||||
toast.add({
|
||||
type: 'success',
|
||||
message: t('exportDSL.successTip', { ns: 'datasetPipeline' }),
|
||||
title: t('exportDSL.successTip', { ns: 'datasetPipeline' }),
|
||||
})
|
||||
},
|
||||
onError: () => {
|
||||
Toast.notify({
|
||||
toast.add({
|
||||
type: 'error',
|
||||
message: t('exportDSL.errorTip', { ns: 'datasetPipeline' }),
|
||||
title: t('exportDSL.errorTip', { ns: 'datasetPipeline' }),
|
||||
})
|
||||
},
|
||||
})
|
||||
|
||||
@ -5,7 +5,7 @@ import { useCallback, useEffect, useMemo } from 'react'
|
||||
import { useShallow } from 'zustand/react/shallow'
|
||||
import Loading from '@/app/components/base/loading'
|
||||
import SearchInput from '@/app/components/base/notion-page-selector/search-input'
|
||||
import Toast from '@/app/components/base/toast'
|
||||
import { toast } from '@/app/components/base/ui/toast'
|
||||
import { ACCOUNT_SETTING_TAB } from '@/app/components/header/account-setting/constants'
|
||||
import { useDatasetDetailContextWithSelector } from '@/context/dataset-detail'
|
||||
import { useDocLink } from '@/context/i18n'
|
||||
@ -96,9 +96,9 @@ const OnlineDocuments = ({
|
||||
setDocumentsData(documentsData.data as DataSourceNotionWorkspace[])
|
||||
},
|
||||
onDataSourceNodeError: (error: DataSourceNodeErrorResponse) => {
|
||||
Toast.notify({
|
||||
toast.add({
|
||||
type: 'error',
|
||||
message: error.error,
|
||||
title: error.error,
|
||||
})
|
||||
},
|
||||
},
|
||||
|
||||
@ -4,7 +4,7 @@ import type { DataSourceNodeCompletedResponse, DataSourceNodeErrorResponse } fro
|
||||
import { produce } from 'immer'
|
||||
import { useCallback, useEffect, useMemo, useRef, useState } from 'react'
|
||||
import { useShallow } from 'zustand/react/shallow'
|
||||
import Toast from '@/app/components/base/toast'
|
||||
import { toast } from '@/app/components/base/ui/toast'
|
||||
import { ACCOUNT_SETTING_TAB } from '@/app/components/header/account-setting/constants'
|
||||
import { useDatasetDetailContextWithSelector } from '@/context/dataset-detail'
|
||||
import { useDocLink } from '@/context/i18n'
|
||||
@ -105,9 +105,9 @@ const OnlineDrive = ({
|
||||
isLoadingRef.current = false
|
||||
},
|
||||
onDataSourceNodeError: (error: DataSourceNodeErrorResponse) => {
|
||||
Toast.notify({
|
||||
toast.add({
|
||||
type: 'error',
|
||||
message: error.error,
|
||||
title: error.error,
|
||||
})
|
||||
setIsLoading(false)
|
||||
isLoadingRef.current = false
|
||||
|
||||
@ -8,7 +8,7 @@ import { useAppForm } from '@/app/components/base/form'
|
||||
import BaseField from '@/app/components/base/form/form-scenarios/base/field'
|
||||
import { generateZodSchema } from '@/app/components/base/form/form-scenarios/base/utils'
|
||||
import { ArrowDownRoundFill } from '@/app/components/base/icons/src/vender/solid/general'
|
||||
import Toast from '@/app/components/base/toast'
|
||||
import { toast } from '@/app/components/base/ui/toast'
|
||||
import { useConfigurations, useInitialData } from '@/app/components/rag-pipeline/hooks/use-input-fields'
|
||||
import { CrawlStep } from '@/models/datasets'
|
||||
import { cn } from '@/utils/classnames'
|
||||
@ -44,9 +44,9 @@ const Options = ({
|
||||
const issues = result.error.issues
|
||||
const firstIssue = issues[0]
|
||||
const errorMessage = `"${firstIssue.path.join('.')}" ${firstIssue.message}`
|
||||
Toast.notify({
|
||||
toast.add({
|
||||
type: 'error',
|
||||
message: errorMessage,
|
||||
title: errorMessage,
|
||||
})
|
||||
return errorMessage
|
||||
}
|
||||
|
||||
@ -6,7 +6,7 @@ import { useEffect, useState } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { Notion } from '@/app/components/base/icons/src/public/common'
|
||||
import { Markdown } from '@/app/components/base/markdown'
|
||||
import Toast from '@/app/components/base/toast'
|
||||
import { toast } from '@/app/components/base/ui/toast'
|
||||
import { useDatasetDetailContextWithSelector } from '@/context/dataset-detail'
|
||||
import { usePreviewOnlineDocument } from '@/service/use-pipeline'
|
||||
import { formatNumberAbbreviated } from '@/utils/format'
|
||||
@ -44,9 +44,9 @@ const OnlineDocumentPreview = ({
|
||||
setContent(data.content)
|
||||
},
|
||||
onError(error) {
|
||||
Toast.notify({
|
||||
toast.add({
|
||||
type: 'error',
|
||||
message: error.message,
|
||||
title: error.message,
|
||||
})
|
||||
},
|
||||
})
|
||||
|
||||
@ -3,7 +3,7 @@ import type { BaseConfiguration } from '@/app/components/base/form/form-scenario
|
||||
import { useCallback, useImperativeHandle } from 'react'
|
||||
import { useAppForm } from '@/app/components/base/form'
|
||||
import BaseField from '@/app/components/base/form/form-scenarios/base/field'
|
||||
import Toast from '@/app/components/base/toast'
|
||||
import { toast } from '@/app/components/base/ui/toast'
|
||||
import Header from './header'
|
||||
|
||||
type OptionsProps = {
|
||||
@ -34,9 +34,9 @@ const Form = ({
|
||||
const issues = result.error.issues
|
||||
const firstIssue = issues[0]
|
||||
const errorMessage = `"${firstIssue.path.join('.')}" ${firstIssue.message}`
|
||||
Toast.notify({
|
||||
toast.add({
|
||||
type: 'error',
|
||||
message: errorMessage,
|
||||
title: errorMessage,
|
||||
})
|
||||
return errorMessage
|
||||
}
|
||||
|
||||
@ -31,7 +31,6 @@ import TTSParamsPanel from './tts-params-panel'
|
||||
|
||||
export type ModelParameterModalProps = {
|
||||
popupClassName?: string
|
||||
portalToFollowElemContentClassName?: string
|
||||
isAdvancedMode: boolean
|
||||
value: any
|
||||
setModel: (model: any) => void
|
||||
@ -44,7 +43,6 @@ export type ModelParameterModalProps = {
|
||||
|
||||
const ModelParameterModal: FC<ModelParameterModalProps> = ({
|
||||
popupClassName,
|
||||
portalToFollowElemContentClassName,
|
||||
isAdvancedMode,
|
||||
value,
|
||||
setModel,
|
||||
@ -230,7 +228,6 @@ const ModelParameterModal: FC<ModelParameterModalProps> = ({
|
||||
<PopoverContent
|
||||
placement={isInWorkflow ? 'left' : 'bottom-end'}
|
||||
sideOffset={4}
|
||||
className={portalToFollowElemContentClassName}
|
||||
popupClassName={cn(popupClassName, 'w-[389px] rounded-2xl')}
|
||||
>
|
||||
<div className="max-h-[420px] overflow-y-auto p-4 pt-3">
|
||||
|
||||
@ -3076,9 +3076,6 @@
|
||||
}
|
||||
},
|
||||
"app/components/datasets/create-from-pipeline/list/create-card.tsx": {
|
||||
"no-restricted-imports": {
|
||||
"count": 1
|
||||
},
|
||||
"tailwindcss/enforce-consistent-class-order": {
|
||||
"count": 2
|
||||
}
|
||||
@ -3112,16 +3109,13 @@
|
||||
}
|
||||
},
|
||||
"app/components/datasets/create-from-pipeline/list/template-card/edit-pipeline-info.tsx": {
|
||||
"no-restricted-imports": {
|
||||
"count": 1
|
||||
},
|
||||
"tailwindcss/enforce-consistent-class-order": {
|
||||
"count": 3
|
||||
}
|
||||
},
|
||||
"app/components/datasets/create-from-pipeline/list/template-card/index.tsx": {
|
||||
"no-restricted-imports": {
|
||||
"count": 3
|
||||
"count": 2
|
||||
}
|
||||
},
|
||||
"app/components/datasets/create-from-pipeline/list/template-card/operations.tsx": {
|
||||
@ -3403,9 +3397,6 @@
|
||||
}
|
||||
},
|
||||
"app/components/datasets/documents/create-from-pipeline/data-source/online-documents/index.tsx": {
|
||||
"no-restricted-imports": {
|
||||
"count": 1
|
||||
},
|
||||
"ts/no-explicit-any": {
|
||||
"count": 1
|
||||
}
|
||||
@ -3482,9 +3473,6 @@
|
||||
}
|
||||
},
|
||||
"app/components/datasets/documents/create-from-pipeline/data-source/online-drive/index.tsx": {
|
||||
"no-restricted-imports": {
|
||||
"count": 1
|
||||
},
|
||||
"react-hooks-extra/no-direct-set-state-in-use-effect": {
|
||||
"count": 5
|
||||
}
|
||||
@ -3533,9 +3521,6 @@
|
||||
}
|
||||
},
|
||||
"app/components/datasets/documents/create-from-pipeline/data-source/website-crawl/base/options/index.tsx": {
|
||||
"no-restricted-imports": {
|
||||
"count": 1
|
||||
},
|
||||
"tailwindcss/enforce-consistent-class-order": {
|
||||
"count": 1
|
||||
},
|
||||
@ -3562,9 +3547,6 @@
|
||||
}
|
||||
},
|
||||
"app/components/datasets/documents/create-from-pipeline/preview/online-document-preview.tsx": {
|
||||
"no-restricted-imports": {
|
||||
"count": 1
|
||||
},
|
||||
"tailwindcss/enforce-consistent-class-order": {
|
||||
"count": 4
|
||||
}
|
||||
@ -3578,9 +3560,6 @@
|
||||
}
|
||||
},
|
||||
"app/components/datasets/documents/create-from-pipeline/process-documents/form.tsx": {
|
||||
"no-restricted-imports": {
|
||||
"count": 1
|
||||
},
|
||||
"ts/no-explicit-any": {
|
||||
"count": 3
|
||||
}
|
||||
|
||||
@ -116,7 +116,6 @@ export const OVERLAY_MIGRATION_LEGACY_BASE_FILES = [
|
||||
'app/components/base/select/index.tsx',
|
||||
'app/components/base/select/pure.tsx',
|
||||
'app/components/base/sort/index.tsx',
|
||||
'app/components/base/tag-management/filter.tsx',
|
||||
'app/components/base/theme-selector.tsx',
|
||||
'app/components/base/tooltip/index.tsx',
|
||||
]
|
||||
|
||||
@ -35,6 +35,7 @@
|
||||
"details.structureTooltip": "Chunk Structure determines how documents are split and indexed—offering General, Parent-Child, and Q&A modes—and is unique to each knowledge base.",
|
||||
"documentSettings.title": "Document Settings",
|
||||
"editPipelineInfo": "Edit pipeline info",
|
||||
"editPipelineInfoNameRequired": "Please enter a name for the Knowledge Base.",
|
||||
"exportDSL.errorTip": "Failed to export pipeline DSL",
|
||||
"exportDSL.successTip": "Export pipeline DSL successfully",
|
||||
"inputField": "Input Field",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user