-
Notifications
You must be signed in to change notification settings - Fork 3k
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
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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? |
@@ -122,7 +127,6 @@ class WorkspacesListPage extends Component { | |||
brickRoadIndicator: PolicyUtils.getPolicyBrickRoadIndicatorStatus(policy, this.props.policyMembers), | |||
pendingAction: policy.pendingAction, | |||
isPolicy: true, | |||
errors: policy.errors, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change caused a regression
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
optimisticData: [ | |
{ | |
onyxMethod: Onyx.METHOD.MERGE, | |
key: `${ONYXKEYS.COLLECTION.POLICY}${policyID}`, | |
value: { | |
requiresCategory, | |
errors: { | |
requiresCategory: null, | |
}, | |
pendingFields: { | |
requiresCategory: CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE, | |
}, | |
}, | |
}, | |
], | |
successData: [ | |
{ | |
onyxMethod: Onyx.METHOD.MERGE, | |
key: `${ONYXKEYS.COLLECTION.POLICY}${policyID}`, | |
value: { | |
errors: { | |
requiresCategory: null, | |
}, | |
pendingFields: { | |
requiresCategory: null, | |
}, | |
}, | |
}, | |
], |
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 Workspace
else skip to3
....
) >New Workspace
.x
to dismiss the error and ensure the workspace is removed(Not showing in the list).QA Steps
Settings
>Domains
>Groups
.Restrict expense policy creation/removal
on.step 3
that you turnedRestrict expense policy creation/removal
on.+
button >Create Workspace
else skip to3
.Workspaces
....
) >New Workspace
.x
to dismiss the error and ensure the workspace is removed(Not showing in the list).PR Review Checklist
PR Author Checklist
### Fixed Issues
section aboveTests
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
filesWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG
)Avatar
is modified, I verified thatAvatar
is 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 Issues
section aboveTests
sectionQA steps
sectiontoggleReport
and notonIconClick
).src/languages/*
filesWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
have been tested & I retested again)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG
)Avatar
is modified, I verified thatAvatar
is 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