feat(dify): 把本地控制台的中文与去外链改动入库
这些界面改动和专家服务草稿停在工作区,没有随上一笔主分支提交进入仓库。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
9c7c80e194
commit
c2cb845a32
211 files changed
+3030
-2794
No files matched your search
@@ -277,16 +277,16 @@ it('closes compact navigation after changing the settings section', async () =>
|
||||
})
|
||||
|
||||
it('preserves the host title in settings and updates it for route navigation', () => {
|
||||
document.title = 'Workspace settings - Dify'
|
||||
document.title = 'Workspace settings - 甘肃省房地产价格评估行业协会'
|
||||
const view = renderPage()
|
||||
expect(document.title).toBe('Workspace settings - Dify')
|
||||
expect(document.title).toBe('Workspace settings - 甘肃省房地产价格评估行业协会')
|
||||
view.rerender(<IntegrationsPage section="provider" syncDocumentTitle />)
|
||||
expect(document.title).toBe(
|
||||
'navigation.settings.provider · navigation.mainNav.integrations - Dify',
|
||||
'navigation.settings.provider · navigation.mainNav.integrations - 甘肃省房地产价格评估行业协会',
|
||||
)
|
||||
view.rerender(<IntegrationsPage section="data-source" syncDocumentTitle />)
|
||||
expect(document.title).toBe(
|
||||
'navigation.settings.dataSource · navigation.mainNav.integrations - Dify',
|
||||
'navigation.settings.dataSource · navigation.mainNav.integrations - 甘肃省房地产价格评估行业协会',
|
||||
)
|
||||
})
|
||||
|
||||
@@ -362,31 +362,24 @@ it.each([
|
||||
expect(screen.getByRole('link', { name: heading })).toHaveAttribute('aria-current', 'page')
|
||||
})
|
||||
|
||||
it.each([
|
||||
['provider', '/plugins/model'],
|
||||
['data-source', '/plugins/datasource'],
|
||||
] as const)('opens the %s marketplace from its actual section action', async (section, path) => {
|
||||
const user = userEvent.setup()
|
||||
renderPage({ props: { section } })
|
||||
const action = 'plugin.marketplace.difyMarketplace'
|
||||
await user.click(await screen.findByRole('button', { name: action }))
|
||||
expect(window.open).toHaveBeenCalledWith(
|
||||
expect.stringContaining(`${path}?source=`),
|
||||
'_blank',
|
||||
'noopener,noreferrer',
|
||||
)
|
||||
})
|
||||
it.each(['provider', 'data-source'] as const)(
|
||||
'does not open the official %s marketplace',
|
||||
async (section) => {
|
||||
renderPage({ props: { section } })
|
||||
expect(
|
||||
screen.queryByRole('button', { name: 'plugin.marketplace.difyMarketplace' }),
|
||||
).not.toBeInTheDocument()
|
||||
expect(window.open).not.toHaveBeenCalled()
|
||||
},
|
||||
)
|
||||
|
||||
it('opens the category marketplace path from the install menu', async () => {
|
||||
it('opens the in-app marketplace from the install menu', async () => {
|
||||
const user = userEvent.setup()
|
||||
renderPage({ props: { section: 'trigger' } })
|
||||
await user.click(await screen.findByRole('button', { name: 'plugin.installAction' }))
|
||||
await user.click(screen.getByRole('menuitem', { name: 'plugin.source.marketplace' }))
|
||||
expect(window.open).toHaveBeenCalledExactlyOnceWith(
|
||||
expect.stringContaining('/plugins/trigger?source='),
|
||||
'_blank',
|
||||
'noopener,noreferrer',
|
||||
)
|
||||
expect(api.push).toHaveBeenCalledExactlyOnceWith('/marketplace')
|
||||
expect(window.open).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('saves category-specific automatic update settings from the toolbar', async () => {
|
||||
|
||||
+4
-10
@@ -579,17 +579,11 @@ it.each([
|
||||
},
|
||||
)
|
||||
|
||||
it('loads the tool marketplace when the user expands it', async () => {
|
||||
const user = userEvent.setup()
|
||||
it('does not show the marketplace catalog on builtin tools', async () => {
|
||||
renderProviderList({ marketplace: true })
|
||||
await user.click(screen.getByRole('button', { name: 'plugin.marketplace.moreFrom' }))
|
||||
await waitFor(() =>
|
||||
expect(api.collections).toHaveBeenCalledWith(
|
||||
{ query: expect.objectContaining({ category: 'tool', exclude: [] }) },
|
||||
expect.anything(),
|
||||
),
|
||||
)
|
||||
expect(screen.getByText('plugin.marketplace.moreFrom')).toBeInTheDocument()
|
||||
await act(async () => {})
|
||||
expect(screen.queryByText('plugin.marketplace.moreFrom')).not.toBeInTheDocument()
|
||||
expect(api.collections).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('loads an installed plugin detail and closes it without losing the catalog', async () => {
|
||||
|
||||
Reference in new issue
Block a user