@@ -21,7 +21,7 @@ import {
2121 reverseMapExtraArgs ,
2222} from '../helper/runtimeExtraArgsParser' ;
2323import { useBAISettingUserState } from '../hooks/useBAISetting' ;
24- import { useModelStoreProject } from '../hooks/useModelStoreProject ' ;
24+ import { useCurrentProjectValue } from '../hooks/useCurrentProject ' ;
2525import {
2626 buildArgsSchemaKeySet ,
2727 buildDefaultsMap ,
@@ -71,8 +71,8 @@ import {
7171 BAIFlex ,
7272 BAIModal ,
7373 BAIModalProps ,
74- BAIProjectVfolderSelect ,
7574 BAIRuntimeVariantSelect ,
75+ BAIVFolderSelect ,
7676 convertToUUID ,
7777 safeDecodeUuid ,
7878 toLocalId ,
@@ -180,10 +180,11 @@ const DeploymentAddRevisionModal: React.FC<DeploymentAddRevisionModalProps> = ({
180180 const { token } = theme . useToken ( ) ;
181181 const { message } = App . useApp ( ) ;
182182 const relayEnvironment = useRelayEnvironment ( ) ;
183- // The model folder picker scopes to the MODEL_STORE project, not the
184- // deployment's own project — model cards live in the domain-wide model
185- // store regardless of which project owns the deployment.
186- const { id : modelStoreProjectId } = useModelStoreProject ( ) ;
183+ // The model folder picker scopes to the user's current project so the
184+ // listing matches what the user has access to in the active project
185+ // context, consistent with the rest of the model-deployment UI
186+ // (ServiceLauncherPageContent, ModelCardDeployModal).
187+ const { id : currentProjectId } = useCurrentProjectValue ( ) ;
187188 const { logger } = useBAILogger ( ) ;
188189
189190 // Defer `open` so the lazy query only fires once the modal has actually
@@ -263,7 +264,6 @@ const DeploymentAddRevisionModal: React.FC<DeploymentAddRevisionModalProps> = ({
263264 query DeploymentAddRevisionModalQuery($deploymentId: ID!) {
264265 deployment(id: $deploymentId) {
265266 metadata {
266- projectId
267267 resourceGroupName
268268 }
269269 currentRevision {
@@ -758,9 +758,10 @@ const DeploymentAddRevisionModal: React.FC<DeploymentAddRevisionModalProps> = ({
758758 ] ) ,
759759 ) ,
760760 runtimeVariantId : rev . modelRuntimeConfig ?. runtimeVariantId ?? undefined ,
761- // BAIProjectVfolderSelect returns the canonical dashed UUID, which
762- // matches `rev.modelMountConfig.vfolderId` directly. `convertToUUID`
763- // in the submit is idempotent on already-dashed values.
761+ // BAIVFolderSelect with `valuePropName="row_id"` returns the
762+ // canonical dashed UUID, which matches `rev.modelMountConfig.vfolderId`
763+ // directly. `convertToUUID` in the submit is idempotent on already-
764+ // dashed values.
764765 modelFolderId : rev . modelMountConfig ?. vfolderId ?? undefined ,
765766 mountDestination : rev . modelMountConfig ?. mountDestination ?? '/models' ,
766767 definitionPath : rev . modelMountConfig ?. definitionPath ?? undefined ,
@@ -1273,13 +1274,12 @@ const DeploymentAddRevisionModal: React.FC<DeploymentAddRevisionModalProps> = ({
12731274 tooltip = { t ( 'deployment.ModelFolderTooltip' ) }
12741275 rules = { [ { required : true } ] }
12751276 >
1276- < BAIProjectVfolderSelect
1277- projectId = { modelStoreProjectId ?? '' }
1278- disabled = { ! modelStoreProjectId }
1279- filter = { {
1280- usageMode : { equals : 'MODEL' } ,
1281- status : { equals : 'READY' } ,
1282- } }
1277+ < BAIVFolderSelect
1278+ currentProjectId = { currentProjectId ?? undefined }
1279+ excludeDeleted
1280+ filter = 'usage_mode == "model"'
1281+ valuePropName = "row_id"
1282+ labelRender = { ( { label, value } ) => label ?? value }
12831283 style = { { width : '100%' } }
12841284 />
12851285 </ Form . Item >
@@ -1332,13 +1332,12 @@ const DeploymentAddRevisionModal: React.FC<DeploymentAddRevisionModalProps> = ({
13321332 tooltip = { t ( 'deployment.ModelFolderTooltip' ) }
13331333 rules = { [ { required : true } ] }
13341334 >
1335- < BAIProjectVfolderSelect
1336- projectId = { modelStoreProjectId ?? '' }
1337- disabled = { ! modelStoreProjectId }
1338- filter = { {
1339- usageMode : { equals : 'MODEL' } ,
1340- status : { equals : 'READY' } ,
1341- } }
1335+ < BAIVFolderSelect
1336+ currentProjectId = { currentProjectId ?? undefined }
1337+ excludeDeleted
1338+ filter = 'usage_mode == "model"'
1339+ valuePropName = "row_id"
1340+ labelRender = { ( { label, value } ) => label ?? value }
13421341 style = { { width : '100%' } }
13431342 />
13441343 </ Form . Item >
0 commit comments