elastic/kibana

Saved object import: show validation errors in UI

開放

#166,795 建立於 2023年9月20日

 (1 則留言) (1 個反應) (0 位負責人)TypeScript (8,021 個分叉)batch import
Feature:Saved Objects ManagementTeam:Coregood first issue

倉庫指標

星標
 (19,065 顆星)
PR 合併指標
 (平均合併 1天 16小時) (30 天內合併 999 個 PR)

描述

If importing saved objects results in the API returning validation errors these errors should be displayed in the UI so users can take action on them.

For example, importing a dashboard with kibanaSavedObjectMeta.searchSourceJSON as a object instead of a string causes the API to respond with:

{
    "successCount": 0,
    "success": false,
    "warnings": [],
    "errors": [
        {
            "id": "elasticsearch-storage-dashboard",
            "type": "dashboard",
            "meta": {
                "title": "Cluster Ingest Per Day (Technical Preview/Beta)",
                "icon": "dashboardApp"
            },
            "error": {
                "isBoom": true,
                "isServer": false,
                "data": null,
                "output": {
                    "statusCode": 400,
                    "payload": {
                        "message": "[attributes.kibanaSavedObjectMeta.searchSourceJSON]: expected value of type [string] but got [Object]: Bad Request",
                        "statusCode": 400,
                        "error": "Bad Request"
                    },
                    "headers": {}
                },
                "type": "unknown"
            }
        }
    ]
}

But the UI just shows "Error" without any explanation

貢獻者指南