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

Workspace page upgrades for a user that asked to join one or more available workspaces during signup #54483

Open
2 tasks
anmurali opened this issue Dec 23, 2024 · 19 comments
Assignees
Labels

Comments

@anmurali
Copy link

anmurali commented Dec 23, 2024

Related to #48189 (comment)

Workspace page for a user that asked to join one or more workspaces in the sign up flow

  • On the workspaces page, show the workspace row they’re pending to be accepted to join with the “[Requested]” badge (just like a policy join request that needs to be approved)
image
  • If they select New Workspace in the + menu or Workspace page, have a warning just to let them know we’re waiting on their colleagues to still accept the request to join

Working on the mockups

Copy link

melvin-bot bot commented Dec 31, 2024

Triggered auto assignment to @shawnborton (Design), see these Stack Overflow questions for more details.

@anmurali
Copy link
Author

@shawnborton assigned you to help me with figma mockups for those two. @jamesdeanexpensify - can you help us with the copy for the warning message? The intention is to prevent an employee that is waiting to join an existing workspace from creating a new one in error.

@parasharrajat
Copy link
Member

parasharrajat commented Dec 31, 2024

We already have the first part of this, showing requested badge. We just need to implement the part 2 for showing warning. We just need mockup. I can help in building that up.

Screenshot 2025-01-01 at 12 15 12 AM

@jamesdeanexpensify
Copy link
Contributor

Something simple like this?

Create new workspace? (alts: "Heads up!" or "Are you sure?")
You've already requested to join an existing workspace. Are you sure you want to create a new one?

@parasharrajat
Copy link
Member

parasharrajat commented Dec 31, 2024

You mean this kind of modal with your text and green button instead of red.

Screenshot 2025-01-01 at 12 18 24 AM

@jamesdeanexpensify
Copy link
Contributor

Yeah so maybe like:

Create workspace
You've already requested to join an existing workspace. Are you sure you want to create a new one?

@parasharrajat
Copy link
Member

That looks good. If we agree, I can write down the steps as a proposal and start.

@jamesdeanexpensify
Copy link
Contributor

Let's see what @anmurali thinks!

@parasharrajat
Copy link
Member

parasharrajat commented Dec 31, 2024

Edited by proposal-police: This proposal was edited at 2024-12-31 21:25:38 UTC.

Proposal

Please re-state the problem that we are trying to solve in this issue.

  1. On the workspaces page, show the workspace row they’re pending to be accepted to join with the “[Requested]” badge (just like a policy join request that needs to be approved)
  2. If they select New Workspace in the + menu or Workspace page, have a warning just to let them know we’re waiting on their colleagues to still accept the request to join

What is the root cause of that problem?

NewFeature

What changes do you think we should make in order to solve the problem?

  1. First part is already implemented.
    image

  2. For part 2, We will make following changes to WorkspaceListPage.tsx

  • Add a new Confirm Modal for confirmation.
            <ConfirmModal
               title={translate('key for Create Worksapce')}
               isVisible={isCreateWarningVisible}
               onConfirm={() => interceptAnonymousUser(() => App.createWorkspaceWithPolicyDraftAndNavigateToIt())}
               onCancel={() => setIsCreateWarningVisible(false)}
               prompt={translate('key for prompt')}
               confirmText={translate('common.create')}
               cancelText={translate('common.cancel')}
               success
           />
  • Add new state boolean state like isCreateWarningVisible to control the visibility of modal.
  • We need a new variable to check if we have a policy with pending invite.
const hasJoinPendingPolicy = useMemo(() => {
     if (isEmptyObject(policies)) {
         return false;
     }

     return Object.values(policies).some((policy) => PolicyUtils.shouldShowPolicy(policy, isOffline, session?.email) && policy?.isJoinRequestPending);
 }, [policies, isOffline, session?.email]);
  • Then we will update New Workspace button onPress handler to show this modal in getHeaderButton function.
```
onPress={() => {
            if (hasJoinPendingPolicy) {
                setIsCreateWarningVisible(true);
                return;
            }
            interceptAnonymousUser(() => App.createWorkspaceWithPolicyDraftAndNavigateToIt());
        }}
```        

Result UI

image

What alternative solutions did you explore? (Optional)

@melvin-bot melvin-bot bot added Daily KSv2 and removed Monthly KSv2 labels Dec 31, 2024
@shawnborton
Copy link
Contributor

Thanks for the mock @parasharrajat - let's see if this is what @anmurali had in mind. cc @Expensify/design for visibility too

One thing to call out - before we make this change, should we wait until the workspace confirmation modal is merged? That might actually kind of solve this problem and maybe we could just close this?

@shubham1206agra
Copy link
Contributor

One thing to call out - before we make this change, should we wait until the workspace confirmation modal is merged? That might actually kind of solve this problem and maybe we could just close this?

@shawnborton It will not solve this problem. I know this cause I am reviewing that PR. Can I take over this issue as C+ since I have some context over workspace creation?

@melvin-bot melvin-bot bot added the Overdue label Jan 6, 2025
@shubham1206agra
Copy link
Contributor

@parasharrajat Please fix the hasJoinPendingPolicy. It should use every instead of some since the prompt should be shown if every workspace is marked as requested.

@parasharrajat
Copy link
Member

Why every? Requirement does not mention that particularly.

@shubham1206agra
Copy link
Contributor

Why every? Requirement does not mention that particularly.

Yes, but I believe that was @anmurali's intention. To show the prompt if every workspace has the status as requested. This will be cleared up when we heard back from her about this.

Copy link

melvin-bot bot commented Jan 6, 2025

@shawnborton Whoops! This issue is 2 days overdue. Let's get this updated quick!

@anmurali
Copy link
Author

anmurali commented Jan 7, 2025

I like the mockup and the proposal. Re: the every vs. some - it's a good call out. Basically if I am already in a workspace, and have one pending on a request and go to create another, should there be a warning or not - that's the question?

before we make this change, should we wait until the workspace confirmation modal is merged? That might actually kind of solve this problem and maybe we could just close this?

@shubham1206agra why won't this cover this case? Is it cause this PR only triggers a warning if the user is already a part of another workspace, i.e. not pending joining?

@shubham1206agra
Copy link
Contributor

Is it cause this PR only triggers a warning if the user is already a part of another workspace, i.e. not pending joining?

Cause I don't see any warning modals in that PR.

@shawnborton
Copy link
Contributor

Sorry, to clarify - I am saying that maybe the upcoming workspace confirmation modal is enough here and we don't need to introduce a new pattern of having a warning modal. Basically it used to be way too easy to create a workspace - one press of the button and one would be created for you. Now we're making it so that if you press the create workspace button, you are met with a confirmation screen to set the name/photo first.

If we still think we need the warning modal, I am totally cool with that. Just wanted to call the above out. Otherwise yeah, we can try something like this:
image

@melvin-bot melvin-bot bot removed the Overdue label Jan 7, 2025
@dannymcclain
Copy link
Contributor

I guess I don't feel too strongly but agree with Shawn that the workspace confirmation might help with this issue. I feel like we had a very very similar issue not too long ago that we decided to close because we felt like the workspace confirmation would be enough. But if we really want a warning, I like what you guys have with the confirmation dialog. Could we make the button say "Create workspace" though instead of just "Create"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Development

No branches or pull requests

6 participants