Open IuliiaHerets opened 6 days ago
Triggered auto assignment to @johncschuster (Bug
), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.
@johncschuster 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-09-13 12:03:09 UTC.
Submit button appears for archived workspace chat if delayed submission is en bled
we dont disable the submit button if the workspce is archived here
https://github.com/Expensify/App/blob/eb5a569942af5f4117a548d9ed683046e11f9012/src/components/MoneyReportHeader.tsx#L126 https://github.com/Expensify/App/blob/4817f9dada5f97392df81037097502039704ca5e/src/components/ReportActionItem/ReportPreview.tsx#L185
we should add another condition that the workspace is not deleted above using the isArchivedReport
var
or it could be added to the isOpenExpenseReport directly (to follow the same concept as in the isOpenTaskReport function) :
return isExpenseReport(report) && !isArchivedRoomWithID(report?.reportID) && report?.stateNum === CONST.REPORT.STATE_NUM.OPEN && report?.statusNum === CONST.REPORT.STATUS_NUM.OPEN;
https://github.com/user-attachments/assets/59ac5207-295f-4c58-9846-e6dc98f0e09b
Expense - Submit button appears for archived workspace chat if delayed submission is enabled
We display when report is archived here https://github.com/Expensify/App/blob/00bc167940607f1418109f00e2b4e2d7d4ae858b/src/components/MoneyReportHeader.tsx#L126 And here https://github.com/Expensify/App/blob/00bc167940607f1418109f00e2b4e2d7d4ae858b/src/components/ReportActionItem/ReportPreview.tsx#L187
We should hide the button when report is archived here
const shouldShowSubmitButton = isDraft && reimbursableSpend !== 0 && !hasAllPendingRTERViolations && !isArchivedReport;
And here
const shouldShowSubmitButton = isOpenExpenseReport && reimbursableSpend !== 0 && !showRTERViolationMessage && !isArchivedReport;
[!NOTE] A kind reminder for C+:
The fist section of the first proposal's permalink edit that points to shouldShowSubmitButton comes after my proposal. Prior to that it pointed to shouldDisableApproveButton.
Thanks for pointing it out @etCoderDysto. I believe the current proposal is the same as the first one since I didn’t introduce any new solutions or approaches—just code implementation and POC, which isn't part of the proposal requirements to be accepted. That’s why I didn’t add the proposal updated comment.
however regardless, your proposal is only similar to my first solution, the second one is diff.
Hi @abzokhattab. Writing few details takes time and make a difference in proposal submission time, and there seems to be a little difference between what you have suggested at first which is disabling the button (we dont disable the submit button ) by pointing a permalink to shouldDisableApproveButton, and what you suggested after the edit. That was why I raised the question. I have no ill intention towards you in saying that though🙏.
Thanks!
All of these conditions can be handled in:
const shouldShowSubmitButton = isDraft && reimbursableSpend !== 0 && !hasAllPendingRTERViolations && ReportUtils.canUserPerformWriteAction(moneyRequestReport);
and
const shouldShowSubmitButton = isOpenExpenseReport && reimbursableSpend !== 0 && !showRTERViolationMessage && ReportUtils.canUserPerformWriteAction(iouReport);
@johncschuster Whoops! This issue is 2 days overdue. Let's get this updated quick!
Job added to Upwork: https://www.upwork.com/jobs/~021836147581047135142
Triggered auto assignment to Contributor-plus team member for initial proposal review - @Ollyws (External
)
@etCoderDysto's proposal LGTM. @dominictb Thanks for the proposal but I don't think it's substantially different enough to @etCoderDysto's to be fair to pick it over theirs. 🎀👀🎀 C+ reviewed
Triggered auto assignment to @srikarparsi, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
Looking forward to hearing your thoughts!
Hi @abzokhattab. Writing few details takes time and make a difference in proposal submission time, and there seems to be a little difference between what you have suggested at first which is disabling the button (we dont disable the submit button ) by pointing a permalink to shouldDisableApproveButton, and what you suggested after the edit. That was why I raised the question. I have no ill intention towards you in saying that though🙏.
Thanks!
Before edit, it seems that you were suggesting disabling the button as I have commented here.
Before edit, it seems that you were suggesting disabling the button as I have commented here.
Thanks for your input, by disabling I mean not to make it shown ... meaning making the shouldShowSubmitButton
as false
.
The first link was linked by mistake to line L124
(which is shouldDisableApproveButton
which is related to the approve
not the submit
button) instead of L126
... whereas the second link was correct.
so you can see its a reference mistake
Hm, wait. Why is the expense report being archived in the OP video, @srikarparsi? 🤔 We should have stopped doing that, shouldn't we?
As for how to handle this case of an open
report on a deleted workspace, let's tread carefully. On OldDot I believe we automatically move it to the submitter's "new" primary policy or something like that. The report action buttons shown are then applicable to whichever workspace it was moved to.
I think to handle this properly and holistically for all report states and setup scenarios, we're going to need better planning and probably the inclusion of the feature to let people manually move a report to a different workspace.
Why is the expense report being archived in the OP video, @srikarparsi? 🤔 We should have stopped doing that, shouldn't we?
Hmm, I think we wanted to stop closing
the expense report when the workspace is deleted, but continue archiving
it. If it wasn't archived, then transactions could be continued to be submitted on the report and people could continue to chat on the report (which is what I thought we didn't want?). What do you think?
I think to handle this properly and holistically for all report states and setup scenarios, we're going to need better planning and probably the inclusion of the feature to let people manually move a report to a different workspace.
Yeah I think I agree
Okay, I can see why we kept doing that for now because of otherwise having the ability to add expenses to the report, but we want to continue to allow people to chat on an expense report to discuss what to do about outstanding reports - and more importantly, we need to stop the actions of submit/approve/pay which all will fail - so I don't think we should archive them. Thinking through how we should handle this broadly and consistently:
When a workspace is deleted
Submit
, Approve
and Pay
action buttons are hidden for all participants of the report, as those actions are no longer available on this now deleted workspace. Submit expense
& Track expense
options from the expense report's create menu (i.e the menu where Add attachment
etc lives). Move report
a. Submitter: The option row is visible on open
and processing
reports.
b. Admin: The option row is visible on open
, processing
, approved
and closed
reports. (reimbursed reports can't be moved because they are a record of payment made from this company workspace).
c. Everyone: You should not be able to move a report that has been previously exported to a connected accounting system, so the option row shouldn't show on exported reports. Move report
is pressed it opens a filtered participant selector:
a. Submitter: all workspaces they have access to + their selfDM*(note on this below)
b. Admins: all workspaces they are an admin of. If they choose a workspace that the submitter is not a member of, we invite the submitter to the workspace and do the following:
open
state if the workspace has delayed submission
enabled. A Submit
button is now available on the report. processing
state if the workspace has delayed submission disabled (A.k.a "instant submit"). An Approve
|| Pay
button is now visible depending on the workspace settings.*Q: If the submitter chooses their selfDM
here in 4.a how should we handle it? All expenses in the selfDM are unreported as it stands I believe, so would we be effectively deleting the expense report to unreport the expenses and show them in the selfDM where they can then be submitted on to wherever they want to put them via the actionable whisper message?
How does that sound? Let's align, and then I can create mocks for the relevant parts above. CC: @JmillsExpensify
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: 9.0.33-4 Reproducible in staging?: Y Reproducible in production?:Y Email or phone of affected tester (no customers): nathanmulugetatesting+1469@gmail.com Issue reported by: Applause Internal Team
Action Performed:
Expected Result:
Submit button doesn't show on the archived workspace chat on the expense
Actual Result:
Submit button shows on both the employee's and admin's archived workspace chat and clicking on the button results in an error
Workaround:
Unknown
Platforms:
Screenshots/Videos
https://github.com/user-attachments/assets/bca2d8f4-6b61-49d7-a214-ae98828881ed
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @Ollyws