From 0f6487f20a2ce504e97705e7409f8c182e43d14f Mon Sep 17 00:00:00 2001 From: Sobit Neupane <073bct543.sobit@pcampus.edu.np> Date: Fri, 14 Jan 2022 12:40:51 +0545 Subject: [PATCH 1/3] Disable save button after saving self-select pronoun with a sapce at the end --- src/pages/settings/Profile/ProfilePage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/settings/Profile/ProfilePage.js b/src/pages/settings/Profile/ProfilePage.js index 70137aefa53d..4838f9e84a0a 100755 --- a/src/pages/settings/Profile/ProfilePage.js +++ b/src/pages/settings/Profile/ProfilePage.js @@ -177,7 +177,7 @@ class ProfilePage extends Component { })); // Determines if the pronouns/selected pronouns have changed - const arePronounsUnchanged = this.props.myPersonalDetails.pronouns === this.state.pronouns; + const arePronounsUnchanged = this.props.myPersonalDetails.pronouns === this.state.pronouns.trim(); // Disables button if none of the form values have changed const isButtonDisabled = (this.props.myPersonalDetails.firstName === this.state.firstName.trim()) From 88dcf7e4ab8f3c0e9a7abb370b1c805c490d5f72 Mon Sep 17 00:00:00 2001 From: Sobit Neupane <073bct543.sobit@pcampus.edu.np> Date: Fri, 14 Jan 2022 14:53:24 +0545 Subject: [PATCH 2/3] Check character limit in self-select pronoun after trimming --- src/pages/settings/Profile/ProfilePage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/settings/Profile/ProfilePage.js b/src/pages/settings/Profile/ProfilePage.js index 4838f9e84a0a..495d5bbfb6ec 100755 --- a/src/pages/settings/Profile/ProfilePage.js +++ b/src/pages/settings/Profile/ProfilePage.js @@ -161,7 +161,7 @@ class ProfilePage extends Component { } validateInputs() { - const [hasFirstNameError, hasLastNameError, hasPronounError] = ValidationUtils.doesFailCharacterLimit(50, [this.state.firstName, this.state.lastName, this.state.pronouns]); + const [hasFirstNameError, hasLastNameError, hasPronounError] = ValidationUtils.doesFailCharacterLimit(50, [this.state.firstName.trim(), this.state.lastName.trim(), this.state.pronouns.trim()]); this.setState({ hasFirstNameError, hasLastNameError, From bc9287d7fb52a0a126d6c568a6f1a64d294625e6 Mon Sep 17 00:00:00 2001 From: Sobit Neupane <073bct543.sobit@pcampus.edu.np> Date: Fri, 14 Jan 2022 15:45:24 +0545 Subject: [PATCH 3/3] Fix the lint warning --- src/pages/settings/Profile/ProfilePage.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pages/settings/Profile/ProfilePage.js b/src/pages/settings/Profile/ProfilePage.js index 495d5bbfb6ec..3f5ebeca14aa 100755 --- a/src/pages/settings/Profile/ProfilePage.js +++ b/src/pages/settings/Profile/ProfilePage.js @@ -161,7 +161,10 @@ class ProfilePage extends Component { } validateInputs() { - const [hasFirstNameError, hasLastNameError, hasPronounError] = ValidationUtils.doesFailCharacterLimit(50, [this.state.firstName.trim(), this.state.lastName.trim(), this.state.pronouns.trim()]); + const [hasFirstNameError, hasLastNameError, hasPronounError] = ValidationUtils.doesFailCharacterLimit( + 50, + [this.state.firstName.trim(), this.state.lastName.trim(), this.state.pronouns.trim()], + ); this.setState({ hasFirstNameError, hasLastNameError,