@@ -3,7 +3,7 @@ import React, { useState, useEffect } from 'react';
3
3
import { Modal , Form , Select , Checkbox , Button , Spin , Input , Tag , Space , Alert } from 'antd' ;
4
4
import { messageInstance } from 'lowcoder-design/src/components/GlobalInstances' ;
5
5
import { useSelector } from 'react-redux' ;
6
- import { selectEnvironments , selectEnvironmentsLoading } from 'redux/selectors/enterpriseSelectors' ;
6
+ import { selectLicensedEnvironments , selectEnvironmentsLoading } from 'redux/selectors/enterpriseSelectors' ;
7
7
import { Environment } from '../types/environment.types' ;
8
8
import { DeployableItemConfig } from '../types/deployable-item.types' ;
9
9
import { getEnvironmentTagColor , formatEnvironmentType } from '../utils/environmentUtils' ;
@@ -28,7 +28,7 @@ function DeployItemModal({
28
28
onSuccess
29
29
} : DeployItemModalProps ) {
30
30
const [ form ] = Form . useForm ( ) ;
31
- const environments = useSelector ( selectEnvironments ) ;
31
+ const licensedEnvironments = useSelector ( selectLicensedEnvironments ) ;
32
32
const isLoading = useSelector ( selectEnvironmentsLoading ) ;
33
33
const [ deploying , setDeploying ] = useState ( false ) ;
34
34
const [ credentialConfirmationStep , setCredentialConfirmationStep ] = useState ( 0 ) ; // 0: not started, 1: first confirmation, 2: confirmed
@@ -41,8 +41,8 @@ function DeployItemModal({
41
41
} , [ visible , form ] ) ;
42
42
43
43
// 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
46
46
) ;
47
47
48
48
// Handle credential checkbox change with double confirmation
@@ -84,7 +84,7 @@ function DeployItemModal({
84
84
85
85
try {
86
86
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 ) ;
88
88
89
89
if ( ! targetEnv ) {
90
90
messageInstance . error ( 'Target environment not found' ) ;
0 commit comments