Compare commits

...

3 Commits

Author SHA1 Message Date
yyh
d9f229815a refactor(web): remove assigner panel React.FC 2026-08-09 18:20:00 +08:00
yyh
db9333049f refactor(web): use css icon for assigner add 2026-08-09 18:18:46 +08:00
yyh
48aae30dc0 fix(web): name assigner add operation 2026-08-09 18:15:33 +08:00
2 changed files with 9 additions and 8 deletions

View File

@@ -105,7 +105,7 @@ describe('assigner/panel', () => {
}),
)
await user.click(screen.getAllByRole('button')[0]!)
await user.click(screen.getByRole('button', { name: 'common.operation.add' }))
expect(mockUseHandleAddOperationItem).toHaveBeenCalledWith(createData().items)
expect(handleOperationListChanges).toHaveBeenCalledWith([

View File

@@ -1,8 +1,6 @@
import type { FC } from 'react'
import type { AssignerNodeType } from './types'
import type { NodePanelProps } from '@/app/components/workflow/types'
import { RiAddLine } from '@remixicon/react'
import * as React from 'react'
import { memo } from 'react'
import { useTranslation } from 'react-i18next'
import ActionButton from '@/app/components/base/action-button'
import VarList from './components/var-list'
@@ -11,7 +9,7 @@ import useConfig from './use-config'
const i18nPrefix = 'nodes.assigner'
const Panel: FC<NodePanelProps<AssignerNodeType>> = ({ id, data }) => {
const Panel = ({ id, data }: NodePanelProps<AssignerNodeType>) => {
const { t } = useTranslation()
const handleAddOperationItem = useHandleAddOperationItem()
const {
@@ -38,8 +36,11 @@ const Panel: FC<NodePanelProps<AssignerNodeType>> = ({ id, data }) => {
<div className="flex grow flex-col items-start justify-center system-sm-semibold-uppercase text-text-secondary">
{t(($) => $[`${i18nPrefix}.variables`], { ns: 'workflow' })}
</div>
<ActionButton onClick={handleAddOperation}>
<RiAddLine className="size-4 shrink-0 text-text-tertiary" />
<ActionButton
aria-label={t(($) => $['operation.add'], { ns: 'common' })}
onClick={handleAddOperation}
>
<span aria-hidden="true" className="i-ri-add-line size-4 shrink-0 text-text-tertiary" />
</ActionButton>
</div>
<VarList
@@ -62,4 +63,4 @@ const Panel: FC<NodePanelProps<AssignerNodeType>> = ({ id, data }) => {
)
}
export default React.memo(Panel)
export default memo(Panel)