Skip to content

[HOLD for payment 2024-04-15] [$500] Use Const for 'violation' everywhere we check for violation type #39227

Description

@yuwenmemon

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

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionDailyKSv2ExternalAdded to denote the issue can be worked on by a contributorImprovementItem broken or needs improvement.

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions