From 02e67fd82842577691678a32a90df508ef343cf0 Mon Sep 17 00:00:00 2001 From: Nicolas Brossard Date: Fri, 5 Apr 2024 16:28:36 -0400 Subject: [PATCH 1/2] [new_profile] Site not selected when recruiting another candidate --- modules/new_profile/jsx/NewProfileIndex.js | 14 ++++++-------- modules/new_profile/test/TestPlan.md | 1 + 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/modules/new_profile/jsx/NewProfileIndex.js b/modules/new_profile/jsx/NewProfileIndex.js index cdcdfe58e67..f6ec564531e 100644 --- a/modules/new_profile/jsx/NewProfileIndex.js +++ b/modules/new_profile/jsx/NewProfileIndex.js @@ -140,14 +140,12 @@ class NewProfileIndex extends React.Component { cancelButtonColor: '#3085d6', cancelButtonText: 'Recruit another candidate', }).then((result) => { - if (result.value === true) { - window.location.href = '/' + data.CandID; - } else { - this.setState({ - formData: {}, - submitDisabled: false, - }); - } + // Go to the candidate profile or reload the page, depending + // on whether the user clicked on 'Access Profile' or + // 'Recruit another candidate' respectively + window.location.href = result.value === true + ? window.location.href = '/' + data.CandID + : window.location.href; }); } ) .catch((error) => { diff --git a/modules/new_profile/test/TestPlan.md b/modules/new_profile/test/TestPlan.md index 0f5ba7cf6f0..44928da3738 100644 --- a/modules/new_profile/test/TestPlan.md +++ b/modules/new_profile/test/TestPlan.md @@ -31,4 +31,5 @@ have the current day as the maximum possible value to choose. 10. Change date format from 'YMd' to 'YM' in the Configuration module and repeat steps 4 to 6 while asserting that database values being saved are correct. +11. As a user with only one site affiliation, fill the form with valid values and create a new user. When the popup indicating that the creation succeeded is displayed, click on 'Recruit another candidate'. Ensure that when the page reloads, the user's (unique) site is selected. [Manual Testing] From 9bd1e4407f718d19f9e66ec36498e2884dc0624f Mon Sep 17 00:00:00 2001 From: Nicolas Brossard Date: Thu, 11 Apr 2024 10:45:22 -0400 Subject: [PATCH 2/2] Jefferson's suggestions --- modules/new_profile/jsx/NewProfileIndex.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/new_profile/jsx/NewProfileIndex.js b/modules/new_profile/jsx/NewProfileIndex.js index f6ec564531e..4faf94a1245 100644 --- a/modules/new_profile/jsx/NewProfileIndex.js +++ b/modules/new_profile/jsx/NewProfileIndex.js @@ -144,7 +144,7 @@ class NewProfileIndex extends React.Component { // on whether the user clicked on 'Access Profile' or // 'Recruit another candidate' respectively window.location.href = result.value === true - ? window.location.href = '/' + data.CandID + ? '/' + data.CandID : window.location.href; }); } )