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

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

Closed
3 of 6 tasks
kbecciv opened this issue Feb 14, 2024 · 44 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@kbecciv
Copy link

kbecciv commented Feb 14, 2024

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] 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
@kbecciv kbecciv added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Feb 14, 2024
@melvin-bot melvin-bot bot 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. Feb 14, 2024
Copy link

melvin-bot bot commented Feb 14, 2024

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Feb 14, 2024
Copy link

melvin-bot bot commented Feb 14, 2024

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

Copy link

melvin-bot bot commented Feb 14, 2024

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

@kbecciv
Copy link
Author

kbecciv commented Feb 14, 2024

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

@Krishna2323
Copy link
Contributor

Krishna2323 commented Feb 14, 2024

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

@FitseTLT
Copy link
Contributor

FitseTLT commented Feb 14, 2024

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)

@melvin-bot melvin-bot bot added the Overdue label Feb 16, 2024
Copy link

melvin-bot bot commented Feb 19, 2024

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

@alitoshmatov
Copy link
Contributor

Reviewing proposals

@melvin-bot melvin-bot bot removed the Overdue label Feb 21, 2024
@alitoshmatov
Copy link
Contributor

@Krishna2323 Thank you for your proposal. I do agree that this is very similar to tags page and we can have the same approach on fixing the issue.

@alitoshmatov
Copy link
Contributor

@FitseTLT Thank you for your proposal, I don't think your solution is correct. Even if we set enabled there the selectCategory is overwritten on category page. Here is a screenshot when I tried your solution:
Screenshot 2024-02-21 at 10 26 00

@alitoshmatov
Copy link
Contributor

We can go with @Krishna2323 's proposal

C+ reviewed 🎀 👀 🎀

Copy link

melvin-bot bot commented Feb 21, 2024

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

@dangrous
Copy link
Contributor

Makes sense!

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Feb 21, 2024
@dangrous dangrous assigned Krishna2323 and unassigned Krishna2323 Feb 21, 2024
@dangrous
Copy link
Contributor

well I'm not sure why the automation isn't firing but let's move forward with @Krishna2323 and we can handle that afterwards.

@dangrous dangrous assigned Krishna2323 and unassigned Krishna2323 Feb 22, 2024
@sakluger
Copy link
Contributor

I'm going to be OOO when this is ready to be paid so I'm going to reassign to another BZ member now.

I've updated the automatic offer links in this comment so they're correct now.

@melvin-bot melvin-bot bot removed the Overdue label May 14, 2024
@sakluger sakluger removed their assignment May 14, 2024
@sakluger sakluger added Bug Something is broken. Auto assigns a BugZero manager. and removed Bug Something is broken. Auto assigns a BugZero manager. labels May 14, 2024
Copy link

melvin-bot bot commented May 14, 2024

Triggered auto assignment to @puneetlath (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 melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels May 14, 2024
@sakluger
Copy link
Contributor

Back to weekly since payment isn't due until Monday.

@sakluger sakluger self-assigned this May 14, 2024
@melvin-bot melvin-bot bot added the Overdue label May 16, 2024
@sakluger sakluger added Weekly KSv2 and removed Daily KSv2 labels May 16, 2024
@melvin-bot melvin-bot bot added Daily KSv2 and removed Overdue Weekly KSv2 labels May 16, 2024
@puneetlath
Copy link
Contributor

@Krishna2323 has been paid.

@alitoshmatov bump on the checklist.

@melvin-bot melvin-bot bot added the Overdue label May 21, 2024
@puneetlath puneetlath added Weekly KSv2 and removed Daily KSv2 labels May 21, 2024
@melvin-bot melvin-bot bot removed the Overdue label May 21, 2024
@puneetlath puneetlath added Daily KSv2 and removed Weekly KSv2 labels May 21, 2024
@alitoshmatov
Copy link
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 👎

@mallenexpensify
Copy link
Contributor

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

Looks payments are still pending, so leaving open.

@puneetlath
Copy link
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
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
No open projects
Archived in project
Development

No branches or pull requests

8 participants