Show errors after workspace creation failure#12117
Conversation
|
There was an awkward behaviour with the offline testing, so I'll wait for this PR to be merged before I continue with this. |
|
Awkward behaviour fixed, after the PR was merged. |
Reviewer Checklist
Screenshots/Videos |
|
I did run into an odd UX while testing this. Probably not blockers for this specific PR, but things that are still weird in the overall flow that you might want to look into. Issue One
It would be great if we could show the RBR on the workspace settings page, and perhaps leave all options disabled if there was an error on creation. Issue Two
|
|
Do you need C+ review here? |
|
You can review it if you want. No need to do all the testing though |
|
@tgolen , I updated the logic to make the children non interactive when creation fails. You can take a look/test. |
|
I am busy with stuff so I will let it go. Thanks. |
tgolen
left a comment
There was a problem hiding this comment.
Cool, thanks for disabling those!
|
The PR for workspace list was merged, which meant I needed to tweak this, you can join in on the conversation here regarding a few concerns. |
|
@tgolen I removed the RBR on the workspace list item, you can review again/test. |
|
I'll update the PR description with the latest tests videos |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by @Justicea83 in version: 1.2.23-0 🚀
|
|
@Justicea83 We are not getting error when creating workspace. Is there any steps to trigger the workspace creation failure error? |
| brickRoadIndicator: PolicyUtils.getPolicyBrickRoadIndicatorStatus(policy, this.props.policyMembers), | ||
| pendingAction: policy.pendingAction, | ||
| isPolicy: true, | ||
| errors: policy.errors, |
There was a problem hiding this comment.
Didn't see any discussion about this change on this PR. Going to remove it and perform all the testing steps again to see if it can be safely added back
There was a problem hiding this comment.
We had a discussion on this. We wanted to only show the error message on the workspace details page. Like in this video.
2022-10-31_09-35-03.mp4
There was a problem hiding this comment.
There was a problem hiding this comment.
I now understand the context of that thread, and can see that my fix wasn't what was agreed upon in that thread. However, this PR didn't achieve what was agreed upon in that thread either. It was still a regression – we forgot to test the delete workspace flow with this PR. In that case, the workspace was just not showing at all, so there was no way to dismiss the red dot error that appeared in the settings menu.
|
🚀 Deployed to production by @Julesssss in version: 1.2.23-9 🚀
|
| * @returns {Boolean} | ||
| */ | ||
| hasPolicyCreationError() { | ||
| return Boolean(this.props.policy.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD && this.props.policy.errors); |
There was a problem hiding this comment.
The above logic caused issue:
because optimistic / success data is setting requiresCategory to null, therefore policy.errors will always be true.
App/src/libs/actions/Policy.ts
Lines 3571 to 3599 in 942c851
The proposed and implemented solution to fix this was to check !isEmptyObject(policy.errors) instead.












Details
Fixed Issues
$ https://github.com/Expensify/Expensify/issues/236995
Tests
Changes For Testing
+button >Create Workspaceelse skip to3....) >New Workspace.xto dismiss the error and ensure the workspace is removed(Not showing in the list).QA Steps
Settings>Domains>Groups.Restrict expense policy creation/removalon.step 3that you turnedRestrict expense policy creation/removalon.+button >Create Workspaceelse skip to3.Workspaces....) >New Workspace.xto dismiss the error and ensure the workspace is removed(Not showing in the list).PR Review Checklist
PR Author Checklist
### Fixed Issuessection aboveTestssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*filesWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)Avataris modified, I verified thatAvataris working as expected in all cases)PR Reviewer Checklist
The reviewer will copy/paste it into a new comment and complete it after the author checklist is completed
### Fixed Issuessection aboveTestssectionQA stepssectiontoggleReportand notonIconClick).src/languages/*filesWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarhave been tested & I retested again)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)Avataris modified, I verified thatAvataris working as expected in all cases)Screenshots
Web
2022-10-31_09-29-59.mp4
Mobile Web - Chrome
2022-10-31_09-30-55.mp4
Mobile Web - Safari
2022-10-31_09-32-05.mp4
Desktop
2022-10-31_09-35-03.mp4
iOS
2022-10-31_09-53-49.mp4
Android
2022-10-26_17-50-32.mp4