Skip to content

Implement new component ReceiptEmptyState #30663

Description

@cead22
  • Design doc
  • This will be similar to the ReceiptSelector component we have in the receipt scan flow.
  • The component will just render the SVG + background + border and the onPress callback should launch the receipt selector
  • The component can have a the normal border, or a red border, based on a prop hasError
  • onPress callback should launch the receipt selector, like the ... > Replace menu currently does
  • When selecting a receipt, we should call ReplaceReceipt with the corresponding transactionID
  • The red text shown in the screenshot at the bottom "Receipt required for amounts over $100", is not part of this component
  • As part of this change let's also update this code in MoneyRequestView so that if hasReceipt is false and permissions.canUseViolations() is true we show the ReceiptEmptyState component
  • permissions.canUseViolations doesn't exist yet so let's add it as part of this change, and make it return true if the user is in the BETA_VIOLATIONS = 'violations' beta
image

Here's the red border
image

Here are some tests to include in the PR to make sure everything is working correctly

  • permissions.canUseViolations returns true for user on the violations beta, and false otherwise
  • ReceiptEmptyState shows normal border when !hasErrors and red border when hasErrors
  • Open money request without a receipt, confirm ReceiptEmptyState is shown, action ReceiptEmptyState
    • Import from photo library
    • Import from Files
    • Upload receipt by taking photo
    • Confirm new receipt is attached to the money request and saved successfully

Metadata

Metadata

Labels

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