From 082b223ab1b3e679fbddbd28611a171ea47ab013 Mon Sep 17 00:00:00 2001 From: Stephen Zhou <38493346+hyoban@users.noreply.github.com> Date: Wed, 27 May 2026 22:46:29 +0800 Subject: [PATCH] Refine deployment creation flow and restore method cards --- .../runtime-credential-bindings.tsx | 6 ++- .../deployments/create-guide/done-step.tsx | 35 ---------------- .../deployments/create-guide/index.tsx | 23 ++++------- .../deployments/create-guide/layout.tsx | 41 ++++++++++--------- .../deployments/create-guide/release-step.tsx | 24 +++++++---- .../deployments/create-guide/target-step.tsx | 1 + .../deployments/create-guide/types.ts | 2 +- .../use-create-deployment-guide.ts | 25 ----------- .../deployments/detail/settings-tab.tsx | 2 +- web/i18n/en-US/deployments.json | 27 +++--------- web/i18n/zh-Hans/deployments.json | 27 +++--------- 11 files changed, 62 insertions(+), 151 deletions(-) delete mode 100644 web/features/deployments/create-guide/done-step.tsx diff --git a/web/features/deployments/components/runtime-credential-bindings.tsx b/web/features/deployments/components/runtime-credential-bindings.tsx index 987c072a97..ac353055ac 100644 --- a/web/features/deployments/components/runtime-credential-bindings.tsx +++ b/web/features/deployments/components/runtime-credential-bindings.tsx @@ -33,6 +33,7 @@ type RuntimeCredentialBindingsPanelProps = { noCredentialCandidatesLabel: string selectCredentialLabel: string missingRequiredLabel: string + bindingCountLabel?: string onChange: (slotKey: string, value: string) => void className?: string listClassName?: string @@ -66,7 +67,7 @@ function RuntimeCredentialSelect({ @@ -94,6 +95,7 @@ export function RuntimeCredentialBindingsPanel({ noCredentialCandidatesLabel, selectCredentialLabel, missingRequiredLabel, + bindingCountLabel, onChange, className, listClassName, @@ -107,7 +109,7 @@ export function RuntimeCredentialBindingsPanel({
{title}
{slots.length > 0 && ( - {slots.length} + {bindingCountLabel ?? slots.length} )} diff --git a/web/features/deployments/create-guide/done-step.tsx b/web/features/deployments/create-guide/done-step.tsx deleted file mode 100644 index d37406b78d..0000000000 --- a/web/features/deployments/create-guide/done-step.tsx +++ /dev/null @@ -1,35 +0,0 @@ -'use client' - -import { useTranslation } from 'react-i18next' -import Link from '@/next/link' -import { StepShell } from './layout' - -export function DoneStep({ environmentName }: { - environmentName: string -}) { - const { t } = useTranslation('deployments') - - return ( - -
-
- - -
-
{t('createGuide.done.ready')}
-
{t('createGuide.done.next')}
-
-
-
- - {t('createGuide.done.backToList')} - -
-
-
- ) -} diff --git a/web/features/deployments/create-guide/index.tsx b/web/features/deployments/create-guide/index.tsx index c67f11e0c2..364c45385b 100644 --- a/web/features/deployments/create-guide/index.tsx +++ b/web/features/deployments/create-guide/index.tsx @@ -2,7 +2,6 @@ import { useTranslation } from 'react-i18next' import Link from '@/next/link' -import { DoneStep } from './done-step' import { GuideActions, GuideCard, GuideFrame } from './layout' import { CreationSections } from './source-release-sections' import { TargetReviewSections } from './target-step' @@ -13,11 +12,9 @@ export function CreateDeploymentGuide() { const { canContinue, creationSectionsProps, - deployedEnvironmentName, handleBack, handlePrimaryAction, isDeploying, - selectedTargetEnvironmentName, showTargetConfiguration, step, targetReviewSectionsProps, @@ -25,25 +22,21 @@ export function CreateDeploymentGuide() { const guideContent = ( <> - {step === 'done' + {showTargetConfiguration ? ( - +
+ +
) - : showTargetConfiguration - ? ( -
- -
- ) - : ( - - )} + : ( + + )} ) return (
-
+
- {GUIDE_PROGRESS_STEPS.map((step) => { +
    + {GUIDE_PROGRESS_STEPS.map((step, index) => { const isActive = step === activeStep + const isComplete = index < activeIndex const label = t(`createGuide.steps.${step}`) return ( @@ -57,20 +59,26 @@ function GuideProgress({ activeStep }: { aria-current={isActive ? 'step' : undefined} title={label} className={cn( - 'flex min-w-0 items-center gap-2 px-2 py-1.5 system-xs-medium', - isActive ? 'text-text-primary' : 'text-text-quaternary', + 'flex min-w-0 items-start gap-1.5 px-1 py-1.5 system-xs-medium sm:items-center sm:gap-2 sm:px-2', + isActive + ? 'text-text-primary' + : isComplete + ? 'text-text-secondary' + : 'text-text-quaternary', )} > - {label} + {label} ) })} @@ -173,18 +181,14 @@ export function GuideFrame({ activeStep, children }: {

    {t('createGuide.title')}

    - {activeStep !== 'done' && ( -
    - -
    - )} +
    + +
    - {activeStep !== 'done' && ( -
    - -
    - )} +
    + +
    {children}
    @@ -212,9 +216,6 @@ export function GuideActions({ ? t('createGuide.actions.creating') : t('createGuide.actions.next') - if (step === 'method' || step === 'done') - return null - return (
    {(step === 'release' || step === 'target') && ( diff --git a/web/features/deployments/create-guide/release-step.tsx b/web/features/deployments/create-guide/release-step.tsx index 8a7c9d86ce..4c4c306fe3 100644 --- a/web/features/deployments/create-guide/release-step.tsx +++ b/web/features/deployments/create-guide/release-step.tsx @@ -50,14 +50,18 @@ export function ReleaseStep({ />
    - +
    + + {t('versions.optional')} +