Skip to content
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

[$250] Workspace - Able to delete expense from archived workspace #48588

Closed
3 of 6 tasks
IuliiaHerets opened this issue Sep 4, 2024 · 21 comments
Closed
3 of 6 tasks

[$250] Workspace - Able to delete expense from archived workspace #48588

IuliiaHerets opened this issue Sep 4, 2024 · 21 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2

Comments

@IuliiaHerets
Copy link

IuliiaHerets commented Sep 4, 2024

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.29-5
Reproducible in staging?: Y
Reproducible in production?: Y
Issue reported by: Applause Internal Team

Action Performed:

  1. Launch app
  2. Create a WS
  3. Submit one or few expenses
  4. Delete the workspace
  5. Open archived WS chat
  6. Tap header -- delete expense

Expected Result:

User must not be able to delete expense from archived workspace.

Actual Result:

Able to delete expense from archived workspace.

Workaround:

Unknown

Platforms:

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6593261_1725474007965.screenrecorder-2024-09-04-09-20-17-618_compress_1.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021833087706130184523
  • Upwork Job ID: 1833087706130184523
  • Last Price Increase: 2024-09-09
  • Automatic offers:
    • situchan | Reviewer | 103922957
    • FitseTLT | Contributor | 103922958
Issue OwnerCurrent Issue Owner: @FitseTLT
@IuliiaHerets IuliiaHerets added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Sep 4, 2024
Copy link

melvin-bot bot commented Sep 4, 2024

Triggered auto assignment to @zanyrenney (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.

@IuliiaHerets
Copy link
Author

@zanyrenney z 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

@FitseTLT
Copy link
Contributor

FitseTLT commented Sep 4, 2024

Edited by proposal-police: This proposal was edited at 2024-09-04 19:02:31 UTC.

Proposal

Please re-state the problem that we are trying to solve in this issue.

Workspace - Able to delete expense from archived workspace

What is the root cause of that problem?

We don't check if it is archived in can add or delete transaction here

App/src/libs/ReportUtils.ts

Lines 1653 to 1657 in 6760f96

function canAddOrDeleteTransactions(moneyRequestReport: OnyxEntry<Report>): boolean {
if (!isMoneyRequestReport(moneyRequestReport)) {
return false;
}

What changes do you think we should make in order to solve the problem?

We should return false if the report is archived one

if (!isMoneyRequestReport(moneyRequestReport)|| isArchivedRoom(moneyRequestReport)) {
        return false;

If we don't want to apply it to add transaction too we can apply the check (is not archived check) only for canDeleteTransaction here
In addition to preventing the deletion in FE we need to also ensure the BE doesn't allow deletion for archived workspace

Note: we don't need to apply the check for shouldShowTaskDeleteButton because we already have it here

!ReportUtils.isClosedReport(report) &&

What alternative solutions did you explore? (Optional)

@eucool
Copy link
Contributor

eucool commented Sep 4, 2024

Proposal

Please re-state the problem that we are trying to solve in this issue.

We see delete report action even when the workspace is archived

What is the root cause of that problem?



The actual bug here is that we see the delete action even when the workspace is archived this is because we do not hide the button when the workspace is archived:




const shouldShowDeleteButton = shouldShowTaskDeleteButton || canDeleteRequest;

What changes do you think we should make in order to solve the problem?

Update the condition to:

const shouldShowDeleteButton = (shouldShowTaskDeleteButton || canDeleteRequest ) && !isArchivedRoom;

Or update the shouldShowTaskDeleteButton directly to hide the button by adding the isArchivedRoom check there

What alternative solutions did you explore? (Optional)

@melvin-bot melvin-bot bot added the Overdue label Sep 6, 2024
@zanyrenney
Copy link
Contributor

Ooh sorry I totally missed this one!

@melvin-bot melvin-bot bot removed the Overdue label Sep 9, 2024
@zanyrenney
Copy link
Contributor

Reviewing now.

@zanyrenney
Copy link
Contributor

Adding External

@zanyrenney zanyrenney added the External Added to denote the issue can be worked on by a contributor label Sep 9, 2024
Copy link

melvin-bot bot commented Sep 9, 2024

Job added to Upwork: https://www.upwork.com/jobs/~021833087706130184523

@melvin-bot melvin-bot bot changed the title Workspace - Able to delete expense from archived workspace [$250] Workspace - Able to delete expense from archived workspace Sep 9, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Sep 9, 2024
Copy link

melvin-bot bot commented Sep 9, 2024

Triggered auto assignment to Contributor-plus team member for initial proposal review - @situchan (External)

@zanyrenney
Copy link
Contributor

hey @situchan please review the proposals above and let me know which one is best so we can move ahead here. Thank you!

@situchan
Copy link
Contributor

@FitseTLT's proposal looks good to me.
🎀👀🎀 C+ reviewed

Copy link

melvin-bot bot commented Sep 10, 2024

Triggered auto assignment to @aldo-expensify, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Sep 12, 2024
Copy link

melvin-bot bot commented Sep 12, 2024

📣 @situchan 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

Copy link

melvin-bot bot commented Sep 12, 2024

📣 @FitseTLT 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@zanyrenney
Copy link
Contributor

hello! how are we getting along here @FitseTLT @situchan thanks!

@zanyrenney
Copy link
Contributor

cc @aldo-expensify

@FitseTLT
Copy link
Contributor

PR ready

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Sep 13, 2024
@FitseTLT
Copy link
Contributor

FitseTLT commented Oct 3, 2024

@zanyrenney payment overdue

@FitseTLT
Copy link
Contributor

@zanyrenney Can u pls issue the payment ?? Thx

@FitseTLT
Copy link
Contributor

@zanyrenney this is super overdue for payment

@zanyrenney
Copy link
Contributor

payment summary

$250 to @FitseTLT paid via upwork
$250 to @situchan paid via upwork.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2
Projects
None yet
Development

No branches or pull requests

6 participants