@@ -19,22 +19,16 @@ import {
1919 useCurrentResourceGroupValue ,
2020} from '../hooks/useCurrentProject' ;
2121import { App , Form , Skeleton , Typography , theme } from 'antd' ;
22- import {
23- BAIButton ,
24- BAIFlex ,
25- toGlobalId ,
26- toLocalId ,
27- useBAILogger ,
28- } from 'backend.ai-ui' ;
22+ import { BAIFlex , toGlobalId , toLocalId , useBAILogger } from 'backend.ai-ui' ;
2923import React , { Suspense } from 'react' ;
3024import { useTranslation } from 'react-i18next' ;
3125import { graphql , useLazyLoadQuery , useMutation } from 'react-relay' ;
32- import { useNavigate , useParams , useSearchParams } from 'react-router-dom' ;
26+ import { useNavigate , useParams } from 'react-router-dom' ;
3327
3428/**
3529 * DeploymentLauncherPage — page-level orchestrator for the deployment launcher.
3630 *
37- * Handles both create (`/deployments/new `) and edit
31+ * Handles both create (`/deployments/start `) and edit
3832 * (`/deployments/:deploymentId/edit`) routes. Owns:
3933 * - Relay `useLazyLoadQuery` for the edit-mode deployment snapshot.
4034 * - The antd `FormInstance` that the content component binds to.
@@ -63,31 +57,16 @@ const DeploymentLauncherPage: React.FC = () => {
6357} ;
6458
6559/**
66- * Create-mode view — no deployment fragment to pre-fill from. Reads URL
67- * params forwarded by entry points (model store split button, VFolderDeployModal)
68- * and builds a preFilledValues object passed down to the content component.
69- * Supported params: `model`, `resourceGroup`, `resourcePresetId` .
60+ * Create-mode view — no deployment fragment to pre-fill from. Pre-fill
61+ * params (model, resourceGroup, resourcePresetId, step) are read directly
62+ * from the URL inside DeploymentLauncherPageContent via nuqs so they are
63+ * always in sync and never stripped by step navigation URL updates .
7064 */
7165const DeploymentLauncherCreateView : React . FC = ( ) => {
7266 'use memo' ;
73- const [ searchParams ] = useSearchParams ( ) ;
7467 const [ form ] = Form . useForm < DeploymentLauncherFormValue > ( ) ;
7568
76- const preFilledValues : Partial < DeploymentLauncherFormValue > = { } ;
77- const model = searchParams . get ( 'model' ) ;
78- const resourceGroup = searchParams . get ( 'resourceGroup' ) ;
79- const resourcePresetId = searchParams . get ( 'resourcePresetId' ) ;
80- if ( model ) preFilledValues . modelFolderId = model ;
81- if ( resourceGroup ) preFilledValues . resourceGroup = resourceGroup ;
82- if ( resourcePresetId ) preFilledValues . resourcePresetId = resourcePresetId ;
83-
84- return (
85- < DeploymentLauncherPageLayout
86- mode = "create"
87- form = { form }
88- preFilledValues = { preFilledValues }
89- />
90- ) ;
69+ return < DeploymentLauncherPageLayout mode = "create" form = { form } /> ;
9170} ;
9271
9372/**
@@ -139,7 +118,6 @@ interface DeploymentLauncherPageLayoutProps {
139118 deploymentFrgmt ?: React . ComponentProps <
140119 typeof DeploymentLauncherPageContent
141120 > [ 'deploymentFrgmt' ] ;
142- preFilledValues ?: Partial < DeploymentLauncherFormValue > ;
143121}
144122
145123/**
@@ -149,7 +127,7 @@ interface DeploymentLauncherPageLayoutProps {
149127 */
150128const DeploymentLauncherPageLayout : React . FC <
151129 DeploymentLauncherPageLayoutProps
152- > = ( { mode, form, deploymentId, deploymentFrgmt, preFilledValues } ) => {
130+ > = ( { mode, form, deploymentId, deploymentFrgmt } ) => {
153131 'use memo' ;
154132
155133 const { t } = useTranslation ( ) ;
@@ -396,25 +374,11 @@ const DeploymentLauncherPageLayout: React.FC<
396374 mode = { mode }
397375 form = { form }
398376 deploymentFrgmt = { deploymentFrgmt }
399- preFilledValues = { preFilledValues }
400377 onValuesChange = { ( ) => setIsDirty ( true ) }
378+ onCancel = { handleCancel }
379+ onSubmit = { handleSubmit }
380+ isSubmitting = { isSubmitting }
401381 />
402-
403- < BAIFlex
404- direction = "row"
405- justify = "end"
406- gap = "sm"
407- style = { { marginTop : token . marginLG } }
408- >
409- < BAIButton onClick = { handleCancel } disabled = { isSubmitting } >
410- { t ( 'button.Cancel' ) }
411- </ BAIButton >
412- < BAIButton type = "primary" loading = { isSubmitting } action = { handleSubmit } >
413- { mode === 'edit'
414- ? t ( 'deployment.UpdateDeployment' )
415- : t ( 'deployment.CreateDeployment' ) }
416- </ BAIButton >
417- </ BAIFlex >
418382 </ BAIFlex >
419383 ) ;
420384} ;
0 commit comments