Skip to content

[Awaiting payment][$250] [Track Tax] Selected tax rate is not marked with green check mark #39709

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.60-8
Reproducible in staging?: y
Reproducible in production?: y
Issue reported by: Applause - Internal Team

Action Performed:

Precondition:

  • User is an employee of Collect workspace.
  • The Collect workspace has at least 9 tax rates.
  1. Go to staging.new.expensify.com
  2. Go to workspace chat.
  3. Go to FAB > Request money > Manual.
  4. Enter amount > Next.
  5. On confirmation page, click Show more > Tax.
  6. Select a tax rate.
  7. Open Tax list again.
  8. Enter any term in search field and clear it.

Expected Result:

The selected tax rate should be marked with a green check mark because it will confuse the users when there is no highlight and check mark on the selected tax rate in a long list of rates.

Actual Result:

The selected tax rate is not marked with a green check mark. After clearing the search field, the selected item is not highlighted which will confuse the users.

Workaround:

n/a

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

Bug6438818_1712296385429.20240405_134519.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0179c138ca9de376f2
  • Upwork Job ID: 1777731900689838080
  • Last Price Increase: 2024-04-09
  • Automatic offers:
    • hoangzinh | Reviewer | 0
    • FitseTLT | Contributor | 0
Issue OwnerCurrent Issue Owner: @anmurali

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Apr 5, 2024
  2. melvin-bot commented on Apr 5, 2024

    @melvin-bot

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

  3. kbecciv commented on Apr 5, 2024

    @kbecciv
    Author

    We think that this bug might be related to #wave-collect - Release 1

  4. kbecciv commented on Apr 5, 2024

    @kbecciv
    Author

    @anmurali I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors.

  5. FitseTLT commented on Apr 5, 2024

    @FitseTLT
    Contributor

    Proposal

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

    Taxes - Selected tax rate is not marked with green check mark

    What is the root cause of that problem?

    We are not setting isSelected as true for selected option for the sections we are passing here

    const sections = useMemo(() => OptionsListUtils.getTaxRatesSection(taxRates, selectedOptions as OptionsListUtils.Category[], searchValue), [taxRates, searchValue, selectedOptions]);

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

    We should set isSelected as true in these two places

    const selectedTaxRateOptions = selectedOptions.map((option) => ({
    modifiedName: option.name,
    // Should be marked as enabled to be able to be de-selected
    isDisabled: false,

    isDisabled: !!taxRateObject?.isDisabled,
    };

    and change
    const enabledTaxRates = sortedTaxRates.filter((taxRate) => !taxRate.isDisabled);

    
        const enabledTaxRates = sortedTaxRates
            .filter((taxRate) => !taxRate.isDisabled)
            .map((taxRate) => ({...taxRate, isSelected: selectedOptions.some((option) => option.name === taxRate.modifiedName)}));
    

    and then add here

    data: taxRate,
    }));

            isSelected: !!taxRate.isSelected,
    
    

    What alternative solutions did you explore? (Optional)

  6. dragnoir commented on Apr 5, 2024

    @dragnoir
    Contributor

    Proposal

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

    Taxes - Selected tax rate is not marked with green check mark

    What is the root cause of that problem?

    The issue is happening with Tax rate and not categories (I picked categories as a working example)

    If we console.log the sections passed to SelectionList inside TaxPicker.tsx

    <SelectionList
    sections={sections}

    and we compare it with the same sections passed to SelectionList inside CategoryPicker.tsx

    We will notice that isSelected is missing from the data related to the selected item.
    SelectionList needs this attribute isSelected to display the green check mark.

    As we can see here CategoryPicker add isSelected: true to the data with the received value selectedCategory

    return [
    {
    name: selectedCategory,
    enabled: true,
    accountID: null,
    isSelected: true,
    },

    Same with TaxPicker, we have the selectedTaxRate but we are missing isSelected: true here

    return [
    {
    name: selectedTaxRate,
    enabled: true,
    accountID: null,
    },

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

    1- add isSelected: true here

    const  selectedOptions  =  useMemo(() => {
      if (!selectedTaxRate) {
        return [];
      }
      
      return [
      {
        name:  selectedTaxRate,
        enabled:  true,
        accountID:  null,
    +   isSelected:  true,
        },
      ];
    }, [selectedTaxRate]);

    2- The new data will be passed to getTaxRatesSection to create the sections

    const sections = useMemo(() => OptionsListUtils.getTaxRatesSection(taxRates, selectedOptions as OptionsListUtils.Category[], searchValue), [taxRates, searchValue, selectedOptions]);

    we shouls add isSelected: option.isSelected here

    return {
      modifiedName:  option.name,
      isDisabled:  !!taxRateObject?.isDisabled,
    + isSelected:  option.isSelected,
    };

    3- the new data from getTaxRatesSection will be passed to getTaxRatesOptions

    data: getTaxRatesOptions(selectedTaxRatesOptions),

    We need to add isSelected: taxRate.isSelected here

    return  taxRates.map((taxRate) => ({
    	text:  taxRate.modifiedName,
    	keyForList:  taxRate.modifiedName,
    	searchText:  taxRate.modifiedName,
    	tooltipText:  taxRate.modifiedName,
    	isDisabled:  taxRate.isDisabled,
    	data:  taxRate,
    +	isSelected:  taxRate.isSelected,
    }));

    POC:

    20240405_160556.mp4

    Link for a test branch: https://github.com/dragnoir/App/tree/39709-mos-test

  7. melvin-bot commented on Apr 8, 2024

    @melvin-bot

    @anmurali Whoops! This issue is 2 days overdue. Let's get this updated quick!

  8. anmurali commented on Apr 9, 2024

    @anmurali

    Makes sense to fix this as it would be consistent with the design for other fields
    image

  9. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Apr 9, 2024
  10. changed the title [-]Taxes - Selected tax rate is not marked with green check mark[/-] [+][$250] Taxes - Selected tax rate is not marked with green check mark[/+] on Apr 9, 2024
  11. 33 remaining items

  12. hoangzinh commented on May 14, 2024

    @hoangzinh
    Contributor

    @MonilBhavsar @anmurali I think we should process payment here for both contributor and C+ because the proposal has been accepted and PR was in progress.

  13. FitseTLT commented on May 17, 2024

    @FitseTLT
    Contributor

    bump @anmurali for the payment. The PR was on the final review stage so Payment is due. Thx.

  14. FitseTLT commented on Jun 6, 2024

    @FitseTLT
    Contributor

    @anmurali Can u pls process the payment here, it is super ooooverdue?

  15. changed the title [-][$250] [Track Tax] Selected tax rate is not marked with green check mark[/-] [+][Awaiting payment][$250] [Track Tax] Selected tax rate is not marked with green check mark[/+] on Jun 6, 2024
  16. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed on Jun 6, 2024
  17. anmurali commented on Jun 21, 2024

    @anmurali

    everyone's been paid.

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

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions