feat: 将工作流分享改为独立页面
- 新增无后台布局的工作流分享与失效路由 - 同步分享地址并保留旧链接兼容 - 补充前后端分享链路测试
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
|
||||
import routes from '../routes/external/share';
|
||||
|
||||
describe('external share routes', () => {
|
||||
it('keeps workflow sharing outside the management layout', () => {
|
||||
const route = routes.find((item) => item.name === 'WorkflowShare');
|
||||
|
||||
expect(route?.path).toBe('/share/workflow');
|
||||
expect(route?.meta).toMatchObject({
|
||||
hideInBreadcrumb: true,
|
||||
hideInMenu: true,
|
||||
hideInTab: true,
|
||||
noBasicLayout: true,
|
||||
});
|
||||
});
|
||||
|
||||
it('provides a standalone workflow share failure page', () => {
|
||||
const route = routes.find((item) => item.name === 'WorkflowShareExpired');
|
||||
|
||||
expect(route?.path).toBe('/share/workflow/expired');
|
||||
expect(route?.meta?.noBasicLayout).toBe(true);
|
||||
});
|
||||
});
|
||||
@@ -28,8 +28,13 @@ interface NetworkConnectionLike {
|
||||
|
||||
const CHUNK_ERROR_RELOAD_KEY = '__easyflow_chunk_error_reload_path__';
|
||||
|
||||
function isKnowledgeShareRoute(path: string) {
|
||||
return path === '/share/knowledge' || path === '/share/knowledge/expired';
|
||||
function isExternalShareRoute(path: string) {
|
||||
return (
|
||||
path === '/share/knowledge' ||
|
||||
path === '/share/knowledge/expired' ||
|
||||
path === '/share/workflow' ||
|
||||
path === '/share/workflow/expired'
|
||||
);
|
||||
}
|
||||
|
||||
function isSlowNetworkConnection() {
|
||||
@@ -242,7 +247,7 @@ function setupAccessGuard(router: Router) {
|
||||
return buildForcePasswordRoute();
|
||||
}
|
||||
|
||||
if (isKnowledgeShareRoute(to.path)) {
|
||||
if (isExternalShareRoute(to.path)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -27,6 +27,31 @@ const routes: RouteRecordRaw[] = [
|
||||
hideInTab: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'WorkflowShare',
|
||||
path: '/share/workflow',
|
||||
component: () => import('#/views/ai/workflow/WorkflowShareView.vue'),
|
||||
meta: {
|
||||
title: 'Workflow Share',
|
||||
noBasicLayout: true,
|
||||
hideInMenu: true,
|
||||
hideInBreadcrumb: true,
|
||||
hideInTab: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'WorkflowShareExpired',
|
||||
path: '/share/workflow/expired',
|
||||
component: () =>
|
||||
import('#/views/ai/documentCollection/KnowledgeShareExpired.vue'),
|
||||
meta: {
|
||||
title: 'Workflow Share Expired',
|
||||
noBasicLayout: true,
|
||||
hideInMenu: true,
|
||||
hideInBreadcrumb: true,
|
||||
hideInTab: true,
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
export default routes;
|
||||
|
||||
Reference in New Issue
Block a user