From 663818f4111ed4aa98b3641a4d8575f8d365093c Mon Sep 17 00:00:00 2001 From: Stephen Zhou <38493346+hyoban@users.noreply.github.com> Date: Wed, 29 Apr 2026 23:26:07 +0800 Subject: [PATCH] tweaks --- web/app/(commonLayout)/deployments/page.tsx | 3 +- .../components/create-instance-modal.tsx | 5 +- .../components/deploy-drawer/select.tsx | 17 +-- .../deployments/components/rollback-modal.tsx | 1 - .../deployments/components/status-badge.tsx | 1 - web/features/deployments/data.ts | 6 +- .../deployments/detail/access-tab.tsx | 13 +-- .../detail/access-tab/permissions-section.tsx | 3 - .../detail/access-tab/permissions.tsx | 6 - .../deployments/detail/overview-tab.tsx | 9 +- .../deployments/detail/settings-tab.tsx | 1 - .../__tests__/release-deployments.spec.ts | 109 ++++++++++++++++++ .../versions-tab/release-deployments.ts | 5 +- web/features/deployments/list/index.tsx | 6 +- web/features/deployments/store/actions.ts | 13 +-- 15 files changed, 129 insertions(+), 69 deletions(-) create mode 100644 web/features/deployments/detail/versions-tab/__tests__/release-deployments.spec.ts diff --git a/web/app/(commonLayout)/deployments/page.tsx b/web/app/(commonLayout)/deployments/page.tsx index 585f4bb03e..f6bff9762d 100644 --- a/web/app/(commonLayout)/deployments/page.tsx +++ b/web/app/(commonLayout)/deployments/page.tsx @@ -1,5 +1,4 @@ 'use client' -import * as React from 'react' import { useTranslation } from 'react-i18next' import DeploymentsMain from '@/features/deployments/list' import useDocumentTitle from '@/hooks/use-document-title' @@ -10,4 +9,4 @@ const DeploymentsPage = () => { return } -export default React.memo(DeploymentsPage) +export default DeploymentsPage diff --git a/web/features/deployments/components/create-instance-modal.tsx b/web/features/deployments/components/create-instance-modal.tsx index 657805da57..69dc54d95c 100644 --- a/web/features/deployments/components/create-instance-modal.tsx +++ b/web/features/deployments/components/create-instance-modal.tsx @@ -7,7 +7,6 @@ import { cn } from '@langgenius/dify-ui/cn' import { Dialog, DialogCloseButton, DialogContent, DialogDescription, DialogTitle } from '@langgenius/dify-ui/dialog' import { Popover, PopoverContent, PopoverTrigger } from '@langgenius/dify-ui/popover' import { toast } from '@langgenius/dify-ui/toast' -import * as React from 'react' import { useMemo, useRef, useState } from 'react' import { useTranslation } from 'react-i18next' import { AppTypeIcon } from '@/app/components/app/type-selector' @@ -46,8 +45,6 @@ export const AppPicker: FC = ({ apps, isLoading, value, onChange const triggerRef = useRef(null) const [triggerWidth, setTriggerWidth] = useState(undefined) - const selected = useMemo(() => apps.find(a => a.id === value), [apps, value]) - const filtered = useMemo(() => { const q = keywords.trim().toLowerCase() if (!q) @@ -71,6 +68,8 @@ export const AppPicker: FC = ({ apps, isLoading, value, onChange ) } + const selected = apps.find(a => a.id === value) + if (apps.length === 0) { return (
diff --git a/web/features/deployments/components/deploy-drawer/select.tsx b/web/features/deployments/components/deploy-drawer/select.tsx index 2abc834c73..aeafaf08a3 100644 --- a/web/features/deployments/components/deploy-drawer/select.tsx +++ b/web/features/deployments/components/deploy-drawer/select.tsx @@ -4,7 +4,6 @@ import type { FC } from 'react' import type { EnvironmentOption } from '@/contract/console/deployments' import { cn } from '@langgenius/dify-ui/cn' import { Select, SelectContent, SelectItem, SelectItemIndicator, SelectItemText, SelectTrigger } from '@langgenius/dify-ui/select' -import { useMemo } from 'react' import { useTranslation } from 'react-i18next' import { environmentHealth, environmentMode, environmentName } from '../../utils' import { HealthBadge, ModeBadge } from '../status-badge' @@ -36,10 +35,7 @@ type SelectProps = { export const DeploymentSelect: FC = ({ value, onChange, options, placeholder }) => { const { t } = useTranslation('deployments') - const selectedOption = useMemo( - () => options.find(option => option.value === value), - [options, value], - ) + const selectedOption = options.find(option => option.value === value) return (