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

[8.15] [ResponseOps][Alerts] Fix Stack Alerts page filter controls error (#194785) #194942

Merged
merged 1 commit into from
Oct 4, 2024

Conversation

kibanamachine
Copy link
Contributor

Backport

This will backport the following commits from main to 8.15:

Questions ?

Please refer to the Backport tool documentation

…astic#194785)

## Summary

elastic#190561 introduced a breaking
change in the format of the controls embeddable configuration object
that caused usages in the Security and Stack alerts pages to break if
there was an old value saved in localStorage.

This PR makes the storage key for the alert filter controls configurable
and uses a new value for the usage in `<UrlSyncedAlertsSearchBar>`,
fixing the error in the Stack Alerts page.

## To verify

1. Checkout a revision prior to this PR
2. Create Stack rules that fire alerts
3. Visit the Stack Alerts page (should show a full-page error message,
if it doesn't see [If the page works correctly](#how-to-break))
4. Checkout this PR
5. Reload the Stack Alerts page
6. Verify that the page loads correctly

<details id="how-to-break">

<summary>If the page works correctly</summary>

You likely didn't have an old saved configuration for the controls bar
in the localStorage. In this case, create a localStorage item named
`stackAlerts.default.pageFilters` with the following content:

```json
{
  "panels": {
    "0": {
      "type": "optionsListControl",
      "order": 0,
      "grow": true,
      "width": "small",
      "explicitInput": {
        "id": "0",
        "dataViewId": "unified-alerts-dv",
        "fieldName": "kibana.alert.status",
        "title": "Status",
        "hideExclude": true,
        "hideSort": true,
        "hidePanelTitles": true,
        "placeholder": "",
        "ignoreParentSettings": {
          "ignoreValidations": true
        },
        "selectedOptions": [
          "active"
        ],
        "hideActionBar": true,
        "persist": true,
        "hideExists": true
      }
    },
    "1": {
      "type": "optionsListControl",
      "order": 1,
      "grow": true,
      "width": "small",
      "explicitInput": {
        "id": "1",
        "dataViewId": "unified-alerts-dv",
        "fieldName": "kibana.alert.rule.name",
        "title": "Rule",
        "hideExclude": true,
        "hideSort": true,
        "hidePanelTitles": true,
        "placeholder": "",
        "ignoreParentSettings": {
          "ignoreValidations": true
        },
        "hideExists": true
      }
    },
    "2": {
      "type": "optionsListControl",
      "order": 2,
      "grow": true,
      "width": "small",
      "explicitInput": {
        "id": "2",
        "dataViewId": "unified-alerts-dv",
        "fieldName": "kibana.alert.group.value",
        "title": "Group",
        "hideExclude": true,
        "hideSort": true,
        "hidePanelTitles": true,
        "placeholder": "",
        "ignoreParentSettings": {
          "ignoreValidations": true
        }
      }
    },
    "3": {
      "type": "optionsListControl",
      "order": 3,
      "grow": true,
      "width": "small",
      "explicitInput": {
        "id": "3",
        "dataViewId": "unified-alerts-dv",
        "fieldName": "tags",
        "title": "Tags",
        "hideExclude": true,
        "hideSort": true,
        "hidePanelTitles": true,
        "placeholder": "",
        "ignoreParentSettings": {
          "ignoreValidations": true
        }
      }
    }
  },
  "labelPosition": "oneLine",
  "chainingSystem": "HIERARCHICAL",
  "autoApplySelections": true,
  "ignoreParentSettings": {
    "ignoreValidations": true
  },
  "editorConfig": {
    "hideWidthSettings": true,
    "hideDataViewSelector": true,
    "hideAdditionalSettings": true
  }
}
```
</details>

## References

Fixes elastic#193565

(cherry picked from commit ef3bc96)
@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/alerts-ui-shared 223 224 +1

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
securitySolution 17.2MB 17.2MB +28.0B
triggersActionsUi 1.7MB 1.7MB +137.0B
total +165.0B
Unknown metric groups

API count

id before after diff
@kbn/alerts-ui-shared 237 238 +1

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @umbopepato

@kibanamachine kibanamachine merged commit 73dcb07 into elastic:8.15 Oct 4, 2024
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants