chore: replace all cn comments of fe to en version by volc api (#320)
This commit is contained in:
@@ -38,14 +38,14 @@ const hasHistory = (): boolean =>
|
||||
type NavigateScene = 'publish' | 'exit';
|
||||
|
||||
/**
|
||||
* 返回上一页逻辑
|
||||
* Return to previous page logic
|
||||
*/
|
||||
export const useNavigateBack = () => {
|
||||
const pageJumpResponse = usePageJumpResponse(PageType.WORKFLOW);
|
||||
const { jump } = usePageJumpService();
|
||||
const navigate = useNavigate();
|
||||
|
||||
/** 流程详情页路由更新会导致 pageJumpResponse 失效, 因此需要缓存一份原始版本 */
|
||||
/** Process details page route update will invalidate pageJumpResponse, so you need to cache a copy of the original version */
|
||||
const memoPageJumpResponse = useMemo(() => pageJumpResponse, []);
|
||||
|
||||
const navigateBack = async (
|
||||
@@ -71,12 +71,12 @@ export const useNavigateBack = () => {
|
||||
return;
|
||||
}
|
||||
|
||||
// 跳转回bot详情页,并带上场景参数
|
||||
// Jump back to the bot details page with scene parameters
|
||||
if (memoPageJumpResponse?.scene) {
|
||||
if (scene === 'publish') {
|
||||
let pluginID = plugin_id;
|
||||
|
||||
// 第一次发布流程时,需要重新从接口获取pluginID
|
||||
// When you publish the process for the first time, you need to retrieve the pluginID from the interface again.
|
||||
if (!pluginID || pluginID === '0') {
|
||||
const workflowRes = await workflowApi.GetCanvasInfo(
|
||||
{
|
||||
@@ -143,9 +143,9 @@ export const useNavigateBack = () => {
|
||||
namespace: 'workflow',
|
||||
eventName: 'workflow_navigate_back_to_list',
|
||||
});
|
||||
// 如果 history 就一个页面,此时 navigate(-1) 不生效,需要手动指定路径
|
||||
// 目前先写死路径,缺点是需要跟随页面结构更改而更改,后面再优化更好的实现
|
||||
// /library 为 coze 2.0 混排资源列表页
|
||||
// If history is only one page, navigate (-1) does not take effect at this time, you need to manually specify the path
|
||||
// At present, the dead path is written first. The disadvantage is that it needs to be changed with the change of the page structure, and then optimized for a better implementation later.
|
||||
// /library coze 2.0 mixed resource list page
|
||||
navigate(`/space/${spaceId}/library`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -22,23 +22,23 @@ import { OperateType } from '@coze-workflow/base/api';
|
||||
import { I18n } from '@coze-arch/i18n';
|
||||
import { Toast } from '@coze-arch/coze-design';
|
||||
|
||||
/** 流程详情页参数 */
|
||||
/** Process details page parameters */
|
||||
interface SearchParams {
|
||||
workflow_id: string;
|
||||
space_id: string;
|
||||
/** 流程版本, 当多人协作时有版本概念, 单独设置时可预览对应版本流程 */
|
||||
/** Process version, when multiple people cooperate, there is a version concept, and the corresponding version process can be previewed when set separately */
|
||||
version?: string;
|
||||
/** 是否要恢复到目标版本, 如果设置, 则流程草稿会自动设置到对应 version */
|
||||
/** Whether to restore to the target version, if set, the process draft will be automatically set to the corresponding version */
|
||||
set_version?: string;
|
||||
/** 对应 version 的操作类型 */
|
||||
/** Corresponding version of the operation type */
|
||||
opt_type?: string;
|
||||
/** 流程页面打开来源 */
|
||||
/** Process page open source */
|
||||
from?: WorkflowPlaygroundProps['from'];
|
||||
/** 节点id 配置会自动定位到对应节点 */
|
||||
/** The node id configuration will automatically locate to the corresponding node. */
|
||||
node_id?: string;
|
||||
/** 执行id 配置会展示对应执行结果 */
|
||||
/** The execution id configuration will display the corresponding execution result. */
|
||||
execute_id?: string;
|
||||
/** 子流程执行id */
|
||||
/** subprocess execution id */
|
||||
sub_execute_id?: string;
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ export function usePageParams() {
|
||||
needUpdateSearch = true;
|
||||
}
|
||||
|
||||
// 强制设置历史版本
|
||||
// Force setting of historical version
|
||||
if (setVersion) {
|
||||
newSearchParams.delete('set_version');
|
||||
newSearchParams.delete('version');
|
||||
|
||||
@@ -26,7 +26,7 @@ import {
|
||||
import { usePageParams } from './hooks/use-page-params';
|
||||
import { useNavigateBack } from './hooks';
|
||||
|
||||
// 添加节点放在工具栏了,原来侧边栏不需要了
|
||||
// The added node is placed in the toolbar, but the original sidebar is no longer needed.
|
||||
const EmptySidebar = React.forwardRef<AddNodeRef, unknown>(
|
||||
(_props, _addNodeRef) => null,
|
||||
);
|
||||
@@ -48,7 +48,7 @@ export function WorkflowPage(): React.ReactNode {
|
||||
const [initOnce, setInitOnce] = useState(false);
|
||||
const { navigateBack } = useNavigateBack();
|
||||
|
||||
/** 是否只读模式, 来源于流程探索模块 */
|
||||
/** Whether it is read-only mode, derived from the process exploration module */
|
||||
const readonly = from === 'explore';
|
||||
|
||||
if (!workflowId || !spaceId) {
|
||||
@@ -75,14 +75,14 @@ export function WorkflowPage(): React.ReactNode {
|
||||
});
|
||||
}
|
||||
|
||||
// onInit可能被多次调用 这里只需要执行一次
|
||||
// onInit may be called multiple times, it only needs to be executed once
|
||||
if (!initOnce) {
|
||||
// 读取链接上的node_id参数 滚动到对应节点
|
||||
// Read the node_id parameters on the link and scroll to the corresponding node
|
||||
if (nodeId) {
|
||||
workflowPlaygroundRef.current?.scrollToNode(nodeId);
|
||||
}
|
||||
|
||||
// 读取execute_id 展示对应执行结果
|
||||
// Read execute_id show the corresponding execution result
|
||||
if (executeId) {
|
||||
workflowPlaygroundRef.current?.showTestRunResult(
|
||||
executeId,
|
||||
|
||||
Reference in New Issue
Block a user