elastic/kibana

Saved object import: show validation errors in UI

オープン

#166,795 opened on 2023/09/20

 (1 件のコメント) (1 件のリアクション) (0 人の担当者)TypeScript (8,021 件のフォーク)batch import
Feature:Saved Objects ManagementTeam:Coregood first issue

Repository metrics

Stars
 (19,065 個のスター)
PR merge metrics
 (平均マージ 1d 16h) (30d で 999 merged PRs)

説明

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

コントリビューターガイド