You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Hold for payment 2021-08-17] Handle redirects to Invalid PolicyIds in WorkspaceCard and WorkspacePeople screens #4350
@mananjadhav I think your approach is checking for something that's already being checked inside WorkspaceSidebar. Don't you think? I think the root cause of the problem is Sidebar's returning null.
I am not aware if policy will get changed anywhere. If it does, then yeah we'll have to add it as a dependency. Empty brackets [], will act as a componentDidMount for class components.
It was already set up like this but can you please elaborate on this.
Earlier it was just returning null. Now we're calling Navigation.dismissModal. In the console tab of devtools you'll find the following error/warning.
Warning: Cannot update a component (`ForwardRef(BaseNavigationContainer)`) while rendering a different component (`WorkspaceSidebar`). To locate the bad setState() call inside `WorkspaceSidebar`, follow the stack trace as describ
Allow user to create a new Workspace with either the same page or WorkspaceNotFound page
@mananjadhav I think it makes sense to direct them to create a new Workspace in the case where no Workspace is setup yet. I don't think we need a new WorkspaceNotFound page, but can you explain in more details how you would accomplish this without a new WorkspaceNotFound page?
The second way to do this is to open the new workspace form in the WorkspaceCard itself. But this is a little extra effort and basically, users might get confused with two routes to create a new workspace.
changed the title [-]Handle redirects to Invalid PolicyIds in WorkspaceCard and WorkspacePeople screens[/-][+][Hold for payment 2021-08-17] Handle redirects to Invalid PolicyIds in WorkspaceCard and WorkspacePeople screens[/+]on Aug 13, 2021
Activity
MelvinBot commentedon Jul 31, 2021
Triggered auto assignment to @bfitzexpensify (
AutoAssignerTriage), see https://stackoverflow.com/c/expensify/questions/4749 for more details.mananjadhav commentedon Jul 31, 2021
Proposal
There are two approaches that we have:
Currently, WorkspaceCardPage doesn't take
policyas one of the props. WorkspacePeoplePage already haspolicypage.Common Code in both approaches
WorkspaceCardPage
Approach 1
Approach 2
Create a new page
WorkspaceNotFoundpage.// Will need help with the designaman-atg commentedon Jul 31, 2021
Proposal
Explaination
WorkspaceSidebarcomponent which is returning null when thepolicyobject isemptyNavigation.dismissModal();to avoid this behaviour or redirect the user somewhere we want.App/src/pages/workspace/WorkspaceSidebar.js
Lines 66 to 68 in 87cbc24
will be changed to
@mananjadhav I think your approach is checking for something that's already being checked inside
WorkspaceSidebar. Don't you think? I think the root cause of the problem is Sidebar's returningnull.mananjadhav commentedon Jul 31, 2021
@aman-atg That's right. I missed the check-in
WorkspaceSidebar. A small change in your approach. Otherwise, it will throw an exception.aman-atg commentedon Jul 31, 2021
@mananjadhav Shouldn't we include
policyinside the dependency array?It was already setup like this but can you please elaborate on this.
mananjadhav commentedon Jul 31, 2021
I am not aware if
policywill get changed anywhere. If it does, then yeah we'll have to add it as a dependency. Empty brackets [], will act as a componentDidMount for class components.Earlier it was just returning null. Now we're calling
Navigation.dismissModal. In the console tab of devtools you'll find the following error/warning.aman-atg commentedon Jul 31, 2021
@mananjadhav Thanks for the clarification.
23 remaining items
adelekennedy commentedon Aug 6, 2021
re-assigning @arielgreen while I'm ooo next week
timszot commentedon Aug 6, 2021
@mananjadhav I think it makes sense to direct them to create a new Workspace in the case where no Workspace is setup yet. I don't think we need a new
WorkspaceNotFoundpage, but can you explain in more details how you would accomplish this without a newWorkspaceNotFoundpage?mananjadhav commentedon Aug 6, 2021
@timszot Quickest approach is,
Worskspace doesn't exist/workspace/newThis the page it'll load

The second way to do this is to open the new workspace form in the WorkspaceCard itself. But this is a little extra effort and basically, users might get confused with two routes to create a new workspace.
timszot commentedon Aug 6, 2021
Nice! I like that simple approach here. @arielgreen Let's hire @mananjadhav for this please 🙏
arielgreen commentedon Aug 6, 2021
Done! @mananjadhav I also upped the price to include the bonus amount you receive for finding/proposing the issue.
mananjadhav commentedon Aug 6, 2021
Thanks, @arielgreen.
mananjadhav commentedon Aug 6, 2021
PR submitted for review.
timszot commentedon Aug 11, 2021
@arielgreen PR is merged for this as of yesterday
[-]Handle redirects to Invalid PolicyIds in WorkspaceCard and WorkspacePeople screens[/-][+][Hold for payment 2021-08-17] Handle redirects to Invalid PolicyIds in WorkspaceCard and WorkspacePeople screens[/+]arielgreen commentedon Aug 17, 2021
Paid.