-
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
[HOLD for payment 2024-09-06] [$250] Workflows - "Approver" field disappears after unselecting approver #47723
Comments
Triggered auto assignment to @abekkala ( |
We think that this bug might be related to #wave-collect - Release 2 |
@abekkala FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors |
ProposalPlease re-state the problem that we are trying to solve in this issue.The approver field disappears when unselecting the approver. What is the root cause of that problem?The approver field is shown based on the approver array. App/src/pages/workspace/workflows/approvals/ApprovalWorkflowEditor.tsx Lines 130 to 134 in c7ec59b
When we unselect the approver, the array is empty, thus, nothing is shown. What changes do you think we should make in order to solve the problem?If the approver is empty, we can render a menu item with minimum details.
We will need to do this for create approval flow too. |
ProposalPlease re-state the problem that we are trying to solve in this issue.Workflows - "Approver" field disappears after unselecting approver What is the root cause of that problem?We allow user to unselect the first approver and save it What changes do you think we should make in order to solve the problem?The first approver should always be mandatory in all cases. We should allow the user to update the approver but prevent them from deselecting the selected approver. App/src/pages/workspace/workflows/approvals/WorkspaceWorkflowsApprovalsApproverPage.tsx Line 198 in 685bb4c
We should disable the submit button if the user doesn't select an approver on the first approver selection page
What alternative solutions did you explore? (Optional)Do nothing if user unselect the first approver (we still allow user change the first approver, we only prevent user from unselecting)
|
@DylanDylann Do you take care this issue? Because I see you reviewed a couple of issues that relates to this feature
If yes, please confirm this expected. TIA |
@blazejkustra Oh, we've got a new little one! In this case, If the user continues to click on the ![]() If we move forward with this issue with an external contributor, I suggest going with @daledah's proposal
|
Job added to Upwork: https://www.upwork.com/jobs/~01ac1b073e9e5491ad |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @jjcoffee ( |
I think we're good to go with @bernhardoj's proposal here, as we already have an error to display if we try and save without an approver. @daledah's proposal would result in a lack of feedback to the user. 🎀👀🎀 C+ reviewed |
Triggered auto assignment to @mountiny, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
PR is ready cc: @jjcoffee |
@jjcoffee Ah see your point, I gave my opinion previously to make it consistent with "Expense from" section (editing flow) Screen.Recording.2024-08-25.at.17.46.48.movAnd the creation flow (we disable the button if there are no selected option) If we go with @bernhardoj's solution, please also update the "Expense from" section (in the editing flow) to make it consistent. Thanks |
Hey guys! Let's not overcomplicate this, we just need to change the copy on the Not a Proposal 😆diff --git a/src/pages/workspace/workflows/approvals/ApprovalWorkflowEditor.tsx b/src/pages/workspace/workflows/approvals/ApprovalWorkflowEditor.tsx
index 9864241a8e8..f232e971b24 100644
--- a/src/pages/workspace/workflows/approvals/ApprovalWorkflowEditor.tsx
+++ b/src/pages/workspace/workflows/approvals/ApprovalWorkflowEditor.tsx
@@ -97,7 +97,7 @@ function ApprovalWorkflowEditor({approvalWorkflow, removeApprovalWorkflow, polic
// User should be allowed to add additional approver only if they upgraded to Control Plan, otherwise redirected to the Upgrade Page
const addAdditionalApprover = useCallback(() => {
- if (!PolicyUtils.isControlPolicy(policy)) {
+ if (!PolicyUtils.isControlPolicy(policy) && approvalWorkflow.approvers.length > 0) {
Navigation.navigate(ROUTES.WORKSPACE_UPGRADE.getRoute(policyID, CONST.UPGRADE_FEATURE_INTRO_MAPPING.approvals.alias, Navigation.getActiveRoute()));
return;
}
@@ -151,7 +151,7 @@ function ApprovalWorkflowEditor({approvalWorkflow, removeApprovalWorkflow, polic
})}
<MenuItemWithTopDescription
- description={translate('workflowsCreateApprovalsPage.additionalApprover')}
+ description={approvalWorkflow.approvers.length === 0 ? translate('workflowsPage.approver') : translate('workflowsCreateApprovalsPage.additionalApprover')}
onPress={addAdditionalApprover}
shouldShowRightIcon
wrapperStyle={styles.sectionMenuItemTopDescription} |
@daledah I believe it is against Expensify's guidelines, we don't want to disable the submit button and instead allow user to make an action and display an error.
Maybe we should do the other way around and make Expenses From page consistent with Approver and Confirm screen? Meaning: allow the user to create an invalid state in the form and display an error when clicking on the submit button. |
@blazejkustra That doesn't sound quite related to this issue, at least I don't think the (not a) proposal would do anything to fix the issue of the Regarding the Expenses From flow, I think we can make it consistent with the Approver screen. It makes sense to block tapping the |
@jjcoffee Check out the logic in
The idea behind this setup is to always have one empty menu item displayed ( Here is the video of how it behaves with my fix: Screen.Recording.2024-08-26.at.15.05.18.mov |
@blazejkustra Ahh gotcha, now it makes sense! I thought that having the I'm a bit on the fence on hiding it if you deselect the default approver, since the |
I think what @blazejkustra suggested makes sense to me. The additional approver is shown to allow the user to add another approver, but if we unselect the current approver, then the additional approver field seems unneeded. |
Ah alright so thanks for chiming in @blazejkustra I agree the solution that Blazej implemented is the desired behaviour here |
Sounds like a consensus to me! @bernhardoj Can you go ahead and implement @blazejkustra's suggestion in your PR? |
@jjcoffee Great, updated the PR. Please check! |
merged to staging yesterday |
Deployed to production Aug 30th, so should be due for payment 2024-09-06. |
PAYMENT SUMMARY FOR SEPT 06
|
@abekkala Accepted, thanks! 🙏 |
Requested in ND. |
$250 approved for @bernhardoj |
@jjcoffee payment sent and contract ended - thank you! 🎉 |
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: v9.0.22-5
Reproducible in staging?: Y
Reproducible in production?: Y
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause Internal Team
Action Performed:
Expected Result:
There should be "Approver" field in "Edit approval workflow" page after removing the approver so that approver can be reselected.
Actual Result:
There is no "Approver" field in "Edit approval workflow" page after removing the approver.
The other field "Additional approver" requires an upgrade to access.
Workaround:
Unknown
Platforms:
Screenshots/Videos
Bug6576985_1724154419888.20240820_194200.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @abekkalaThe text was updated successfully, but these errors were encountered: