@@ -221,7 +213,18 @@ const DisputeAwaitingResponseDetails: React.FC< Props > = ( { dispute } ) => {
diff --git a/client/payment-details/dispute-details/style.scss b/client/payment-details/dispute-details/style.scss
index 5346591176e..4fe5a0c6be6 100644
--- a/client/payment-details/dispute-details/style.scss
+++ b/client/payment-details/dispute-details/style.scss
@@ -34,6 +34,21 @@
}
}
}
+
+ &__actions {
+ display: flex;
+ justify-content: start;
+ gap: $grid-unit-10;
+
+ @media screen and ( max-width: $break-small ) {
+ flex-direction: column;
+
+ .components-button {
+ width: 100%;
+ justify-content: center;
+ }
+ }
+ }
}
}
.dispute-reason-tooltip {
From d8ca8e6e7b2c9f3a63760c80b24e4e4db436691f Mon Sep 17 00:00:00 2001
From: Eric Jinks <3147296+Jinksi@users.noreply.github.com>
Date: Tue, 19 Sep 2023 14:18:25 +1000
Subject: [PATCH 45/49] Add tests for when actions are not allowed
---
.../summary/test/index.test.tsx | 48 +++++++++++++++++++
1 file changed, 48 insertions(+)
diff --git a/client/payment-details/summary/test/index.test.tsx b/client/payment-details/summary/test/index.test.tsx
index 38c4a75e35c..8817b5b1eca 100755
--- a/client/payment-details/summary/test/index.test.tsx
+++ b/client/payment-details/summary/test/index.test.tsx
@@ -505,6 +505,18 @@ describe( 'PaymentDetailsSummary', () => {
ignore: '.a11y-speak-region',
} );
screen.getByRole( 'button', { name: /View dispute details/i } );
+
+ // No actions rendered
+ expect(
+ screen.queryByRole( 'button', {
+ name: /Challenge/i,
+ } )
+ ).toBeNull();
+ expect(
+ screen.queryByRole( 'button', {
+ name: /Accept/i,
+ } )
+ ).toBeNull();
} );
test( 'correctly renders dispute details for "under_review" disputes', () => {
@@ -520,6 +532,18 @@ describe( 'PaymentDetailsSummary', () => {
ignore: '.a11y-speak-region',
} );
screen.getByRole( 'button', { name: /View submitted evidence/i } );
+
+ // No actions rendered
+ expect(
+ screen.queryByRole( 'button', {
+ name: /Challenge/i,
+ } )
+ ).toBeNull();
+ expect(
+ screen.queryByRole( 'button', {
+ name: /Accept/i,
+ } )
+ ).toBeNull();
} );
test( 'correctly renders dispute details for "accepted" disputes', () => {
@@ -539,6 +563,18 @@ describe( 'PaymentDetailsSummary', () => {
screen.getByText( /\$15.00 fee/i, {
ignore: '.a11y-speak-region',
} );
+
+ // No actions rendered
+ expect(
+ screen.queryByRole( 'button', {
+ name: /Challenge/i,
+ } )
+ ).toBeNull();
+ expect(
+ screen.queryByRole( 'button', {
+ name: /Accept/i,
+ } )
+ ).toBeNull();
} );
test( 'correctly renders dispute details for "lost" disputes', () => {
@@ -559,6 +595,18 @@ describe( 'PaymentDetailsSummary', () => {
ignore: '.a11y-speak-region',
} );
screen.getByRole( 'button', { name: /View dispute details/i } );
+
+ // No actions rendered
+ expect(
+ screen.queryByRole( 'button', {
+ name: /Challenge/i,
+ } )
+ ).toBeNull();
+ expect(
+ screen.queryByRole( 'button', {
+ name: /Accept/i,
+ } )
+ ).toBeNull();
} );
} );
} );
From 3709cc0b8bb0899dd0cb011648e7d891a36fba5d Mon Sep 17 00:00:00 2001
From: Eric Jinks <3147296+Jinksi@users.noreply.github.com>
Date: Tue, 19 Sep 2023 16:33:37 +1000
Subject: [PATCH 46/49] Remove `Button` from `Link` to simplify code
but keep functionality and styles
---
.../dispute-awaiting-response-details.tsx | 41 ++++++++-----------
1 file changed, 16 insertions(+), 25 deletions(-)
diff --git a/client/payment-details/dispute-details/dispute-awaiting-response-details.tsx b/client/payment-details/dispute-details/dispute-awaiting-response-details.tsx
index c313c5d83d6..f298df0cfaf 100644
--- a/client/payment-details/dispute-details/dispute-awaiting-response-details.tsx
+++ b/client/payment-details/dispute-details/dispute-awaiting-response-details.tsx
@@ -93,31 +93,22 @@ const DisputeAwaitingResponseDetails: React.FC< Props > = ( { dispute } ) => {
{ showDisputeActions && (
{
+ wcpayTracks.recordEvent(
+ wcpayTracks.events
+ .DISPUTE_CHALLENGE_CLICK,
+ {
+ dispute_status: dispute.status,
+ }
+ );
+ } }
>
-
+