-
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
Changes from all commits
5edd8c5
f07b9fc
8c7395a
6d01d82
d609cf4
eac41f2
09fdaef
38b34a4
6be3ef2
d0408fb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -80,6 +80,11 @@ function dismissWorkspaceError(policyID, pendingAction) { | |
Policy.clearDeleteWorkspaceError(policyID); | ||
return; | ||
} | ||
|
||
if (pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD) { | ||
Policy.removeWorkspace(policyID); | ||
return; | ||
} | ||
throw new Error('Not implemented'); | ||
} | ||
|
||
|
@@ -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 commentThe 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 commentThe 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 commentThe 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.mp4There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe 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. |
||
dismissError: () => dismissWorkspaceError(policy.id, policy.pendingAction), | ||
disabled: policy.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE, | ||
})) | ||
|
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
tonull
, thereforepolicy.errors
will always betrue
.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.