episerver / netcore-preview

This repository is a preview providing early access to the latest Optimizely (formerly Episerver) product packages targeting .NET 5.
43 stars 9 forks source link

Commerce Order Management: market selector shows empty options #41

Closed stefanolsen closed 3 years ago

stefanolsen commented 3 years ago

From the Commerce Order Management view, I click "Create Order". I have created three markets, but when opening the "Choose Market" dropdown box, I see three options with empty markets (see attachment).

Build:

Screenshot
stefanolsen commented 3 years ago

Same issue with customer in the field below. I can search for a customer. Auto-suggest will find it and show an empty-text option. Selecting a market and a customer from the empty-options and then clicking "Create Order" closes the modal box and throws these exceptions in the console.

TypeError: Cannot read property 'trim' of undefined
    at t.value (1.chunk.js:1)
    at t.value (1.chunk.js:1)
    at Fo (vendor~main.chunk.js:1)
    at Ro (vendor~main.chunk.js:1)
    at Ul (vendor~main.chunk.js:1)
    at Ur (vendor~main.chunk.js:1)
    at Sr (vendor~main.chunk.js:1)
    at lr (vendor~main.chunk.js:1)
    at vendor~main.chunk.js:1
    at e.unstable_runWithPriority (vendor~main.chunk.js:1)

Uncaught TypeError: Cannot read property 'trim' of undefined
    at t.value (1.chunk.js:1)
    at t.value (1.chunk.js:1)
    at Fo (vendor~main.chunk.js:1)
    at Ro (vendor~main.chunk.js:1)
    at Ul (vendor~main.chunk.js:1)
    at Ur (vendor~main.chunk.js:1)
    at Sr (vendor~main.chunk.js:1)
    at lr (vendor~main.chunk.js:1)
    at vendor~main.chunk.js:1
    at e.unstable_runWithPriority (vendor~main.chunk.js:1)
lunchin commented 3 years ago

Thanks for reporting I have created an issue in our internal tracking system.

lunchin commented 3 years ago

We are unable to recreate this issue

stefanolsen commented 3 years ago

This is locally. In DXP the same page crashes even before this (opening a separate issue for that).

Trying it out with React Debugger in Chrome, I see that the markets property has correct market items.

Screenshot 1

But in the immediate child node, those markets have been transformed to an options property, which has undefined labels and values.

Screenshot 2

Let me know if you need further information.

stefanolsen commented 3 years ago

Turns out that adding the following lines in Startup.cs fixes the error:

services.Configure<JsonOptions>(o =>
{
    o.JsonSerializerOptions.PropertyNamingPolicy = null;
});

But since this is a global setting, it also affect custom code where we might want to use the default camel-case naming. Is it possible for Episerver to apply the setting internally (in areas where needed)?

jbearfoot commented 3 years ago

I have verified the issue and reported an issue in our internal tracking system

lunchin commented 3 years ago

this should be fixed in latest packages

stefanolsen commented 3 years ago

Which version is this fixed in?

lunchin commented 3 years ago

Fixed in EPiServer.Commerce.Core.14.0.0-inte-021024