Skip to content

Commit

Permalink
节点勾选/取消勾选逻辑错误问题修复&&文案修改 (#7084)
Browse files Browse the repository at this point in the history
  • Loading branch information
ywywZhou authored Sep 18, 2023
1 parent ad944aa commit 6e362b6
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
<i
:class="['common-icon-variable-hook hook-icon', { actived: hook, disabled: !option.formEdit || !render }]"
v-bk-tooltips="{
content: hook ? $t('取消变量引用') : $t('设置为变量'),
content: hook ? $t('恢复为非变量节点内维护') : $t('转换为变量集中维护'),
placement: 'bottom',
zIndex: 3000
}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
<i
:class="['common-icon-variable-hook hook-icon', { actived: hook, disabled: !option.formEdit || !render }]"
v-bk-tooltips="{
content: hook ? $t('取消变量引用') : $t('设置为变量'),
content: hook ? $t('恢复为非变量节点内维护') : $t('转换为变量集中维护'),
placement: 'bottom',
zIndex: 3000
}"
Expand Down
15 changes: 12 additions & 3 deletions frontend/desktop/src/config/i18n/cn.js
Original file line number Diff line number Diff line change
Expand Up @@ -1405,9 +1405,18 @@ const cn = {
'变量豁免': '变量豁免',
'取消变量引用': '取消变量引用',
'变量引用': '变量引用',
'设置为变量&变量免渲染使用指引': '设置为变量&变量免渲染使用指引',
'设置为变量:将节点的输入或输出设置为全局变量,可供其他节点使用': '设置为变量:将节点的输入或输出设置为全局变量,可供其他节点使用',
'变量免渲染:忽略参数中的全局变量,将${}视为普通字符串': '变量免渲染:忽略参数中的全局变量,将${}视为普通字符串',
'转换为变量和恢复为非变量使用说明': '转换为变量和恢复为非变量使用说明',
'利用节点的参数创建一个对应组件类型的变量,如已存在该类型变量则可直接使用': '利用节点的参数创建一个对应组件类型的变量,如已存在该类型变量则可直接使用',
'使用这种转换,可将多个节点的同一配置项统一起来,利用变量集中维护': '使用这种转换,可将多个节点的同一配置项统一起来,利用变量集中维护',
'当所有使用该变量的参数恢复为节点内维护,则自动删除变量': '当所有使用该变量的参数恢复为节点内维护,则自动删除变量',
'接收输出和取消接收使用说明': '接收输出和取消接收使用说明',
'自动创建一个节点输出类型变量来接收任务执行时节点的输出': '自动创建一个节点输出类型变量来接收任务执行时节点的输出',
'后续节点可引用变量来获取该节点的输出': '后续节点可引用变量来获取该节点的输出',
'取消接收输出则自动删除变量': '取消接收输出则自动删除变量',
'转换为变量集中维护': '转换为变量集中维护',
'恢复为非变量节点内维护': '恢复为非变量节点内维护',
'使用变量接收输出': '使用变量接收输出',
'取消接收输出': '取消接收输出',
'流程当前被使用中,无法删除': '流程当前被使用中,无法删除',
'以下情况参数值无法复用,将使用全局变量的默认值:': '以下情况参数值无法复用,将使用全局变量的默认值:',
'变量的类型变更': '变量的类型变更',
Expand Down
17 changes: 13 additions & 4 deletions frontend/desktop/src/config/i18n/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -1415,7 +1415,7 @@ const en = {
'返回编辑': 'Back To Edit',
'周期任务根据创建时的流程和执行方案数据生成快照保存,流程变更后不影响周期任务,可手动更新到使用流程最新数据。': 'Cron tasks generate snapshots and save according to the flow and node-group data at the time of creation. After the flow is changed, it does not affect the cron tasks, and can be manually updated to use the latest version of the flow.',
'不使用执行方案': 'Don\'t use node-group',
'当前流程非最新,执行方案不可更改,请先更新流程': '当前流程非最新,执行方案不可更改,请先更新流程',
'当前流程非最新,执行方案不可更改,请先更新流程': 'The current flow is not the latest version and the step-group cannot be modified. Please update the flow first.',
'执行代理人在任务开始执行时确定,未执行任务不展示': 'The agent is determined when the task starts to execute, and the unexecuted task will not be displayed',
'计划任务在执行时获取最新的流程和执行方案数据创建任务,流程和方案变更将影响未执行的计划任务,如增加参数可能导致计划任务启动失败。': 'When a scheduled task is executed, it get the latest version from the flow and node-group to create a task. Changes to the flow and plan will affect the unexecuted scheduled task. For example, adding parameters may cause the scheduled task to fail to start.',
'未能重用': 'Failed to reuse',
Expand Down Expand Up @@ -1443,9 +1443,18 @@ const en = {
'变量豁免': 'Variable exemption',
'取消变量引用': 'Unlink Variable',
'变量引用': 'Variable Used',
'设置为变量&变量免渲染使用指引': 'User manual for set as a variable & variable rendering-free',
'设置为变量:将节点的输入或输出设置为全局变量,可供其他节点使用': "Set as variable: Set the node's input or output as a global variable that can be used by other nodes",
'变量免渲染:忽略参数中的全局变量,将${}视为普通字符串': 'Variable-free rendering: ignore global variables in parameters, treat ${} as a normal string',
'转换为变量和恢复为非变量使用说明': 'Instructions for converting to variable and restoring to non-variable',
'利用节点的参数创建一个对应组件类型的变量,如已存在该类型变量则可直接使用': "Create a variable of the corresponding component type using the node's parameter, If a variable of the same type already exists, it can be used directly. ",
'使用这种转换,可将多个节点的同一配置项统一起来,利用变量集中维护': 'By using this conversion, the same configuration item of multiple nodes can be unified and maintained centrally using variable.',
'当所有使用该变量的参数恢复为节点内维护,则自动删除变量': 'When all parameters using this variable are restored to node-internal maintenance, it will automatically delete the variable.',
'接收输出和取消接收使用说明': 'Instructions for receiving output and canceling receive output',
'自动创建一个节点输出类型变量来接收任务执行时节点的输出': 'Automatically create a node output type variable to receive the output of the node during task execution.',
'后续节点可引用变量来获取该节点的输出': 'Subsequent nodes can reference the variable to get the output of the node.',
'取消接收输出则自动删除变量': 'Canceling receive output will automatically delete the variable.',
'转换为变量集中维护': 'Convert to variable for centralized maintenance',
'恢复为非变量节点内维护': 'Restore to non-variable for node-internal maintenance',
'使用变量接收输出': 'Use variable to receive output',
'取消接收输出': 'Cancel receiving output',
'流程当前被使用中,无法删除': 'The flow is being used and can not be deleted',
'以下情况参数值无法复用,将使用全局变量的默认值:': 'The parameter value cannot be reused in the following cases, and the global variable default value is used:',
'变量的类型变更': 'Variable type change',
Expand Down
3 changes: 2 additions & 1 deletion frontend/desktop/src/pages/task/TaskCreate/TaskScheme.vue
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,8 @@
async initLoad () {
try {
await this.loadDefaultSchemeList()
this.loadSchemeList()
await this.loadSchemeList()
this.showPanel = !!this.schemeList.length
} catch (error) {
console.warn(error)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,13 @@
</i>
</h3>
<p class="citations-waivers-guide">
<bk-popover placement="top-end" theme="light" width="258" :ext-cls="'citations-waivers-guide-tip'">
<bk-popover placement="top-end" theme="light" width="350" :ext-cls="'citations-waivers-guide-tip'">
<i class="bk-icon icon-info-circle-shape"></i>
{{ $t('设置为变量&变量免渲染使用指引') }}
{{ $t('转换为变量和恢复为非变量使用说明') }}
<div slot="content">
<p>{{ $t('设置为变量:将节点的输入或输出设置为全局变量,可供其他节点使用') }}</p><br>
<p>{{ $t('变量免渲染:忽略参数中的全局变量,将${}视为普通字符串') }}</p>
<p>{{ $t('利用节点的参数创建一个对应组件类型的变量,如已存在该类型变量则可直接使用') }}</p><br>
<p>{{ $t('使用这种转换,可将多个节点的同一配置项统一起来,利用变量集中维护') }}</p><br>
<p>{{ $t('当所有使用该变量的参数恢复为节点内维护,则自动删除变量') }}</p>
</div>
</bk-popover>
</p>
Expand Down Expand Up @@ -250,6 +251,17 @@
<!-- 输出参数 -->
<section class="config-section" data-test-id="templateEdit_form_outputParamsInfo">
<h3>{{$t('输出参数')}}</h3>
<p class="citations-waivers-guide">
<bk-popover placement="top-end" theme="light" width="350" :ext-cls="'citations-waivers-guide-tip'">
<i class="bk-icon icon-info-circle-shape"></i>
{{ $t('接收输出和取消接收使用说明') }}
<div slot="content">
<p>{{ $t('自动创建一个节点输出类型变量来接收任务执行时节点的输出') }}</p><br>
<p>{{ $t('后续节点可引用变量来获取该节点的输出') }}</p><br>
<p>{{ $t('取消接收输出则自动删除变量') }}</p>
</div>
</bk-popover>
</p>
<div class="outputs-wrapper" v-bkloading="{ isLoading: outputLoading, zIndex: 100 }">
<template v-if="!outputLoading">
<output-params
Expand Down Expand Up @@ -1291,8 +1303,6 @@
// 当变量来源为0时,自动删除变量
if (sourceInfo[id].length <= 1) {
this.$delete(sourceInfo, id)
this.deleteUnhookingVar()
return
} else {
let atomIndex
sourceInfo[id].some((item, index) => {
Expand All @@ -1303,6 +1313,9 @@
})
sourceInfo[id].splice(atomIndex, 1)
}
if (Object.keys(sourceInfo).length === 0) {
this.$delete(this.localConstants, key)
}
const refDom = source === 'input' ? this.$refs.inputParams : this.$refs.outputParams
refDom && refDom.setFormData({ ...this.unhookingVarForm })
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
disabled: isViewMode || !hook
}]"
v-bk-tooltips="{
content: props.row.hooked ? $t('取消变量引用') : $t('设置为变量'),
content: props.row.hooked ? $t('取消接收输出') : $t('使用变量接收输出'),
placement: 'bottom',
zIndex: 3000
}"
Expand Down

0 comments on commit 6e362b6

Please sign in to comment.