Skip to content

[HOLD for payment 2024-05-20] [$500] IOU - Disabled tag is greyed in list but disabled category is shown bold in list. #36485

Closed

Description

@kbecciv

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: 1.4.41.0
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/4314177
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:

Action Performed:

  1. Launch app as employee
  2. Tap on employee workspace chat
  3. Create a manual request by entering tag, category and all necessary field
  4. In admin account, disable the tag and category used to create above expense
  5. In employee account, in Workspace chat, open the newly created request to open details page.
  6. Note missing tag and category in red displayed
  7. Tap on tag and note disabled tag is greyed in the drop down list
  8. Tap on category and note disabled category is in bold in the drop down list

Expected Result:

Both disabled tag and category should be disabled in same manner.

Actual Result:

Disabled tag is greyed in list but disabled category is shown bold in list.

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

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

Screenshots/Videos

Add any screenshot/video evidence

Bug6379128_1707903377173.az_recorder_20240214_093216.mp4
Bug6379128_1707903377149.az_recorder_20240214_093432.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0153013ee28976211a
  • Upwork Job ID: 1757771565108477952
  • Last Price Increase: 2024-02-14
  • Automatic offers:
    • alitoshmatov | Reviewer | 0
    • Krishna2323 | Contributor | 0

Activity

  1. added
    External
    Daily
    Bug
    on Feb 14, 2024
  2. changed the title [-]IOU - Disabled tag is greyed in list but disabled category is shown bold in list.[/-] [+][$500] IOU - Disabled tag is greyed in list but disabled category is shown bold in list.[/+] on Feb 14, 2024
  3. melvin-bot commented on Feb 14, 2024

    @melvin-bot
  4. added
    Help Wanted
    on Feb 14, 2024
  5. melvin-bot commented on Feb 14, 2024

    @melvin-bot

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

  6. melvin-bot commented on Feb 14, 2024

    @melvin-bot

    Triggered auto assignment to @sakluger (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

  7. kbecciv commented on Feb 14, 2024

    @kbecciv
    Author

    We think that this bug might be related #vip-bills
    CC @davidcardoza

  8. Krishna2323 commented on Feb 14, 2024

    @Krishna2323
    Contributor

    Proposal

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

    IOU - Disabled tag is greyed in list but disabled category is shown bold in list.

    What is the root cause of that problem?

    We don't use shouldShowDisabledAndSelectedOption in CategoryPicker to filter out enabledCategories for expected UI.

    const sections = useMemo(() => {
    const validPolicyRecentlyUsedCategories = _.filter(policyRecentlyUsedCategories, (p) => !_.isEmpty(p));
    const {categoryOptions} = OptionsListUtils.getFilteredOptions(
    {},
    {},
    [],
    searchValue,
    selectedOptions,
    [],
    false,
    false,
    true,
    policyCategories,
    validPolicyRecentlyUsedCategories,
    false,
    );

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

    Pass shouldShowDisabledAndSelectedOption in EditRequestCategoryPage to CategoryPicker and instead of passing policyCategories directly, filter out enabledCategories just like enabledTags and pass enabledCategories to getFilteredOptions instead of policyCategories.

    Do same thing in CategoryPicker

    const enabledTags = useMemo(() => {
    if (!shouldShowDisabledAndSelectedOption) {
    return policyTagList;
    }
    const selectedNames = _.map(selectedOptions, (s) => s.name);
    const tags = [...selectedOptions, ..._.filter(policyTagList, (policyTag) => policyTag.enabled && !selectedNames.includes(policyTag.name))];
    return tags;
    }, [selectedOptions, policyTagList, shouldShowDisabledAndSelectedOption]);
    const sections = useMemo(
    () => OptionsListUtils.getFilteredOptions({}, {}, [], searchValue, selectedOptions, [], false, false, false, {}, [], true, enabledTags, policyRecentlyUsedTagsList, false).tagOptions,
    [searchValue, enabledTags, selectedOptions, policyRecentlyUsedTagsList],
    );

    We have enabled & name properties on a category so there is not much to do here.

    Result

  9. FitseTLT commented on Feb 14, 2024

    @FitseTLT
    Contributor

    Proposal

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

    Disabled tag is greyed in list but disabled category is shown bold in list.

    What is the root cause of that problem?

    We pass enabled as true for selectedOptions here

    enabled: true,
    accountID: null,

    It is similar as in tag case

    enabled: true,
    accountID: null,

    but for categories we miss the same piece of code that we use in tags list construction that correctly set enabled prop based on the enabled state we get from BE instead of the manually set one I mentioned above which is always true here
    if (selectedOptions) {
    const selectedTagOptions = selectedOptions.map((option) => {
    const tagObject = tags.find((tag) => tag.name === option.name);
    return {
    name: option.name,
    enabled: !!tagObject?.enabled,
    };
    });

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

    We need to change this here

    if (selectedOptions.length > 0) {
    categorySections.push({
    // "Selected" section
    title: '',
    shouldShow: false,
    indexOffset,
    data: getCategoryOptionTree(selectedOptions, true),
    });

    to

    if (selectedOptions.length > 0) {
            const selectedCategoryOptions = selectedOptions.map((option) => {
                const categoryObject = sortedCategories.find((category) => category.name === option.name);
                return {
                    name: option.name,
                    enabled: !!categoryObject?.enabled,
                };
            });
            categorySections.push({
                // "Selected" section
                title: '',
                shouldShow: false,
                indexOffset,
                data: getCategoryOptionTree(selectedCategoryOptions, true),
            });
    
    

    What alternative solutions did you explore? (Optional)

  10. melvin-bot commented on Feb 19, 2024

    @melvin-bot

    @sakluger, @alitoshmatov Huh... This is 4 days overdue. Who can take care of this?

  11. 81 remaining items

  12. added
    Daily
    and removed
    Weekly
    on May 16, 2024
  13. puneetlath commented on May 21, 2024

    @puneetlath
    Contributor

    @Krishna2323 has been paid.

    @alitoshmatov bump on the checklist.

  14. added
    Weekly
    and removed
    Daily
    on May 21, 2024
  15. added
    Daily
    and removed
    Weekly
    on May 21, 2024
  16. alitoshmatov commented on May 21, 2024

    @alitoshmatov
    Contributor
    • The PR that introduced the bug has been identified. Link to the PR: Fix the focus effect of categories #27518
    • The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment: https://github.com/Expensify/App/pull/27518/files#r1608871281
    • A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion: no need
    • Determine if we should create a regression test for this bug. Yes
    1. As workspace employee create money request with category and tag
    2. As workspace admin disable selected category and tag in step 1 in old dot
    3. As employee open money request in step 1 and go to categories/tag
    4. Selected category/tag should be greyed out, but you can still click on it to unselect
    5. After selecting new category/tag or unselecting them, it should disappear

    Do we agree 👍 or 👎

  17. mallenexpensify commented on May 22, 2024

    @mallenexpensify
    Contributor

    I happened to be subscribed here so I created the TR GH

    Looks payments are still pending, so leaving open.

  18. puneetlath commented on May 23, 2024

    @puneetlath
    Contributor

    Oh, thanks @mallenexpensify!

    @alitoshmatov has been paid. Thanks everyone!

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

Metadata

Metadata

Labels

Awaiting PaymentBugDailyExternal

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions