Closed izarutskaya closed 1 month ago
Triggered auto assignment to @VictoriaExpensify (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.
We think this issue might be related to the #vip-vsb
Edited by proposal-police: This proposal was edited at 2024-08-15 14:15:22 UTC.
Search - Select all check box is not checked with tick mark in shared, drafts & finish tab
The condition report type of items is not correct. searchResults?.search.type
is always expense
, so areItemsOfReportType
will be always false even if the status is not ALL
.
https://github.com/Expensify/App/blob/6a9a97690cd97f7f608ff9dd125ac1a7d7da3137/src/components/Search/index.tsx#L284
We should updated it to const areItemsOfReportType = status !== CONST.SEARCH.STATUS.EXPENSE.ALL;
.
OR:
const areItemsOfReportType = status && status !== CONST.SEARCH.STATUS.EXPENSE.ALL;
Similar logic is used here: https://github.com/Expensify/App/blob/6a9a97690cd97f7f608ff9dd125ac1a7d7da3137/src/libs/SearchUtils.ts#L294
If needed we can also check if the condition is one of the CONST.SEARCH.DATA_TYPES
types.
const areItemsOfReportType = Object.keys(CONST.SEARCH.DATA_TYPES).includes(type) && status !== CONST.SEARCH.STATUS.EXPENSE.ALL;
Edited by proposal-police: This proposal was edited at 2024-08-16 00:47:01 UTC.
When we switch to other tabs such as shared, draft & finish, areItemOfReportType
:
https://github.com/Expensify/App/blob/6a9a97690cd97f7f608ff9dd125ac1a7d7da3137/src/components/Search/index.tsx#L284
is always false
.
Hence, we use incorrect logic to get the selected transactions: https://github.com/Expensify/App/blob/6a9a97690cd97f7f608ff9dd125ac1a7d7da3137/src/components/Search/index.tsx#L299
In this case, it should be: https://github.com/Expensify/App/blob/6a9a97690cd97f7f608ff9dd125ac1a7d7da3137/src/components/Search/index.tsx#L294
Since each item in data can be either TransactionListItemType
or ReportListItemType
(as indicated here), we use areItemsOfReportType
to determine if the item is of type ReportListItemType
or TransactionListItemType
. This approach serves as a workaround for distinguishing between these types.
So I suggest a solution that does not need to use areItemsOfReportType
:
https://github.com/Expensify/App/blob/6a9a97690cd97f7f608ff9dd125ac1a7d7da3137/src/components/Search/index.tsx#L283-L300
should be:
const toggleAllTransactions = () => {
const flattenedItems = (data as Array<ReportListItemType | TransactionListItemType>).flatMap((item) => (item as ReportListItemType)?.transactions ?? [item]);
const isAllSelected = flattenedItems.length === Object.keys(selectedTransactions).length;
if (isAllSelected) {
clearSelectedTransactions();
return;
}
setSelectedTransactions(
Object.fromEntries(
(data as Array<ReportListItemType | TransactionListItemType>).flatMap(
(item) => (item as ReportListItemType)?.transactions?.map(mapTransactionItemToSelectedEntry) ?? [mapTransactionItemToSelectedEntry(item as TransactionListItemType)],
),
),
);
};
I think @izarutskaya has uploaded the wrong screen-recording, but I've been able to reproduce the issue:
I agree this is a problem and we should fix it.
Job added to Upwork: https://www.upwork.com/jobs/~010cf70262c4767dc9
Triggered auto assignment to Contributor-plus team member for initial proposal review - @getusha (External
)
I think this is more suited to Wave-Collect
@VictoriaExpensify, @getusha Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
@getusha could you please review @daledah's proposal? https://github.com/Expensify/App/issues/47494#issuecomment-2292522017
I am no longer able to reproduce it, i think layout is not same as it was when this issue was created.
https://github.com/user-attachments/assets/2add79a6-519f-4082-9d66-dd92be12df83
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
@VictoriaExpensify, @getusha Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
Hmm I can still recreate this @getusha
On the desktop app:
And on Staging:
Expenses seem to be ok, but "shared" "drafts" and "finished" are not
@VictoriaExpensify I don't know why the changes aren't deployed to staging yet but i am seeing a different layout in DEV
environment 😄
@VictoriaExpensify @getusha this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!
We've now deployed the new search tabs if you want to re-test this one, @VictoriaExpensify.
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
@VictoriaExpensify, @getusha Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
@VictoriaExpensify, @getusha 6 days overdue. This is scarier than being forced to listen to Vogon poetry!
@VictoriaExpensify, @getusha Now this issue is 8 days overdue. Are you sure this should be a Daily? Feel free to change it!
Oh nice! The search tabs look great at this issue is resolved - closing!
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.20 Reproducible in staging?: Y Reproducible in production?: Y If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/4861073 Logs: https://stackoverflow.com/c/expensify/questions/4856 Issue reported by: Applause-Internal team
Action Performed:
Pre-condition:Login to account with few expenses
Expected Result:
Select all check box must be checked with tick mark in shared, drafts & finish tab
Actual Result:
Select all check box is not checked with tick mark in shared, drafts & finish tab.
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
https://github.com/user-attachments/assets/ecb40073-a967-442d-8cf3-19dd8586f238
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @getusha