fix(plugin-workflow): fix style details (#6240)

* fix(plugin-workflow): fix style details

* fix(plugin-workflow): revert node id back due to e2e fails
This commit is contained in:
Junyi 2025-02-19 16:58:28 +08:00 committed by GitHub
parent 1955499178
commit e827c5823f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 23 additions and 13 deletions

View File

@ -109,6 +109,8 @@ export default class extends Instruction {
padding-top: 2em; padding-top: 2em;
> button { > button {
line-height: 1;
.anticon { .anticon {
transform: rotate(45deg); transform: rotate(45deg);
} }
@ -140,6 +142,7 @@ export default class extends Instruction {
className={css` className={css`
position: relative; position: relative;
top: 1em; top: 1em;
line-height: 1;
transform-origin: center; transform-origin: center;
transform: rotate(45deg); transform: rotate(45deg);

View File

@ -43,7 +43,7 @@ const useStyles = createStyles(({ css, token }) => {
}); });
export function DrawerDescription(props) { export function DrawerDescription(props) {
const { label, title, description } = props; const { label, title, icon, description } = props;
const { styles } = useStyles(); const { styles } = useStyles();
return ( return (
@ -51,7 +51,9 @@ export function DrawerDescription(props) {
<dl> <dl>
<dt>{label}</dt> <dt>{label}</dt>
<dd> <dd>
<Tag style={{ background: 'none' }}>{title}</Tag> <Tag icon={icon} style={{ background: 'none' }}>
{title}
</Tag>
</dd> </dd>
</dl> </dl>
{description ? <p>{description}</p> : null} {description ? <p>{description}</p> : null}

View File

@ -697,6 +697,7 @@ export function NodeDefaultView(props) {
'x-component-props': { 'x-component-props': {
label: lang('Node type'), label: lang('Node type'),
title: instruction.title, title: instruction.title,
icon: instruction.icon,
description: instruction.description, description: instruction.description,
}, },
}, },

View File

@ -256,7 +256,7 @@ const useStyles = createStyles(({ css, token }) => {
position: relative; position: relative;
width: 16em; width: 16em;
background: ${token.colorBgContainer}; background: ${token.colorBgContainer};
padding: 1em; padding: 0.75em;
box-shadow: ${token.boxShadowTertiary}; box-shadow: ${token.boxShadowTertiary};
border-radius: ${token.borderRadiusLG}px; border-radius: ${token.borderRadiusLG}px;
cursor: pointer; cursor: pointer;
@ -266,7 +266,7 @@ const useStyles = createStyles(({ css, token }) => {
box-shadow: ${token.boxShadow}; box-shadow: ${token.boxShadow};
.workflow-node-remove-button { .workflow-node-remove-button {
display: block; opacity: 1;
} }
} }
@ -275,11 +275,10 @@ const useStyles = createStyles(({ css, token }) => {
} }
.workflow-node-remove-button { .workflow-node-remove-button {
display: none; opacity: 0;
position: absolute;
right: 0;
top: 0;
color: ${token.colorText}; color: ${token.colorText};
font-size: ${token.fontSizeIcon}px;
line-height: 1em;
&[disabled] { &[disabled] {
display: none; display: none;
@ -325,9 +324,6 @@ const useStyles = createStyles(({ css, token }) => {
nodeJobButtonClass: css` nodeJobButtonClass: css`
display: flex; display: flex;
position: absolute;
top: 0;
right: 0;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
color: ${token.colorTextLightSolid}; color: ${token.colorTextLightSolid};
@ -335,19 +331,27 @@ const useStyles = createStyles(({ css, token }) => {
nodeHeaderClass: css` nodeHeaderClass: css`
display: flex; display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 0.5em; margin-bottom: 0.5em;
.workflow-node-actions { .workflow-node-actions {
position: relative;
} }
`, `,
nodeMetaClass: css` nodeMetaClass: css`
flex-grow: 1; flex-grow: 1;
display: flex;
align-items: center;
.ant-tag {
max-width: 10em;
overflow: hidden;
text-overflow: ellipsis;
}
.workflow-node-id { .workflow-node-id {
color: ${token.colorTextDescription}; color: ${token.colorTextDescription};
&:before { &:before {
content: '#'; content: '#';
} }