Skip to content

Commit a960819

Browse files
code review comments incorporated
1 parent 0870d4e commit a960819

File tree

1 file changed

+21
-26
lines changed

1 file changed

+21
-26
lines changed

src/components/ApplicationGroup/Details/TriggerView/EnvTriggerView.tsx

Lines changed: 21 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -238,39 +238,34 @@ export default function EnvTriggerView({ filteredAppIds, isVirtualEnv }: AppGrou
238238
const getWorkflowsData = async (): Promise<void> => {
239239
try {
240240
const { workflows: _workflows, filteredCIPipelines } = await getWorkflows(envId, filteredAppIds)
241-
if (_workflows) {
242-
if (showCIModal) {
243-
_workflows.forEach((wf) =>
244-
wf.nodes.forEach((n) => {
245-
if (+n.id === selectedCINode.id) {
246-
workflows.forEach((sw) =>
247-
sw.nodes.forEach((sn) => {
248-
if (+sn.id === selectedCINode.id) {
249-
n.inputMaterialList = sn.inputMaterialList
250-
}
251-
}),
252-
)
253-
}
254-
}),
255-
)
256-
}
257-
preserveSelection(_workflows)
258-
setWorkflows(_workflows)
259-
setFilteredCIPipelines(filteredCIPipelines)
260-
setErrorCode(0)
261-
setPageViewType(ViewType.FORM)
262-
getWorkflowStatusData(_workflows)
263-
processFilteredData(_workflows)
264-
} else {
265-
setPageViewType(ViewType.FORM)
241+
if (showCIModal) {
242+
_workflows.forEach((wf) =>
243+
wf.nodes.forEach((n) => {
244+
if (+n.id === selectedCINode.id) {
245+
workflows.forEach((sw) =>
246+
sw.nodes.forEach((sn) => {
247+
if (+sn.id === selectedCINode.id) {
248+
n.inputMaterialList = sn.inputMaterialList
249+
}
250+
}),
251+
)
252+
}
253+
}),
254+
)
266255
}
256+
preserveSelection(_workflows)
257+
setWorkflows(_workflows)
258+
setFilteredCIPipelines(filteredCIPipelines)
259+
setErrorCode(0)
260+
setPageViewType(ViewType.FORM)
261+
getWorkflowStatusData(_workflows)
262+
processFilteredData(_workflows)
267263
} catch (error) {
268264
showError(error)
269265
setErrorCode(error['code'])
270266
setPageViewType(ViewType.ERROR)
271267
}
272268
}
273-
274269
const processFilteredData = (_filteredWorkflows: WorkflowType[]): void => {
275270
const _selectedAppList = []
276271
let _preNodeExist, _postNodeExist

0 commit comments

Comments
 (0)