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

[$500] Web - Workspace - User does not navigates to Admin room when create new Workspace #32842

Closed
1 of 6 tasks
kbecciv opened this issue Dec 11, 2023 · 48 comments
Closed
1 of 6 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors

Comments

@kbecciv
Copy link

kbecciv commented Dec 11, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: 1.4.11-1
Reproducible in staging?: y
Reproducible in production?: y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:

Action Performed:

  1. Navigate to staging.new.expensify.com
  2. Login with an account with no workspace
  3. Create a workspace via the FAB button

Expected Result:

User should be navigated to the #admins room

Actual Result:

User does not navigates to Admin room

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

Bug6309344_1702315137928.Recording__1524.1.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01fc9b8851006df053
  • Upwork Job ID: 1734267218774921216
  • Last Price Increase: 2024-01-22
  • Automatic offers:
    • DylanDylann | Contributor | 28121336
@kbecciv kbecciv added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Dec 11, 2023
@melvin-bot melvin-bot bot changed the title Web - Workspace - User does not navigates to Admin room when create new Workspace [$500] Web - Workspace - User does not navigates to Admin room when create new Workspace Dec 11, 2023
Copy link

melvin-bot bot commented Dec 11, 2023

Job added to Upwork: https://www.upwork.com/jobs/~01fc9b8851006df053

Copy link

melvin-bot bot commented Dec 11, 2023

Triggered auto assignment to @conorpendergrast (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Dec 11, 2023
Copy link

melvin-bot bot commented Dec 11, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

Copy link

melvin-bot bot commented Dec 11, 2023

Triggered auto assignment to Contributor-plus team member for initial proposal review - @thesahindia (External)

@shahinyan11
Copy link

shahinyan11 commented Dec 11, 2023

Proposal

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

Web - Workspace - User does not navigates to Admin room when create new Workspace

What is the root cause of that problem?

There is not navigation to admins room after clicking New Workspace

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

  1. Change this line with below code
 const adminsChatReportID = Policy.createWorkspace(policyOwnerEmail, makeMeAdmin, policyName, policyID);
  1. Add below code before this line
Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(adminsChatReportID));
Untitled.mov

What alternative solutions did you explore? ( Optional)

To avoid changing the Policy.createDraftInitialWorkspace with Policy.createWorkspace we should update createDraftInitialWorkspace function so add draft report in Onyx data too

@brunovjk
Copy link
Contributor

Proposal

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

The issue at hand revolves around users not being directed to the Admin room upon creating a new workspace.

What is the root cause of that problem?

The crux of the matter lies in the absence of redirection logic after crafting a workspace on the WorkspaceInitialPage. The critical sequence involves drafting, navigating to the initial workspace page, and finalizing the workspace creation. The absence to redirect to the #admins room is at the heart of the problem.

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

I suggest we start by modifying the savePolicyDraftByNewWorkspace function in App.ts. The adjustment involves aligning it with the existing behavior in the createWorkspace function in Policy.js, ensuring a consistent approach to obtaining the adminsChatReportID after workspace creation.

function savePolicyDraftByNewWorkspace(policyID?: string, policyName?: string, policyOwnerEmail = '', makeMeAdmin = false) {
    return Policy.createWorkspace(policyOwnerEmail, makeMeAdmin, policyName, policyID);
}

Furthermore, in the WorkspaceInitialPage.js component, a delay is introduced after calling App.savePolicyDraftByNewWorkspace before navigating to the Admins Room. This delay ensures the user has adequate time to witness the workspace creation before redirection.

...
const policyDraftId = lodashGet(props.policyDraft, 'id', null);
if (!policyDraftId) {
    return;
}
const adminsChatReportID = App.savePolicyDraftByNewWorkspace(props.policyDraft.id, props.policyDraft.name, '', props.policyDraft.makeMeAdmin);

// After a small delay, navigate to Admins Room
setTimeout(() => {
    Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(adminsChatReportID));
}, 2000); // Adjust the delay time as needed

POC

32842_delay_to_admin.mp4

What alternative solutions did you explore? (Optional)

An alternative route involves integrating navigation directly to the #admins room after createDraftInitialWorkspace. This approach bypasses the intermediary step through WorkspaceInitialPage, simplifying the process.

function createWorkspaceWithPolicyDraftAndNavigateToIt(policyOwnerEmail = '', policyName = '', transitionFromOldDot = false, makeMeAdmin = false) {
...
    const adminsChatReportID = savePolicyDraftByNewWorkspace(policyID, policyName, '', makeMeAdmin);

    Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(adminsChatReportID));
...
}
32842_admin_direct.mp4

Note:I believe it would be a better approach if we can redirect to Workspace Welcome page instead of #AdminChat.

@melvin-bot melvin-bot bot added the Overdue label Dec 13, 2023
Copy link

melvin-bot bot commented Dec 15, 2023

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

Copy link

melvin-bot bot commented Dec 18, 2023

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@allstarsmen
Copy link

@conorpendergrast @thesahindia I don't think this is a bug.

Based on this comment in issue 28573, this is an expected behavior.

Copy link

melvin-bot bot commented Dec 19, 2023

@conorpendergrast, @thesahindia 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

@conorpendergrast
Copy link
Contributor

@kbecciv did this come from a specific regression test? If so, could you link to that? Otherwise, I agree that this isn't expected behaviour. I'll close for now, but am open to correction!

@kbecciv
Copy link
Author

kbecciv commented Dec 20, 2023

@kbecciv kbecciv reopened this Dec 20, 2023
@melvin-bot melvin-bot bot added the Overdue label Dec 25, 2023

This comment was marked as duplicate.

This comment was marked as duplicate.

This comment was marked as duplicate.

This comment was marked as duplicate.

This comment was marked as duplicate.

@zanyrenney
Copy link
Contributor

apologies about the silence here @conorpendergrast - appreciate the bump.

@conorpendergrast
Copy link
Contributor

@thesahindia Oh, oops, I just spotted that there are two proposals above to review!

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Jan 19, 2024
Copy link

melvin-bot bot commented Jan 22, 2024

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@brunovjk
Copy link
Contributor

Hi @conorpendergrast, any feedback on my proposal? Thanks.

@thesahindia
Copy link
Member

@conorpendergrast, please reassign. I am not in a good shape, I won't be able to review.

@melvin-bot melvin-bot bot removed the Overdue label Jan 24, 2024
@thesahindia thesahindia removed their assignment Jan 24, 2024
@conorpendergrast
Copy link
Contributor

Checking!

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Jan 25, 2024
Copy link

melvin-bot bot commented Jan 25, 2024

📣 @DylanDylann 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@conorpendergrast
Copy link
Contributor

Assigning @DylanDylann as C+, so adding the labels back

@conorpendergrast conorpendergrast added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jan 25, 2024
@shahinyan11
Copy link

@conorpendergrast Should I expect feedback about my proposal or no ?

@conorpendergrast
Copy link
Contributor

@shahinyan11 Yeah; @DylanDylann has taken over as Contributor+. First task is to review all proposals!

@DylanDylann
Copy link
Contributor

DylanDylann commented Jan 26, 2024

@conorpendergrast Thanks for clearing the step here In step 1

Login with an account with no workspace (or delete all workspaces)

You mean that we only should navigate to the admin room in the background if the user creates the first workspace, right?
In case, the current account has some workspaces and the user creates one more workspace. Do we want to navigate to the admin room in the background?

@dukenv0307
Copy link
Contributor

dukenv0307 commented Jan 26, 2024

Proposal

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

  • Web - Workspace - User does not navigates to Admin room when create new Workspace

What is the root cause of that problem?

  • We do not have a logic that navigates to the admin room when creating new workspace in here

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

  • Generally, we will add the admin report to the navigation stack like we add the report screen to stack if there was no report screen in the stack yet. Steps to do it:
  1. Create a global variable, named policyAdminReportID and its getter, setter functions.
  2. Before we open the Workspace Initial page:
    Navigation.navigate(ROUTES.WORKSPACE_INITIAL.getRoute(policyID));
    call:
    setPolicyAdminReportID(adminChatReportID)
  1. In CustomRouter, create a function addReport that will add the report screen to the second position from the end.
const addReport = (state: State, reportID: string) => {
    const centralPaneNavigatorRoute = {
        name: NAVIGATORS.CENTRAL_PANE_NAVIGATOR,
        state: {
            routes: [
                {
                    name: SCREENS.REPORT,
                    params: {
                        reportID,
                    },
                },
            ],
        },
    };
    state.routes.splice(state.routes.length - 1, 0, centralPaneNavigatorRoute);
    // eslint-disable-next-line no-param-reassign, @typescript-eslint/non-nullable-type-assertion-style
    (state.index as number) = state.routes.length - 1;
};
  1. Finally, in getRehydratedState, adding the condition:
            } else if (getPolicyAdminReportID()) {
                addReport(partialState, policyAdminReportID);
                setPolicyAdminReportID('');
            }

What alternative solutions did you explore? (Optional)

  • NA

POC

Screencast.from.26-01-2024.13.23.42.webm

@shahinyan11
Copy link

shahinyan11 commented Jan 26, 2024

Proposal

Updated

@conorpendergrast
Copy link
Contributor

conorpendergrast commented Jan 26, 2024

@DylanDylann That's a great clarifying question. Thinking through it again, I think that creating any workspace should navigate to that new workspace's room in the background (not just a first workspace). I'll check my thinking on that in the wave's Slack channel, and will come back to confirm the correct behaviour

@conorpendergrast
Copy link
Contributor

Ah, I forgot that we're overhauling the new workspace flow entirely at the moment. So, this is not worth fixing! Closing out, thanks very much for your time everyone!

@github-project-automation github-project-automation bot moved this from Release I: Ideal Nav & Collect Simplfied Profile, Members, Categories, Workflows (approvals) to Done in [#whatsnext] Wave 08 - Collect Plan Admins Jan 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors
Projects
No open projects
Development

No branches or pull requests

9 participants