From 001804d77315e766bcc557ed7fd1852db207c509 Mon Sep 17 00:00:00 2001 From: Vipin Kumar Date: Sat, 29 Jul 2023 13:04:50 +0530 Subject: [PATCH 1/4] fix: 23369 back button navigation fixed for ondify steps --- src/components/Onfido/index.css | 4 ++++ .../ReimbursementAccount/RequestorOnfidoStep.js | 12 +++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/components/Onfido/index.css b/src/components/Onfido/index.css index 7e05cce7d49d..1c19a2728197 100644 --- a/src/components/Onfido/index.css +++ b/src/components/Onfido/index.css @@ -47,3 +47,7 @@ height: 92% !important; } } + +.onfido-sdk-ui-NavigationBar-back { + visibility: hidden; +} diff --git a/src/pages/ReimbursementAccount/RequestorOnfidoStep.js b/src/pages/ReimbursementAccount/RequestorOnfidoStep.js index 5d91f5dae562..d2d262eb9e0e 100644 --- a/src/pages/ReimbursementAccount/RequestorOnfidoStep.js +++ b/src/pages/ReimbursementAccount/RequestorOnfidoStep.js @@ -31,6 +31,16 @@ class RequestorOnfidoStep extends React.Component { constructor(props) { super(props); this.submit = this.submit.bind(this); + this.goBack = this.goBack.bind(this); + } + + goBack(...args) { + const ondifyBack = document.getElementsByClassName('onfido-sdk-ui-NavigationBar-back'); + if (ondifyBack.length && !ondifyBack[0].classList.contains('onfido-sdk-ui-NavigationBar-disabled')) { + ondifyBack[0].click(); + } else { + this.props.onBackButtonPress(...args); + } } submit(onfidoData) { @@ -50,7 +60,7 @@ class RequestorOnfidoStep extends React.Component { stepCounter={{step: 3, total: 5}} shouldShowGetAssistanceButton guidesCallTaskID={CONST.GUIDES_CALL_TASK_IDS.WORKSPACE_BANK_ACCOUNT} - onBackButtonPress={this.props.onBackButtonPress} + onBackButtonPress={this.goBack} /> From eb4b50baa4a8df8147cad1ccd42ef1972b16eaa8 Mon Sep 17 00:00:00 2001 From: Vipin Kumar Date: Sat, 29 Jul 2023 22:38:13 +0530 Subject: [PATCH 2/4] Trigger Build From c7fc62496dca5ad0d8be26f419175b0c8de1dfe0 Mon Sep 17 00:00:00 2001 From: Vipin Kumar Date: Tue, 1 Aug 2023 07:32:46 +0530 Subject: [PATCH 3/4] getElementByClass replaced with querySelector --- src/pages/ReimbursementAccount/RequestorOnfidoStep.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pages/ReimbursementAccount/RequestorOnfidoStep.js b/src/pages/ReimbursementAccount/RequestorOnfidoStep.js index d2d262eb9e0e..53b30d89df77 100644 --- a/src/pages/ReimbursementAccount/RequestorOnfidoStep.js +++ b/src/pages/ReimbursementAccount/RequestorOnfidoStep.js @@ -35,9 +35,9 @@ class RequestorOnfidoStep extends React.Component { } goBack(...args) { - const ondifyBack = document.getElementsByClassName('onfido-sdk-ui-NavigationBar-back'); - if (ondifyBack.length && !ondifyBack[0].classList.contains('onfido-sdk-ui-NavigationBar-disabled')) { - ondifyBack[0].click(); + const onfidoBack = document.querySelector('.onfido-sdk-ui-NavigationBar-back'); + if (onfidoBack && !onfidoBack.classList.contains('onfido-sdk-ui-NavigationBar-disabled')) { + onfidoBack.click(); } else { this.props.onBackButtonPress(...args); } From 5671c62cb589e27391ceb594c27d6ef53f440ac4 Mon Sep 17 00:00:00 2001 From: Vipin Kumar Date: Tue, 1 Aug 2023 18:05:06 +0530 Subject: [PATCH 4/4] comment added in css file and args removed from function call --- src/components/Onfido/index.css | 2 ++ src/pages/ReimbursementAccount/RequestorOnfidoStep.js | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/Onfido/index.css b/src/components/Onfido/index.css index 1c19a2728197..fba72e0139c1 100644 --- a/src/components/Onfido/index.css +++ b/src/components/Onfido/index.css @@ -49,5 +49,7 @@ } .onfido-sdk-ui-NavigationBar-back { + /* This keeps onfido back button hidden since there is already a back button in the top header which + programatically clicks onfido button. */ visibility: hidden; } diff --git a/src/pages/ReimbursementAccount/RequestorOnfidoStep.js b/src/pages/ReimbursementAccount/RequestorOnfidoStep.js index 53b30d89df77..f86cbaba79b0 100644 --- a/src/pages/ReimbursementAccount/RequestorOnfidoStep.js +++ b/src/pages/ReimbursementAccount/RequestorOnfidoStep.js @@ -34,12 +34,12 @@ class RequestorOnfidoStep extends React.Component { this.goBack = this.goBack.bind(this); } - goBack(...args) { + goBack() { const onfidoBack = document.querySelector('.onfido-sdk-ui-NavigationBar-back'); if (onfidoBack && !onfidoBack.classList.contains('onfido-sdk-ui-NavigationBar-disabled')) { onfidoBack.click(); } else { - this.props.onBackButtonPress(...args); + this.props.onBackButtonPress(); } }