Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.57k stars 2.91k forks source link

Per diem - Settings page is blank when categories are disabled #53016

Open IuliiaHerets opened 1 day ago

IuliiaHerets commented 1 day ago

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.66-0 Reproducible in staging?: Y Reproducible in production?: N/A - new feature, doesn't exist in prod If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: If this was caught during regression testing, add the test name, ID and link from TestRail: Email or phone of affected tester (no customers): Logs: https://stackoverflow.com/c/expensify/questions/4856 Expensify/Expensify Issue URL: Issue reported by: Slack conversation (hyperlinked to channel name):

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to workspace settings > More features.
  3. Enable Per diem and upgrade workspace.
  4. DIsable Categories.
  5. Go to Per diem.
  6. Click Settings.

Expected Result:

Settings button should not be present when categories are disabled.

Actual Result:

Settings page is blank when categories are disabled.

Workaround:

Unknown

Platforms:

Screenshots/Videos

https://github.com/user-attachments/assets/5a3d7b5f-94d8-4272-a9b7-e54c539f412c

View all open jobs on GitHub

melvin-bot[bot] commented 1 day ago

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

melvin-bot[bot] commented 1 day ago

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

melvin-bot[bot] commented 1 day ago

💬 A slack conversation has been started in #expensify-open-source

github-actions[bot] commented 1 day ago

:wave: 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.
abzokhattab commented 1 day ago

Edited by proposal-police: This proposal was edited at 2024-11-23 14:35:22 UTC.

Proposal

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

Per diem - Settings page is blank when categories are disabled

What is the root cause of that problem?

we display the settings button in the per diem page even if categories are disabled: https://github.com/Expensify/App/blob/2a031a04d73bbb8b9e0b421358a7a76a5fbf2720/src/pages/workspace/perDiem/WorkspacePerDiemPage.tsx#L263-L280

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

we should return null if categories are disabled:

to achevie that we can move the isFeatureEnabledInPolicies inside the AdvancedSearchFilters to the policy utils functions then use it in the WorkspacePerDiemPage as followiing:

    const areCategoriesEnabled = PolicyUtils.isFeatureEnabledInPolicies(policies, CONST.POLICY.MORE_FEATURES.ARE_CATEGORIES_ENABLED);

then in the getHeaderButtons before returning the settings button we should add this conditon:

   if (!areCategoriesEnabled) {
            return null;
        }

What alternative solutions did you explore? (Optional)

shubham1206agra commented 7 hours ago

Me and @c3024 will handle this issue. No need to go external.