Skip to content

Commit 6b20446

Browse files
committed
feat: add conditional checks for app details for isolated env
1 parent cfb0c1f commit 6b20446

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,8 @@ export const Details: React.FC<DetailsType> = ({
294294
const appDetailsAbortRef = useRef(null)
295295
const shouldFetchTimelineRef = useRef(false)
296296

297+
const isAirGappedIsolatedEnv = isVirtualEnvRef.current && appDetails?.resourceTree
298+
297299
const [deploymentStatusDetailsBreakdownData, setDeploymentStatusDetailsBreakdownData] =
298300
useState<DeploymentStatusDetailsBreakdownDataType>({
299301
...(isVirtualEnvRef.current && processVirtualEnvironmentDeploymentData
@@ -354,6 +356,7 @@ export const Details: React.FC<DetailsType> = ({
354356
],
355357
)
356358

359+
// This is called only when timeline modal is open
357360
const getDeploymentDetailStepsData = useCallback(
358361
(showTimeline?: boolean): void => {
359362
const shouldFetchTimeline = showTimeline ?? shouldFetchTimelineRef.current
@@ -474,7 +477,7 @@ export const Details: React.FC<DetailsType> = ({
474477
getDeploymentStatusDetail(params.appId, params.envId, shouldFetchTimeline)
475478
.then((deploymentStatusDetailRes) => {
476479
if (deploymentStatusDetailRes.result) {
477-
if (deploymentAppType === DeploymentAppTypes.HELM) {
480+
if (deploymentAppType === DeploymentAppTypes.HELM || isAirGappedIsolatedEnv) {
478481
setDeploymentStatusDetailsBreakdownData({
479482
...deploymentStatusDetailsBreakdownData,
480483
deploymentStatus:
@@ -732,6 +735,7 @@ export const Details: React.FC<DetailsType> = ({
732735
ciArtifactId={appDetails?.ciArtifactId}
733736
setErrorsList={setErrorsList}
734737
deploymentUserActionState={deploymentUserActionState}
738+
isAirGappedIsolatedEnv={isAirGappedIsolatedEnv}
735739
/>
736740
</div>
737741
{!loadingDetails && !loadingResourceTree && !appDetails?.deploymentAppDeleteRequest && (

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

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ export const SourceInfo = ({
7070
setErrorsList,
7171
filteredEnvIds,
7272
deploymentUserActionState,
73+
isAirGappedIsolatedEnv,
7374
}: SourceInfoType) => {
7475
const [showVulnerabilitiesCard, setShowVulnerabilitiesCard] = useState<boolean>(false)
7576
const isdeploymentAppDeleting = appDetails?.deploymentAppDeleteRequest || false
@@ -187,6 +188,7 @@ export const SourceInfo = ({
187188
</div>
188189
</Tooltip>
189190
)}
191+
{/* TODO: Add last synced time */}
190192
{isdeploymentAppDeleting && (
191193
<div data-testid="deleteing-argocd-pipeline">
192194
<Trash className="icon-dim-16 mr-8 ml-12" />
@@ -304,21 +306,24 @@ export const SourceInfo = ({
304306
setDetailed={setDetailed}
305307
/>
306308
)}
307-
{isVirtualEnvironment && appDetails?.resourceTree && (
309+
{isAirGappedIsolatedEnv && (
308310
<HelmAppConfigApplyStatusCard
309311
cardLoading={cardLoading}
310312
releaseStatus={appDetails.resourceTree.releaseStatus}
311313
/>
312314
)}
313315
</>
314316
)}
315-
{isVirtualEnvironment && renderGeneratedManifestDownloadCard()}
317+
{isVirtualEnvironment && !isAirGappedIsolatedEnv && renderGeneratedManifestDownloadCard()}
316318
{!helmMigratedAppNotTriggered && (
317319
<>
318320
<DeploymentStatusCard
319321
deploymentStatusDetailsBreakdownData={deploymentStatusDetailsBreakdownData}
320322
cardLoading={cardLoading}
321-
hideDetails={appDetails?.deploymentAppType === DeploymentAppTypes.HELM}
323+
hideDetails={
324+
appDetails?.deploymentAppType === DeploymentAppTypes.HELM ||
325+
isAirGappedIsolatedEnv
326+
}
322327
isVirtualEnvironment={isVirtualEnvironment}
323328
refetchDeploymentStatus={refetchDeploymentStatus}
324329
/>

src/components/app/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,7 @@ export interface SourceInfoType {
590590
setErrorsList?: React.Dispatch<React.SetStateAction<ErrorItem[]>>
591591
filteredEnvIds?: string
592592
deploymentUserActionState?: ACTION_STATE
593+
isAirGappedIsolatedEnv?: boolean
593594
}
594595

595596
export interface AppDetailsCDButtonType

0 commit comments

Comments
 (0)