Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.
Python agentagentic-aiagentic-frameworkagentic-workflowaiautomationclaudedeepseekgenaigptllmlow-codemcpnextjsno-codeopenaipythonskillsworkflow
fix(web): template creation permission for app templates (#30367)
quicksandde53c78125a7
diff --git a/web/app/components/app/create-app-dialog/app-list/index.spec.tsx b/web/app/components/app/create-app-dialog/app-list/index.spec.tsxindex d873b4243e3..e0f459ee75c 100644--- a/web/app/components/app/create-app-dialog/app-list/index.spec.tsx+++ b/web/app/components/app/create-app-dialog/app-list/index.spec.tsx@@ -14,13 +14,6 @@ vi.mock('ahooks', () => ({vi.mock('@/context/app-context', () => ({useAppContext: () => ({ isCurrentWorkspaceEditor: true }),}))-vi.mock('use-context-selector', async () => {- const actual = await vi.importActual<typeof import('use-context-selector')>('use-context-selector')- return {- ...actual,- useContext: () => ({ hasEditPermission: true }),- }-})vi.mock('nuqs', () => ({useQueryState: () => ['Recommended', vi.fn()],}))@@ -119,6 +112,7 @@ describe('Apps', () => {fireEvent.click(screen.getAllByTestId('app-card')[0])expect(screen.getByTestId('create-from-template-modal')).toBeInTheDocument()})+it('shows no template message when list is empty', () => {mockUseExploreAppList.mockReturnValueOnce({data: { allList: [], categories: [] },diff --git a/web/app/components/app/create-app-dialog/app-list/index.tsx b/web/app/components/app/create-app-dialog/app-list/index.tsxindex 6a30df0dd9c..b967ba7d55a 100644--- a/web/app/components/app/create-app-dialog/app-list/index.tsx+++ b/web/app/components/app/create-app-dialog/app-list/index.tsx@@ -8,7 +8,6 @@ import { useRouter } from 'next/navigation'import * as React from 'react'import { useMemo, useState } from 'react'import { useTranslation } from 'react-i18next'-import { useContext } from 'use-context-selector'import AppTypeSelector from '@/app/components/app/type-selector'import { trackEvent } from '@/app/components/base/amplitude'import Divider from '@/app/components/base/divider'@@ -19,7 +18,6 @@ import CreateAppModal from '@/app/components/explore/create-app-modal'import { usePluginDependencies } from '@/app/components/workflow/plugin-dependency/hooks'import { NEED_REFRESH_APP_LIST_KEY } from '@/config'import { useAppContext } from '@/context/app-context'-import ExploreContext from '@/context/explore-context'import { DSLImportMode } from '@/models/app'import { importDSL } from '@/service/apps'import { fetchAppDetail } from '@/service/explore'@@ -47,7 +45,6 @@ const Apps = ({const { t } = useTranslation()const { isCurrentWorkspaceEditor } = useAppContext()const { push } = useRouter()- const { hasEditPermission } = useContext(ExploreContext)const allCategoriesEn = AppCategories.RECOMMENDEDconst [keywords, setKeywords] = useState('')@@ -214,7 +211,7 @@ const Apps = ({<AppCardkey={app.app_id}app={app}- canCreate={hasEditPermission}+ canCreate={isCurrentWorkspaceEditor}onCreate={() => {setCurrApp(app)setIsShowCreateModal(true)