-
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
Fix - Expense - Submit button appears for archived workspace chat if delayed submission is enabled #52183
base: main
Are you sure you want to change the base?
Fix - Expense - Submit button appears for archived workspace chat if delayed submission is enabled #52183
Conversation
@FitseTLT what's the ETA for this PR? It's holding up a couple other PRs so just wanted to check. Also, we should try to be a little careful with this since it has a chance to cause regressions. By this, I mean that we should check all occurrences of |
I am working on it. Will provide update tomorrow 👍 |
I have checked all instances of isArchivedRoom and isArchivedRoomWithID and I have listed down some case I want confirmation from U
Now to confirm: You are aiming to set is_privateArchived for expense reports from BE. Correct me if I am wrong. Last question: I know we want to allow commenting and so on on open archive expense reports but what about settled archived reports we want the same behaviour as the unsettled one? This might also decide our isArchivedExpenseReport. |
Thank you for all the questions @FitseTLT, I'll get to them tomorrow since I need to look at some of the backend code |
Yes, since they are still able to be commented on, we don't want to hide these menu items
We do want to show this as archived. So the
This should not be possible with
I think no right now because there is nothing actionable on these expense reports so they shouldn't have RBRs or GBRs. (The move button doesn't exist yet). But @trjExpensify could you help confirm?
No, we should not show the archived suffix for expense reports
Yes, but for the expense reports, the reason should not be archived but rather the regular expense report reasons.
Yes, we should show it for expense reports because they are still able to be commented on
Yes, we should show subscript, expense reports shouldn't be visibly archived in the frontend.
Yes.
Yes, we want to enable reply in thread
Expense reports shouldn't be considered archived so we don't want to order these last
I don't believe we want to show hold and unhold either for archived expense reports. @trjExpensify do you think you can confirm this one as well.
Yes, we do not for archived expense reports.
I don't think we want to show any action buttons on archived expense reports. @trjExpensify can you please help confirm this one as well?
Yes, but after we merge this PR so that users are able to continue commenting on expense reports. If we do that first before merging this PR, users won't be able to comment on expense reports until this PR gets deployed.
Yes, I believe we want the same behavior for all expense reports. I had the same question here and @trjExpensify recommended we should retain the ability to chat on all archived expense reports. Please let me know if you have any other questions. |
@srikarparsi Applied all changes. Only doubt here
App/src/components/MoneyReportHeader.tsx Line 121 in e9e1857
We use the variable to determine the status bar prop. I know I asked you last time but it is not clear to me can you tell me directly what function to use, is it isArchivedNonExpenseReport or isArchivedAnyReport ?
|
Sorry, I weirdly didn't catch this in my inbox until that latest comment.
Agreed, no RBR/GBR. We should add the ability to change the workspace the expense report is on soon though!
Hmm, I don't see a reason to restrict these.
Same here, I think we should leave these as they are. OldDot doesn't restrict actions like reject, unapprove, delete etc when the workspace is deleted. Only Submit > Approve > Pay.
Agreed. |
@srikarparsi I will need a confirmation on two of @trjExpensify responses and will make the changes as soon as you guys agree on it but the other responses are already aligned to the current code 👍
Hmm, I don't see a reason to restrict these.
Same here, I think we should leave these as they are. OldDot doesn't restrict actions like reject, unapprove, delete etc when the workspace is deleted. Only Submit > Approve > Pay. |
Thanks @trjExpensify and @FitseTLT. Let's move forward with what @trjExpensify said in this comment, I also agree with it. |
Hey @FitseTLT, how is this one looking? Do you think this can be ready for review today? |
Ready for review 👍 @srikarparsi @Ollyws |
Great, will review asap. |
@@ -32,12 +32,12 @@ function ReportActionItem({action, report, ...props}: PureReportActionItemProps) | |||
{selector: (transaction) => transaction?.errorFields?.route ?? null}, | |||
); | |||
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- This is needed to prevent the app from crashing when the app is using imported state. | |||
const [reportNameValuePairs] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS}${report?.reportID}`); | |||
const [reportNameValuePairs] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS}${report?.reportID || undefined}`); |
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.
Is this necessary? reportID would be undefined already no?
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.
Can we do ?? CONST.DEFAULT_NUMBER_ID
instead? This would be more in line with the rest of the code.
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 reason I chose undefined
is because it aligns with the guide as we are trying to give a fallback for a string id, we use DEFAULT_NUMBER_ID
for number ids. And ??
doesn't help here because we want to avoid empty string because it will cause a crash when switching from empty string to some non-empty string.
This important to avoid crash when the report id changes from empty string
to other value.
…On Tue, 7 Jan 2025 at 12:24 AM Olly ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In src/pages/home/report/ReportActionItem.tsx
<#52183 (comment)>:
> @@ -32,12 +32,12 @@ function ReportActionItem({action, report, ...props}: PureReportActionItemProps)
{selector: (transaction) => transaction?.errorFields?.route ?? null},
);
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- This is needed to prevent the app from crashing when the app is using imported state.
- const [reportNameValuePairs] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS}${report?.reportID}`);
+ const [reportNameValuePairs] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS}${report?.reportID || undefined}`);
Is this necessary? reportID would be undefined already no?
—
Reply to this email directly, view it on GitHub
<#52183 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJG4AZPCUYK45MDINLKM4DT2JLYBFAVCNFSM6AAAAABRLG73KCVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDKMZSHE4TONJSGI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Continuing testing, will try to have this one reviewed today/tomorrow. |
Do we want to do something about getLastMessageTextForReport? |
Good call, we should fix that. We will also fix this in the backend by not adding the |
Fixed |
Details
Fixed Issues
$ #49169
PROPOSAL: #49169 (comment)
Tests
Offline tests
Same as above
QA Steps
Same as above
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting 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)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
2025-01-06.20-29-11.mp4
Android: mWeb Chrome
2025-01-06.20-36-52.mp4
iOS: Native
2025-01-06.20-48-38.mp4
iOS: mWeb Safari
2025-01-06.20-41-20.mp4
MacOS: Chrome / Safari
2025-01-06.20-50-26.mp4
MacOS: Desktop
2025-01-06.20-51-55.mp4