Skip to content

[HOLD for payment 2023-10-02] [HOLD for payment 2023-09-27] [Wave 6: Categories] CRITICAL: Allow Editing a Category on a Money Request #24464

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

Closed
puneetlath opened this issue Aug 11, 2023 · 20 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Engineering NewFeature Something to build that is a new item. Weekly KSv2

Comments

@puneetlath
Copy link
Contributor

puneetlath commented Aug 11, 2023

Tracking Issue: https://github.com/Expensify/Expensify/issues/282161

Design Doc: https://docs.google.com/document/d/1itXKWlhms5YHcF4-lujO6g8T5LPdLVD_7onjtZBsATQ/edit#

HOLD ON https://github.com/Expensify/Expensify/issues/302031


Viewing Categories on Money Requests

For viewing a category on an already existing Money Request, if isSingleTransactionView = true, we'll render a MenuItemWithTopDescription in the MoneyRequestView. (This is not too different from what we do for the MoneyRequestConfirmationList above when creating an expense).

  • This menu item component will display the category tied to the expense.
  • If there are no categories on the policy AND there is no category already on the expense, then the component will not display.

If a request is paid, then users will not be able to tap the request to edit the category, unless they are an admin of the policy the request is on.

Editing Categories on Money Requests

To edit, we will be building off the EditMoneyRequestPage added in Wave 3: Manual Requests. We'll add a new route to the moneyRequestDetails Form that will render our CategoryPicker described above.

// src/pages/iou/EditMoneyRequestPage.js

<Form
  formID='moneyRequestDetails'
  validate={this.validate}
  onSubmit={this.onSubmit}
>

    // ... Other routes and their edit paths

    ) ? route === 'category' (
      <CategoryPicker
        inputID="category"
        label="Category"
        placeholder={props.translate('common.category')}
      />
    )
</Form>

The component will work the same as it does in the Money Request creation flow, except this time the onSubmit prop function will call the UpdateTransaction API command. The action is described in Wave 3: Manual Requests. We will update it to support changing the category.

A couple of other notes about editing categories:

  • If you are offline, we will not actually call the UpdateTransaction API command but use the optimisticData of the UpdateTransaction API.write call to display your category in a "greyed out" state. When the update syncs with the server we'll "ink in" the change.
  • If a category is disabled, but was already selected on a Money Request, when the user clicks the category to edit it, the disabled but selected category will show in the "Selected Category" section. Unselecting it will make it disappear since the user will be navigated back to the expense, saving an empty category on it.
    • Should they open the list again, because the category was disabled, they will not be able to see it to re-select it.
    • The same would apply if there were < 8 categories on the policy. We would just show the selected category directly in the list of categories itself.
  • If categories are completely disabled, or there are no enabled categories on the policy, but there is a category on an expense…
    • When the user clicks the category to edit it, the lone category will be shown as the only category in the policy.
    • This will use the "simplified" < 8 categories view.
    • Deselecting the category will again navigate the user back to the expense.
    • This time, because there are no categories on the policy and no category is selected, the Category menu item will disappear.
@puneetlath puneetlath added Engineering Daily KSv2 NewFeature Something to build that is a new item. labels Aug 11, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 11, 2023

@puneetlath puneetlath assigned puneetlath and unassigned sakluger Aug 11, 2023
@melvin-bot melvin-bot bot added Weekly KSv2 and removed Daily KSv2 labels Aug 11, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 11, 2023

Triggered auto assignment to Design team member for new feature review - @shawnborton (NewFeature)

@rezkiy37
Copy link
Contributor

Hi, I'm Michael (Mykhailo) from Callstack and I would like to work in this issue.

@waterim
Copy link
Contributor

waterim commented Aug 14, 2023

Hello, Im Artem from Callstack and I would like to help with this issue

@puneetlath
Copy link
Contributor Author

This is still on hold.

@melvin-bot melvin-bot bot removed the Overdue label Aug 21, 2023
@puneetlath puneetlath moved this from In Progress to Todo in [#whatsnext] Wave 06 - Collect Submitters Aug 21, 2023
@melvin-bot melvin-bot bot added the Overdue label Aug 30, 2023
@yuwenmemon
Copy link
Contributor

Still on HOLD

@yuwenmemon
Copy link
Contributor

Also, another development, because we want to start sending push notifications for category updates from our server before this goes live, we can no longer rely on the absence of categories to hide the selector from the EditRequestPage. We'll need to check that a user is on a beta in addition to that.

This means we'll need to add a canUseCategories to the Permissions.js file, and check that before showing the selector or not. Does that make sense / sound good?

@rezkiy37
Copy link
Contributor

Waiting on backend, because it is important to test and verify that the app handles everything properly.

@yuwenmemon
Copy link
Contributor

Actually, @rezkiy37 we need to deploy the front-end portion first because of the way EditMoneyRequest works. Right now, if it doesn't see a category coming from the client it will clear the category entirely (cc @mountiny). Would you be able to build out the front-end portions - sending the category as a param to EditMoneyRequest into the ether - and then we can test and verify things work well from there? This is all under a beta so we should be safe to do so.

@rezkiy37
Copy link
Contributor

Actually, @rezkiy37 we need to deploy the front-end portion first because of the way EditMoneyRequest works. Right now, if it doesn't see a category coming from the client it will clear the category entirely (cc @mountiny). Would you be able to build out the front-end portions - sending the category as a param to EditMoneyRequest into the ether - and then we can test and verify things work well from there? This is all under a beta so we should be safe to do so.

Makes sense. I agree. I am preparing a PR today.

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Sep 19, 2023
@melvin-bot melvin-bot bot changed the title [Wave 6: Categories] CRITICAL: Allow Editing a Category on a Money Request [HOLD for payment 2023-09-27] [Wave 6: Categories] CRITICAL: Allow Editing a Category on a Money Request Sep 20, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Sep 20, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 20, 2023

Reviewing label has been removed, please complete the "BugZero Checklist".

@melvin-bot
Copy link

melvin-bot bot commented Sep 20, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.71-12 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 2023-09-27. 🎊

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

For reference, here are some details about the assignees on this issue:

  • @waterim does not require payment (Contractor)
  • @rezkiy37 does not require payment (Contractor)

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@rezkiy37
Copy link
Contributor

Melvin, this issue is not completed yet. The main PR - #27459 - still under review.

@rezkiy37
Copy link
Contributor

The PR - #27459 - has been merged.

@puneetlath puneetlath moved this from In Progress to Done in [#whatsnext] Wave 06 - Collect Submitters Sep 22, 2023
@puneetlath
Copy link
Contributor Author

Looks like no C+ payment is required for this issue. So we can go ahead and close it out once it's on production.

@melvin-bot
Copy link

melvin-bot bot commented Sep 23, 2023

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Sep 25, 2023
@melvin-bot melvin-bot bot changed the title [HOLD for payment 2023-09-27] [Wave 6: Categories] CRITICAL: Allow Editing a Category on a Money Request [HOLD for payment 2023-10-02] [HOLD for payment 2023-09-27] [Wave 6: Categories] CRITICAL: Allow Editing a Category on a Money Request Sep 25, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 25, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.73-1 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 2023-10-02. 🎊

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

For reference, here are some details about the assignees on this issue:

  • @waterim does not require payment (Contractor)
  • @rezkiy37 does not require payment (Contractor)

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Engineering NewFeature Something to build that is a new item. Weekly KSv2
Projects
No open projects
Development

No branches or pull requests

6 participants