Problem
Right now, in many places where we look to see if the type of a violation is the most severe (violation, as opposed to warn or notice), we check for the string 'violation'. This can lead to issues where it can make it harder to track down instances where code is checking for this. As violation is a pretty generic term.
Example 1 - transactionUtils.tsx
Example 2 - MoneyRequestPreviewContent.tsx
Example 3 - useViolations.tsx hook
Solution
Use a CONST for 'violation' instead. This will have the added benefit of having all Consts for violation types be in the same place once those other types are introduced. This will make the code easier to understand.
cc @cead22 @luacmartins
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~01f2b3e68e72d70030
- Upwork Job ID: 1773585200383107072
- Last Price Increase: 2024-03-29
- Automatic offers:
- akinwale | Reviewer | 0
- Krishna2323 | Contributor | 0
Problem
Right now, in many places where we look to see if the type of a violation is the most severe (
violation, as opposed towarnornotice), we check for the string'violation'. This can lead to issues where it can make it harder to track down instances where code is checking for this. Asviolationis a pretty generic term.Example 1 - transactionUtils.tsx
Example 2 - MoneyRequestPreviewContent.tsx
Example 3 - useViolations.tsx hook
Solution
Use a CONST for
'violation'instead. This will have the added benefit of having all Consts for violation types be in the same place once those other types are introduced. This will make the code easier to understand.cc @cead22 @luacmartins
Upwork Automation - Do Not Edit