@@ -3,7 +3,7 @@ import React, { useState, useEffect } from 'react';
33import { Modal , Form , Select , Checkbox , Button , Spin , Input , Tag , Space , Alert } from 'antd' ;
44import { messageInstance } from 'lowcoder-design/src/components/GlobalInstances' ;
55import { useSelector } from 'react-redux' ;
6- import { selectEnvironments , selectEnvironmentsLoading } from 'redux/selectors/enterpriseSelectors' ;
6+ import { selectLicensedEnvironments , selectEnvironmentsLoading } from 'redux/selectors/enterpriseSelectors' ;
77import { Environment } from '../types/environment.types' ;
88import { DeployableItemConfig } from '../types/deployable-item.types' ;
99import { getEnvironmentTagColor , formatEnvironmentType } from '../utils/environmentUtils' ;
@@ -28,7 +28,7 @@ function DeployItemModal({
2828 onSuccess
2929} : DeployItemModalProps ) {
3030 const [ form ] = Form . useForm ( ) ;
31- const environments = useSelector ( selectEnvironments ) ;
31+ const licensedEnvironments = useSelector ( selectLicensedEnvironments ) ;
3232 const isLoading = useSelector ( selectEnvironmentsLoading ) ;
3333 const [ deploying , setDeploying ] = useState ( false ) ;
3434 const [ credentialConfirmationStep , setCredentialConfirmationStep ] = useState ( 0 ) ; // 0: not started, 1: first confirmation, 2: confirmed
@@ -41,8 +41,8 @@ function DeployItemModal({
4141 } , [ visible , form ] ) ;
4242
4343 // Filter out source environment from target list
44- const targetEnvironments = environments . filter (
45- ( env : Environment ) => env . environmentId !== sourceEnvironment . environmentId && env . isLicensed !== false
44+ const targetEnvironments = licensedEnvironments . filter (
45+ ( env : Environment ) => env . environmentId !== sourceEnvironment . environmentId
4646 ) ;
4747
4848 // Handle credential checkbox change with double confirmation
@@ -84,7 +84,7 @@ function DeployItemModal({
8484
8585 try {
8686 const values = await form . validateFields ( ) ;
87- const targetEnv = environments . find ( env => env . environmentId === values . targetEnvId ) ;
87+ const targetEnv = licensedEnvironments . find ( env => env . environmentId === values . targetEnvId ) ;
8888
8989 if ( ! targetEnv ) {
9090 messageInstance . error ( 'Target environment not found' ) ;
0 commit comments