Browse Source

[Feature][UI Next] Add dag toolbar tooltip. (#8546)

* toolbar add tooltip

* fix toolbar workflow name dispaly bug
3.0.0/version-upgrade
Devosend 3 years ago committed by GitHub
parent
commit
f7722d9e01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      dolphinscheduler-ui-next/src/locales/modules/en_US.ts
  2. 5
      dolphinscheduler-ui-next/src/locales/modules/zh_CN.ts
  3. 41
      dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/dag-toolbar.tsx
  4. 7
      dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/dag.module.scss
  5. 2
      dolphinscheduler-ui-next/src/views/projects/workflow/instance/detail/index.tsx

5
dolphinscheduler-ui-next/src/locales/modules/en_US.ts

@ -564,7 +564,10 @@ const project = {
positive_integer: 'Please enter a positive integer greater than 0', positive_integer: 'Please enter a positive integer greater than 0',
prop_empty: 'prop is empty', prop_empty: 'prop is empty',
prop_repeat: 'prop is repeat', prop_repeat: 'prop is repeat',
node_not_created: 'Failed to save node not created' node_not_created: 'Failed to save node not created',
copy_name: 'Copy Name',
view_variables: 'View Variables',
startup_parameter: 'Startup Parameter'
}, },
node: { node: {
current_node_settings: 'Current node settings', current_node_settings: 'Current node settings',

5
dolphinscheduler-ui-next/src/locales/modules/zh_CN.ts

@ -562,7 +562,10 @@ const project = {
positive_integer: '请输入大于 0 的正整数', positive_integer: '请输入大于 0 的正整数',
prop_empty: '自定义参数prop不能为空', prop_empty: '自定义参数prop不能为空',
prop_repeat: 'prop中有重复', prop_repeat: 'prop中有重复',
node_not_created: '未创建节点保存失败' node_not_created: '未创建节点保存失败',
copy_name: '复制名称',
view_variables: '查看变量',
startup_parameter: '启动参数'
}, },
node: { node: {
current_node_settings: '当前节点设置', current_node_settings: '当前节点设置',

41
dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/dag-toolbar.tsx

@ -162,25 +162,43 @@ export default defineComponent({
Styles[themeStore.darkTheme ? 'toolbar-dark' : 'toolbar-light'] Styles[themeStore.darkTheme ? 'toolbar-dark' : 'toolbar-light']
]} ]}
> >
<div>
<span class={Styles['workflow-name']}> <span class={Styles['workflow-name']}>
{props.definition?.processDefinition?.name || {route.name === 'workflow-instance-detail'
? props.instance?.name
: props.definition?.processDefinition?.name ||
t('project.dag.create')} t('project.dag.create')}
</span> </span>
{props.definition?.processDefinition?.name && ( {props.definition?.processDefinition?.name && (
<NTooltip
v-slots={{
trigger: () => (
<NButton <NButton
quaternary quaternary
circle circle
onClick={() => copy(props.definition?.processDefinition?.name)} onClick={() => {
const name =
route.name === 'workflow-instance-detail'
? props.instance?.name
: props.definition?.processDefinition?.name
copy(name)
}}
class={Styles['toolbar-btn']} class={Styles['toolbar-btn']}
> >
<NIcon> <NIcon>
<CopyOutlined /> <CopyOutlined />
</NIcon> </NIcon>
</NButton> </NButton>
),
default: () => t('project.dag.copy_name')
}}
></NTooltip>
)} )}
<div class={Styles['toolbar-left-part']}>
{route.name === 'workflow-instance-detail' && ( {route.name === 'workflow-instance-detail' && (
<> <>
<NTooltip
v-slots={{
trigger: () => (
<NPopover <NPopover
show={paramPopoverRef.value} show={paramPopoverRef.value}
placement='bottom' placement='bottom'
@ -209,7 +227,13 @@ export default defineComponent({
default: () => <VariablesView onCopy={copy} /> default: () => <VariablesView onCopy={copy} />
}} }}
</NPopover> </NPopover>
),
default: () => t('project.dag.view_variables')
}}
></NTooltip>
<NTooltip
v-slots={{
trigger: () => (
<NPopover <NPopover
show={startupPopoverRef.value} show={startupPopoverRef.value}
placement='bottom' placement='bottom'
@ -221,7 +245,8 @@ export default defineComponent({
quaternary quaternary
circle circle
onClick={() => onClick={() =>
(startupPopoverRef.value = !startupPopoverRef.value) (startupPopoverRef.value =
!startupPopoverRef.value)
} }
class={Styles['toolbar-btn']} class={Styles['toolbar-btn']}
> >
@ -236,10 +261,14 @@ export default defineComponent({
</NText> </NText>
), ),
default: () => ( default: () => (
<StartupParam startupParam={props.instance.value} /> <StartupParam startupParam={props.instance} />
) )
}} }}
</NPopover> </NPopover>
),
default: () => t('project.dag.startup_parameter')
}}
></NTooltip>
</> </>
)} )}
</div> </div>

7
dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/dag.module.scss

@ -75,6 +75,7 @@ $bgLight: #ffffff;
.workflow-name { .workflow-name {
font-size: 14px; font-size: 14px;
font-weight: 700;
} }
.toolbar-btn { .toolbar-btn {
@ -228,6 +229,12 @@ $bgLight: #ffffff;
z-index: 9; z-index: 9;
} }
.toolbar-left-part {
display: flex;
align-items: center;
flex: 1;
}
.toolbar-right-part { .toolbar-right-part {
display: flex; display: flex;
align-items: center; align-items: center;

2
dolphinscheduler-ui-next/src/views/projects/workflow/instance/detail/index.tsx

@ -59,7 +59,7 @@ export default defineComponent({
]} ]}
> >
<Dag <Dag
instance={instance} instance={instance.value}
definition={definition.value} definition={definition.value}
onRefresh={refresh} onRefresh={refresh}
projectCode={projectCode} projectCode={projectCode}

Loading…
Cancel
Save