diff --git a/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/card-view.tsx b/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/card-view.tsx index ae50279f1c..289e50c257 100644 --- a/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/card-view.tsx +++ b/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/card-view.tsx @@ -103,7 +103,7 @@ const CardView: FC = ({ appId, isInPanel, className }) => { }) } } - + toast(t(`actionMsg.${message}`, { ns: 'common' }) as string, { type }) } diff --git a/web/app/components/app/configuration/hooks/use-configuration.ts b/web/app/components/app/configuration/hooks/use-configuration.ts index f2f708ad52..943642b545 100644 --- a/web/app/components/app/configuration/hooks/use-configuration.ts +++ b/web/app/components/app/configuration/hooks/use-configuration.ts @@ -21,6 +21,7 @@ import type { TextToSpeechConfig, } from '@/models/debug' import type { VisionSettings } from '@/types/app' +import type { PublishWorkflowParams } from '@/types/workflow' import { useBoolean, useGetState } from 'ahooks' import { clone } from 'es-toolkit/object' import { produce } from 'immer' @@ -480,34 +481,40 @@ export const useConfiguration = (): ConfigurationViewModel => { resolvedModelModeType, ]) - const onPublish = useCallback(async (modelAndParameter?: ModelAndParameter, features?: FeaturesData) => createPublishHandler({ - appId, - chatPromptConfig, - citationConfig, - completionParamsState, - completionPromptConfig, - contextVar, - contextVarEmpty, - dataSets, - datasetConfigs, - externalDataToolsConfig, - hasSetBlockStatus, - introduction, - isAdvancedMode, - isFunctionCall, - mode, - modelConfig, - moreLikeThisConfig, - promptEmpty, - promptMode, - resolvedModelModeType, - setCanReturnToSimpleMode, - setPublishedConfig, - speechToTextConfig, - suggestedQuestionsAfterAnswerConfig, - t, - textToSpeechConfig, - })(updateAppModelConfig, modelAndParameter, features), [ + const onPublish = useCallback(async (params?: ModelAndParameter | PublishWorkflowParams, features?: FeaturesData) => { + const modelAndParameter = params && 'model' in params && 'provider' in params && 'parameters' in params + ? params + : undefined + + return createPublishHandler({ + appId, + chatPromptConfig, + citationConfig, + completionParamsState, + completionPromptConfig, + contextVar, + contextVarEmpty, + dataSets, + datasetConfigs, + externalDataToolsConfig, + hasSetBlockStatus, + introduction, + isAdvancedMode, + isFunctionCall, + mode, + modelConfig, + moreLikeThisConfig, + promptEmpty, + promptMode, + resolvedModelModeType, + setCanReturnToSimpleMode, + setPublishedConfig, + speechToTextConfig, + suggestedQuestionsAfterAnswerConfig, + t, + textToSpeechConfig, + })(updateAppModelConfig, modelAndParameter, features) + }, [ appId, chatPromptConfig, citationConfig, diff --git a/web/app/components/apps/__tests__/list.spec.tsx b/web/app/components/apps/__tests__/list.spec.tsx index ce4c721c54..38f5be30ad 100644 --- a/web/app/components/apps/__tests__/list.spec.tsx +++ b/web/app/components/apps/__tests__/list.spec.tsx @@ -386,7 +386,7 @@ describe('List', () => { describe('Edge Cases', () => { it('should handle multiple renders without issues', () => { - const { rerender, unmount } = renderWithNuqs() + const { unmount } = renderWithNuqs() expect(screen.getByText('app.types.all')).toBeInTheDocument() unmount() diff --git a/web/app/components/base/chat/embedded-chatbot/header/__tests__/index.spec.tsx b/web/app/components/base/chat/embedded-chatbot/header/__tests__/index.spec.tsx index 5236beda60..51aa8a9b0c 100644 --- a/web/app/components/base/chat/embedded-chatbot/header/__tests__/index.spec.tsx +++ b/web/app/components/base/chat/embedded-chatbot/header/__tests__/index.spec.tsx @@ -83,6 +83,7 @@ describe('EmbeddedChatbot Header', () => { allow_email_code_login: false, allow_email_password_login: false, }, + enable_collaboration_mode: false, enable_trial_app: false, enable_explore_banner: false, } diff --git a/web/app/components/base/ui/avatar/index.tsx b/web/app/components/base/ui/avatar/index.tsx index 9e375dba45..b92dd7e838 100644 --- a/web/app/components/base/ui/avatar/index.tsx +++ b/web/app/components/base/ui/avatar/index.tsx @@ -141,5 +141,3 @@ export const Avatar = ({ ) } - -export default Avatar diff --git a/web/app/components/base/user-avatar-list/index.tsx b/web/app/components/base/user-avatar-list/index.tsx index 96ad5a6464..7fab07c21e 100644 --- a/web/app/components/base/user-avatar-list/index.tsx +++ b/web/app/components/base/user-avatar-list/index.tsx @@ -1,7 +1,7 @@ import type { FC } from 'react' import type { AvatarSize } from '@/app/components/base/ui/avatar' import { memo } from 'react' -import Avatar from '@/app/components/base/ui/avatar' +import { Avatar } from '@/app/components/base/ui/avatar' import { getUserColor } from '@/app/components/workflow/collaboration/utils/user-color' import { useAppContext } from '@/context/app-context' diff --git a/web/app/components/workflow-app/components/__tests__/workflow-main.spec.tsx b/web/app/components/workflow-app/components/__tests__/workflow-main.spec.tsx index 5e3fbfada0..ee3b044657 100644 --- a/web/app/components/workflow-app/components/__tests__/workflow-main.spec.tsx +++ b/web/app/components/workflow-app/components/__tests__/workflow-main.spec.tsx @@ -1,6 +1,7 @@ import type { ReactNode } from 'react' import type { WorkflowProps } from '@/app/components/workflow' import { fireEvent, render, screen } from '@testing-library/react' +import { ChatVarType } from '@/app/components/workflow/panel/chat-variable-panel/type' import WorkflowMain from '../workflow-main' const mockSetFeatures = vi.fn() @@ -116,9 +117,23 @@ vi.mock('@/app/components/workflow', () => ({ diff --git a/web/app/components/workflow-app/components/workflow-main.tsx b/web/app/components/workflow-app/components/workflow-main.tsx index f32b6ed089..957344a1da 100644 --- a/web/app/components/workflow-app/components/workflow-main.tsx +++ b/web/app/components/workflow-app/components/workflow-main.tsx @@ -240,7 +240,7 @@ const WorkflowMain = ({ invalidateConversationVarValues, } = useInspectVarsCrud() - const hooksStore = useMemo>(() => { + const hooksStore = useMemo(() => { return { syncWorkflowDraftWhenPageClose, doSyncWorkflowDraft, @@ -326,7 +326,7 @@ const WorkflowMain = ({ edges={edges} viewport={viewport} onWorkflowDataUpdate={handleWorkflowDataUpdate} - hooksStore={hooksStore} + hooksStore={hooksStore as unknown as Partial} cursors={filteredCursors} myUserId={myUserId} onlineUsers={onlineUsers} diff --git a/web/app/components/workflow/__tests__/features.spec.tsx b/web/app/components/workflow/__tests__/features.spec.tsx index c0294c2c1d..632a4c4e0b 100644 --- a/web/app/components/workflow/__tests__/features.spec.tsx +++ b/web/app/components/workflow/__tests__/features.spec.tsx @@ -134,7 +134,7 @@ const DelayedFeatures = () => { return } -const renderFeatures = (options?: Omit[1], 'nodes' | 'edges'>) => { +const renderFeatures = (options?: Omit[1]>, 'nodes' | 'edges'>) => { const mergedInitialStoreState = { appId: 'app-1', ...(options?.initialStoreState || {}), diff --git a/web/app/components/workflow/collaboration/core/event-emitter.ts b/web/app/components/workflow/collaboration/core/event-emitter.ts index b4f79b7922..c562ae3083 100644 --- a/web/app/components/workflow/collaboration/core/event-emitter.ts +++ b/web/app/components/workflow/collaboration/core/event-emitter.ts @@ -1,4 +1,4 @@ -export type EventHandler = (data: T) => void +type EventHandler = (data: T) => void export class EventEmitter { private events: Map>> = new Map() diff --git a/web/app/components/workflow/collaboration/types/collaboration.ts b/web/app/components/workflow/collaboration/types/collaboration.ts index d87a86985e..ae355a7b51 100644 --- a/web/app/components/workflow/collaboration/types/collaboration.ts +++ b/web/app/components/workflow/collaboration/types/collaboration.ts @@ -9,15 +9,6 @@ export type OnlineUser = { sid: string } -export type WorkflowOnlineUsers = { - workflow_id: string - users: OnlineUser[] -} - -export type OnlineUserListResponse = { - data: WorkflowOnlineUsers[] -} - export type CursorPosition = { x: number y: number @@ -48,11 +39,6 @@ export type CollaborationState = { error?: string } -export type GraphSyncData = { - nodes: Node[] - edges: Edge[] -} - export type CollaborationEventType = | 'mouse_move' | 'vars_and_features_update' diff --git a/web/app/components/workflow/collaboration/types/events.ts b/web/app/components/workflow/collaboration/types/events.ts deleted file mode 100644 index 69d228357e..0000000000 --- a/web/app/components/workflow/collaboration/types/events.ts +++ /dev/null @@ -1,34 +0,0 @@ -export type CollaborationEvent = { - type: string - data: TData - timestamp: number -} - -export type GraphUpdateEvent = { - type: 'graph_update' -} & CollaborationEvent - -export type CursorMoveEvent = { - type: 'cursor_move' -} & CollaborationEvent<{ - x: number - y: number - userId: string -}> - -export type UserConnectEvent = { - type: 'user_connect' -} & CollaborationEvent<{ - workflow_id: string -}> - -export type OnlineUsersEvent = { - type: 'online_users' -} & CollaborationEvent<{ - users: Array<{ - user_id: string - username: string - avatar: string - sid: string - }> -}> diff --git a/web/app/components/workflow/comment/comment-input.tsx b/web/app/components/workflow/comment/comment-input.tsx index fd7043bd28..999be93242 100644 --- a/web/app/components/workflow/comment/comment-input.tsx +++ b/web/app/components/workflow/comment/comment-input.tsx @@ -1,7 +1,7 @@ import type { FC, PointerEvent as ReactPointerEvent } from 'react' import { memo, useCallback, useEffect, useRef, useState } from 'react' import { useTranslation } from 'react-i18next' -import Avatar from '@/app/components/base/ui/avatar' +import { Avatar } from '@/app/components/base/ui/avatar' import { useAppContext } from '@/context/app-context' import { cn } from '@/utils/classnames' import { MentionInput } from './mention-input' diff --git a/web/app/components/workflow/comment/mention-input.tsx b/web/app/components/workflow/comment/mention-input.tsx index c845535b30..c721a1a690 100644 --- a/web/app/components/workflow/comment/mention-input.tsx +++ b/web/app/components/workflow/comment/mention-input.tsx @@ -19,7 +19,7 @@ import { useTranslation } from 'react-i18next' import Textarea from 'react-textarea-autosize' import Button from '@/app/components/base/button' import EnterKey from '@/app/components/base/icons/src/public/common/EnterKey' -import Avatar from '@/app/components/base/ui/avatar' +import { Avatar } from '@/app/components/base/ui/avatar' import { useParams } from '@/next/navigation' import { fetchMentionableUsers } from '@/service/workflow-comment' import { cn } from '@/utils/classnames' diff --git a/web/app/components/workflow/comment/thread.tsx b/web/app/components/workflow/comment/thread.tsx index 020f7ac57c..612cfdf24d 100644 --- a/web/app/components/workflow/comment/thread.tsx +++ b/web/app/components/workflow/comment/thread.tsx @@ -8,7 +8,7 @@ import { useTranslation } from 'react-i18next' import { useReactFlow, useViewport } from 'reactflow' import Divider from '@/app/components/base/divider' import InlineDeleteConfirm from '@/app/components/base/inline-delete-confirm' -import Avatar from '@/app/components/base/ui/avatar' +import { Avatar } from '@/app/components/base/ui/avatar' import { DropdownMenu, DropdownMenuContent, diff --git a/web/app/components/workflow/header/online-users.tsx b/web/app/components/workflow/header/online-users.tsx index ba1b8731db..8811a9a713 100644 --- a/web/app/components/workflow/header/online-users.tsx +++ b/web/app/components/workflow/header/online-users.tsx @@ -3,7 +3,7 @@ import type { OnlineUser } from '../collaboration/types/collaboration' import { ChevronDownIcon } from '@heroicons/react/20/solid' import { useEffect, useState } from 'react' import { useReactFlow } from 'reactflow' -import Avatar from '@/app/components/base/ui/avatar' +import { Avatar } from '@/app/components/base/ui/avatar' import { Popover, PopoverContent, diff --git a/web/app/components/workflow/hooks-store/store.ts b/web/app/components/workflow/hooks-store/store.ts index e6a2b1cbba..a9d5003fb3 100644 --- a/web/app/components/workflow/hooks-store/store.ts +++ b/web/app/components/workflow/hooks-store/store.ts @@ -1,8 +1,6 @@ import type { FileUpload } from '../../base/features/types' -import type { TriggerType } from '@/app/components/workflow/header/test-run-menu' import type { BlockEnum, - CommonNodeType, Node, NodeDefault, ToolWithProvider, @@ -11,7 +9,7 @@ import type { import type { IOtherOptions } from '@/service/base' import type { SchemaTypeDefinition } from '@/service/use-common' import type { FlowType } from '@/types/common' -import type { FetchWorkflowDraftResponse, VarInInspect } from '@/types/workflow' +import type { VarInInspect } from '@/types/workflow' import { noop } from 'es-toolkit/function' import { useContext } from 'react' import { @@ -20,17 +18,9 @@ import { import { createStore } from 'zustand/vanilla' import { HooksStoreContext } from './provider' -export type AvailableNodeDefault = NodeDefault>> -export type WorkflowRunOptions = { - mode?: TriggerType - scheduleNodeId?: string - webhookNodeId?: string - pluginNodeId?: string - allNodeIds?: string[] -} export type AvailableNodesMetaData = { - nodes: AvailableNodeDefault[] - nodesMap?: Partial> + nodes: NodeDefault[] + nodesMap?: Record> } export type SyncDraftCallback = { onSuccess?: () => void @@ -46,9 +36,9 @@ export type CommonHooksFnMap = { handleRefreshWorkflowDraft: () => void handleBackupDraft: () => void handleLoadBackupDraft: () => void - handleRestoreFromPublishedWorkflow: (publishedWorkflow: FetchWorkflowDraftResponse) => void - handleRun: (params: unknown, callback?: IOtherOptions, options?: WorkflowRunOptions) => void | Promise - handleStopRun: (taskId: string) => void + handleRestoreFromPublishedWorkflow: (...args: any[]) => void + handleRun: (params: any, callback?: IOtherOptions, options?: any) => void + handleStopRun: (...args: any[]) => void handleStartWorkflowRun: () => void handleWorkflowStartRunInWorkflow: () => void handleWorkflowStartRunInChatflow: () => void @@ -64,7 +54,7 @@ export type CommonHooksFnMap = { hasNodeInspectVars: (nodeId: string) => boolean hasSetInspectVar: (nodeId: string, name: string, sysVars: VarInInspect[], conversationVars: VarInInspect[]) => boolean fetchInspectVarValue: (selector: ValueSelector, schemaTypeDefinitions: SchemaTypeDefinition[]) => Promise - editInspectVarValue: (nodeId: string, varId: string, value: unknown) => Promise + editInspectVarValue: (nodeId: string, varId: string, value: any) => Promise renameInspectVarName: (nodeId: string, oldName: string, newName: string) => Promise appendNodeInspectVars: (nodeId: string, payload: VarInInspect[], allNodes: Node[]) => void deleteInspectVar: (nodeId: string, varId: string) => Promise @@ -78,7 +68,7 @@ export type CommonHooksFnMap = { configsMap?: { flowId: string flowType: FlowType - fileSettings?: FileUpload + fileSettings: FileUpload } } @@ -92,9 +82,9 @@ export const createHooksStore = ({ handleRefreshWorkflowDraft = noop, handleBackupDraft = noop, handleLoadBackupDraft = noop, - handleRestoreFromPublishedWorkflow = (_publishedWorkflow: FetchWorkflowDraftResponse) => noop(), + handleRestoreFromPublishedWorkflow = noop, handleRun = noop, - handleStopRun = (_taskId: string) => noop(), + handleStopRun = noop, handleStartWorkflowRun = noop, handleWorkflowStartRunInWorkflow = noop, handleWorkflowStartRunInChatflow = noop, diff --git a/web/app/components/workflow/hooks/index.ts b/web/app/components/workflow/hooks/index.ts index ca73eb2f08..d3e9a38bff 100644 --- a/web/app/components/workflow/hooks/index.ts +++ b/web/app/components/workflow/hooks/index.ts @@ -1,5 +1,4 @@ export * from './use-auto-generate-webhook-url' -export * from './use-auto-generate-webhook-url' export * from './use-available-blocks' export * from './use-checklist' export * from './use-DSL' @@ -13,7 +12,6 @@ export * from './use-nodes-sync-draft' export * from './use-panel-interactions' export * from './use-selection-interactions' export * from './use-serial-async-callback' -export * from './use-serial-async-callback' export * from './use-set-workflow-vars-with-value' export * from './use-shortcuts' export * from './use-tool-icon' diff --git a/web/app/components/workflow/hooks/use-leader-restore.ts b/web/app/components/workflow/hooks/use-leader-restore.ts index fb050641c8..048bb932e0 100644 --- a/web/app/components/workflow/hooks/use-leader-restore.ts +++ b/web/app/components/workflow/hooks/use-leader-restore.ts @@ -13,7 +13,7 @@ import { useNodesSyncDraft } from './use-nodes-sync-draft' type RestoreCallbacks = SyncCallback -export const usePerformRestore = () => { +const usePerformRestore = () => { const { doSyncWorkflowDraft } = useNodesSyncDraft() const appDetail = useAppStore.getState().appDetail const featuresStore = useFeaturesStore() diff --git a/web/app/components/workflow/panel/env-panel/__tests__/index.spec.tsx b/web/app/components/workflow/panel/env-panel/__tests__/index.spec.tsx index 41a5b27492..96fe961bb0 100644 --- a/web/app/components/workflow/panel/env-panel/__tests__/index.spec.tsx +++ b/web/app/components/workflow/panel/env-panel/__tests__/index.spec.tsx @@ -36,8 +36,8 @@ const { mockVariableTriggerState: { savePayload: undefined as EnvironmentVariable | undefined, }, - mockUpdateEnvironmentVariables: vi.fn(() => Promise.resolve({})), - mockGetSocket: vi.fn(() => null), + mockUpdateEnvironmentVariables: vi.fn<(payload: { appId: string, environmentVariables: EnvironmentVariable[] }) => Promise>(() => Promise.resolve({})), + mockGetSocket: vi.fn<(appId: string) => { emit: (event: string, payload: unknown) => void } | null>(() => null), })) vi.mock('@/app/components/workflow/hooks/use-nodes-sync-draft', () => ({ diff --git a/web/app/components/workflow/update-dsl-modal.tsx b/web/app/components/workflow/update-dsl-modal.tsx index 6667319fea..b29ae657e4 100644 --- a/web/app/components/workflow/update-dsl-modal.tsx +++ b/web/app/components/workflow/update-dsl-modal.tsx @@ -184,7 +184,8 @@ const UpdateDSLModal = ({ if (isImportCompleted(status)) { await handleCompletedImport(status, app_id) // Notify other collaboration clients about the workflow update - collaborationManager.emitWorkflowUpdate(app_id) + if (app_id) + collaborationManager.emitWorkflowUpdate(app_id) } else if (status === DSLImportStatus.FAILED) { setLoading(false) diff --git a/web/contract/console/apps.ts b/web/contract/console/apps.ts index 873821fcd2..8c76e439b0 100644 --- a/web/contract/console/apps.ts +++ b/web/contract/console/apps.ts @@ -25,4 +25,3 @@ export const workflowOnlineUsersContract = base } }>()) .output(type()) - \ No newline at end of file diff --git a/web/contract/console/workflow-comment.ts b/web/contract/console/workflow-comment.ts index cac1307b0a..e23b795c50 100644 --- a/web/contract/console/workflow-comment.ts +++ b/web/contract/console/workflow-comment.ts @@ -110,7 +110,7 @@ export type CreateReplyParams = { mentioned_user_ids?: string[] } -export const workflowCommentListContract = base +const workflowCommentListContract = base .route({ path: '/apps/{appId}/workflow/comments', method: 'GET', @@ -122,7 +122,7 @@ export const workflowCommentListContract = base }>()) .output(type<{ data: WorkflowCommentList[] }>()) -export const workflowCommentCreateContract = base +const workflowCommentCreateContract = base .route({ path: '/apps/{appId}/workflow/comments', method: 'POST', @@ -135,7 +135,7 @@ export const workflowCommentCreateContract = base }>()) .output(type()) -export const workflowCommentDetailContract = base +const workflowCommentDetailContract = base .route({ path: '/apps/{appId}/workflow/comments/{commentId}', method: 'GET', @@ -148,7 +148,7 @@ export const workflowCommentDetailContract = base }>()) .output(type()) -export const workflowCommentUpdateContract = base +const workflowCommentUpdateContract = base .route({ path: '/apps/{appId}/workflow/comments/{commentId}', method: 'PUT', @@ -162,7 +162,7 @@ export const workflowCommentUpdateContract = base }>()) .output(type()) -export const workflowCommentDeleteContract = base +const workflowCommentDeleteContract = base .route({ path: '/apps/{appId}/workflow/comments/{commentId}', method: 'DELETE', @@ -175,7 +175,7 @@ export const workflowCommentDeleteContract = base }>()) .output(type()) -export const workflowCommentResolveContract = base +const workflowCommentResolveContract = base .route({ path: '/apps/{appId}/workflow/comments/{commentId}/resolve', method: 'POST', @@ -188,7 +188,7 @@ export const workflowCommentResolveContract = base }>()) .output(type()) -export const workflowCommentReplyCreateContract = base +const workflowCommentReplyCreateContract = base .route({ path: '/apps/{appId}/workflow/comments/{commentId}/replies', method: 'POST', @@ -202,7 +202,7 @@ export const workflowCommentReplyCreateContract = base }>()) .output(type()) -export const workflowCommentReplyUpdateContract = base +const workflowCommentReplyUpdateContract = base .route({ path: '/apps/{appId}/workflow/comments/{commentId}/replies/{replyId}', method: 'PUT', @@ -217,7 +217,7 @@ export const workflowCommentReplyUpdateContract = base }>()) .output(type()) -export const workflowCommentReplyDeleteContract = base +const workflowCommentReplyDeleteContract = base .route({ path: '/apps/{appId}/workflow/comments/{commentId}/replies/{replyId}', method: 'DELETE', @@ -231,7 +231,7 @@ export const workflowCommentReplyDeleteContract = base }>()) .output(type()) -export const workflowCommentMentionUsersContract = base +const workflowCommentMentionUsersContract = base .route({ path: '/apps/{appId}/workflow/comments/mention-users', method: 'GET', diff --git a/web/env.ts b/web/env.ts index 3623b68462..0c2868be5c 100644 --- a/web/env.ts +++ b/web/env.ts @@ -116,6 +116,7 @@ const clientSchema = { */ NEXT_PUBLIC_SENTRY_DSN: z.string().optional(), NEXT_PUBLIC_SITE_ABOUT: z.string().optional(), + NEXT_PUBLIC_SOCKET_URL: z.string().optional(), NEXT_PUBLIC_SUPPORT_EMAIL_ADDRESS: z.email().optional(), NEXT_PUBLIC_SUPPORT_MAIL_LOGIN: coercedBoolean.default(false), /** @@ -186,6 +187,7 @@ export const env = createEnv({ NEXT_PUBLIC_PUBLIC_API_PREFIX: isServer ? process.env.NEXT_PUBLIC_PUBLIC_API_PREFIX : getRuntimeEnvFromBody('publicApiPrefix'), NEXT_PUBLIC_SENTRY_DSN: isServer ? process.env.NEXT_PUBLIC_SENTRY_DSN : getRuntimeEnvFromBody('sentryDsn'), NEXT_PUBLIC_SITE_ABOUT: isServer ? process.env.NEXT_PUBLIC_SITE_ABOUT : getRuntimeEnvFromBody('siteAbout'), + NEXT_PUBLIC_SOCKET_URL: isServer ? process.env.NEXT_PUBLIC_SOCKET_URL : getRuntimeEnvFromBody('socketUrl'), NEXT_PUBLIC_SUPPORT_EMAIL_ADDRESS: isServer ? process.env.NEXT_PUBLIC_SUPPORT_EMAIL_ADDRESS : getRuntimeEnvFromBody('supportEmailAddress'), NEXT_PUBLIC_SUPPORT_MAIL_LOGIN: isServer ? process.env.NEXT_PUBLIC_SUPPORT_MAIL_LOGIN : getRuntimeEnvFromBody('supportMailLogin'), NEXT_PUBLIC_TEXT_GENERATION_TIMEOUT_MS: isServer ? process.env.NEXT_PUBLIC_TEXT_GENERATION_TIMEOUT_MS : getRuntimeEnvFromBody('textGenerationTimeoutMs'), diff --git a/web/eslint-suppressions.json b/web/eslint-suppressions.json index 175f51de12..6cc85a5600 100644 --- a/web/eslint-suppressions.json +++ b/web/eslint-suppressions.json @@ -2639,7 +2639,7 @@ }, "app/components/base/icons/src/public/other/index.ts": { "no-barrel-files/no-barrel-files": { - "count": 5 + "count": 6 } }, "app/components/base/icons/src/public/thought/index.ts": { @@ -8312,6 +8312,11 @@ "count": 1 } }, + "app/components/workflow/hooks-store/store.ts": { + "ts/no-explicit-any": { + "count": 2 + } + }, "app/components/workflow/hooks/__tests__/use-checklist.spec.ts": { "react/error-boundaries": { "count": 1 @@ -8319,7 +8324,7 @@ }, "app/components/workflow/hooks/index.ts": { "no-barrel-files/no-barrel-files": { - "count": 25 + "count": 27 } }, "app/components/workflow/hooks/use-checklist.ts": { @@ -12034,4 +12039,4 @@ "count": 2 } } -} \ No newline at end of file +} diff --git a/web/i18n/ar-TN/workflow.json b/web/i18n/ar-TN/workflow.json index 7463962f5a..63e3150e63 100644 --- a/web/i18n/ar-TN/workflow.json +++ b/web/i18n/ar-TN/workflow.json @@ -110,9 +110,9 @@ "chatVariable.storedContent": "المحتوى المخزن", "chatVariable.updatedAt": "تم التحديث في ", "collaboration.historyAction.generic": "قام متعاون بعملية تراجع/إعادة", + "comments.actions.addComment": "Add Comment", "comments.actions.deleteReply": "حذف الرد", "comments.actions.editReply": "تعديل الرد", - "comments.actions.addComment": "Add Comment", "comments.aria.closeComment": "إغلاق التعليق", "comments.aria.deleteComment": "حذف المناقشة", "comments.aria.nextComment": "التعليق التالي", diff --git a/web/i18n/de-DE/workflow.json b/web/i18n/de-DE/workflow.json index dad038dc83..967040af3e 100644 --- a/web/i18n/de-DE/workflow.json +++ b/web/i18n/de-DE/workflow.json @@ -110,9 +110,9 @@ "chatVariable.storedContent": "Gespeicherter Inhalt", "chatVariable.updatedAt": "Aktualisiert am ", "collaboration.historyAction.generic": "Ein Mitbearbeiter hat Rückgängig/Wiederholen ausgeführt", + "comments.actions.addComment": "Add Comment", "comments.actions.deleteReply": "Antwort löschen", "comments.actions.editReply": "Antwort bearbeiten", - "comments.actions.addComment": "Add Comment", "comments.aria.closeComment": "Kommentar schließen", "comments.aria.deleteComment": "Kommentar löschen", "comments.aria.nextComment": "Nächster Kommentar", diff --git a/web/i18n/en-US/workflow.json b/web/i18n/en-US/workflow.json index 971c069df0..68d49ce048 100644 --- a/web/i18n/en-US/workflow.json +++ b/web/i18n/en-US/workflow.json @@ -110,9 +110,9 @@ "chatVariable.storedContent": "Stored content", "chatVariable.updatedAt": "Updated at ", "collaboration.historyAction.generic": "A collaborator performed an undo/redo action", + "comments.actions.addComment": "Add Comment", "comments.actions.deleteReply": "Delete reply", "comments.actions.editReply": "Edit reply", - "comments.actions.addComment": "Add Comment", "comments.aria.closeComment": "Close comment", "comments.aria.deleteComment": "Delete thread", "comments.aria.nextComment": "Next comment", diff --git a/web/i18n/es-ES/workflow.json b/web/i18n/es-ES/workflow.json index bf16a4b8b6..9dcdc57273 100644 --- a/web/i18n/es-ES/workflow.json +++ b/web/i18n/es-ES/workflow.json @@ -110,9 +110,9 @@ "chatVariable.storedContent": "Contenido almacenado", "chatVariable.updatedAt": "Actualizado el ", "collaboration.historyAction.generic": "Un colaborador realizó deshacer/rehacer", + "comments.actions.addComment": "Add Comment", "comments.actions.deleteReply": "Eliminar respuesta", "comments.actions.editReply": "Editar respuesta", - "comments.actions.addComment": "Add Comment", "comments.aria.closeComment": "Cerrar comentario", "comments.aria.deleteComment": "Eliminar comentario", "comments.aria.nextComment": "Comentario siguiente", diff --git a/web/i18n/fa-IR/workflow.json b/web/i18n/fa-IR/workflow.json index a0f7fdd0b8..eebcc01cca 100644 --- a/web/i18n/fa-IR/workflow.json +++ b/web/i18n/fa-IR/workflow.json @@ -110,9 +110,9 @@ "chatVariable.storedContent": "محتوای ذخیره‌شده", "chatVariable.updatedAt": "به‌روزرسانی شده در ", "collaboration.historyAction.generic": "یک همکار عملیات برگرداندن/انجام مجدد را انجام داد", + "comments.actions.addComment": "Add Comment", "comments.actions.deleteReply": "حذف پاسخ", "comments.actions.editReply": "ویرایش پاسخ", - "comments.actions.addComment": "Add Comment", "comments.aria.closeComment": "بستن دیدگاه", "comments.aria.deleteComment": "حذف دیدگاه", "comments.aria.nextComment": "دیدگاه بعدی", diff --git a/web/i18n/fr-FR/workflow.json b/web/i18n/fr-FR/workflow.json index 58aa2c3d72..1d619511e3 100644 --- a/web/i18n/fr-FR/workflow.json +++ b/web/i18n/fr-FR/workflow.json @@ -110,9 +110,9 @@ "chatVariable.storedContent": "Contenu stocké", "chatVariable.updatedAt": "Mis à jour le ", "collaboration.historyAction.generic": "Un collaborateur a effectué une annulation/une réexécution", + "comments.actions.addComment": "Add Comment", "comments.actions.deleteReply": "Supprimer la réponse", "comments.actions.editReply": "Modifier la réponse", - "comments.actions.addComment": "Add Comment", "comments.aria.closeComment": "Fermer le commentaire", "comments.aria.deleteComment": "Supprimer le commentaire", "comments.aria.nextComment": "Commentaire suivant", diff --git a/web/i18n/hi-IN/workflow.json b/web/i18n/hi-IN/workflow.json index ddf937035b..113641b39b 100644 --- a/web/i18n/hi-IN/workflow.json +++ b/web/i18n/hi-IN/workflow.json @@ -110,9 +110,9 @@ "chatVariable.storedContent": "संग्रहीत सामग्री", "chatVariable.updatedAt": "अपडेट किया गया ", "collaboration.historyAction.generic": "एक सहयोगी ने Undo/Redo किया", + "comments.actions.addComment": "Add Comment", "comments.actions.deleteReply": "जवाब हटाएं", "comments.actions.editReply": "जवाब संपादित करें", - "comments.actions.addComment": "Add Comment", "comments.aria.closeComment": "टिप्पणी बंद करें", "comments.aria.deleteComment": "टिप्पणी हटाएं", "comments.aria.nextComment": "अगली टिप्पणी", diff --git a/web/i18n/id-ID/workflow.json b/web/i18n/id-ID/workflow.json index b5a2a847f1..e728b65741 100644 --- a/web/i18n/id-ID/workflow.json +++ b/web/i18n/id-ID/workflow.json @@ -110,9 +110,9 @@ "chatVariable.storedContent": "Konten yang disimpan", "chatVariable.updatedAt": "Diperbarui pada", "collaboration.historyAction.generic": "Seorang kolaborator melakukan urungkan/ulang", + "comments.actions.addComment": "Add Comment", "comments.actions.deleteReply": "Hapus balasan", "comments.actions.editReply": "Edit balasan", - "comments.actions.addComment": "Add Comment", "comments.aria.closeComment": "Tutup komentar", "comments.aria.deleteComment": "Hapus komentar", "comments.aria.nextComment": "Komentar berikutnya", diff --git a/web/i18n/it-IT/workflow.json b/web/i18n/it-IT/workflow.json index 09ad8e952d..e52c7ed0bd 100644 --- a/web/i18n/it-IT/workflow.json +++ b/web/i18n/it-IT/workflow.json @@ -110,9 +110,9 @@ "chatVariable.storedContent": "Contenuto memorizzato", "chatVariable.updatedAt": "Aggiornato il ", "collaboration.historyAction.generic": "Un collaboratore ha eseguito annulla/ripristina", + "comments.actions.addComment": "Add Comment", "comments.actions.deleteReply": "Elimina risposta", "comments.actions.editReply": "Modifica risposta", - "comments.actions.addComment": "Add Comment", "comments.aria.closeComment": "Chiudi commento", "comments.aria.deleteComment": "Elimina commento", "comments.aria.nextComment": "Commento successivo", diff --git a/web/i18n/ja-JP/workflow.json b/web/i18n/ja-JP/workflow.json index 82ec43d64c..eb8f9ebddb 100644 --- a/web/i18n/ja-JP/workflow.json +++ b/web/i18n/ja-JP/workflow.json @@ -110,9 +110,9 @@ "chatVariable.storedContent": "保存内容", "chatVariable.updatedAt": "最終更新:", "collaboration.historyAction.generic": "共同編集者が元に戻す/やり直しを実行しました", + "comments.actions.addComment": "Add Comment", "comments.actions.deleteReply": "返信を削除", "comments.actions.editReply": "返信を編集", - "comments.actions.addComment": "Add Comment", "comments.aria.closeComment": "コメントを閉じる", "comments.aria.deleteComment": "スレッドを削除", "comments.aria.nextComment": "次のコメント", diff --git a/web/i18n/ko-KR/workflow.json b/web/i18n/ko-KR/workflow.json index 6fa64403ba..8ecf7b25e3 100644 --- a/web/i18n/ko-KR/workflow.json +++ b/web/i18n/ko-KR/workflow.json @@ -110,9 +110,9 @@ "chatVariable.storedContent": "저장된 내용", "chatVariable.updatedAt": "업데이트 시간: ", "collaboration.historyAction.generic": "공동 작업자가 실행 취소/다시 실행을 수행했습니다", + "comments.actions.addComment": "Add Comment", "comments.actions.deleteReply": "답글 삭제", "comments.actions.editReply": "답글 편집", - "comments.actions.addComment": "Add Comment", "comments.aria.closeComment": "댓글 닫기", "comments.aria.deleteComment": "댓글 삭제", "comments.aria.nextComment": "다음 댓글", diff --git a/web/i18n/pl-PL/workflow.json b/web/i18n/pl-PL/workflow.json index 5a5066d626..92aba7a5fe 100644 --- a/web/i18n/pl-PL/workflow.json +++ b/web/i18n/pl-PL/workflow.json @@ -110,9 +110,9 @@ "chatVariable.storedContent": "Przechowywana zawartość", "chatVariable.updatedAt": "Zaktualizowano ", "collaboration.historyAction.generic": "Współpracownik wykonał cofnięcie/ponowienie", + "comments.actions.addComment": "Add Comment", "comments.actions.deleteReply": "Delete reply", "comments.actions.editReply": "Edit reply", - "comments.actions.addComment": "Add Comment", "comments.aria.closeComment": "Close comment", "comments.aria.deleteComment": "Delete thread", "comments.aria.nextComment": "Next comment", diff --git a/web/i18n/pt-BR/workflow.json b/web/i18n/pt-BR/workflow.json index 530e6bf244..aa93bf5ade 100644 --- a/web/i18n/pt-BR/workflow.json +++ b/web/i18n/pt-BR/workflow.json @@ -110,9 +110,9 @@ "chatVariable.storedContent": "Conteúdo armazenado", "chatVariable.updatedAt": "Atualizado em ", "collaboration.historyAction.generic": "Um colaborador realizou desfazer/refazer", + "comments.actions.addComment": "Add Comment", "comments.actions.deleteReply": "Delete reply", "comments.actions.editReply": "Edit reply", - "comments.actions.addComment": "Add Comment", "comments.aria.closeComment": "Close comment", "comments.aria.deleteComment": "Delete thread", "comments.aria.nextComment": "Next comment", diff --git a/web/i18n/ro-RO/workflow.json b/web/i18n/ro-RO/workflow.json index f55581b7f5..eaa13d77ac 100644 --- a/web/i18n/ro-RO/workflow.json +++ b/web/i18n/ro-RO/workflow.json @@ -110,9 +110,9 @@ "chatVariable.storedContent": "Conținut stocat", "chatVariable.updatedAt": "Actualizat la ", "collaboration.historyAction.generic": "Un colaborator a efectuat anulare/refacere", + "comments.actions.addComment": "Add Comment", "comments.actions.deleteReply": "Delete reply", "comments.actions.editReply": "Edit reply", - "comments.actions.addComment": "Add Comment", "comments.aria.closeComment": "Close comment", "comments.aria.deleteComment": "Delete thread", "comments.aria.nextComment": "Next comment", diff --git a/web/i18n/ru-RU/workflow.json b/web/i18n/ru-RU/workflow.json index dc5095dcd6..65a1e42154 100644 --- a/web/i18n/ru-RU/workflow.json +++ b/web/i18n/ru-RU/workflow.json @@ -110,9 +110,9 @@ "chatVariable.storedContent": "Сохраненный контент", "chatVariable.updatedAt": "Обновлено в ", "collaboration.historyAction.generic": "Участник выполнил отмену/повтор", + "comments.actions.addComment": "Add Comment", "comments.actions.deleteReply": "Delete reply", "comments.actions.editReply": "Edit reply", - "comments.actions.addComment": "Add Comment", "comments.aria.closeComment": "Close comment", "comments.aria.deleteComment": "Delete thread", "comments.aria.nextComment": "Next comment", diff --git a/web/i18n/sl-SI/workflow.json b/web/i18n/sl-SI/workflow.json index db2d35fb45..c07f0462a5 100644 --- a/web/i18n/sl-SI/workflow.json +++ b/web/i18n/sl-SI/workflow.json @@ -110,9 +110,9 @@ "chatVariable.storedContent": "Shranjena vsebina", "chatVariable.updatedAt": "Posodobljeno ob", "collaboration.historyAction.generic": "Sodelavec je izvedel razveljavitev/ponovitev", + "comments.actions.addComment": "Add Comment", "comments.actions.deleteReply": "Delete reply", "comments.actions.editReply": "Edit reply", - "comments.actions.addComment": "Add Comment", "comments.aria.closeComment": "Close comment", "comments.aria.deleteComment": "Delete thread", "comments.aria.nextComment": "Next comment", diff --git a/web/i18n/th-TH/workflow.json b/web/i18n/th-TH/workflow.json index f9b366fa65..0013d1e59d 100644 --- a/web/i18n/th-TH/workflow.json +++ b/web/i18n/th-TH/workflow.json @@ -110,9 +110,9 @@ "chatVariable.storedContent": "เนื้อหาที่เก็บไว้", "chatVariable.updatedAt": "อัพเดทเมื่อ", "collaboration.historyAction.generic": "ผู้ร่วมงานได้ทำการยกเลิก/ทำซ้ำ", + "comments.actions.addComment": "Add Comment", "comments.actions.deleteReply": "Delete reply", "comments.actions.editReply": "Edit reply", - "comments.actions.addComment": "Add Comment", "comments.aria.closeComment": "Close comment", "comments.aria.deleteComment": "Delete thread", "comments.aria.nextComment": "Next comment", diff --git a/web/i18n/tr-TR/workflow.json b/web/i18n/tr-TR/workflow.json index 5664fec435..5cdb024e4a 100644 --- a/web/i18n/tr-TR/workflow.json +++ b/web/i18n/tr-TR/workflow.json @@ -110,9 +110,9 @@ "chatVariable.storedContent": "Depolanan içerik", "chatVariable.updatedAt": "Güncellenme zamanı: ", "collaboration.historyAction.generic": "Bir işbirlikçi geri alma/yeniden yapma gerçekleştirdi", + "comments.actions.addComment": "Add Comment", "comments.actions.deleteReply": "Delete reply", "comments.actions.editReply": "Edit reply", - "comments.actions.addComment": "Add Comment", "comments.aria.closeComment": "Close comment", "comments.aria.deleteComment": "Delete thread", "comments.aria.nextComment": "Next comment", diff --git a/web/i18n/uk-UA/workflow.json b/web/i18n/uk-UA/workflow.json index b87b1ab41d..aad5d5b03f 100644 --- a/web/i18n/uk-UA/workflow.json +++ b/web/i18n/uk-UA/workflow.json @@ -110,9 +110,9 @@ "chatVariable.storedContent": "Збережений вміст", "chatVariable.updatedAt": "Оновлено ", "collaboration.historyAction.generic": "Співавтор виконав скасування/повторення", + "comments.actions.addComment": "Add Comment", "comments.actions.deleteReply": "Delete reply", "comments.actions.editReply": "Edit reply", - "comments.actions.addComment": "Add Comment", "comments.aria.closeComment": "Close comment", "comments.aria.deleteComment": "Delete thread", "comments.aria.nextComment": "Next comment", diff --git a/web/i18n/vi-VN/workflow.json b/web/i18n/vi-VN/workflow.json index 3150462e79..84bc3a6ff2 100644 --- a/web/i18n/vi-VN/workflow.json +++ b/web/i18n/vi-VN/workflow.json @@ -110,9 +110,9 @@ "chatVariable.storedContent": "Nội dung đã lưu", "chatVariable.updatedAt": "Cập nhật lúc ", "collaboration.historyAction.generic": "Một cộng tác viên đã thực hiện hoàn tác/làm lại", + "comments.actions.addComment": "Add Comment", "comments.actions.deleteReply": "Delete reply", "comments.actions.editReply": "Edit reply", - "comments.actions.addComment": "Add Comment", "comments.aria.closeComment": "Close comment", "comments.aria.deleteComment": "Delete thread", "comments.aria.nextComment": "Next comment", diff --git a/web/i18n/zh-Hans/workflow.json b/web/i18n/zh-Hans/workflow.json index 766ea09b39..6bbf1f9ebb 100644 --- a/web/i18n/zh-Hans/workflow.json +++ b/web/i18n/zh-Hans/workflow.json @@ -110,9 +110,9 @@ "chatVariable.storedContent": "存储内容", "chatVariable.updatedAt": "更新时间 ", "collaboration.historyAction.generic": "协作者执行了撤销/重做操作", + "comments.actions.addComment": "Add Comment", "comments.actions.deleteReply": "删除回复", "comments.actions.editReply": "编辑回复", - "comments.actions.addComment": "Add Comment", "comments.aria.closeComment": "关闭评论", "comments.aria.deleteComment": "删除讨论", "comments.aria.nextComment": "下一条评论", diff --git a/web/i18n/zh-Hant/workflow.json b/web/i18n/zh-Hant/workflow.json index f22c025ba5..12349280d4 100644 --- a/web/i18n/zh-Hant/workflow.json +++ b/web/i18n/zh-Hant/workflow.json @@ -110,9 +110,9 @@ "chatVariable.storedContent": "已儲存內容", "chatVariable.updatedAt": "更新於 ", "collaboration.historyAction.generic": "協作者執行了復原/重做操作", + "comments.actions.addComment": "Add Comment", "comments.actions.deleteReply": "刪除回覆", "comments.actions.editReply": "編輯回覆", - "comments.actions.addComment": "Add Comment", "comments.aria.closeComment": "關閉評論", "comments.aria.deleteComment": "刪除評論", "comments.aria.nextComment": "下一則評論", diff --git a/web/service/apps.ts b/web/service/apps.ts index ef4a077295..8764edc99e 100644 --- a/web/service/apps.ts +++ b/web/service/apps.ts @@ -13,12 +13,11 @@ export const fetchWorkflowOnlineUsers = async ({ workflowIds }: { workflowIds: s if (!workflowIds.length) return {} - const params = { workflow_ids: workflowIds.join(',') } const response = await consoleClient.apps.workflowOnlineUsers({ - query: params, + query: { workflow_ids: workflowIds.join(',') }, }) - if (!response || !response.data) + if (!response?.data) return {} if (Array.isArray(response.data)) { diff --git a/web/service/workflow-comment.ts b/web/service/workflow-comment.ts index 5b09470344..8e9c132607 100644 --- a/web/service/workflow-comment.ts +++ b/web/service/workflow-comment.ts @@ -5,7 +5,6 @@ import type { UserProfile as ContractUserProfile, WorkflowCommentCreateRes as ContractWorkflowCommentCreateRes, WorkflowCommentDetail as ContractWorkflowCommentDetail, - WorkflowCommentDetailMention as ContractWorkflowCommentDetailMention, WorkflowCommentDetailReply as ContractWorkflowCommentDetailReply, WorkflowCommentList as ContractWorkflowCommentList, WorkflowCommentReply as ContractWorkflowCommentReply, @@ -15,18 +14,17 @@ import type { import type { CommonResponse } from '@/models/common' import { consoleClient } from './client' -export type CreateCommentParams = ContractCreateCommentParams -export type CreateReplyParams = ContractCreateReplyParams -export type UpdateCommentParams = ContractUpdateCommentParams +type CreateCommentParams = ContractCreateCommentParams +type CreateReplyParams = ContractCreateReplyParams +type UpdateCommentParams = ContractUpdateCommentParams export type UserProfile = ContractUserProfile -export type WorkflowCommentCreateRes = ContractWorkflowCommentCreateRes +type WorkflowCommentCreateRes = ContractWorkflowCommentCreateRes export type WorkflowCommentDetail = ContractWorkflowCommentDetail -export type WorkflowCommentDetailMention = ContractWorkflowCommentDetailMention export type WorkflowCommentDetailReply = ContractWorkflowCommentDetailReply export type WorkflowCommentList = ContractWorkflowCommentList -export type WorkflowCommentReply = ContractWorkflowCommentReply -export type WorkflowCommentResolveRes = ContractWorkflowCommentResolveRes -export type WorkflowCommentUpdateRes = ContractWorkflowCommentUpdateRes +type WorkflowCommentReply = ContractWorkflowCommentReply +type WorkflowCommentResolveRes = ContractWorkflowCommentResolveRes +type WorkflowCommentUpdateRes = ContractWorkflowCommentUpdateRes export const fetchWorkflowComments = async (appId: string): Promise => { const response = await consoleClient.workflowComments.list({ diff --git a/web/service/workflow.ts b/web/service/workflow.ts index 6acd327000..2db8dffe53 100644 --- a/web/service/workflow.ts +++ b/web/service/workflow.ts @@ -100,14 +100,6 @@ export const fetchNodeInspectVars = async (flowType: FlowType, flowId: string, n return items } -// Environment Variables API -export const fetchEnvironmentVariables = async (appId: string): Promise => { - const response = await consoleClient.workflowDraft.environmentVariables({ - params: { appId }, - }) - return response.items -} - export const updateEnvironmentVariables = ({ appId, environmentVariables }: { appId: string environmentVariables: EnvironmentVariable[]