Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid visualisation of arguments in payment handlers #2539

Closed
StampixSMO opened this issue Nov 23, 2023 · 0 comments
Closed

Invalid visualisation of arguments in payment handlers #2539

StampixSMO opened this issue Nov 23, 2023 · 0 comments
Assignees
Labels

Comments

@StampixSMO
Copy link
Contributor

Describe the bug
When adding arguments to a payment method handler (for a custom payment plugin), giving the arg json-editor-form-input breaks the UI a bit. See screenshot. The value is saved correctly, the admin UI is just not displaying it correctly.
image

To Reproduce
Steps to reproduce the behavior:

  1. Create a new payment handler with a string arg that uses the json input component
     const handler = new PaymentMethodHandler({
     	  code: 'custom',
     	  args: {
     	    aField: {
     	      type: 'string',
     	      required: true,
     	      ui: {
     	        component: 'json-editor-form-input',
     	      },
     	    },
     	  },
     	...
     });
  2. Add the handler to your vendure config
  3. Create a new payment in the admin UI
  4. Add some JSON to the handler's arguments
  5. Save it
  6. Refresh the page, the JSON gets displayed as [object Object] and says it's invalid

Expected behavior
The JSON to be displayed properly in the UI.

Environment (please complete the following information):

  • @vendure/core version: 3.1.2
  • Nodejs version 18
  • Database (mysql/postgres etc): postgres
@StampixSMO StampixSMO added the type: bug 🐛 Something isn't working label Nov 23, 2023
@michaelbromley michaelbromley moved this to 🏗 In progress in Vendure OS Roadmap Nov 23, 2023
michaelbromley added a commit that referenced this issue Nov 23, 2023
The prior solution in 84764b1
is potentially too far-reaching a change. This is a more
localized approach which is less likely to have
unwanted side-effects.
@michaelbromley michaelbromley moved this from 🏗 In progress to ✅ Done in Vendure OS Roadmap Dec 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: 🚀 Shipped
Development

No branches or pull requests

2 participants