Skip to content

[OldDot Rules Migration] [Polish] [$250] Editing Approver offline does not gray out category but grays out Approver for other categories #49009

Closed

Description

@IuliiaHerets

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.32-1
Reproducible in staging?: Y
Reproducible in production?: N/A - new feature, doesn't exist in prod
If this was caught during regression testing, add the test name, ID and link from TestRail: Exp https://expensify.testrail.io/index.php?/tests/view/4948337
Email or phone of affected tester (no customers): applausetester+kh010901@applause.expensifail.com
Issue reported by: Applause Internal Team

Action Performed:

Precondition:

  • Rules are enabled.
  1. Go to staging.new.expensify.com
  2. Go to workspace settings > Categories.
  3. Go offline.
  4. Click on any category.
  5. Click Approver.
  6. Add any approver.
  7. Close the RHP.
  8. Note that the edited category is not grayed out.
  9. Open a different category.
  10. Note that Approver field is grayed out when it is not edited.

Expected Result:

In Step 8. the edited category should be grayed out after modifying Approver field offline.
In Step 10, the Approver field for other categories should not gray out when the categories are untouched.

Actual Result:

In Step 8. the edited category is not grayed out after modifying Approver field offline.
In Step 10, the Approver field for other categories is gray out when the categories are untouched.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug6600099_1726068970972.bandicam_2024-09-11_23-29-56-435.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021833957180531669064
  • Upwork Job ID: 1833957180531669064
  • Last Price Increase: 2024-09-11
Issue OwnerCurrent Issue Owner: @eh2077

Activity

  1. added
    DeployBlockerCashThis issue or pull request should block deployment
    BugSomething is broken. Auto assigns a BugZero manager.
    on Sep 11, 2024
  2. melvin-bot commented on Sep 11, 2024

    @melvin-bot

    Triggered auto assignment to @luacmartins (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

  3. melvin-bot commented on Sep 11, 2024

    @melvin-bot

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

  4. github-actions commented on Sep 11, 2024

    @github-actions
    Contributor

    👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

    1. Identify the pull request that introduced this issue and revert it.
    2. Find someone who can quickly fix the issue.
    3. Fix the issue yourself.
  5. luacmartins commented on Sep 11, 2024

    @luacmartins
    Contributor

    Might be related to #48171. cc @WojtekBoman @dukenv0307 @marcaaron

  6. nkdengineer commented on Sep 11, 2024

    @nkdengineer
    Contributor

    Edited by proposal-police: This proposal was edited at 2024-09-11 18:47:38 UTC.

    Proposal

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

    In Step 8. the edited category is not grayed out after modifying Approver field offline.
    In Step 10, the Approver field for other categories is gray out when the categories are untouched.

    What is the root cause of that problem?

    We have 2 bugs in here

    1. The edited category is not grayed out after modifying Approver field offline.

    In here we show grayed out when we have pending action of policy category and we not update it when set policy category approver

    const hasVisibleCategories = categoryList.some((category) => category.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE || isOffline);

    1. The Approver field for other categories is gray out when the categories are untouched.

    In here we show grayed out when we have pending fields approvalRules and use this variable for all category when set policy category approver

    <OfflineWithFeedback pendingAction={policy?.rules?.pendingFields?.approvalRules}>

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

    1. The edited category is not grayed out after modifying Approver field offline.

    We should update pending action of policy category in optimisticData when we set policy category approver here

        {
              onyxMethod: Onyx.METHOD.MERGE,
              key: `${ONYXKEYS.COLLECTION.POLICY_CATEGORIES}${policyID}`,
              value: {
                  [categoryName]: {
                      pendingAction: CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE,
                  }
              }
          }
    

    And we can do the same with all fields in category setting.

    1. The Approver field for other categories is grayed out when the categories are untouched.

    We should update the format pendingFields of approvalRules here like

     pendingFields: {
          [categoryName]: CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE,
      },
    

    do the same with failureDate and successData

    And update pendingAction here to show grayed out with each value of category name

    pendingAction={policy?.rules?.pendingFields?.[categoryName]}
    

    What alternative solutions did you explore? (Optional)

  7. luacmartins commented on Sep 11, 2024

    @luacmartins
    Contributor

    @nkdengineer is this a regression from a recent PR?

  8. luacmartins commented on Sep 11, 2024

    @luacmartins
    Contributor

    I'm gonna demote this from being a blocker since it's a minor issue.

  9. 12 remaining items

  10. changed the title [-][$250] Editing Approver offline does not gray out category but grays out Approver for other categories[/-] [+][OldDot Rules Migration] [Polish] [$250] Editing Approver offline does not gray out category but grays out Approver for other categories[/+] on Sep 11, 2024
  11. WojtekBoman commented on Sep 12, 2024

    @WojtekBoman
    Contributor

    Hi! I can fix that as I'm the author of the PR that caused this regression

  12. removed
    Help WantedApply this label when an issue is open to proposals by contributors
    on Sep 12, 2024
  13. dylanexpensify commented on Sep 18, 2024

    @dylanexpensify
    Contributor

    Nice! Merged

  14. dylanexpensify commented on Oct 7, 2024

    @dylanexpensify
    Contributor

    Payment summary:

    Contributor+: @eh2077 $250 via NewDot

    Please apply/request!

  15. eh2077 commented on Oct 10, 2024

    @eh2077
    Contributor

    Requested in NewDot

  16. JmillsExpensify commented on Oct 11, 2024

    @JmillsExpensify
    Contributor

    $250 approved for @eh2077

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.EngineeringExternalAdded to denote the issue can be worked on by a contributorReviewingHas a PR in reviewWeeklyKSv2

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions