Skip to content

[HOLD for payment 2024-07-31] [$250] Billable - Billable toggle should have a locked icon in split details view #43756

Closed

Description

@lanitochka17

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.83-1
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/4631196
Issue reported by: Applause - Internal Team

Action Performed:

Precondition:

  • Billable option is set to default to billable on Old Dot
  1. Go to staging.new.expensify.com
  2. Go to workspace chat
  3. Split a manual expense with billable toggled enabled
  4. Click on the split preview
  5. Click on the toggle

Expected Result:

Billable toggle should appear with a locked icon if billable toggle cannot be edited after splitting the bill

Actual Result:

The billable toggle does not have a locked icon, is clickable but not responsive

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

Bug6512799_1718348053624.bandicam_2024-06-14_14-53-23-432.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~015cebf7a04f37f63d
  • Upwork Job ID: 1801675898344474551
  • Last Price Increase: 2024-06-14
  • Automatic offers:
    • ishpaul777 | Reviewer | 102769577
    • Krishna2323 | Contributor | 102769579
Issue OwnerCurrent Issue Owner: @ishpaul777

Activity

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

    @melvin-bot

    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.

  3. lanitochka17 commented on Jun 14, 2024

    @lanitochka17
    Author

    @puneetlath FYI 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

  4. Krishna2323 commented on Jun 14, 2024

    @Krishna2323
    Contributor

    Proposal

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

    What is the root cause of that problem?

    We haven't added the showLockIcon & disabled prop.

    <View style={[styles.flexRow, styles.justifyContentBetween, styles.alignItemsCenter, styles.ml5, styles.mr8, styles.optionRow]}>
    <Text color={!iouIsBillable ? theme.textSupporting : undefined}>{translate('common.billable')}</Text>
    <Switch
    accessibilityLabel={translate('common.billable')}
    isOn={iouIsBillable}
    onToggle={(isOn) => onToggleBillable?.(isOn)}
    />
    </View>

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

    Add showLockIcon & disabled prop.

    <View style={[styles.flexRow, styles.justifyContentBetween, styles.alignItemsCenter, styles.ml5, styles.mr8, styles.optionRow]}>
        <Text color={!iouIsBillable ? theme.textSupporting : undefined}>{translate('common.billable')}</Text>
        <Switch
            accessibilityLabel={translate('common.billable')}
            isOn={iouIsBillable}
            onToggle={(isOn) => onToggleBillable?.(isOn)}
            showLockIcon={isReadOnly}
            disabled={isReadOnly}
        />
    </View>

    We can also modify Switch component to accept a new prop disabledStyle and pass it to PressableWithFeedback. This should be done incase we want to show the regular cursor instead of disabled one.

    We should also check for other components using Switch which may have similar issue.

    We might also want to update the text color based on the isReadOnly prop.

    What alternative solutions did you explore? (Optional)

    We can use ToggleSettingOptionRow .

    Result

    billable_lock_icon.mp4
  5. Krishna2323 commented on Jun 14, 2024

    @Krishna2323
    Contributor

    Proposal Updated

    • Updated main solution and added alternative.
  6. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Jun 14, 2024
  7. changed the title [-]Billable - Billable toggle should have a locked icon in split details view[/-] [+][$250] Billable - Billable toggle should have a locked icon in split details view[/+] on Jun 14, 2024
  8. melvin-bot commented on Jun 14, 2024

    @melvin-bot
  9. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jun 14, 2024
  10. melvin-bot commented on Jun 14, 2024

    @melvin-bot

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

  11. cretadn22 commented on Jun 14, 2024

    @cretadn22
    Contributor

    Proposal

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

    Billable toggle should have a locked icon in split details view

    What is the root cause of that problem?

    SplitBillDetailsPage is using the MoneyRequestConfirmationList Component. However, the disabled property hasn't been included in the MoneyRequestConfirmationList Component. And since SplitBillDetailsPage doesn't provide the onToggleBillable function to MoneyRequestConfirmationList, it doesn't trigger any action when clicking toggle button

    <Switch
    accessibilityLabel={translate('common.billable')}
    isOn={iouIsBillable}
    onToggle={(isOn) => onToggleBillable?.(isOn)}
    />

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

    Simply adding disabled={isReadOnly} to the MoneyRequestConfirmationList Component

    <Switch
    accessibilityLabel={translate('common.billable')}
    isOn={iouIsBillable}
    onToggle={(isOn) => onToggleBillable?.(isOn)}
    />

    To clarify, the lock icon is displayed when either the disabled prop is true or the showLockIcon prop is true. The showLockIcon prop should only be used when we want to display the lock icon without disabling the toggle, as in this particular use case

    Ghi.Man.hinh.2024-06-15.luc.01.54.49.mov

    Another consideration is that we've recently introduced the ToggleSettingOptionRow Component. We could also consider migrating these places to use the new component

    <Switch
    accessibilityLabel={translate('common.billable')}
    isOn={iouIsBillable}
    onToggle={(isOn) => onToggleBillable?.(isOn)}
    />

    <Switch
    accessibilityLabel={translate('common.billable')}
    isOn={!!transactionBillable}
    onToggle={saveBillable}
    disabled={!canEdit}
    />

    The current way seems fine to me. However, if we aim for consistency, there shouldn't be any issues. I've just tested it locally, and it's functioning smoothly.

  12. Krishna2323 commented on Jun 15, 2024

    @Krishna2323
    Contributor

    Proposal Updated

    • Added back the reference code in RCA which was deleted mistakenly during an edit.
  13. 31 remaining items

  14. puneetlath commented on Jul 16, 2024

    @puneetlath
    Contributor

    @ishpaul777 please complete the checklist ASAP. I'd like to close this issue out.

  15. ishpaul777 commented on Jul 16, 2024

    @ishpaul777
    Contributor

    [@ishpaul777] The PR that introduced the bug has been identified. Link to the PR: #27172
    [@ishpaul777] 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/27172/files#r1679832517
    [@ishpaul777] 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
    [@ishpaul777] Determine if we should create a regression test for this bug. - Not required
    [@ishpaul777] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again. N/a

  16. ishpaul777 commented on Jul 16, 2024

    @ishpaul777
    Contributor

    @puneetlath Please hold my payment until 7/22 i'll bump once i am ready to accept payment, we can move this to weekly for now

  17. changed the title [-][HOLD for payment 2024-07-10] [HOLD for payment 2024-07-02] [$250] Billable - Billable toggle should have a locked icon in split details view[/-] [+][HOLD for payment 2024-07-22] [$250] Billable - Billable toggle should have a locked icon in split details view[/+] on Jul 17, 2024
  18. ishpaul777 commented on Jul 24, 2024

    @ishpaul777
    Contributor

    Sadly i'd still have to keep my payment on hold (Expected End of this month) i'll ping once i am ready to accept. Thanks for you patience.

  19. ishpaul777 commented on Jul 24, 2024

    @ishpaul777
    Contributor

    update above ^ melvin

  20. changed the title [-][HOLD for payment 2024-07-22] [$250] Billable - Billable toggle should have a locked icon in split details view[/-] [+][HOLD for payment 2024-07-31] [$250] Billable - Billable toggle should have a locked icon in split details view[/+] on Jul 24, 2024
  21. ishpaul777 commented on Aug 14, 2024

    @ishpaul777
    Contributor

    Thanks for holding the payment 🙇 , please release payment whenever you get the chance @puneetlath

  22. puneetlath commented on Aug 14, 2024

    @puneetlath
    Contributor

    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.ExternalAdded to denote the issue can be worked on by a contributorMonthlyKSv2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions