bigcommerce / b2b-buyer-portal

B2B Buyer Portal - BigCommerce B2B Edition
MIT License
25 stars 19 forks source link

View Invoice Button Visible on Order Details when Invoices Feature Disabled #97

Open SE-Graham opened 3 weeks ago

SE-Graham commented 3 weeks ago

Please fill out this template to help us diagnose and address your issue effectively.

Type: (Select one)

Summary:

View Invoice button is visible and works on Order Details when invoice feature is disabled

Expected Behavior:

View Invoice button should not be visible on Order Details when invoice feature is disabled

Actual Behavior:

View Invoice button is visible and works on Order Details when invoice feature is disabled

Steps to Reproduce (Bug Reports Only):

  1. Disable Invoice Feature
  2. Go to Order > Order Details

Code Snippet (Bug Reports Only):

I assume it's something to do with isCanShow in /Users/SprattG/GitHub/b2b-buyer-portal/apps/storefront/src/pages/OrderDetail/components/OrderAction.tsx

buttons: [
        {
          value: isB2BUser ? b3Lang('orderDetail.viewInvoice') : b3Lang('orderDetail.printInvoice'),
          key: 'aboutInvoice',
          name: isB2BUser ? 'viewInvoice' : 'printInvoice',
          variant: 'outlined',
          isCanShow: isB2BUser
            ? invoiceBtnPermissions && getInvoicesPermission
            : invoiceBtnPermissions,
        },
      ],

Additional Information:

Please also note the button only works once. First click load the print window when you close the print window and click it again nothing happens.

Version:

b7c20f39ca63972f63c6b38900733174a013f2a1

Screenshots/Screen Recordings (Optional):

Screenshot 2024-08-21 at 11 09 15