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

[No QA] Display workspaces in settings page #3630

Merged
merged 7 commits into from
Jun 18, 2021
Merged

Conversation

roryabraham
Copy link
Contributor

@roryabraham roryabraham commented Jun 17, 2021

Details

Displays free policies (workspaces) in the settings page.

Fixed Issues

Fixes https://github.com/Expensify/Expensify/issues/166038

Tests

  1. Make sure you pull and rebuild auth.
  2. Comment out these lines on dev.
  3. Go to https://expensify.com.dev/ and sign in
  4. Go to https://www.expensify.com.dev/api?command=Policy_Create&policyName=WorkspaceTest&type=free to create a new policy w/ type free
  5. Run E.cash and sign into the same account you used on E.com
  6. Go to settings, verify that you see workspaces at the top of the list.
  7. Repeat step 4 (except with a different policy name)
  8. Verify that you see both free policies.

QA Steps

No QA for now.

Tested On

  • Web
  • Mobile Web
  • Desktop
  • iOS
  • Android

Screenshots

Web

image
image

Mobile Web

image

Desktop

image

iOS

image

Android

@roryabraham roryabraham self-assigned this Jun 17, 2021
@roryabraham roryabraham requested a review from a team as a code owner June 17, 2021 00:18
@MelvinBot MelvinBot requested review from luacmartins and removed request for a team June 17, 2021 00:19
@shawnborton
Copy link
Contributor

Looks good to me. I do wonder if we want to make the Workspace icon consistent across the board and have it use a green background everywhere? I think it uses a green background in the Create menu, so we might want to use it here as well as the workspace editor itself.

@roryabraham
Copy link
Contributor Author

I kinda like the idea of randomizing it to one of our colors like the default profile icons?

Copy link
Contributor

@marcaaron marcaaron left a comment

Choose a reason for hiding this comment

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

Looks good! Just had a few small comments / NAB.

src/components/MenuItem.js Outdated Show resolved Hide resolved

if (Permissions.canUseFreePlan(this.props.betas)) {
getPolicySummaries();
getPolicyList();
Copy link
Contributor

Choose a reason for hiding this comment

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

Curious if maybe we should fetch the policy list / policy summaries when the settings page opens so the policies will be up to date?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you mean instead of or in addition to here? I did notice that if you delete a policy using the API, then the change won't appear unless E.cash refreshes. Not sure that's a problem though ... changes made to the policies in E.cash should update Onyx and trigger a refresh, right?

In other words, I'm not sure we should wait until the settings page opens to fetch the policies, but we could re-fetch them there if we want to keep E.cash and E.com more in sync?

Copy link
Contributor

@marcaaron marcaaron Jun 18, 2021

Choose a reason for hiding this comment

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

I was thinking only when opening the settings. But thinking more on that we'll maybe want to access the policies in the /workspace page as well (which may or may not be accessed via /settings).

I did notice that if you delete a policy using the API, then the change won't appear unless E.cash refreshes.

Right, I don't think we care about this or subscriptions for policies yet if you meant updating in E.cash when deleting the policy via OldDot.

changes made to the policies in E.cash should update Onyx and trigger a refresh, right?

Good question, but let's back up for a second. What changes are we talking about here?

I think for this project it would be mainly altering policy members + creating new policies. The logic for those other two places hasn't really been built out yet so I suppose we can leave this for now and decide what to do later. I mainly suggested that we should put this in the settings page since that seems like the earliest time when we'd need to access our list of policies and not really when the app inits (as we already front load a lot of API calls).

src/pages/settings/InitialPage.js Outdated Show resolved Hide resolved
src/pages/settings/InitialPage.js Outdated Show resolved Hide resolved
@marcaaron
Copy link
Contributor

Random design feedback but curious if this hover style is correct as all the other hover styles are darkening the already grey areas e.g.

What we have now for non workspace icon on hover...
2021-06-17_07-27-41

workspace icon in this PR
2021-06-17_07-26-41

what I'd expect to see based on the behavior of darkening the grey area further...
2021-06-17_07-29-37

anyways pretty small detail but curious if @shawnborton has a preference here.

@shawnborton
Copy link
Contributor

I agree with you Marc, but if we make this icon use a green background to match the other areas where we show the new workspace, I would say we don't even need a hover style for the icon itself. Especially when we plan to have user uploaded avatars there, I don't think we need a hover style for the avatar that is shown.

luacmartins
luacmartins previously approved these changes Jun 17, 2021
Copy link
Contributor

@luacmartins luacmartins left a comment

Choose a reason for hiding this comment

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

LGTM! Just address Marc's and Shawn's concerns.

@roryabraham
Copy link
Contributor Author

Style and code updated 👍

image

* @returns {Object}
*/
function getSimplifiedPolicyObject(fullPolicy) {
return {
ID: fullPolicy.id,
Copy link
Contributor

Choose a reason for hiding this comment

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

NAB, probably would make this lower case to match the API.

@marcaaron marcaaron merged commit 2e7fab7 into main Jun 18, 2021
@marcaaron marcaaron deleted the Rory-ListWorspaces branch June 18, 2021 01:59
@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 in version: 1.0.71-1🚀

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

@OSBotify
Copy link
Contributor

🚀 Deployed to production in version: 1.0.73-3🚀

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.

5 participants