diff --git a/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/layout-main.tsx b/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/layout-main.tsx index e24b7c5ce14..3fbb014a0fe 100644 --- a/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/layout-main.tsx +++ b/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/layout-main.tsx @@ -197,8 +197,7 @@ const AppDetailLayout: FC = (props) => { return } - if (appDetailRes && appDetail?.id !== appDetailRes.id) - setAppDetail({ ...appDetailRes, enable_sso: false }) + if (appDetailRes && appDetail?.id !== appDetailRes.id) setAppDetail(appDetailRes) }, [ appDetail?.id, appDetailRes, diff --git a/web/app/components/app-sidebar/app-info/__tests__/app-info-modals.spec.tsx b/web/app/components/app-sidebar/app-info/__tests__/app-info-modals.spec.tsx index 65b1154799e..06e0ca2314a 100644 --- a/web/app/components/app-sidebar/app-info/__tests__/app-info-modals.spec.tsx +++ b/web/app/components/app-sidebar/app-info/__tests__/app-info-modals.spec.tsx @@ -1,4 +1,4 @@ -import type { App, AppSSO } from '@/types/app' +import type { App } from '@/types/app' import { act, fireEvent, render, screen, waitFor } from '@testing-library/react' import userEvent from '@testing-library/user-event' import * as React from 'react' @@ -107,7 +107,7 @@ vi.mock('@/app/components/app/export-confirm-modal', () => ({ ), })) -const createAppDetail = (overrides: Partial = {}): App & Partial => +const createAppDetail = (overrides: Partial = {}): App => ({ id: 'app-1', name: 'Test App', @@ -120,7 +120,7 @@ const createAppDetail = (overrides: Partial = {}): App & Partial => use_icon_as_answer_icon: false, max_active_requests: null, ...overrides, - }) as App & Partial + }) as App const defaultProps = { appDetail: createAppDetail(), diff --git a/web/app/components/app-sidebar/app-info/__tests__/app-info-trigger.spec.tsx b/web/app/components/app-sidebar/app-info/__tests__/app-info-trigger.spec.tsx index be4a0bda64b..baea07383d5 100644 --- a/web/app/components/app-sidebar/app-info/__tests__/app-info-trigger.spec.tsx +++ b/web/app/components/app-sidebar/app-info/__tests__/app-info-trigger.spec.tsx @@ -1,4 +1,4 @@ -import type { App, AppSSO } from '@/types/app' +import type { App } from '@/types/app' import { screen } from '@testing-library/react' import userEvent from '@testing-library/user-event' import * as React from 'react' @@ -54,7 +54,7 @@ const defaultAppPermissionKeys = [ AppACLPermission.Delete, ] -const createAppDetail = (overrides: Partial = {}): App & Partial => +const createAppDetail = (overrides: Partial = {}): App => ({ id: 'app-1', name: 'Test App', @@ -68,7 +68,7 @@ const createAppDetail = (overrides: Partial = {}): App & Partial => permission_keys: defaultAppPermissionKeys, maintainer: 'user-1', ...overrides, - }) as App & Partial + }) as App const createProps = (overrides: Partial> = {}) => ({ appDetail: createAppDetail(), diff --git a/web/app/components/app-sidebar/app-info/app-info-modals.tsx b/web/app/components/app-sidebar/app-info/app-info-modals.tsx index da0f709bc96..df5b729d3ed 100644 --- a/web/app/components/app-sidebar/app-info/app-info-modals.tsx +++ b/web/app/components/app-sidebar/app-info/app-info-modals.tsx @@ -2,7 +2,7 @@ import type { EnvironmentVariableItemResponse } from '@dify/contracts/api/consol import type { AppInfoModalType } from './use-app-info-actions' import type { DuplicateAppModalProps } from '@/app/components/app/duplicate-modal' import type { CreateAppModalProps } from '@/app/components/explore/create-app-modal' -import type { App, AppSSO } from '@/types/app' +import type { App } from '@/types/app' import { AlertDialog, AlertDialogActions, @@ -35,7 +35,7 @@ const UpdateDSLModal = dynamic(() => import('@/app/components/workflow/update-ds }) type AppInfoModalsProps = { - appDetail: App & Partial + appDetail: App activeModal: AppInfoModalType closeModal: () => void secretEnvList: EnvironmentVariableItemResponse[] diff --git a/web/app/components/app-sidebar/app-info/app-info-trigger.tsx b/web/app/components/app-sidebar/app-info/app-info-trigger.tsx index b088066f13e..153776b6842 100644 --- a/web/app/components/app-sidebar/app-info/app-info-trigger.tsx +++ b/web/app/components/app-sidebar/app-info/app-info-trigger.tsx @@ -1,6 +1,6 @@ import type { Operation } from './app-operations' import type { AppInfoModalType } from './use-app-info-actions' -import type { App, AppSSO } from '@/types/app' +import type { App } from '@/types/app' import { cn } from '@langgenius/dify-ui/cn' import { useSuspenseQuery } from '@tanstack/react-query' import { useAtomValue } from 'jotai' @@ -15,7 +15,7 @@ import { getAppModeLabel } from './app-mode-labels' import AppOperations from './app-operations' type AppInfoTriggerProps = { - appDetail: App & Partial + appDetail: App expand: boolean openModal: (modal: Exclude) => void isExporting: boolean diff --git a/web/app/components/app/access-point/__tests__/mcp-card.spec.tsx b/web/app/components/app/access-point/__tests__/mcp-card.spec.tsx index b272e10ed63..0df4ef82fe6 100644 --- a/web/app/components/app/access-point/__tests__/mcp-card.spec.tsx +++ b/web/app/components/app/access-point/__tests__/mcp-card.spec.tsx @@ -1,4 +1,5 @@ -import type { AccessPointAppInfo, PublishedWorkflow } from '../shared/utils' +import type { PublishedWorkflow } from '../shared/utils' +import type { App } from '@/types/app' import { QueryClientProvider } from '@tanstack/react-query' import { screen, waitFor } from '@testing-library/react' import userEvent from '@testing-library/user-event' @@ -76,13 +77,13 @@ const appInfo = { }, ], }, -} as AccessPointAppInfo +} as App const workflowAppInfo = { ...appInfo, mode: AppModeEnum.WORKFLOW, model_config: null, -} as unknown as AccessPointAppInfo +} as unknown as App const publishedWorkflow = { graph: { @@ -108,7 +109,7 @@ function createDeferredPromise() { return { promise, reject, resolve } } -function renderCard(cardAppInfo: AccessPointAppInfo = appInfo, workflow?: PublishedWorkflow) { +function renderCard(cardAppInfo: App = appInfo, workflow?: PublishedWorkflow) { const queryClient = createTestQueryClient() return render( diff --git a/web/app/components/app/access-point/__tests__/service-api-card.spec.tsx b/web/app/components/app/access-point/__tests__/service-api-card.spec.tsx index 2f26c1af6bd..8e48da87f0f 100644 --- a/web/app/components/app/access-point/__tests__/service-api-card.spec.tsx +++ b/web/app/components/app/access-point/__tests__/service-api-card.spec.tsx @@ -1,4 +1,4 @@ -import type { AccessPointAppInfo } from '../shared/utils' +import type { App } from '@/types/app' import { QueryClientProvider } from '@tanstack/react-query' import { screen, waitFor } from '@testing-library/react' import userEvent from '@testing-library/user-event' @@ -53,24 +53,21 @@ vi.mock('../shared/api-secret-key-button', () => ({ }, })) -function createAppInfo( - mode: AppModeEnum, - overrides: Partial = {}, -): AccessPointAppInfo { +function createAppInfo(mode: AppModeEnum, overrides: Partial = {}): App { return { api_base_url: 'https://api.example.test/v1', enable_api: true, id: 'app-1', mode, ...overrides, - } as AccessPointAppInfo + } as App } function renderCard( mode: AppModeEnum, availability: 'available' | 'loading' | 'unavailable' = 'available', canManage = true, - overrides: Partial = {}, + overrides: Partial = {}, ) { useAppStore.setState({ appDetail: createAppInfo(mode, overrides) }) const queryClient = createTestQueryClient() diff --git a/web/app/components/app/access-point/__tests__/trigger-card.spec.tsx b/web/app/components/app/access-point/__tests__/trigger-card.spec.tsx index d4c78c09465..ab9b6e616dd 100644 --- a/web/app/components/app/access-point/__tests__/trigger-card.spec.tsx +++ b/web/app/components/app/access-point/__tests__/trigger-card.spec.tsx @@ -1,5 +1,5 @@ -import type { AccessPointAppInfo } from '../shared/utils' import type { AppTrigger } from '@/service/use-tools' +import type { App } from '@/types/app' import { QueryClientProvider } from '@tanstack/react-query' import { screen, waitFor } from '@testing-library/react' import userEvent from '@testing-library/user-event' @@ -72,7 +72,7 @@ vi.mock('@/app/components/workflow/block-icon', () => ({ const appInfo = { id: 'app-1', mode: AppModeEnum.WORKFLOW, -} as AccessPointAppInfo +} as App function createTrigger(id: string, status: AppTrigger['status']): AppTrigger { return { diff --git a/web/app/components/app/access-point/__tests__/web-app-card.spec.tsx b/web/app/components/app/access-point/__tests__/web-app-card.spec.tsx index 64756dedc0f..54847d6f2c3 100644 --- a/web/app/components/app/access-point/__tests__/web-app-card.spec.tsx +++ b/web/app/components/app/access-point/__tests__/web-app-card.spec.tsx @@ -1,5 +1,6 @@ -import type { AccessPointAppInfo, PublishedWorkflow } from '../shared/utils' +import type { PublishedWorkflow } from '../shared/utils' import type { InputVar, Node } from '@/app/components/workflow/types' +import type { App } from '@/types/app' import { QueryClientProvider } from '@tanstack/react-query' import { screen, waitFor, within } from '@testing-library/react' import userEvent from '@testing-library/user-event' @@ -109,7 +110,7 @@ vi.mock('@/app/components/app/overview/embedded', () => ({ ) : null, })) -function createAppInfo(mode: AppModeEnum): AccessPointAppInfo { +function createAppInfo(mode: AppModeEnum): App { return { access_mode: AccessMode.PUBLIC, api_base_url: 'https://api.example.test/v1', @@ -124,7 +125,7 @@ function createAppInfo(mode: AppModeEnum): AccessPointAppInfo { access_token: 'site-code', app_base_url: 'https://site.example.test', }, - } as AccessPointAppInfo + } as App } function renderCard( diff --git a/web/app/components/app/access-point/built-in-access-points/mcp-card.tsx b/web/app/components/app/access-point/built-in-access-points/mcp-card.tsx index 2819eee88e5..c95629d781b 100644 --- a/web/app/components/app/access-point/built-in-access-points/mcp-card.tsx +++ b/web/app/components/app/access-point/built-in-access-points/mcp-card.tsx @@ -1,6 +1,7 @@ 'use client' -import type { AccessPointAppInfo, PublishedWorkflow } from '../shared/utils' +import type { PublishedWorkflow } from '../shared/utils' +import type { App } from '@/types/app' import { AlertDialog, AlertDialogActions, @@ -30,7 +31,7 @@ import { useAccessPointStatusLabel } from '../shared/use-access-point-status-lab import { getPublishedWorkflowNodes, isAdvancedApp } from '../shared/utils' type MCPAccessPointCardProps = { - appInfo: AccessPointAppInfo + appInfo: App canManageAccessPoint: boolean highlighted?: boolean triggerModeDisabled: boolean diff --git a/web/app/components/app/access-point/built-in-access-points/service-api-card.tsx b/web/app/components/app/access-point/built-in-access-points/service-api-card.tsx index a2e147e5548..06096c7773b 100644 --- a/web/app/components/app/access-point/built-in-access-points/service-api-card.tsx +++ b/web/app/components/app/access-point/built-in-access-points/service-api-card.tsx @@ -1,7 +1,7 @@ 'use client' -import type { AccessPointAppInfo } from '../shared/utils' import type { AccessPointAvailability } from '@/app/components/base/access-point/status' +import type { App } from '@/types/app' import { useMutation } from '@tanstack/react-query' import { useTranslation } from 'react-i18next' import { useStore as useAppStore } from '@/app/components/app/store' @@ -12,7 +12,7 @@ import { ServiceApiCardView } from '../shared/service-api-card-view' import { getBuiltInAccessUrls } from '../shared/utils' type ServiceApiAccessPointCardProps = { - appInfo: AccessPointAppInfo + appInfo: App availability: AccessPointAvailability canManage: boolean highlighted?: boolean diff --git a/web/app/components/app/access-point/built-in-access-points/trigger-card.tsx b/web/app/components/app/access-point/built-in-access-points/trigger-card.tsx index 516f3032be8..3998bfeadc5 100644 --- a/web/app/components/app/access-point/built-in-access-points/trigger-card.tsx +++ b/web/app/components/app/access-point/built-in-access-points/trigger-card.tsx @@ -1,8 +1,8 @@ 'use client' -import type { AccessPointAppInfo } from '../shared/utils' import type { TriggerWithProvider } from '@/app/components/workflow/block-selector/types' import type { AppTrigger } from '@/service/use-tools' +import type { App } from '@/types/app' import { StatusDot } from '@langgenius/dify-ui/status-dot' import { Switch } from '@langgenius/dify-ui/switch' import { useMutation } from '@tanstack/react-query' @@ -131,7 +131,7 @@ function TriggerAccessPointItem({ } type TriggerAccessPointCardProps = { - appInfo: AccessPointAppInfo + appInfo: App availability: 'available' | 'loading' | 'unavailable' canManageAccessPoint: boolean highlighted?: boolean diff --git a/web/app/components/app/access-point/built-in-access-points/web-app-card.tsx b/web/app/components/app/access-point/built-in-access-points/web-app-card.tsx index ba896eeb425..b278c4ecb96 100644 --- a/web/app/components/app/access-point/built-in-access-points/web-app-card.tsx +++ b/web/app/components/app/access-point/built-in-access-points/web-app-card.tsx @@ -1,9 +1,10 @@ 'use client' import type { SelectorParam } from 'i18next' -import type { AccessPointAppInfo, PublishedWorkflow } from '../shared/utils' +import type { PublishedWorkflow } from '../shared/utils' import type { ConfigParams } from '@/app/components/app/overview/settings' import type { AccessPointAvailability } from '@/app/components/base/access-point/status' +import type { App } from '@/types/app' import { AlertDialog, AlertDialogActions, @@ -57,7 +58,7 @@ const ACCESS_MODE_LABEL_MAP: Record> = { } type WebAppAccessPointCardProps = { - appInfo: AccessPointAppInfo + appInfo: App availability: AccessPointAvailability canDeploy: boolean canManageAccessPoint: boolean diff --git a/web/app/components/app/access-point/deployed-environment-access-points/environment-web-app-card.tsx b/web/app/components/app/access-point/deployed-environment-access-points/environment-web-app-card.tsx index d7c92d3c596..d908aa7067f 100644 --- a/web/app/components/app/access-point/deployed-environment-access-points/environment-web-app-card.tsx +++ b/web/app/components/app/access-point/deployed-environment-access-points/environment-web-app-card.tsx @@ -1,6 +1,5 @@ 'use client' -import type { AccessPointAppInfo } from '../shared/utils' import { AlertDialog, AlertDialogActions, @@ -62,7 +61,7 @@ export function EnvironmentWebAppCard({ 'navigation', ]) const queryClient = useQueryClient() - const appInfo = useAppStore((state) => state.appDetail) as AccessPointAppInfo | null + const appInfo = useAppStore((state) => state.appDetail) const { data: systemFeatures } = useSuspenseQuery(systemFeaturesQueryOptions()) const actions = useAccessPointActions(appId, canManageAccessPoint) const [showSettings, setShowSettings] = useState(false) diff --git a/web/app/components/app/access-point/shared/utils.ts b/web/app/components/app/access-point/shared/utils.ts index ad06c1b8786..1c87d50bd54 100644 --- a/web/app/components/app/access-point/shared/utils.ts +++ b/web/app/components/app/access-point/shared/utils.ts @@ -1,13 +1,11 @@ import type { WorkflowResponse } from '@dify/contracts/api/console/apps/types.gen' import type { InputVar, Node } from '@/app/components/workflow/types' -import type { AppDetailResponse } from '@/models/app' -import type { AppSSO } from '@/types/app' +import type { App } from '@/types/app' import type { DocPathWithoutLang } from '@/types/doc-paths' import { BlockEnum, isTriggerNode } from '@/app/components/workflow/types' import { AppModeEnum } from '@/types/app' import { basePath } from '@/utils/var' -export type AccessPointAppInfo = AppDetailResponse & Partial export type PublishedWorkflow = WorkflowResponse | null | undefined type AppRouteMode = Exclude @@ -28,10 +26,7 @@ export function getAppApiReferencePath(appMode: AppModeEnum) { return APP_API_REFERENCE_PATHS[appMode] } -export function getPublishedWorkflowState( - appInfo: AccessPointAppInfo, - workflow: PublishedWorkflow, -) { +export function getPublishedWorkflowState(appInfo: App, workflow: PublishedWorkflow) { const isWorkflowApp = appInfo.mode === AppModeEnum.WORKFLOW const nodes = getPublishedWorkflowNodes(workflow) const hasStartNode = nodes.some((node) => node.data.type === BlockEnum.Start) @@ -51,7 +46,7 @@ export function getPublishedWorkflowNodes(workflow: PublishedWorkflow) { : EMPTY_WORKFLOW_NODES } -export function getBuiltInAccessUrls(appInfo: AccessPointAppInfo) { +export function getBuiltInAccessUrls(appInfo: App) { const appMode = appInfo.mode === AppModeEnum.COMPLETION || appInfo.mode === AppModeEnum.WORKFLOW ? appInfo.mode @@ -75,6 +70,6 @@ export function getHiddenStartInputs(workflow: PublishedWorkflow) { ) } -export function isAdvancedApp(appInfo: AccessPointAppInfo) { +export function isAdvancedApp(appInfo: App) { return appInfo.mode === AppModeEnum.WORKFLOW || appInfo.mode === AppModeEnum.ADVANCED_CHAT } diff --git a/web/app/components/app/configuration/config-var/config-modal/__tests__/index-logic.spec.tsx b/web/app/components/app/configuration/config-var/config-modal/__tests__/index-logic.spec.tsx index 6a78d68868e..3e60a039da6 100644 --- a/web/app/components/app/configuration/config-var/config-modal/__tests__/index-logic.spec.tsx +++ b/web/app/components/app/configuration/config-var/config-modal/__tests__/index-logic.spec.tsx @@ -1,5 +1,5 @@ import type { InputVar } from '@/app/components/workflow/types' -import type { App, AppSSO } from '@/types/app' +import type { App } from '@/types/app' import { fireEvent, screen, waitFor } from '@testing-library/react' import * as React from 'react' import { toast } from '@/app/components/app/configuration/toast' @@ -128,7 +128,7 @@ describe('ConfigModal logic', () => { useStore.setState({ appDetail: { mode: AppModeEnum.CHAT, - } as App & Partial, + } as App, }) }) diff --git a/web/app/components/app/configuration/config-var/config-modal/__tests__/index.spec.tsx b/web/app/components/app/configuration/config-var/config-modal/__tests__/index.spec.tsx index 8464694bd27..23f522a88d3 100644 --- a/web/app/components/app/configuration/config-var/config-modal/__tests__/index.spec.tsx +++ b/web/app/components/app/configuration/config-var/config-modal/__tests__/index.spec.tsx @@ -1,5 +1,5 @@ import type { InputVar } from '@/app/components/workflow/types' -import type { App, AppSSO } from '@/types/app' +import type { App } from '@/types/app' import { fireEvent, screen } from '@testing-library/react' import userEvent from '@testing-library/user-event' import * as React from 'react' @@ -58,7 +58,7 @@ describe('ConfigModal', () => { useStore.setState({ appDetail: { mode: AppModeEnum.CHAT, - } as App & Partial, + } as App, }) }) diff --git a/web/app/components/app/overview/settings/__tests__/index.spec.tsx b/web/app/components/app/overview/settings/__tests__/index.spec.tsx index e5fce70fcbc..8a43022fcfa 100644 --- a/web/app/components/app/overview/settings/__tests__/index.spec.tsx +++ b/web/app/components/app/overview/settings/__tests__/index.spec.tsx @@ -1,6 +1,5 @@ import type { ReactElement, ReactNode } from 'react' -import type { AppDetailResponse } from '@/models/app' -import type { AppSSO } from '@/types/app' +import type { SettingsAppInfo } from '../index' import { fireEvent, screen, waitFor } from '@testing-library/react' import { NuqsTestingAdapter } from 'nuqs/adapters/testing' import { consoleQuery } from '@/service/console' @@ -75,6 +74,7 @@ vi.mock('@/context/i18n', async () => { }) const mockAppInfo = { + id: 'test-app', site: { title: 'Test App', icon_type: 'emoji', @@ -93,10 +93,9 @@ const mockAppInfo = { use_icon_as_answer_icon: true, }, mode: AppModeEnum.ADVANCED_CHAT, - enable_sso: false, -} as unknown as AppDetailResponse & Partial +} satisfies SettingsAppInfo -const renderSettingsModal = (appInfo = mockAppInfo, canDeploy = false) => +const renderSettingsModal = (appInfo: SettingsAppInfo = mockAppInfo, canDeploy = false) => render( { icon_background: mockAppInfo.site.icon_background, show_workflow_steps: mockAppInfo.site.show_workflow_steps, use_icon_as_answer_icon: mockAppInfo.site.use_icon_as_answer_icon, - enable_sso: mockAppInfo.enable_sso, }), ) expect(mockOnClose).toHaveBeenCalled() @@ -322,15 +320,13 @@ describe('SettingsModal', () => { isChat canDeploy={false} isShow={true} - appInfo={ - { - ...mockAppInfo, - site: { - ...mockAppInfo.site, - input_placeholder: 'Updated prompt', - }, - } as typeof mockAppInfo - } + appInfo={{ + ...mockAppInfo, + site: { + ...mockAppInfo.site, + input_placeholder: 'Updated prompt', + }, + }} onClose={mockOnClose} onSave={mockOnSave} />, @@ -423,7 +419,7 @@ describe('SettingsModal', () => { icon_background: null, icon_url: 'https://example.com/uploaded.png', }, - } as typeof mockAppInfo + } satisfies SettingsAppInfo renderSettingsModal(imageAppInfo) diff --git a/web/app/components/app/overview/settings/index.tsx b/web/app/components/app/overview/settings/index.tsx index c07e1e4e338..349c038b00d 100644 --- a/web/app/components/app/overview/settings/index.tsx +++ b/web/app/components/app/overview/settings/index.tsx @@ -89,7 +89,6 @@ type SettingsAppIconSelection = export type SettingsAppInfo = { id: string mode: AppModeEnum - enable_sso?: boolean site: SettingsSiteInfo } @@ -109,7 +108,6 @@ export type ConfigParams = { icon_background?: string show_workflow_steps: boolean use_icon_as_answer_icon: boolean - enable_sso?: boolean } const INPUT_PLACEHOLDER_MAX_LENGTH = 64 @@ -153,7 +151,6 @@ const createInputInfo = (appInfo: ISettingsModalProps['appInfo']) => { inputPlaceholder: input_placeholder ?? '', show_workflow_steps, use_icon_as_answer_icon, - enable_sso: appInfo.enable_sso, } } @@ -170,7 +167,6 @@ const createAppIcon = (appInfo: ISettingsModalProps['appInfo']): SettingsAppIcon const getSettingsResetKey = (appInfo: ISettingsModalProps['appInfo']) => JSON.stringify([ appInfo.id, - appInfo.enable_sso, appInfo.site.title, appInfo.site.description, appInfo.site.chat_color_theme, @@ -348,7 +344,6 @@ const SettingsModal: FC = ({ icon_background: appIcon.type === 'emoji' ? appIcon.background : undefined, show_workflow_steps: inputInfo.show_workflow_steps, use_icon_as_answer_icon: inputInfo.use_icon_as_answer_icon, - enable_sso: inputInfo.enable_sso, } await onSave?.(params) setSaveLoading(false) diff --git a/web/app/components/app/store.ts b/web/app/components/app/store.ts index 85a4c6324a0..bf1d8549aee 100644 --- a/web/app/components/app/store.ts +++ b/web/app/components/app/store.ts @@ -1,9 +1,9 @@ import type { IChatItem } from '@/app/components/base/chat/chat/type' -import type { App, AppSSO } from '@/types/app' +import type { App } from '@/types/app' import { create } from 'zustand' type State = { - appDetail?: App & Partial + appDetail?: App currentLogItem?: IChatItem currentLogModalActiveTab: string showPromptLogModal: boolean @@ -13,7 +13,7 @@ type State = { } type Action = { - setAppDetail: (appDetail?: App & Partial) => void + setAppDetail: (appDetail?: App) => void setCurrentLogItem: (item?: IChatItem) => void setCurrentLogModalActiveTab: (tab: string) => void setShowPromptLogModal: (showPromptLogModal: boolean) => void diff --git a/web/app/components/workflow/nodes/human-input/components/delivery-method/__tests__/test-email-sender.spec.tsx b/web/app/components/workflow/nodes/human-input/components/delivery-method/__tests__/test-email-sender.spec.tsx index 95a09bc8e27..6c0801387e9 100644 --- a/web/app/components/workflow/nodes/human-input/components/delivery-method/__tests__/test-email-sender.spec.tsx +++ b/web/app/components/workflow/nodes/human-input/components/delivery-method/__tests__/test-email-sender.spec.tsx @@ -6,7 +6,7 @@ import type { SelectFormInput, } from '../../../types' import type { CodeNodeType } from '@/app/components/workflow/nodes/code/types' -import type { App, AppSSO } from '@/types/app' +import type { App } from '@/types/app' import { QueryClient, QueryClientProvider } from '@tanstack/react-query' import { fireEvent, screen, waitFor } from '@testing-library/react' import userEvent from '@testing-library/user-event' @@ -184,7 +184,7 @@ describe('human-input/delivery-method/test-email-sender', () => { appDetail: { id: 'app-1', name: 'Workflow App', - } as App & Partial, + } as App, }) }) diff --git a/web/app/components/workflow/panel/chat-record/__tests__/index.spec.tsx b/web/app/components/workflow/panel/chat-record/__tests__/index.spec.tsx index 1ee4cc28731..4d49ef0c28a 100644 --- a/web/app/components/workflow/panel/chat-record/__tests__/index.spec.tsx +++ b/web/app/components/workflow/panel/chat-record/__tests__/index.spec.tsx @@ -1,5 +1,5 @@ import type { HistoryWorkflowData } from '@/app/components/workflow/types' -import type { App, AppSSO } from '@/types/app' +import type { App } from '@/types/app' import { screen, waitFor } from '@testing-library/react' import userEvent from '@testing-library/user-event' import { useStore as useAppStore } from '@/app/components/app/store' @@ -24,7 +24,7 @@ describe('ChatRecord', () => { beforeEach(() => { vi.clearAllMocks() useAppStore.setState({ - appDetail: { id: 'app-1' } as App & Partial, + appDetail: { id: 'app-1' } as App, }) }) diff --git a/web/features/agent-v2/agent-detail/access/components/web-app-access-card.tsx b/web/features/agent-v2/agent-detail/access/components/web-app-access-card.tsx index 1de5c3b07d9..ed36b9d0368 100644 --- a/web/features/agent-v2/agent-detail/access/components/web-app-access-card.tsx +++ b/web/features/agent-v2/agent-detail/access/components/web-app-access-card.tsx @@ -187,8 +187,7 @@ export function WebAppAccessCard({ async function handleSaveSettings(params: ConfigParams) { if (!appId || !canManageWebApp) return - const { enable_sso: _enableSso, ...body } = params - const sitePayload = body satisfies AppSiteUpdatePayload + const sitePayload = params satisfies AppSiteUpdatePayload try { await updateSiteMutation.mutateAsync({ diff --git a/web/types/app.ts b/web/types/app.ts index b50027ada36..1d97e5aa536 100644 --- a/web/types/app.ts +++ b/web/types/app.ts @@ -445,10 +445,6 @@ export type App = { permission_keys?: string[] } -export type AppSSO = { - enable_sso: boolean -} - export type Resolution = 'low' | 'high' export const Resolution = { low: 'low' as Resolution,