Skip to content

[ResponseOps][Alerts] Add alerts table to a dashboard#216076

Merged
umbopepato merged 58 commits intoelastic:mainfrom
umbopepato:203614-embeddable-alerts-table-creation-flow
May 14, 2025
Merged

[ResponseOps][Alerts] Add alerts table to a dashboard#216076
umbopepato merged 58 commits intoelastic:mainfrom
umbopepato:203614-embeddable-alerts-table-creation-flow

Conversation

@umbopepato
Copy link
Member

@umbopepato umbopepato commented Mar 26, 2025

Summary

  • Implements the embeddable alerts table creation flow, with solution and filters.
  • Enables the new table panel creation action.
image image

Implementation details

Panel configuration state

As part of the panel's persisted configuration state, I opted to only save the selected solution (observability, security, stack) and not the resulting list of rule type ids. Re-calculating the rule type ids based on the solution at render time ensures that users see the rule types they have access to, and should avoid potential authentication errors (both when editing the configuration and viewing the panel).

Switching solution

image

When switching solution, the filters form must be reset since the rule type ids it is based on change. This can be disruptive for the UX, so I added a confirmation prompt in case the user already started to edit the form and then tries to change solution.

Missing authorization

image

When a user doesn't have the necessary permissions for the rule types a panel is based on, a missing authz prompt is shown.

Verification steps

  1. Create rules that fire alerts in multiple solutions (Security, Observability and Stack)
  2. Create a new dashboard or open an existing one, enter edit mode if not active
  3. Click + Add panel > Alerts
  4. Check that the solution selector options are coherent with the rule types the user can access
  5. Select a solution
  6. Build filters expressions, checking that the rule tags and rule types are coherent with the solution selection and the rules created previously
  7. Save the panel
  8. Check that the created panel reflects the filtering options from the creation flyout
  9. Repeat steps 3-9 with different roles:
    9.1. having access to rule types from just one solution (in this case the solution selector shouldn't appear at all),
    9.2. having access just to Observability and Stack but not Security (in this case the solution selector shouldn't appear at all),
  10. Repeat steps 3-8 in the three serverless project types:
    $ yarn es serverless —ssl --projectType <es|oblt|security>
    $ yarn serverless-<es|oblt|security> --ssl --run-examples
    (If the authentication fails when switching between project types, use a clean session)
    10.1. Elasticsearch project types should have access only to Stack rules (no selector)
    10.2. Observability project types should have access only to Observability and Stack rules (no selector)
    10.3. Security project types should have access only to Security and Stack rules (selector shows Stack instead of Observability)
  11. In the previous cases, when the user doesn't have access to rule types from the solution a certain panel is configured to show, check that an authorization prompt is shown
  12. Using a role without access to any rule type
    12.1. Check that the Alerts panel type is not visible in the Add panel flyout
    12.2. Check that any pre-existing table panels show a missing authz prompt

Release Notes

Added an embeddable panel for Dashboards to display alerts.

References

Closes #203613
Closes #203614
Closes #203612

Checklist

@umbopepato umbopepato added Team:ResponseOps Platform ResponseOps team (formerly the Cases and Alerting teams) t// release_note:feature Makes this part of the condensed release notes backport:version Backport to applied version labels v9.1.0 v8.19.0 labels Mar 26, 2025
@umbopepato
Copy link
Member Author

/ci

@umbopepato umbopepato force-pushed the 203614-embeddable-alerts-table-creation-flow branch from 05ed2cd to 2f46bb2 Compare March 26, 2025 15:57
@umbopepato
Copy link
Member Author

/ci

1 similar comment
@umbopepato
Copy link
Member Author

/ci

@umbopepato umbopepato force-pushed the 203614-embeddable-alerts-table-creation-flow branch from e4354e4 to 2994e83 Compare March 27, 2025 11:10
@umbopepato
Copy link
Member Author

/ci

@umbopepato umbopepato force-pushed the 203614-embeddable-alerts-table-creation-flow branch from d0b2a78 to 3c86680 Compare March 27, 2025 12:08
@umbopepato
Copy link
Member Author

/ci

1 similar comment
@umbopepato
Copy link
Member Author

/ci

@umbopepato umbopepato force-pushed the 203614-embeddable-alerts-table-creation-flow branch from 87ddfd6 to 7f50576 Compare April 3, 2025 13:46
@umbopepato
Copy link
Member Author

/ci

@umbopepato umbopepato force-pushed the 203614-embeddable-alerts-table-creation-flow branch from 7f50576 to a9a42d7 Compare April 7, 2025 12:53
@umbopepato
Copy link
Member Author

/ci

@umbopepato umbopepato force-pushed the 203614-embeddable-alerts-table-creation-flow branch from a9a42d7 to 1dfb967 Compare April 22, 2025 10:04
@umbopepato
Copy link
Member Author

/ci

@umbopepato umbopepato enabled auto-merge (squash) May 9, 2025 17:42
@umbopepato
Copy link
Member Author

umbopepato commented May 9, 2025

@joana-cps I remembered that the Feature column is currently being used for some assertions in functional tests, so I haven't had time to remove it now, but it's the first thing on the list!
Thanks all for your thorough reviews and support! 😊

@umbopepato umbopepato merged commit 0a7874c into elastic:main May 14, 2025
8 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.19

https://github.com/elastic/kibana/actions/runs/15025194230

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
embeddableAlertsTable 280 371 +91

Async chunks

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

id before after diff
cases 1.3MB 1.3MB +1.0KB
embeddableAlertsTable 798.2KB 853.7KB +55.5KB
ml 5.3MB 5.3MB +1.1KB
observability 1.3MB 1.3MB +1.1KB
securitySolution 9.2MB 9.2MB +1.0KB
triggersActionsUi 1.4MB 1.4MB +1.1KB
total +60.9KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
embeddableAlertsTable 4.8KB 5.8KB +1016.0B
Unknown metric groups

async chunk count

id before after diff
embeddableAlertsTable 3 7 +4

ESLint disabled in files

id before after diff
embeddableAlertsTable 0 2 +2

Total ESLint disabled count

id before after diff
embeddableAlertsTable 2 4 +2

History

kibanamachine added a commit to kibanamachine/kibana that referenced this pull request May 14, 2025
…216076)

## Summary

- Implements the embeddable alerts table creation flow, with solution
and filters.
- Enables the new table panel creation action.

<img width="1115" alt="image"
src="https://github.com/user-attachments/assets/d3158e55-3d09-4e52-b718-0ebe3e911e4c"
/>

<img width="1488" alt="image"
src="https://github.com/user-attachments/assets/c6e65f12-1347-4859-83f5-1de996d6ba86"
/>

<details>
<summary>

## Implementation details

</summary>

### Panel configuration state

As part of the panel's persisted configuration state, I opted to only
save the selected `solution` (`observability`, `security`, `stack`) and
not the resulting list of rule type ids. Re-calculating the rule type
ids based on the solution at render time ensures that users see the rule
types they have access to, and should avoid potential authentication
errors (both when editing the configuration and viewing the panel).

### Switching solution

<img width="881" alt="image"
src="https://github.com/user-attachments/assets/c4d0359f-dedb-4e74-a4c2-a49d81987fd5"
/>

When switching solution, the filters form must be reset since the rule
type ids it is based on change. This can be disruptive for the UX, so I
added a confirmation prompt in case the user already started to edit the
form and then tries to change solution.

### Missing authorization

<img width="1489" alt="image"
src="https://github.com/user-attachments/assets/866db208-495c-4eec-8ec8-9c2be2d00680"
/>

When a user doesn't have the necessary permissions for the rule types a
panel is based on, a missing authz prompt is shown.

</details>

## Verification steps

1. Create rules that fire alerts in multiple solutions (Security,
Observability and Stack)
2. Create a new dashboard or open an existing one, enter edit mode if
not active
3. Click `+ Add panel > Alerts`
4. Check that the solution selector options are coherent with the rule
types the user can access
5. Select a solution
6. Build filters expressions, checking that the rule tags and rule types
are coherent with the solution selection and the rules created
previously
7. Save the panel
8. Check that the created panel reflects the filtering options from the
creation flyout
9. Repeat steps 3-9 with different roles:
9.1. having access to rule types from just one solution (in this case
the solution selector shouldn't appear at all),
9.2. having access just to Observability and Stack but not Security (in
this case the solution selector shouldn't appear at all),
10. Repeat steps 3-8 in the three serverless project types:
    ```shell
    $ yarn es serverless —ssl --projectType <es|oblt|security>
    $ yarn serverless-<es|oblt|security> --ssl --run-examples
    ```
(If the authentication fails when switching between project types, use a
clean session)
10.1. Elasticsearch project types should have access only to Stack rules
(no selector)
10.2. Observability project types should have access only to
Observability and Stack rules (no selector)
10.3. Security project types should have access only to Security and
Stack rules (selector shows Stack instead of Observability)
11. In the previous cases, when the user doesn't have access to rule
types from the solution a certain panel is configured to show, check
that an authorization prompt is shown
12. Using a role without access to any rule type
12.1. Check that the `Alerts` panel type is not visible in the `Add
panel` flyout
12.2. Check that any pre-existing table panels show a missing authz
prompt

## Release Notes

Added an embeddable panel for Dashboards to display alerts.

## References

Closes elastic#203613
Closes elastic#203614
Closes elastic#203612

### Checklist

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 0a7874c)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.19

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label May 16, 2025
@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.
cc: @umbopepato

6 similar comments
@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.
cc: @umbopepato

@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.
cc: @umbopepato

@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.
cc: @umbopepato

@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.
cc: @umbopepato

@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.
cc: @umbopepato

@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.
cc: @umbopepato

@umbopepato
Copy link
Member Author

💚 All backports created successfully

Status Branch Result
8.19

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

umbopepato added a commit to umbopepato/kibana that referenced this pull request May 27, 2025
…216076)

## Summary

- Implements the embeddable alerts table creation flow, with solution
and filters.
- Enables the new table panel creation action.

<img width="1115" alt="image"
src="https://github.com/user-attachments/assets/d3158e55-3d09-4e52-b718-0ebe3e911e4c"
/>

<img width="1488" alt="image"
src="https://github.com/user-attachments/assets/c6e65f12-1347-4859-83f5-1de996d6ba86"
/>

<details>
<summary>

## Implementation details

</summary>

### Panel configuration state

As part of the panel's persisted configuration state, I opted to only
save the selected `solution` (`observability`, `security`, `stack`) and
not the resulting list of rule type ids. Re-calculating the rule type
ids based on the solution at render time ensures that users see the rule
types they have access to, and should avoid potential authentication
errors (both when editing the configuration and viewing the panel).

### Switching solution

<img width="881" alt="image"
src="https://github.com/user-attachments/assets/c4d0359f-dedb-4e74-a4c2-a49d81987fd5"
/>

When switching solution, the filters form must be reset since the rule
type ids it is based on change. This can be disruptive for the UX, so I
added a confirmation prompt in case the user already started to edit the
form and then tries to change solution.

### Missing authorization

<img width="1489" alt="image"
src="https://github.com/user-attachments/assets/866db208-495c-4eec-8ec8-9c2be2d00680"
/>

When a user doesn't have the necessary permissions for the rule types a
panel is based on, a missing authz prompt is shown.

</details>

## Verification steps

1. Create rules that fire alerts in multiple solutions (Security,
Observability and Stack)
2. Create a new dashboard or open an existing one, enter edit mode if
not active
3. Click `+ Add panel > Alerts`
4. Check that the solution selector options are coherent with the rule
types the user can access
5. Select a solution
6. Build filters expressions, checking that the rule tags and rule types
are coherent with the solution selection and the rules created
previously
7. Save the panel
8. Check that the created panel reflects the filtering options from the
creation flyout
9. Repeat steps 3-9 with different roles:
9.1. having access to rule types from just one solution (in this case
the solution selector shouldn't appear at all),
9.2. having access just to Observability and Stack but not Security (in
this case the solution selector shouldn't appear at all),
10. Repeat steps 3-8 in the three serverless project types:
    ```shell
    $ yarn es serverless —ssl --projectType <es|oblt|security>
    $ yarn serverless-<es|oblt|security> --ssl --run-examples
    ```
(If the authentication fails when switching between project types, use a
clean session)
10.1. Elasticsearch project types should have access only to Stack rules
(no selector)
10.2. Observability project types should have access only to
Observability and Stack rules (no selector)
10.3. Security project types should have access only to Security and
Stack rules (selector shows Stack instead of Observability)
11. In the previous cases, when the user doesn't have access to rule
types from the solution a certain panel is configured to show, check
that an authorization prompt is shown
12. Using a role without access to any rule type
12.1. Check that the `Alerts` panel type is not visible in the `Add
panel` flyout
12.2. Check that any pre-existing table panels show a missing authz
prompt

## Release Notes

Added an embeddable panel for Dashboards to display alerts.

## References

Closes elastic#203613
Closes elastic#203614
Closes elastic#203612

### Checklist

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 0a7874c)
@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.
cc: @umbopepato

1 similar comment
@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.
cc: @umbopepato

akowalska622 pushed a commit to akowalska622/kibana that referenced this pull request May 29, 2025
…216076)

## Summary

- Implements the embeddable alerts table creation flow, with solution
and filters.
- Enables the new table panel creation action.

<img width="1115" alt="image"
src="https://github.com/user-attachments/assets/d3158e55-3d09-4e52-b718-0ebe3e911e4c"
/>

<img width="1488" alt="image"
src="https://github.com/user-attachments/assets/c6e65f12-1347-4859-83f5-1de996d6ba86"
/>

<details>
<summary>

## Implementation details

</summary>

### Panel configuration state

As part of the panel's persisted configuration state, I opted to only
save the selected `solution` (`observability`, `security`, `stack`) and
not the resulting list of rule type ids. Re-calculating the rule type
ids based on the solution at render time ensures that users see the rule
types they have access to, and should avoid potential authentication
errors (both when editing the configuration and viewing the panel).

### Switching solution

<img width="881" alt="image"
src="https://github.com/user-attachments/assets/c4d0359f-dedb-4e74-a4c2-a49d81987fd5"
/>

When switching solution, the filters form must be reset since the rule
type ids it is based on change. This can be disruptive for the UX, so I
added a confirmation prompt in case the user already started to edit the
form and then tries to change solution.

### Missing authorization

<img width="1489" alt="image"
src="https://github.com/user-attachments/assets/866db208-495c-4eec-8ec8-9c2be2d00680"
/>

When a user doesn't have the necessary permissions for the rule types a
panel is based on, a missing authz prompt is shown.

</details>

## Verification steps

1. Create rules that fire alerts in multiple solutions (Security,
Observability and Stack)
2. Create a new dashboard or open an existing one, enter edit mode if
not active
3. Click `+ Add panel > Alerts`
4. Check that the solution selector options are coherent with the rule
types the user can access
5. Select a solution
6. Build filters expressions, checking that the rule tags and rule types
are coherent with the solution selection and the rules created
previously
7. Save the panel
8. Check that the created panel reflects the filtering options from the
creation flyout
9. Repeat steps 3-9 with different roles:
9.1. having access to rule types from just one solution (in this case
the solution selector shouldn't appear at all),
9.2. having access just to Observability and Stack but not Security (in
this case the solution selector shouldn't appear at all),
10. Repeat steps 3-8 in the three serverless project types:
    ```shell
    $ yarn es serverless —ssl --projectType <es|oblt|security>
    $ yarn serverless-<es|oblt|security> --ssl --run-examples
    ```
(If the authentication fails when switching between project types, use a
clean session)
10.1. Elasticsearch project types should have access only to Stack rules
(no selector)
10.2. Observability project types should have access only to
Observability and Stack rules (no selector)
10.3. Security project types should have access only to Security and
Stack rules (selector shows Stack instead of Observability)
11. In the previous cases, when the user doesn't have access to rule
types from the solution a certain panel is configured to show, check
that an authorization prompt is shown
12. Using a role without access to any rule type
12.1. Check that the `Alerts` panel type is not visible in the `Add
panel` flyout
12.2. Check that any pre-existing table panels show a missing authz
prompt

## Release Notes

Added an embeddable panel for Dashboards to display alerts.

## References

Closes elastic#203613
Closes elastic#203614
Closes elastic#203612

### Checklist

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.
cc: @umbopepato

umbopepato added a commit that referenced this pull request May 30, 2025
…216076) (#221629)

# Backport

This will backport the following commits from `main` to `8.19`:
- [[ResponseOps][Alerts] Embeddable alerts table creation flow
(#216076)](#216076)

<!--- Backport version: 10.0.0 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Umberto
Pepato","email":"umbopepato@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-05-14T15:46:27Z","message":"[ResponseOps][Alerts]
Embeddable alerts table creation flow (#216076)\n\n## Summary\n\n-
Implements the embeddable alerts table creation flow, with solution\nand
filters.\n- Enables the new table panel creation action.\n\n<img
width=\"1115\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/d3158e55-3d09-4e52-b718-0ebe3e911e4c\"\n/>\n\n<img
width=\"1488\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/c6e65f12-1347-4859-83f5-1de996d6ba86\"\n/>\n\n<details>\n<summary>\n\n##
Implementation details\n\n</summary>\n\n### Panel configuration
state\n\nAs part of the panel's persisted configuration state, I opted
to only\nsave the selected `solution` (`observability`, `security`,
`stack`) and\nnot the resulting list of rule type ids. Re-calculating
the rule type\nids based on the solution at render time ensures that
users see the rule\ntypes they have access to, and should avoid
potential authentication\nerrors (both when editing the configuration
and viewing the panel).\n\n### Switching solution\n\n<img width=\"881\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/c4d0359f-dedb-4e74-a4c2-a49d81987fd5\"\n/>\n\nWhen
switching solution, the filters form must be reset since the rule\ntype
ids it is based on change. This can be disruptive for the UX, so
I\nadded a confirmation prompt in case the user already started to edit
the\nform and then tries to change solution.\n\n### Missing
authorization\n\n<img width=\"1489\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/866db208-495c-4eec-8ec8-9c2be2d00680\"\n/>\n\nWhen
a user doesn't have the necessary permissions for the rule types
a\npanel is based on, a missing authz prompt is
shown.\n\n</details>\n\n## Verification steps\n\n1. Create rules that
fire alerts in multiple solutions (Security,\nObservability and
Stack)\n2. Create a new dashboard or open an existing one, enter edit
mode if\nnot active\n3. Click `+ Add panel > Alerts`\n4. Check that the
solution selector options are coherent with the rule\ntypes the user can
access\n5. Select a solution\n6. Build filters expressions, checking
that the rule tags and rule types\nare coherent with the solution
selection and the rules created\npreviously\n7. Save the panel\n8. Check
that the created panel reflects the filtering options from the\ncreation
flyout\n9. Repeat steps 3-9 with different roles:\n9.1. having access to
rule types from just one solution (in this case\nthe solution selector
shouldn't appear at all),\n9.2. having access just to Observability and
Stack but not Security (in\nthis case the solution selector shouldn't
appear at all),\n10. Repeat steps 3-8 in the three serverless project
types:\n ```shell\n $ yarn es serverless —ssl --projectType
<es|oblt|security>\n $ yarn serverless-<es|oblt|security> --ssl
--run-examples\n ```\n(If the authentication fails when switching
between project types, use a\nclean session)\n10.1. Elasticsearch
project types should have access only to Stack rules\n(no
selector)\n10.2. Observability project types should have access only
to\nObservability and Stack rules (no selector)\n10.3. Security project
types should have access only to Security and\nStack rules (selector
shows Stack instead of Observability)\n11. In the previous cases, when
the user doesn't have access to rule\ntypes from the solution a certain
panel is configured to show, check\nthat an authorization prompt is
shown\n12. Using a role without access to any rule type\n12.1. Check
that the `Alerts` panel type is not visible in the `Add\npanel`
flyout\n12.2. Check that any pre-existing table panels show a missing
authz\nprompt\n\n## Release Notes\n\nAdded an embeddable panel for
Dashboards to display alerts.\n\n## References\n\nCloses #203613\nCloses
#203614\nCloses #203612\n\n### Checklist\n\n- [x] Any text added follows
[EUI's
writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\nsentence case text and includes
[i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n-
[
]\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\nwas
added for features that require explanation or tutorials\n- [x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [x] The PR
description includes the appropriate Release Notes section,\nand the
correct `release_note:*` label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"0a7874cecead785d1d8c4db2ea9bd4fa4c287622","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:ResponseOps","backport
missing","release_note:feature","backport:version","v9.1.0","v8.19.0"],"title":"[ResponseOps][Alerts]
Embeddable alerts table creation
flow","number":216076,"url":"https://github.com/elastic/kibana/pull/216076","mergeCommit":{"message":"[ResponseOps][Alerts]
Embeddable alerts table creation flow (#216076)\n\n## Summary\n\n-
Implements the embeddable alerts table creation flow, with solution\nand
filters.\n- Enables the new table panel creation action.\n\n<img
width=\"1115\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/d3158e55-3d09-4e52-b718-0ebe3e911e4c\"\n/>\n\n<img
width=\"1488\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/c6e65f12-1347-4859-83f5-1de996d6ba86\"\n/>\n\n<details>\n<summary>\n\n##
Implementation details\n\n</summary>\n\n### Panel configuration
state\n\nAs part of the panel's persisted configuration state, I opted
to only\nsave the selected `solution` (`observability`, `security`,
`stack`) and\nnot the resulting list of rule type ids. Re-calculating
the rule type\nids based on the solution at render time ensures that
users see the rule\ntypes they have access to, and should avoid
potential authentication\nerrors (both when editing the configuration
and viewing the panel).\n\n### Switching solution\n\n<img width=\"881\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/c4d0359f-dedb-4e74-a4c2-a49d81987fd5\"\n/>\n\nWhen
switching solution, the filters form must be reset since the rule\ntype
ids it is based on change. This can be disruptive for the UX, so
I\nadded a confirmation prompt in case the user already started to edit
the\nform and then tries to change solution.\n\n### Missing
authorization\n\n<img width=\"1489\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/866db208-495c-4eec-8ec8-9c2be2d00680\"\n/>\n\nWhen
a user doesn't have the necessary permissions for the rule types
a\npanel is based on, a missing authz prompt is
shown.\n\n</details>\n\n## Verification steps\n\n1. Create rules that
fire alerts in multiple solutions (Security,\nObservability and
Stack)\n2. Create a new dashboard or open an existing one, enter edit
mode if\nnot active\n3. Click `+ Add panel > Alerts`\n4. Check that the
solution selector options are coherent with the rule\ntypes the user can
access\n5. Select a solution\n6. Build filters expressions, checking
that the rule tags and rule types\nare coherent with the solution
selection and the rules created\npreviously\n7. Save the panel\n8. Check
that the created panel reflects the filtering options from the\ncreation
flyout\n9. Repeat steps 3-9 with different roles:\n9.1. having access to
rule types from just one solution (in this case\nthe solution selector
shouldn't appear at all),\n9.2. having access just to Observability and
Stack but not Security (in\nthis case the solution selector shouldn't
appear at all),\n10. Repeat steps 3-8 in the three serverless project
types:\n ```shell\n $ yarn es serverless —ssl --projectType
<es|oblt|security>\n $ yarn serverless-<es|oblt|security> --ssl
--run-examples\n ```\n(If the authentication fails when switching
between project types, use a\nclean session)\n10.1. Elasticsearch
project types should have access only to Stack rules\n(no
selector)\n10.2. Observability project types should have access only
to\nObservability and Stack rules (no selector)\n10.3. Security project
types should have access only to Security and\nStack rules (selector
shows Stack instead of Observability)\n11. In the previous cases, when
the user doesn't have access to rule\ntypes from the solution a certain
panel is configured to show, check\nthat an authorization prompt is
shown\n12. Using a role without access to any rule type\n12.1. Check
that the `Alerts` panel type is not visible in the `Add\npanel`
flyout\n12.2. Check that any pre-existing table panels show a missing
authz\nprompt\n\n## Release Notes\n\nAdded an embeddable panel for
Dashboards to display alerts.\n\n## References\n\nCloses #203613\nCloses
#203614\nCloses #203612\n\n### Checklist\n\n- [x] Any text added follows
[EUI's
writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\nsentence case text and includes
[i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n-
[
]\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\nwas
added for features that require explanation or tutorials\n- [x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [x] The PR
description includes the appropriate Release Notes section,\nand the
correct `release_note:*` label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"0a7874cecead785d1d8c4db2ea9bd4fa4c287622"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/216076","number":216076,"mergeCommit":{"message":"[ResponseOps][Alerts]
Embeddable alerts table creation flow (#216076)\n\n## Summary\n\n-
Implements the embeddable alerts table creation flow, with solution\nand
filters.\n- Enables the new table panel creation action.\n\n<img
width=\"1115\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/d3158e55-3d09-4e52-b718-0ebe3e911e4c\"\n/>\n\n<img
width=\"1488\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/c6e65f12-1347-4859-83f5-1de996d6ba86\"\n/>\n\n<details>\n<summary>\n\n##
Implementation details\n\n</summary>\n\n### Panel configuration
state\n\nAs part of the panel's persisted configuration state, I opted
to only\nsave the selected `solution` (`observability`, `security`,
`stack`) and\nnot the resulting list of rule type ids. Re-calculating
the rule type\nids based on the solution at render time ensures that
users see the rule\ntypes they have access to, and should avoid
potential authentication\nerrors (both when editing the configuration
and viewing the panel).\n\n### Switching solution\n\n<img width=\"881\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/c4d0359f-dedb-4e74-a4c2-a49d81987fd5\"\n/>\n\nWhen
switching solution, the filters form must be reset since the rule\ntype
ids it is based on change. This can be disruptive for the UX, so
I\nadded a confirmation prompt in case the user already started to edit
the\nform and then tries to change solution.\n\n### Missing
authorization\n\n<img width=\"1489\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/866db208-495c-4eec-8ec8-9c2be2d00680\"\n/>\n\nWhen
a user doesn't have the necessary permissions for the rule types
a\npanel is based on, a missing authz prompt is
shown.\n\n</details>\n\n## Verification steps\n\n1. Create rules that
fire alerts in multiple solutions (Security,\nObservability and
Stack)\n2. Create a new dashboard or open an existing one, enter edit
mode if\nnot active\n3. Click `+ Add panel > Alerts`\n4. Check that the
solution selector options are coherent with the rule\ntypes the user can
access\n5. Select a solution\n6. Build filters expressions, checking
that the rule tags and rule types\nare coherent with the solution
selection and the rules created\npreviously\n7. Save the panel\n8. Check
that the created panel reflects the filtering options from the\ncreation
flyout\n9. Repeat steps 3-9 with different roles:\n9.1. having access to
rule types from just one solution (in this case\nthe solution selector
shouldn't appear at all),\n9.2. having access just to Observability and
Stack but not Security (in\nthis case the solution selector shouldn't
appear at all),\n10. Repeat steps 3-8 in the three serverless project
types:\n ```shell\n $ yarn es serverless —ssl --projectType
<es|oblt|security>\n $ yarn serverless-<es|oblt|security> --ssl
--run-examples\n ```\n(If the authentication fails when switching
between project types, use a\nclean session)\n10.1. Elasticsearch
project types should have access only to Stack rules\n(no
selector)\n10.2. Observability project types should have access only
to\nObservability and Stack rules (no selector)\n10.3. Security project
types should have access only to Security and\nStack rules (selector
shows Stack instead of Observability)\n11. In the previous cases, when
the user doesn't have access to rule\ntypes from the solution a certain
panel is configured to show, check\nthat an authorization prompt is
shown\n12. Using a role without access to any rule type\n12.1. Check
that the `Alerts` panel type is not visible in the `Add\npanel`
flyout\n12.2. Check that any pre-existing table panels show a missing
authz\nprompt\n\n## Release Notes\n\nAdded an embeddable panel for
Dashboards to display alerts.\n\n## References\n\nCloses #203613\nCloses
#203614\nCloses #203612\n\n### Checklist\n\n- [x] Any text added follows
[EUI's
writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\nsentence case text and includes
[i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n-
[
]\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\nwas
added for features that require explanation or tutorials\n- [x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [x] The PR
description includes the appropriate Release Notes section,\nand the
correct `release_note:*` label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"0a7874cecead785d1d8c4db2ea9bd4fa4c287622"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/220796","number":220796,"state":"OPEN"}]}]
BACKPORT-->

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
@kibanamachine kibanamachine removed the backport missing Added to PRs automatically when the are determined to be missing a backport. label May 30, 2025
qn895 pushed a commit to qn895/kibana that referenced this pull request Jun 3, 2025
…216076)

## Summary

- Implements the embeddable alerts table creation flow, with solution
and filters.
- Enables the new table panel creation action.

<img width="1115" alt="image"
src="https://github.com/user-attachments/assets/d3158e55-3d09-4e52-b718-0ebe3e911e4c"
/>

<img width="1488" alt="image"
src="https://github.com/user-attachments/assets/c6e65f12-1347-4859-83f5-1de996d6ba86"
/>

<details>
<summary>

## Implementation details

</summary>

### Panel configuration state

As part of the panel's persisted configuration state, I opted to only
save the selected `solution` (`observability`, `security`, `stack`) and
not the resulting list of rule type ids. Re-calculating the rule type
ids based on the solution at render time ensures that users see the rule
types they have access to, and should avoid potential authentication
errors (both when editing the configuration and viewing the panel).

### Switching solution

<img width="881" alt="image"
src="https://github.com/user-attachments/assets/c4d0359f-dedb-4e74-a4c2-a49d81987fd5"
/>

When switching solution, the filters form must be reset since the rule
type ids it is based on change. This can be disruptive for the UX, so I
added a confirmation prompt in case the user already started to edit the
form and then tries to change solution.

### Missing authorization

<img width="1489" alt="image"
src="https://github.com/user-attachments/assets/866db208-495c-4eec-8ec8-9c2be2d00680"
/>

When a user doesn't have the necessary permissions for the rule types a
panel is based on, a missing authz prompt is shown.

</details>

## Verification steps

1. Create rules that fire alerts in multiple solutions (Security,
Observability and Stack)
2. Create a new dashboard or open an existing one, enter edit mode if
not active
3. Click `+ Add panel > Alerts`
4. Check that the solution selector options are coherent with the rule
types the user can access
5. Select a solution
6. Build filters expressions, checking that the rule tags and rule types
are coherent with the solution selection and the rules created
previously
7. Save the panel
8. Check that the created panel reflects the filtering options from the
creation flyout
9. Repeat steps 3-9 with different roles:
9.1. having access to rule types from just one solution (in this case
the solution selector shouldn't appear at all),
9.2. having access just to Observability and Stack but not Security (in
this case the solution selector shouldn't appear at all),
10. Repeat steps 3-8 in the three serverless project types:
    ```shell
    $ yarn es serverless —ssl --projectType <es|oblt|security>
    $ yarn serverless-<es|oblt|security> --ssl --run-examples
    ```
(If the authentication fails when switching between project types, use a
clean session)
10.1. Elasticsearch project types should have access only to Stack rules
(no selector)
10.2. Observability project types should have access only to
Observability and Stack rules (no selector)
10.3. Security project types should have access only to Security and
Stack rules (selector shows Stack instead of Observability)
11. In the previous cases, when the user doesn't have access to rule
types from the solution a certain panel is configured to show, check
that an authorization prompt is shown
12. Using a role without access to any rule type
12.1. Check that the `Alerts` panel type is not visible in the `Add
panel` flyout
12.2. Check that any pre-existing table panels show a missing authz
prompt

## Release Notes

Added an embeddable panel for Dashboards to display alerts.

## References

Closes elastic#203613
Closes elastic#203614
Closes elastic#203612

### Checklist

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
@cnasikas cnasikas changed the title [ResponseOps][Alerts] Embeddable alerts table creation flow Jun 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels release_note:feature Makes this part of the condensed release notes Team:ResponseOps Platform ResponseOps team (formerly the Cases and Alerting teams) t// v8.19.0 v9.1.0