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

Dashboard: When creating a new chart with two sources, selecting another color than the default generates an error "UNPROCESSABLE_ENTITY" #2189

Open
LM1LC3N7 opened this issue Dec 20, 2024 · 0 comments

Comments

@LM1LC3N7
Copy link
Contributor

Describe the bug
When creating a new chart with two sources, selecting another color than the default generates an error "UNPROCESSABLE_ENTITY".

To Reproduce
Steps to reproduce the behavior:

  1. Create a new dashboard (or edit one)
  2. Add a new chart
  3. Add two sources (like two temperature devices)
  4. Select colors different than the default selected
  5. Click on "save"
  6. See error, the page is stuck on "loading"

Expected behavior
Choosing any color should work as expected

Screen Recording
https://github.com/user-attachments/assets/15f95606-7ce7-4c5a-b3ca-abe0dabccd79

Your Gladys installation (please complete the following information):

  • Docker
  • Official last image v4.50.2

Web browser error

Uncaught (in promise) TypeError: s is undefined
    value apexcharts.common.js:6
    value apexcharts.common.js:6
    value apexcharts.common.js:6
    value apexcharts.common.js:6
    value apexcharts.common.js:14
    value apexcharts.common.js:6
    value apexcharts.common.js:14
    value apexcharts.common.js:14
    c ApexChartComponent.jsx:218
    componentDidMount ApexChartComponent.jsx:222
    Preact 7
    a Chart.jsx:259
    componentDidMount Chart.jsx:290
    Preact 7
    a EditChart.jsx:67
    S Preact
{
  "response": {
    "status": 422,
    "data": {
      "status": 422,
      "code": "UNPROCESSABLE_ENTITY",
      "properties": [
        {
          "message": "\"[2][0].colors[0]\" must be a string",
          "attribute": "boxes",
          "value": [
            [
              {
                "type": "temperature-in-room",
                "room": "salle-de-bain"
              },
              {
                "type": "humidity-in-room",
                "room": "salle-de-bain"
              }
            ],
            [
              {
                "type": "temperature-in-room",
                "room": "salle-de-douche"
              },
              {
                "type": "humidity-in-room",
                "room": "salle-de-douche"
              }
            ],
            [
              {
                "type": "chart",
                "device_feature_names": [
                  "Salle de bain",
                  "Douche"
                ],
                "device_features": [
                  "zigbee2mqtt-sdd-temp-sonoff-temperature-sensor-decimal-temperature",
                  "zigbee2mqtt-sdb-temp-sonoff-temperature-sensor-decimal-temperature"
                ],
                "title": "Salles d'eau",
                "chart_type": "area",
                "colors": [
                  null,
                  "#00cec9"
                ],
                "display_axes": true,
                "display_variation": true,
                "interval": "last-day"
              }
            ]
          ],
          "type": "Validation error"
        }
      ]
    }
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant