Skip to content

Commit 256c176

Browse files
committed
refactor: rename detailedStatus state to showAppStatusModal for clarity
1 parent 21811ee commit 256c176

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

src/components/app/details/appDetails/AppDetails.tsx

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,7 @@ const Details: React.FC<DetailsType> = ({
210210

211211
const appDetailsFromIndexStore = IndexStore.getAppDetails()
212212

213-
// fixme: the state is not being set anywhere and just being drilled down
214-
const [detailedStatus, toggleDetailedStatus] = useState<boolean>(false)
213+
const [showAppStatusModal, setShowAppStatusModal] = useState<boolean>(false)
215214
const [resourceTreeFetchTimeOut, setResourceTreeFetchTimeOut] = useState<boolean>(false)
216215
const [urlInfo, setUrlInfo] = useState<boolean>(false)
217216
const [hibernateConfirmationModal, setHibernateConfirmationModal] = useState<HibernationModalTypes>(null)
@@ -293,7 +292,6 @@ const Details: React.FC<DetailsType> = ({
293292
],
294293
)
295294

296-
// This method is called in case of gitops based deployment for polling
297295
const getDeploymentDetailStepsData = useCallback((): void => {
298296
// Deployments status details for Devtron apps
299297
getDeploymentStatusDetail(params.appId, params.envId)
@@ -513,8 +511,8 @@ const Details: React.FC<DetailsType> = ({
513511
}
514512

515513
const handleCloseAppStatusModal = (): void => {
516-
if (detailedStatus) {
517-
toggleDetailedStatus(false)
514+
if (showAppStatusModal) {
515+
setShowAppStatusModal(false)
518516
}
519517

520518
if (location.search.includes(DEPLOYMENT_STATUS_QUERY_PARAM)) {
@@ -525,7 +523,7 @@ const Details: React.FC<DetailsType> = ({
525523
}
526524

527525
const showApplicationDetailedModal = (): void => {
528-
toggleDetailedStatus(true)
526+
setShowAppStatusModal(true)
529527
}
530528

531529
const renderAppDetailsCDButton = () =>
@@ -666,7 +664,7 @@ const Details: React.FC<DetailsType> = ({
666664
>
667665
<SourceInfo
668666
appDetails={appDetails}
669-
setDetailed={toggleDetailedStatus}
667+
setDetailed={setShowAppStatusModal}
670668
environment={environment}
671669
isAppView={isAppView}
672670
environments={environments}
@@ -714,7 +712,7 @@ const Details: React.FC<DetailsType> = ({
714712
) : (
715713
renderAppDetails()
716714
)}
717-
{(detailedStatus || (appDetails && location.search.includes(DEPLOYMENT_STATUS_QUERY_PARAM))) && (
715+
{(showAppStatusModal || (appDetails && location.search.includes(DEPLOYMENT_STATUS_QUERY_PARAM))) && (
718716
<AppStatusModal
719717
titleSegments={[appDetailsFromIndexStore.appName, appDetailsFromIndexStore.environmentName]}
720718
handleClose={handleCloseAppStatusModal}
@@ -723,7 +721,7 @@ const Details: React.FC<DetailsType> = ({
723721
isConfigDriftEnabled={isConfigDriftEnabled}
724722
configDriftModal={ConfigDriftModal}
725723
initialTab={
726-
detailedStatus ? AppStatusModalTabType.APP_STATUS : AppStatusModalTabType.DEPLOYMENT_STATUS
724+
showAppStatusModal ? AppStatusModalTabType.APP_STATUS : AppStatusModalTabType.DEPLOYMENT_STATUS
727725
}
728726
processVirtualEnvironmentDeploymentData={processVirtualEnvironmentDeploymentData}
729727
handleUpdateDeploymentStatusDetailsBreakdownData={handleUpdateDeploymentStatusDetailsBreakdownData}

src/components/v2/appDetails/AppDetails.component.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,12 +226,11 @@ const AppDetailsComponent = ({
226226
renderHelmAppDetails()
227227
)}
228228

229-
{appDetails && location.search.includes(DEPLOYMENT_STATUS_QUERY_PARAM) && (
229+
{!loadingDetails && location.search.includes(DEPLOYMENT_STATUS_QUERY_PARAM) && (
230230
<AppStatusModal
231231
type="other-apps"
232232
titleSegments={[appDetails?.appName, appDetails?.environmentName || appDetails?.namespace]}
233233
handleClose={handleCloseDeploymentStatusModal}
234-
// TODO: Check appDetails.deploymentAppDeleteRequest
235234
appDetails={appDetails}
236235
isConfigDriftEnabled={false}
237236
configDriftModal={null}

0 commit comments

Comments
 (0)