Skip to content

Commit c8caa61

Browse files
Merge pull request #1516 from devtron-labs/app_group_fix
fix:App group empty state handled
2 parents 0e16a20 + 1e4fdd0 commit c8caa61

File tree

1 file changed

+17
-15
lines changed

1 file changed

+17
-15
lines changed

src/components/ApplicationGroup/AppGroup.service.ts

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -79,21 +79,23 @@ export const getWorkflows = (envID: string, appIds: string): Promise<WorkflowsRe
7979
for (const _ciConfig of ciConfig.result) {
8080
_ciConfigMap.set(_ciConfig.appId, _ciConfig)
8181
}
82-
for (const workflowResult of workflow.result.workflows) {
83-
const processWorkflowData = processWorkflow(
84-
{
85-
...workflowResult,
86-
workflows: [workflowResult],
87-
} as WorkflowResult,
88-
_ciConfigMap.get(workflowResult.appId),
89-
cdConfig.result as CdPipelineResult,
90-
externalCIConfig.result,
91-
WorkflowTrigger,
92-
WorkflowTrigger.workflow,
93-
filterChildAndSiblingCD(envID),
94-
)
95-
_workflows.push(...processWorkflowData.workflows)
96-
_filteredCIPipelines.set(workflowResult.appId, processWorkflowData.filteredCIPipelines)
82+
if (workflow?.result?.workflows) {
83+
for (const workflowResult of workflow.result.workflows) {
84+
const processWorkflowData = processWorkflow(
85+
{
86+
...workflowResult,
87+
workflows: [workflowResult],
88+
} as WorkflowResult,
89+
_ciConfigMap.get(workflowResult.appId),
90+
cdConfig.result as CdPipelineResult,
91+
externalCIConfig.result,
92+
WorkflowTrigger,
93+
WorkflowTrigger.workflow,
94+
filterChildAndSiblingCD(envID),
95+
)
96+
_workflows.push(...processWorkflowData.workflows)
97+
_filteredCIPipelines.set(workflowResult.appId, processWorkflowData.filteredCIPipelines)
98+
}
9799
}
98100
return { workflows: _workflows, filteredCIPipelines: _filteredCIPipelines }
99101
})

0 commit comments

Comments
 (0)