-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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-11-05] [$250] Approver - In edit approval workflow, in offline approver selected is not greyed out #50477
Comments
Triggered auto assignment to @strepanier03 ( |
@strepanier03 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 |
Edited by proposal-police: This proposal was edited at 2024-10-09 09:27:42 UTC. ProposalPlease re-state the problem that we are trying to solve in this issue.In edit approval workflow, in offline approver selected is not greyed out What is the root cause of that problem?We haven't handled the case for greying out the edit approval workflow yet What changes do you think we should make in order to solve the problem?We need to wrap the component rendering + const approvalWorkflowPendingUpdate = approvalWorkflow.pendingAction;
// .src/pages/workspace/workflows/approvals/ApprovalWorkflowEditor.tsx#L136
+ <OfflineWithFeedback pendingAction={approvalWorkflowPendingUpdate>
<MenuItemWithTopDescription
....
/>
+ </OfflineWithFeedback>
// .src/pages/workspace/workflows/approvals/ApprovalWorkflowEditor.tsx#L151
+ <OfflineWithFeedback pendingAction={approvalWorkflowPendingUpdate}>
<MenuItemWithTopDescription
....
/>
+ </OfflineWithFeedback>
// .src/pages/workspace/workflows/approvals/ApprovalWorkflowEditor.tsx#L198
+ <OfflineWithFeedback pendingAction={approvalWorkflowPendingUpdate}>
<MenuItemWithTopDescription
....
/>
+ </OfflineWithFeedback> What alternative solutions did you explore? (Optional)If we want to gray out only the edited parts, you need to check which // .src/pages/workspace/workflows/approvals/ApprovalWorkflowEditor.tsx#L103
// get list employee pending update
+ const [listEmployeePending, setListEmployeePending] = useState<[]>();
+ const getFieldPending = useCallback(async () => {
+ try {
+ const persistedRequests = await PersistedRequests.getAll();
+ const updateWorkspaceApprovalRequests = persistedRequests.filter(({command}) => command === WRITE_COMMANDS.UPDATE_WORKSPACE_APPROVAL);
+ const employeesPending = updateWorkspaceApprovalRequests.flatMap((item) => {
+ const employees = JSON.parse(item.data.employees);
+ return employees.filter((employee) => employee.pendingAction === 'update');
+ });
+ setListEmployeePending(employeesPending);
+ } catch (error) {
+ console.error('****** error ******', error);
+ }
+ }, []);
+ useEffect(() => {
+ getFieldPending();
+ }, [getFieldPending]);
// .src/pages/workspace/workflows/approvals/ApprovalWorkflowEditor.tsx#L173
// We check if this approver's pendingAction is 'update' or not
+ const isApproverPending = (listEmployeePending || []).some((item) => {
+ return item.email === approver?.email;
+ });
// .src/pages/workspace/workflows/approvals/ApprovalWorkflowEditor.tsx#L178
// Update condition to show grayed out
+ <OfflineWithFeedback pendingAction={isApproverPending ? approvalWorkflowPendingUpdate : undefined}>
<MenuItemWithTopDescription
.... POC
Screen.Recording.2024-10-09.at.16.17.45.mov |
ProposalPlease re-state the problem that we are trying to solve in this issue.In edit approval workflow, in offline approver selected is not greyed out. What is the root cause of that problem?We don't add App/src/pages/workspace/workflows/approvals/ApprovalWorkflowEditor.tsx Lines 137 to 139 in 285bde8
What changes do you think we should make in order to solve the problem?
Lines 233 to 237 in 285bde8
Lines 249 to 253 in 285bde8
Lines 124 to 127 in 285bde8
App/src/pages/workspace/workflows/approvals/ApprovalWorkflowEditor.tsx Lines 137 to 139 in 285bde8
What alternative solutions did you explore? (Optional)We can wrap App/src/pages/workspace/workflows/approvals/ApprovalWorkflowEditor.tsx Lines 137 to 139 in 285bde8
|
Job added to Upwork: https://www.upwork.com/jobs/~021844825382815760064 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @eh2077 ( |
Not 100% sure about the Project since there's a shift internally and I don't think things are updated fully. It might move but for now we can work on this. |
@nkdengineer Thanks for your proposal. Your alternative solution looks simpler and it's same as the main solution of the first proposal. Is there any drawback of the alternative solution? Or what're the advantages of your main solution? |
@eh2077 With my main solution, only the changed approver will be grey out instead of all approvers as my alternative solution. |
I think this shouldn't be a recent bug but a missing case we want to polish. @nkdengineer 's proposal looks good to me. 🎀👀🎀 C+ reviewed |
Triggered auto assignment to @flodnv, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
@eh2077 Could you review my proposal? |
@eh2077 , My proposal provides two solutions:
and We need to check which of the two solutions to apply to fix this issue. If we gray out only the field that was changed, it won't be consistent with the previous behavior, as it grayed out two fields. We need to confirm this. |
@eh2077 , I believe both proposals suggest the same solution, differing only in their implementation approach: my proposal checks for approver pending status in the persistent request, while the other proposal sets the pending action in the parameters. Since my proposal came first, I believe the other proposal does not align with the following point from CONTRIBUTING.md
Once again, I apologize if I'm wrong. |
@huult Thanks for your comments! I did check your proposal
I totally feel your point about competing proposals. I think your proposal is very close to succeed - you included both a simple / straightforward method and a more thoughtful one. If I could give you an advice, I think you can explore the codebase for similar patterns / practices to compare with the solution you come up. Hope it helps, thanks. |
@eh2077 , Thank you for your feedback and advice. Would it be alright if I asked you a question? Regarding the solution, is my proposal still correct? Is my proposal not selected because the code example change isn’t best practice and cannot be updated during the PR phase? |
@tgolen I believe you've recently shipped this feature, so I'm reassigning this to you |
📣 @nkdengineer 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
I agree with @eh2077's reasoning for the proposal that was accepted. |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.54-11 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue: If no regressions arise, payment will be issued on 2024-11-05. 🎊 For reference, here are some details about the assignees on this issue:
|
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
|
Payment Summary
|
@nkdengineer - I have paid and closed the contract for you in Upwork, thank you for continuing to be part of our community. @eh2077 the payment summary is ready but on hold. Once you do the checklist I'll finish up my bits and update it. I'll check in again later today. |
Checklist
|
Requested payment in NewDot |
$250 approved for @eh2077 |
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.46-3
Reproducible in staging?: Y
Reproducible in production?: Y
Issue reported by: Applause Internal Team
Action Performed:
Pre-condition:
Expected Result:
In edit approval workflow, in offline approver selected must be greyed out.
Actual Result:
In edit approval workflow, in offline approver selected is not greyed out.
Workaround:
Unknown
Platforms:
Screenshots/Videos
Bug6628543_1728406287719.Screenrecorder-2024-10-08-17-31-14-150_compress_1.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @strepanier03The text was updated successfully, but these errors were encountered: