From cbde56549db36769393b13be1de46af3182df2b3 Mon Sep 17 00:00:00 2001 From: Kia Lam Date: Fri, 6 May 2022 13:26:09 -0700 Subject: [PATCH 1/2] Fix deleted wf approval node name. --- .../WorkflowApprovalList/WorkflowApprovalList.js | 6 +----- .../WorkflowApprovalList/WorkflowApprovalListItem.js | 11 +++++++++-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/awx/ui/src/screens/WorkflowApproval/WorkflowApprovalList/WorkflowApprovalList.js b/awx/ui/src/screens/WorkflowApproval/WorkflowApprovalList/WorkflowApprovalList.js index 020acbed7c48..cc4e15af0bea 100644 --- a/awx/ui/src/screens/WorkflowApproval/WorkflowApprovalList/WorkflowApprovalList.js +++ b/awx/ui/src/screens/WorkflowApproval/WorkflowApprovalList/WorkflowApprovalList.js @@ -45,12 +45,8 @@ function WorkflowApprovalsList() { WorkflowApprovalsAPI.read(params), WorkflowApprovalsAPI.readOptions(), ]); - const dataWithModifiedName = response.data.results.map((i) => { - i.name = `${i.summary_fields.source_workflow_job.id} - ${i.name}`; - return i; - }); return { - results: dataWithModifiedName, + results: response.data.results, count: response.data.count, relatedSearchableKeys: ( actionsResponse?.data?.related_search_fields || [] diff --git a/awx/ui/src/screens/WorkflowApproval/WorkflowApprovalList/WorkflowApprovalListItem.js b/awx/ui/src/screens/WorkflowApproval/WorkflowApprovalList/WorkflowApprovalListItem.js index c475c468c891..1c7c11e966dd 100644 --- a/awx/ui/src/screens/WorkflowApproval/WorkflowApprovalList/WorkflowApprovalListItem.js +++ b/awx/ui/src/screens/WorkflowApproval/WorkflowApprovalList/WorkflowApprovalListItem.js @@ -21,7 +21,6 @@ function WorkflowApprovalListItem({ }) { const labelId = `check-action-${workflowApproval.id}`; const workflowJob = workflowApproval?.summary_fields?.source_workflow_job; - return ( - {workflowApproval.name} + {workflowJob && workflowJob?.id ? ( + + {`${workflowJob?.id} - ${workflowApproval?.name}`} + + ) : ( + + {t`Deleted`} {`- ${workflowApproval?.name}`} + + )} From b17f22cd386bf3fe655d0d82a3a0f7708e1244b5 Mon Sep 17 00:00:00 2001 From: Kia Lam Date: Mon, 9 May 2022 10:55:51 -0700 Subject: [PATCH 2/2] Fix unit tests. --- .../WorkflowApprovalList/WorkflowApprovalListItem.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/awx/ui/src/screens/WorkflowApproval/WorkflowApprovalList/WorkflowApprovalListItem.js b/awx/ui/src/screens/WorkflowApproval/WorkflowApprovalList/WorkflowApprovalListItem.js index 1c7c11e966dd..a5aebbf57802 100644 --- a/awx/ui/src/screens/WorkflowApproval/WorkflowApprovalList/WorkflowApprovalListItem.js +++ b/awx/ui/src/screens/WorkflowApproval/WorkflowApprovalList/WorkflowApprovalListItem.js @@ -34,9 +34,7 @@ function WorkflowApprovalListItem({ {workflowJob && workflowJob?.id ? ( - - {`${workflowJob?.id} - ${workflowApproval?.name}`} - + {`${workflowJob?.id} - ${workflowApproval?.name}`} ) : ( {t`Deleted`} {`- ${workflowApproval?.name}`}