From 164e0539f05eaa9c791951e1a001fc7514a1f7e5 Mon Sep 17 00:00:00 2001 From: James Allan Date: Fri, 22 Jul 2022 15:37:16 +1000 Subject: [PATCH 1/3] Fix the plural string used in the disputes task list --- client/overview/task-list/tasks.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/overview/task-list/tasks.js b/client/overview/task-list/tasks.js index a2aac629c73..5ffc0a938da 100644 --- a/client/overview/task-list/tasks.js +++ b/client/overview/task-list/tasks.js @@ -122,7 +122,7 @@ export const getTasks = ( { _n( '1 disputed payment needs your response', '%s disputed payments need your response', - numDisputesNeedingResponse, + parseInt( numDisputesNeedingResponse, 10 ), 'woocommerce-payments' ), numDisputesNeedingResponse From 0151943df9cd3485562e6d55369588fd6545af78 Mon Sep 17 00:00:00 2001 From: Shendy Kurnia Date: Fri, 22 Jul 2022 13:53:20 +0700 Subject: [PATCH 2/3] Remove the conditional `completed` and additionalInfo attribute for dispute task. --- changelog/fix-4123-dispute-count | 2 +- client/overview/task-list/tasks.js | 7 ++----- client/overview/task-list/test/tasks.js | 2 ++ 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/changelog/fix-4123-dispute-count b/changelog/fix-4123-dispute-count index d51ff4e88a9..08ef9190a1e 100644 --- a/changelog/fix-4123-dispute-count +++ b/changelog/fix-4123-dispute-count @@ -1,4 +1,4 @@ Significance: patch Type: fix -Correctly show the number of disputes that need to be responded in task list. +Show the correct number of disputes needing a response in the Payments > Overview task list. diff --git a/client/overview/task-list/tasks.js b/client/overview/task-list/tasks.js index 5ffc0a938da..649c171e533 100644 --- a/client/overview/task-list/tasks.js +++ b/client/overview/task-list/tasks.js @@ -127,11 +127,8 @@ export const getTasks = ( { ), numDisputesNeedingResponse ), - additionalInfo: - 0 < numDisputesNeedingResponse - ? __( 'View and respond', 'woocommerce-payments' ) - : '', - completed: 0 === numDisputesNeedingResponse, + additionalInfo: __( 'View and respond', 'woocommerce-payments' ), + completed: false, isDeletable: true, isDismissable: true, allowSnooze: true, diff --git a/client/overview/task-list/test/tasks.js b/client/overview/task-list/test/tasks.js index 180c6878565..9e60e4d50e1 100644 --- a/client/overview/task-list/test/tasks.js +++ b/client/overview/task-list/test/tasks.js @@ -177,6 +177,7 @@ describe( 'getTasks()', () => { completed: false, level: 3, title: '1 disputed payment needs your response', + additionalInfo: 'View and respond', } ), ] ) ); @@ -201,6 +202,7 @@ describe( 'getTasks()', () => { completed: false, level: 3, title: '2000 disputed payments need your response', + additionalInfo: 'View and respond', } ), ] ) ); From 32e41c29abafc6743e27ffb1aa1731d97e415947 Mon Sep 17 00:00:00 2001 From: Shendy Kurnia Date: Fri, 22 Jul 2022 15:09:04 +0700 Subject: [PATCH 3/3] Remove parseInt() due to incorrect merge conflict resolution. --- client/overview/task-list/tasks.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/overview/task-list/tasks.js b/client/overview/task-list/tasks.js index 649c171e533..5bd720a1c32 100644 --- a/client/overview/task-list/tasks.js +++ b/client/overview/task-list/tasks.js @@ -122,7 +122,7 @@ export const getTasks = ( { _n( '1 disputed payment needs your response', '%s disputed payments need your response', - parseInt( numDisputesNeedingResponse, 10 ), + numDisputesNeedingResponse, 'woocommerce-payments' ), numDisputesNeedingResponse