Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tiny improvement on the getShouldShowAlertPrompt method #5738

Merged
merged 2 commits into from
Oct 11, 2021

Conversation

Luke9389
Copy link
Contributor

@Luke9389 Luke9389 commented Oct 8, 2021

Details

Implementing a tiny improvement that @marcaaron suggested here: #5729 (comment)

Related to

#5729 (comment)

Tests

Same as Web QA done locally

QA Steps

  1. Launch App and login
  2. Create a workspace
  3. Navigate to the People
  4. Click on the "Invite" button
  5. Verify you can see the invite modal on the right hand side like in the screenshot below

Tested On

  • Web
  • Mobile Web
  • Desktop
  • iOS
  • Android

Screenshots

Web

Screen Shot 2021-10-08 at 12 11 16 PM

@Luke9389 Luke9389 self-assigned this Oct 8, 2021
@Luke9389 Luke9389 requested a review from a team as a code owner October 8, 2021 22:38
@MelvinBot MelvinBot requested review from NikkiWines and removed request for a team October 8, 2021 22:38
@@ -107,7 +107,7 @@ class WorkspaceInvitePage extends React.Component {
* @returns {Boolean}
*/
getShouldShowAlertPrompt() {
return _.size(lodashGet(this.props.policy, 'errors', {})) > 0 || lodashGet(this.props.policy, 'alertMessage.length') > 0;
return _.size(lodashGet(this.props.policy, 'errors', {})) > 0 || lodashGet(this.props.policy, 'alertMessage').length > 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this will actually cause the same problem as before 😅. If alertMessage isn't there it'll be calling length on undefined. I think we need just a default value to be the third parameter of the lodashGet function.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ha, I was just testing this and thought "wait a minute....." 🤦

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gimme one sec. Running this with a new account. Missed this comment #5727 (comment)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just ran this with a new account and it looks like alertMessage will be set as an empty string. I think I'll just default it to an empty string just in case?
Screen Shot 2021-10-08 at 5 15 33 PM

@Luke9389 Luke9389 changed the title Tiny improvement on the getShouldShowAlertPrompt method [HOLD] Tiny improvement on the getShouldShowAlertPrompt method Oct 8, 2021
@Luke9389 Luke9389 changed the title [HOLD] Tiny improvement on the getShouldShowAlertPrompt method Tiny improvement on the getShouldShowAlertPrompt method Oct 8, 2021
Copy link
Contributor

@NikkiWines NikkiWines left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@TomatoToaster TomatoToaster merged commit 93a8b25 into main Oct 11, 2021
@TomatoToaster TomatoToaster deleted the luke-quick-fix-alert-prompt branch October 11, 2021 19:13
@OSBotify
Copy link
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@OSBotify
Copy link
Contributor

🚀 Deployed to staging by @TomatoToaster in version: 1.1.7-25 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

@OSBotify
Copy link
Contributor

🚀 Deployed to production by @roryabraham in version: 1.1.8-9 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants