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.03k stars 2.54k forks source link

update rate list #42330

Open cretadn22 opened 2 weeks ago

cretadn22 commented 2 weeks ago
### Details Defaulting distance rate to the first enabled when the Rate field is not shown (users with betas disabled). Not displaying the disabled distance rates in the Rate field list (users with betas enabled). ### Fixed Issues

$ https://github.com/Expensify/App/issues/42284 PROPOSAL: https://github.com/Expensify/App/issues/42284#issuecomment-2116574341

Tests

Offline tests

QA Steps

Test 1

Precondition: User does NOT have betas enabled, hence no Rate field will be displayed in Distance confirmation page.

  1. Log in and go to Collect workspace settings.
  2. Enable and go to Distance rates.
  3. Click [+ Add rate].
  4. Add a new rate and make sure it's Enabled.
  5. Disable previously existing rate (default $0.670 / mile).
  6. Go to workspace chat.
  7. Start submitting a Distance request.
  8. On Distance confirmation page, verify that the enabled rate is set as default in the Distance field (see below).
Screenshot 2024-05-29 at 14 10 59

Test 2

Precondition: User does has betas enabled, hence the Rate field will be displayed in Distance confirmation page.

  1. Log in and go to Collect workspace settings.
  2. Enable and go to Distance rates.
  3. Click [+ Add rate].
  4. Add a new rate and make sure it's Enabled.
  5. Disable previously existing rate (default $0.670 / mile).
  6. Go to workspace chat.
  7. Start submitting a Distance request.
  8. On Distance confirmation page, verify that the enabled rate is set as default in the Rate field (see [1.]).
  9. On Distance confirmation page, click on the Rate field and verify that the disabled rate is not displayed (see [2.]).
09 21 50

PR Author Checklist

Screenshots/Videos

Android: Native https://github.com/Expensify/App/assets/168617111/86dba335-3b6a-4293-9617-e49bdf02c632
Android: mWeb Chrome https://github.com/Expensify/App/assets/168617111/36a647d9-0fa9-4524-8c08-6f5f0771a622
iOS: Native https://github.com/Expensify/App/assets/168617111/8abe2dc5-ca80-4cda-99b8-b57c93fde658
iOS: mWeb Safari https://github.com/Expensify/App/assets/168617111/0b00bf67-5173-433c-b735-3256d9921385
MacOS: Chrome / Safari https://github.com/Expensify/App/assets/168617111/eb1ae904-efb9-4299-be5f-8628d96398c4
MacOS: Desktop https://github.com/Expensify/App/assets/168617111/5aa54f6e-7834-4964-afa5-a2c12f69b767
melvin-bot[bot] commented 3 days ago

@ikevin127 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

ikevin127 commented 3 days ago

@cretadn22 Regarding the PR description tests, I'd be more specific so the QA team has a better understanding of the changes and what to test.

Note: Here's the pastebin so you can easily copy & paste the below steps in your PR's description.

[!tip]

Test 1

Precondition: User does NOT have betas enabled, hence no Rate field will be displayed in Distance confirmation page.

  1. Log in and go to Collect workspace settings.
  2. Enable and go to Distance rates.
  3. Click [+ Add rate].
  4. Add a new rate and make sure it's Enabled.
  5. Disable previously existing rate (default $0.670 / mile).
  6. Go to workspace chat.
  7. Start submitting a Distance request.
  8. On Distance confirmation page, verify that the enabled rate is set as default in the Distance field (see below).
Screenshot 2024-05-29 at 14 10 59

Test 2

Precondition: User does has betas enabled, hence the Rate field will be displayed in Distance confirmation page.

  1. Log in and go to Collect workspace settings.
  2. Enable and go to Distance rates.
  3. Click [+ Add rate].
  4. Add a new rate and make sure it's Enabled.
  5. Disable previously existing rate (default $0.670 / mile).
  6. Go to workspace chat.
  7. Start submitting a Distance request.
  8. On Distance confirmation page, verify that the enabled rate is set as default in the Rate field (see [1.]).
  9. On Distance confirmation page, click on the Rate field and verify that the disabled rate is not displayed (see [2.]).
1 2
1 2
ikevin127 commented 3 days ago

Reviewer Checklist

Screenshots/Videos

Android: Native
Android: mWeb Chrome https://github.com/Expensify/App/assets/56457735/a978c0cb-9a65-4695-aefc-1fd0a089c389
iOS: Native
iOS: mWeb Safari https://github.com/Expensify/App/assets/56457735/94c118b5-970c-477f-9e91-d2641be09929
MacOS: Chrome / Safari https://github.com/Expensify/App/assets/56457735/37668a9d-09ff-40f8-a254-2e0120c5250d
MacOS: Desktop https://github.com/Expensify/App/assets/56457735/f2af24a9-9a58-460c-8c5d-b8445baf11cb
ikevin127 commented 3 days ago

@cretadn22 I will ✅ Approve once the 2 comments (https://github.com/Expensify/App/pull/42330#discussion_r1619474285 and https://github.com/Expensify/App/pull/42330#issuecomment-2138292122) are addressed.

Note: Please don't force-push anymore as this goes against the guidelines, see Submit your pull request for final review:

  1. Please never force push when a PR review has already started (because this messes with the PR review history)
cretadn22 commented 3 days ago

@ikevin127 Thanks for your comments, It will greatly assist me in future PRs.

cretadn22 commented 1 day ago

@neil-marcellini Your comments make sense, I made an update to address your suggestion

cretadn22 commented 1 day ago

@neil-marcellini I addressed your comment and removed the description of getMileageRates function