fix(web): nav icons

This commit is contained in:
JzoNg
2026-04-20 15:47:34 +08:00
parent bd136cadce
commit b6fbec066d
16 changed files with 140 additions and 41 deletions

View File

@@ -0,0 +1,5 @@
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M3 2.25C3.41421 2.25 3.75 2.58579 3.75 3V15C3.75 15.4142 3.41421 15.75 3 15.75C2.58579 15.75 2.25 15.4142 2.25 15V3C2.25 2.58579 2.58579 2.25 3 2.25Z" fill="#676F83"/>
<path d="M15 2.25C15.4142 2.25 15.75 2.58579 15.75 3V15C15.75 15.4142 15.4142 15.75 15 15.75C14.5858 15.75 14.25 15.4142 14.25 15V3C14.25 2.58579 14.5858 2.25 15 2.25Z" fill="#676F83"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M10.125 4.5C10.5392 4.5 10.875 4.83579 10.875 5.25V12.75C10.875 13.1642 10.5392 13.5 10.125 13.5H7.875C7.46079 13.5 7.125 13.1642 7.125 12.75V5.25C7.125 4.83579 7.46079 4.5 7.875 4.5H10.125ZM8.625 12H9.375V6H8.625V12Z" fill="#676F83"/>
</svg>

After

Width:  |  Height:  |  Size: 751 B

View File

@@ -0,0 +1,5 @@
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M15 14.25C15.4142 14.25 15.75 14.5858 15.75 15C15.75 15.4142 15.4142 15.75 15 15.75H3C2.58579 15.75 2.25 15.4142 2.25 15C2.25 14.5858 2.58579 14.25 3 14.25H15Z" fill="#676F83"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M13.5 7.125C13.9142 7.125 14.25 7.46079 14.25 7.875V10.125C14.25 10.5392 13.9142 10.875 13.5 10.875H4.5C4.08579 10.875 3.75 10.5392 3.75 10.125V7.875C3.75 7.46079 4.08579 7.125 4.5 7.125H13.5ZM5.25 9.375H12.75V8.625H5.25V9.375Z" fill="#676F83"/>
<path d="M15 2.25C15.4142 2.25 15.75 2.58579 15.75 3C15.75 3.41421 15.4142 3.75 15 3.75H3C2.58579 3.75 2.25 3.41421 2.25 3C2.25 2.58579 2.58579 2.25 3 2.25H15Z" fill="#676F83"/>
</svg>

After

Width:  |  Height:  |  Size: 763 B

View File

@@ -0,0 +1,3 @@
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M3 15V3.75V12.2625V10.6688V15ZM2.5 16.5C1.94772 16.5 1.5 16.0523 1.5 15.5V3.25C1.5 2.69771 1.94772 2.25 2.5 2.25H15.5C16.0523 2.25 16.5 2.69772 16.5 3.25V10.5H15V3.75H3V15H9V16.5H2.5ZM13.0125 17.25L10.35 14.5875L11.4188 13.5375L13.0125 15.1312L16.2 11.9438L17.25 13.0125L13.0125 17.25ZM7.5 9.75H13.5V8.25H7.5V9.75ZM7.5 6.75H13.5V5.25H7.5V6.75ZM4.5 9.75H6V8.25H4.5V9.75ZM4.5 6.75H6V5.25H4.5V6.75Z" fill="#495464"/>
</svg>

After

Width:  |  Height:  |  Size: 526 B

View File

@@ -1,6 +1,6 @@
{
"prefix": "custom-public",
"lastModified": 1776313052,
"lastModified": 1776670225,
"icons": {
"avatar-user": {
"body": "<g fill=\"none\"><g clip-path=\"url(#svgID0)\"><rect width=\"512\" height=\"512\" fill=\"currentColor\" rx=\"256\"/></g><defs><clipPath id=\"svgID0\"><rect width=\"512\" height=\"512\" fill=\"#fff\" rx=\"256\"/></clipPath></defs></g>",

View File

@@ -1,6 +1,6 @@
{
"prefix": "custom-vender",
"lastModified": 1776313052,
"lastModified": 1776670225,
"icons": {
"features-citations": {
"body": "<path fill=\"currentColor\" d=\"M1 12C1 5.925 5.925 1 12 1s11 4.925 11 11s-4.925 11-11 11S1 18.075 1 12m6-.03v2.988h4.036v-3.724H8.813a2.5 2.5 0 0 1 .212-1.204q.495-1.104 1.94-1.557V7q-1.94.383-2.96 1.614Q7 9.847 7 11.97m8.04-1.911q.495-1.148 1.925-1.586V7q-1.884.382-2.931 1.6Q13 9.818 13 11.97v2.988h4.036v-3.724h-2.224q-.056-.567.227-1.175\"/>"
@@ -513,12 +513,27 @@
"width": 14,
"height": 14
},
"line-others-dhs": {
"body": "<g fill=\"currentColor\"><path d=\"M3 2.25a.75.75 0 0 1 .75.75v12a.75.75 0 0 1-1.5 0V3A.75.75 0 0 1 3 2.25m12 0a.75.75 0 0 1 .75.75v12a.75.75 0 0 1-1.5 0V3a.75.75 0 0 1 .75-.75\"/><path fill-rule=\"evenodd\" d=\"M10.125 4.5a.75.75 0 0 1 .75.75v7.5a.75.75 0 0 1-.75.75h-2.25a.75.75 0 0 1-.75-.75v-7.5a.75.75 0 0 1 .75-.75zm-1.5 7.5h.75V6h-.75z\" clip-rule=\"evenodd\"/></g>",
"width": 18,
"height": 18
},
"line-others-drag-handle": {
"body": "<path fill=\"currentColor\" fill-rule=\"evenodd\" d=\"M6 5a1 1 0 1 0 0-2a1 1 0 0 0 0 2m0 4a1 1 0 1 0 0-2a1 1 0 0 0 0 2m5-5a1 1 0 1 1-2 0a1 1 0 0 1 2 0m-1 5a1 1 0 1 0 0-2a1 1 0 0 0 0 2m-3 3a1 1 0 1 1-2 0a1 1 0 0 1 2 0m3 1a1 1 0 1 0 0-2a1 1 0 0 0 0 2\" clip-rule=\"evenodd\"/>"
},
"line-others-dvs": {
"body": "<g fill=\"currentColor\"><path d=\"M15 14.25a.75.75 0 0 1 0 1.5H3a.75.75 0 0 1 0-1.5z\"/><path fill-rule=\"evenodd\" d=\"M13.5 7.125a.75.75 0 0 1 .75.75v2.25a.75.75 0 0 1-.75.75h-9a.75.75 0 0 1-.75-.75v-2.25a.75.75 0 0 1 .75-.75zm-8.25 2.25h7.5v-.75h-7.5z\" clip-rule=\"evenodd\"/><path d=\"M15 2.25a.75.75 0 0 1 0 1.5H3a.75.75 0 0 1 0-1.5z\"/></g>",
"width": 18,
"height": 18
},
"line-others-env": {
"body": "<path fill=\"currentColor\" fill-rule=\"evenodd\" d=\"M1.333 3.333a2 2 0 0 1 2-2h9.334a2 2 0 0 1 2 2v.334a.667.667 0 0 1-1.334 0v-.334a.667.667 0 0 0-.666-.666H3.333a.667.667 0 0 0-.666.666v.334a.667.667 0 0 1-1.334 0zm13.334 9.334a2 2 0 0 1-2 2H3.333a2 2 0 0 1-2-2v-.334a.667.667 0 1 1 1.334 0v.334c0 .368.298.666.666.666h9.334a.667.667 0 0 0 .666-.666v-.334a.667.667 0 1 1 1.334 0zM1.333 6c0-.368.299-.667.667-.667h2.333a.667.667 0 0 1 0 1.334H2.667v.666H4a.667.667 0 0 1 0 1.334H2.667v.666h1.666a.667.667 0 0 1 0 1.334H2A.667.667 0 0 1 1.333 10zm5.14-.638a.67.67 0 0 1 .748.268l1.446 2.168V6A.667.667 0 1 1 10 6v4a.667.667 0 0 1-1.221.37L7.333 8.202V10A.667.667 0 1 1 6 10V6c0-.294.192-.553.473-.638m4.604.023c.34-.142.73.019.872.359l1.05 2.523l1.052-2.523a.667.667 0 1 1 1.231.512l-1.667 4a.667.667 0 0 1-1.23 0l-1.667-4a.667.667 0 0 1 .359-.871\" clip-rule=\"evenodd\"/>"
},
"line-others-evaluation": {
"body": "<path fill=\"currentColor\" d=\"M3 15V3.75v8.513v-1.594zm-.5 1.5a1 1 0 0 1-1-1V3.25a1 1 0 0 1 1-1h13a1 1 0 0 1 1 1v7.25H15V3.75H3V15h6v1.5zm10.513.75l-2.663-2.662l1.069-1.05l1.593 1.593l3.188-3.187l1.05 1.068zM7.5 9.75h6v-1.5h-6zm0-3h6v-1.5h-6zm-3 3H6v-1.5H4.5zm0-3H6v-1.5H4.5z\"/>",
"width": 18,
"height": 18
},
"line-others-global-variable": {
"body": "<path fill=\"currentColor\" fill-rule=\"evenodd\" d=\"M6.238 1.333h3.524c.722 0 1.305 0 1.777.039c.486.04.913.123 1.308.325c.627.32 1.137.83 1.456 1.456c.202.395.285.822.325 1.308c.039.472.039 1.055.039 1.777v3.524c0 .722 0 1.305-.039 1.777c-.04.486-.123.913-.325 1.308a3.33 3.33 0 0 1-1.456 1.456c-.395.201-.822.285-1.308.325c-.472.039-1.055.039-1.777.039H6.238c-.722 0-1.305 0-1.777-.039c-.486-.04-.913-.123-1.308-.325a3.33 3.33 0 0 1-1.456-1.456c-.202-.395-.285-.822-.325-1.308c-.039-.472-.039-1.055-.039-1.777V6.238c0-.722 0-1.305.039-1.777c.04-.486.123-.913.325-1.308c.32-.627.83-1.137 1.456-1.456c.395-.202.822-.285 1.308-.325c.472-.039 1.055-.039 1.777-.039M4.57 2.701c-.403.033-.635.094-.81.184a2 2 0 0 0-.874.874c-.09.175-.151.407-.184.81c-.034.412-.034.94-.034 1.698v3.466c0 .758 0 1.286.034 1.697c.033.404.094.636.184.811a2 2 0 0 0 .874.874c.175.09.407.151.81.184c.412.034.94.034 1.698.034h3.466c.758 0 1.286 0 1.697-.034c.404-.033.636-.094.811-.184a2 2 0 0 0 .874-.874c.09-.175.151-.407.184-.81c.034-.412.034-.94.034-1.698V6.267c0-.758 0-1.286-.034-1.698c-.033-.403-.094-.635-.184-.81a2 2 0 0 0-.874-.874c-.175-.09-.407-.151-.81-.184c-.412-.034-.94-.034-1.698-.034H6.267c-.758 0-1.286 0-1.698.034m.514 2.632c0-.368.299-.666.667-.666h.934c.64 0 1.192.43 1.363 1.038l.254.904l.99-1.173a2.16 2.16 0 0 1 1.649-.77H11A.667.667 0 1 1 11 6h-.06c-.24 0-.47.106-.63.295L8.739 8.16l.498 1.774c.013.045.05.066.08.066h.934a.667.667 0 0 1 0 1.333h-.934c-.64 0-1.192-.43-1.363-1.038L7.7 9.391l-.99 1.173a2.16 2.16 0 0 1-1.649.77H5A.667.667 0 1 1 5 10h.06c.24 0 .47-.106.63-.295L7.262 7.84l-.5-1.774A.08.08 0 0 0 6.685 6H5.75a.667.667 0 0 1-.667-.667\" clip-rule=\"evenodd\"/>"
},

View File

@@ -1,7 +1,7 @@
{
"prefix": "custom-vender",
"name": "Dify Custom Vender",
"total": 278,
"total": 281,
"version": "0.0.0-private",
"author": {
"name": "LangGenius, Inc.",

View File

@@ -8,8 +8,6 @@ import {
RiDashboard2Line,
RiFileList3Fill,
RiFileList3Line,
RiFlaskFill,
RiFlaskLine,
RiTerminalBoxFill,
RiTerminalBoxLine,
RiTerminalWindowFill,
@@ -43,6 +41,10 @@ type IAppDetailLayoutProps = {
appId: string
}
const EvaluationIcon = ({ className }: { className?: string }) => {
return <span aria-hidden className={cn('i-custom-vender-line-others-evaluation', className)} />
}
const AppDetailLayout: FC<IAppDetailLayoutProps> = (props) => {
const {
children,
@@ -80,14 +82,6 @@ const AppDetailLayout: FC<IAppDetailLayoutProps> = (props) => {
icon: RiTerminalWindowLine,
selectedIcon: RiTerminalWindowFill,
})
if (canAccessSnippetsAndEvaluation) {
navConfig.push({
name: t('appMenus.evaluation', { ns: 'common' }),
href: `/app/${appId}/evaluation`,
icon: RiFlaskLine,
selectedIcon: RiFlaskFill,
})
}
}
navConfig.push({
@@ -114,6 +108,16 @@ const AppDetailLayout: FC<IAppDetailLayoutProps> = (props) => {
icon: RiDashboard2Line,
selectedIcon: RiDashboard2Fill,
})
if (isCurrentWorkspaceEditor && canAccessSnippetsAndEvaluation) {
navConfig.push({
name: t('appMenus.evaluation', { ns: 'common' }),
href: `/app/${appId}/evaluation`,
icon: EvaluationIcon,
selectedIcon: EvaluationIcon,
})
}
return navConfig
}, [canAccessSnippetsAndEvaluation, t])

View File

@@ -7,8 +7,6 @@ import {
RiEqualizer2Line,
RiFileTextFill,
RiFileTextLine,
RiFlaskFill,
RiFlaskLine,
RiFocus2Fill,
RiFocus2Line,
} from '@remixicon/react'
@@ -34,6 +32,10 @@ type IAppDetailLayoutProps = {
datasetId: string
}
const EvaluationIcon = ({ className }: { className?: string }) => {
return <span aria-hidden className={cn('i-custom-vender-line-others-evaluation', className)} />
}
const DatasetDetailLayout: FC<IAppDetailLayoutProps> = (props) => {
const {
children,
@@ -106,16 +108,16 @@ const DatasetDetailLayout: FC<IAppDetailLayoutProps> = (props) => {
selectedIcon: PipelineFill as RemixiconComponentType,
disabled: false,
},
...baseNavigation,
...(isRagPipelineDataset && canAccessSnippetsAndEvaluation
? [{
name: t('datasetMenus.evaluation', { ns: 'common' }),
href: `/datasets/${datasetId}/evaluation`,
icon: RiFlaskLine,
selectedIcon: RiFlaskFill,
icon: EvaluationIcon,
selectedIcon: EvaluationIcon,
disabled: isButtonDisabledWithPipeline,
}]
: []),
...baseNavigation,
]
}

View File

@@ -205,7 +205,7 @@ export const PublisherSummarySection = ({
<ActionTooltip disabled={workflowTypeSwitchDisabled} tooltip={workflowTypeSwitchDisabledReason}>
<button
type="button"
className="flex h-8 w-full items-center justify-center gap-0.5 rounded-lg px-3 py-2 system-sm-medium text-text-tertiary hover:bg-state-base-hover disabled:cursor-not-allowed disabled:opacity-50"
className="mt-1 flex h-8 w-full items-center justify-center gap-0.5 rounded-lg px-3 py-2 system-sm-medium text-text-tertiary hover:bg-state-base-hover disabled:cursor-not-allowed disabled:opacity-50"
onClick={() => void onWorkflowTypeSwitch()}
disabled={workflowTypeSwitchDisabled}
>

View File

@@ -40,13 +40,21 @@ vi.mock('@/app/components/app-sidebar', () => ({
}))
vi.mock('@/app/components/app-sidebar/nav-link', () => ({
default: ({ name, href, active }: { name: string, href: string, active: boolean }) => (
<a
aria-current={active ? 'page' : undefined}
href={href}
>
{name}
</a>
default: ({ name, href, active, disabled }: { name: string, href: string, active: boolean, disabled?: boolean }) => (
disabled
? (
<button type="button" disabled>
{name}
</button>
)
: (
<a
aria-current={active ? 'page' : undefined}
href={href}
>
{name}
</a>
)
),
}))
@@ -63,6 +71,7 @@ const createSnippet = (overrides: Partial<SnippetDetail> = {}): SnippetDetail =>
usage: '42',
icon: 'emoji',
iconBackground: '#ffffff',
is_published: true,
...overrides,
})
@@ -104,5 +113,20 @@ describe('SnippetLayout', () => {
expect(screen.getByRole('link', { name: 'snippet.sectionEvaluation' })).toHaveAttribute('href', '/snippets/snippet-1/evaluation')
expect(screen.getByRole('link', { name: 'snippet.sectionEvaluation' })).toHaveAttribute('aria-current', 'page')
})
it('should disable the evaluation menu when the snippet is unpublished', () => {
render(
<SnippetLayout
snippetId="snippet-1"
snippet={createSnippet({ is_published: false })}
section="orchestrate"
>
<div>content</div>
</SnippetLayout>,
)
expect(screen.getByRole('button', { name: 'snippet.sectionEvaluation' })).toBeDisabled()
expect(screen.queryByRole('link', { name: 'snippet.sectionEvaluation' })).not.toBeInTheDocument()
})
})
})

View File

@@ -6,6 +6,7 @@ const mockMutateAsync = vi.fn()
const mockSetPublishMenuOpen = vi.fn()
const mockUseKeyPress = vi.fn()
const mockSetPublishedAt = vi.fn()
const mockSetQueryData = vi.fn()
let isPublishMenuOpen = false
let isPending = false
@@ -22,6 +23,12 @@ vi.mock('@langgenius/dify-ui/toast', () => ({
},
}))
vi.mock('@tanstack/react-query', () => ({
useQueryClient: () => ({
setQueryData: mockSetQueryData,
}),
}))
vi.mock('@/service/use-snippet-workflows', () => ({
usePublishSnippetWorkflowMutation: () => ({
mutateAsync: mockMutateAsync,
@@ -72,6 +79,9 @@ describe('useSnippetPublish', () => {
expect(mockMutateAsync).toHaveBeenCalledWith({
params: { snippetId: 'snippet-1' },
})
expect(mockSetQueryData).toHaveBeenCalledTimes(1)
const updateSnippetDetail = mockSetQueryData.mock.calls[0][1] as (old: { is_published: boolean }) => { is_published: boolean }
expect(updateSnippetDetail({ is_published: false })).toEqual({ is_published: true })
expect(mockSetPublishedAt).toHaveBeenCalledWith(1_712_345_678)
expect(mockSetPublishMenuOpen).toHaveBeenCalledWith(false)
expect(toast.success).toHaveBeenCalledWith('snippet.publishSuccess')

View File

@@ -1,10 +1,13 @@
import type { Snippet as SnippetContract } from '@/types/snippet'
import { toast } from '@langgenius/dify-ui/toast'
import { useQueryClient } from '@tanstack/react-query'
import { useKeyPress } from 'ahooks'
import { useCallback } from 'react'
import { useTranslation } from 'react-i18next'
import { useShallow } from 'zustand/react/shallow'
import { useWorkflowStore } from '@/app/components/workflow/store'
import { getKeyboardKeyCodeBySystem } from '@/app/components/workflow/utils'
import { consoleQuery } from '@/service/client'
import { usePublishSnippetWorkflowMutation } from '@/service/use-snippet-workflows'
import { useSnippetDetailStore } from '../../store'
@@ -17,6 +20,7 @@ export const useSnippetPublish = ({
}: UseSnippetPublishOptions) => {
const { t } = useTranslation('snippet')
const workflowStore = useWorkflowStore()
const queryClient = useQueryClient()
const publishSnippetMutation = usePublishSnippetWorkflowMutation(snippetId)
const {
isPublishMenuOpen,
@@ -31,6 +35,14 @@ export const useSnippetPublish = ({
const publishedWorkflow = await publishSnippetMutation.mutateAsync({
params: { snippetId },
})
queryClient.setQueryData<SnippetContract | undefined>(
consoleQuery.snippets.detail.queryKey({
input: {
params: { snippetId },
},
}),
old => old ? { ...old, is_published: true } : old,
)
workflowStore.getState().setPublishedAt(publishedWorkflow.created_at)
setPublishMenuOpen(false)
toast.success(t('publishSuccess'))
@@ -38,7 +50,7 @@ export const useSnippetPublish = ({
catch (error) {
toast.error(error instanceof Error ? error.message : t('publishFailed'))
}
}, [publishSnippetMutation, setPublishMenuOpen, snippetId, t, workflowStore])
}, [publishSnippetMutation, queryClient, setPublishMenuOpen, snippetId, t, workflowStore])
useKeyPress(`${getKeyboardKeyCodeBySystem('ctrl')}.shift.p`, (event) => {
if (publishSnippetMutation.isPending)

View File

@@ -1,14 +1,9 @@
'use client'
import type { ReactNode } from 'react'
import type { FC, ReactNode } from 'react'
import type { NavIcon } from '@/app/components/app-sidebar/nav-link'
import type { SnippetDetail, SnippetSection } from '@/models/snippet'
import {
RiFlaskFill,
RiFlaskLine,
RiTerminalWindowFill,
RiTerminalWindowLine,
} from '@remixicon/react'
import { cn } from '@langgenius/dify-ui/cn'
import { useEffect } from 'react'
import { useTranslation } from 'react-i18next'
import AppSideBar from '@/app/components/app-sidebar'
@@ -25,14 +20,34 @@ type SnippetLayoutProps = {
snippetId: string
}
const SidebarCssIcon: FC<{ iconClassName: string, className?: string }> = ({ iconClassName, className }) => {
return <span aria-hidden className={cn(iconClassName, className)} />
}
const OrchestrateIcon = ({ className }: { className?: string }) => {
return <SidebarCssIcon iconClassName="i-ri-terminal-window-line" className={className} />
}
const OrchestrateSelectedIcon = ({ className }: { className?: string }) => {
return <SidebarCssIcon iconClassName="i-ri-terminal-window-fill" className={className} />
}
const EvaluationIcon = ({ className }: { className?: string }) => {
return <SidebarCssIcon iconClassName="i-custom-vender-line-others-evaluation" className={className} />
}
const EvaluationSelectedIcon = ({ className }: { className?: string }) => {
return <SidebarCssIcon iconClassName="i-custom-vender-line-others-evaluation" className={className} />
}
const ORCHESTRATE_ICONS: { normal: NavIcon, selected: NavIcon } = {
normal: RiTerminalWindowLine,
selected: RiTerminalWindowFill,
normal: OrchestrateIcon,
selected: OrchestrateSelectedIcon,
}
const EVALUATION_ICONS: { normal: NavIcon, selected: NavIcon } = {
normal: RiFlaskLine,
selected: RiFlaskFill,
normal: EvaluationIcon,
selected: EvaluationSelectedIcon,
}
const SnippetLayout = ({
@@ -74,6 +89,7 @@ const SnippetLayout = ({
iconMap={EVALUATION_ICONS}
href={`/snippets/${snippetId}/evaluation`}
active={section === 'evaluation'}
disabled={!snippet.is_published}
/>
</>
)}

View File

@@ -75,8 +75,8 @@ const alignMenuItems: AlignMenuItem[] = [
{ alignType: AlignType.Top, icon: 'i-ri-align-item-top-line', translationKey: 'operator.alignTop' },
{ alignType: AlignType.Middle, icon: 'i-ri-align-item-vertical-center-line', iconClassName: 'rotate-90', translationKey: 'operator.alignMiddle' },
{ alignType: AlignType.Bottom, icon: 'i-ri-align-item-bottom-line', translationKey: 'operator.alignBottom' },
{ alignType: AlignType.DistributeHorizontal, icon: 'i-ri-align-justify-line', translationKey: 'operator.distributeHorizontal' },
{ alignType: AlignType.DistributeVertical, icon: 'i-ri-align-justify-line', iconClassName: 'rotate-90', translationKey: 'operator.distributeVertical' },
{ alignType: AlignType.DistributeHorizontal, icon: 'i-custom-vender-line-others-dhs', translationKey: 'operator.distributeHorizontal' },
{ alignType: AlignType.DistributeVertical, icon: 'i-custom-vender-line-others-dvs', iconClassName: 'rotate-90', translationKey: 'operator.distributeVertical' },
]
const getAlignableNodes = (nodes: Node[], selectedNodes: Node[]) => {

View File

@@ -13,6 +13,7 @@ export type SnippetListItem = {
usage: string
icon: string
iconBackground: string
is_published?: boolean
status?: string
}
@@ -25,6 +26,7 @@ export type SnippetDetail = {
usage: string
icon: string
iconBackground: string
is_published?: boolean
status?: string
}

View File

@@ -29,7 +29,7 @@ type SnippetListParams = {
is_published?: boolean
}
type SnippetSummary = Pick<SnippetContract, 'id' | 'name' | 'description' | 'use_count' | 'icon_info' | 'updated_at'>
type SnippetSummary = Pick<SnippetContract, 'id' | 'name' | 'description' | 'use_count' | 'icon_info' | 'updated_at' | 'is_published'>
const DEFAULT_SNIPPET_LIST_PARAMS = {
page: 1,
@@ -75,6 +75,7 @@ const toSnippetListItem = (snippet: SnippetSummary): SnippetListItemUIModel => {
usage: String(snippet.use_count ?? 0),
icon: getSnippetIcon(snippet.icon_info),
iconBackground: getSnippetIconBackground(snippet.icon_info),
is_published: snippet.is_published,
status: undefined,
}
}