@@ -13,7 +13,11 @@ import { Button, ButtonStyleType, ButtonVariantType } from '../Button'
1313import { Icon } from '../Icon'
1414import ConflictedResourcesTable from './ConflictedResourcesTable'
1515import { getResourceConflictDetails , resourceConflictRedeploy } from './service'
16- import { ResourceConflictDeployDialogURLParamsType , ResourceConflictDetailsModalProps } from './types'
16+ import {
17+ ResourceConflictDeployDialogURLParamsType ,
18+ ResourceConflictDetailsModalProps ,
19+ ResourceConflictItemType ,
20+ } from './types'
1721
1822const ResourceConflictDetailsModal = ( { appName, environmentName, handleClose } : ResourceConflictDetailsModalProps ) => {
1923 const { appId, envId, pipelineId, triggerId } = useParams < ResourceConflictDeployDialogURLParamsType > ( )
@@ -24,11 +28,9 @@ const ResourceConflictDetailsModal = ({ appName, environmentName, handleClose }:
2428 data : resourceConflictDetails ,
2529 refetch : refetchResourceConflictDetails ,
2630 error : resourceConflictDetailsError ,
27- } = useQuery ( {
28- queryKey : [ 'getResourceConflictDetails' ] ,
29- // TODO: Signal
30- queryFn : ( ) => getResourceConflictDetails ( ) ,
31- select : ( data ) => data . result ,
31+ } = useQuery < ResourceConflictItemType [ ] , ResourceConflictItemType [ ] , [ string , string , string , string ] , false > ( {
32+ queryKey : [ 'getResourceConflictDetails' , pipelineId , triggerId , appId ] ,
33+ queryFn : ( { signal } ) => getResourceConflictDetails ( { pipelineId, triggerId, appId, signal } ) ,
3234 } )
3335
3436 const [ isDeploying , setIsDeploying ] = useState ( false )
@@ -47,7 +49,7 @@ const ResourceConflictDetailsModal = ({ appName, environmentName, handleClose }:
4749 description : `Redeployment for application '${ appName } ' in environment '${ environmentName } ' has been initiated successfully.` ,
4850 } )
4951 handleClose ( )
50- history . push ( `${ URLS . APPLICATION_MANAGEMENT_APP } /${ appId } /details/${ envId } ` )
52+ history . push ( `${ URLS . APP } /${ appId } /details/${ envId } ` )
5153 } catch ( error ) {
5254 showError ( error )
5355 } finally {
@@ -77,7 +79,7 @@ const ResourceConflictDetailsModal = ({ appName, environmentName, handleClose }:
7779 />
7880 </ div >
7981
80- < div className = "flexbox flex-grow-1 dc__overflow-auto w-100" >
82+ < div className = "flexbox-col flex-grow-1 dc__overflow-auto w-100" >
8183 < APIResponseHandler
8284 isLoading = { isLoadingResourceData }
8385 progressingProps = { {
@@ -95,24 +97,32 @@ const ResourceConflictDetailsModal = ({ appName, environmentName, handleClose }:
9597 </ div >
9698 </ div >
9799
98- < div className = "flexbox dc__content-end dc__gap-12 py-16 px-20 border__primary--top dc__no-shrink" >
99- < Button
100- dataTestId = "footer-cancel-button"
101- variant = { ButtonVariantType . secondary }
102- text = "Cancel"
103- style = { ButtonStyleType . neutral }
104- size = { ComponentSizeType . large }
105- onClick = { handleClose }
106- />
107-
108- < Button
109- dataTestId = "footer-redeploy-button"
110- variant = { ButtonVariantType . primary }
111- size = { ComponentSizeType . large }
112- text = "Re-deploy"
113- isLoading = { isDeploying }
114- onClick = { handleDeploy }
115- />
100+ < div className = "flexbox dc__content-space dc__gap-20 py-16 px-20 border__primary--top dc__no-shrink" >
101+ < div className = "flexbox dc__gap-8" >
102+ < Icon name = "ic-warning" size = { 20 } color = { null } />
103+ < div className = "flexbox-col" >
104+ < span className = "cn-9 fs-13 fw-6 lh-1-5" > Take resource ownership and redeploy</ span >
105+ < span >
106+ Ensure all resources strictly belong to the { appName } application and the
107+ { environmentName }
108+ environment. Any resource outside this Helm release may cause incorrect associations and
109+ potentially destructive changes.
110+ </ span >
111+ </ div >
112+ </ div >
113+ < div className = "dc__no-shrink" >
114+ < Button
115+ dataTestId = "footer-redeploy-button"
116+ variant = { ButtonVariantType . primary }
117+ style = { ButtonStyleType . warning }
118+ size = { ComponentSizeType . large }
119+ text = "Re-deploy"
120+ startIcon = { < Icon name = "ic-rocket-launch" color = { null } /> }
121+ isLoading = { isDeploying }
122+ disabled = { ! ! resourceConflictDetailsError || isLoadingResourceData }
123+ onClick = { handleDeploy }
124+ />
125+ </ div >
116126 </ div >
117127 </ div >
118128 </ Drawer >
0 commit comments