-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[Dataset Quality] Missing logs privilege blocks user flow #229947
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
[Dataset Quality] Missing logs privilege blocks user flow #229947
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
| const { canUserMonitorAnyDataset, statsLoading } = useDatasetQualityState(); | ||
|
|
||
| if (!canReadDataset) { | ||
| if (!statsLoading && !canUserMonitorAnyDataset) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️ Thanks! this avoids the flickering
| </EuiFlexItem> | ||
| )} | ||
| {!statsLoading && !canUserReadFailureStore && ( | ||
| {!statsLoading && !canUserReadFailureStore && !noDatasetsAccess && ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nit] the double negation here makes everything more complex to grasp
|
I skimmed quickly through the code, it looks good in general my only comment would be maybe to hide the alerts creation button when the user doesn't have any privileges over the data set types. wdyt? |
I think this makes sense since its useless for a use with no privileges at all 👍 |
|
Pinging @elastic/obs-ux-logs-team (Team:obs-ux-logs) |
…e-blocks-user-flow
…er-flow' of https://github.com/mohamedhamed-ahmed/kibana into 229939-dataset-quality-missing-logs-privilege-blocks-user-flow
|
What do you think about adding some e2e tests for this PR? |
Was already working on few tests as you put the comment :) |
yngrdyn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work 🚀
Thanks for addressing this issue
…e-blocks-user-flow
💚 Build Succeeded
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
History
|
|
Starting backport for target branches: 8.19, 9.1 https://github.com/elastic/kibana/actions/runs/16718590361 |
💔 All backports failed
Manual backportTo create the backport manually run: Questions ?Please refer to the Backport tool documentation |
…9947) Fixes elastic#229939 ## Summary The Dataset Quality page was initially introduced with only logs signal type. Later on we introduced the ability to select more types, ex: metrics & traces. Problem is that some places in the code were not updated to accommodate for this change and were kept under the assumption that the user will always have access to logs. This led to a blocked user flow whenever the user has access to for example metrics but not logs and this PR fixes this. ## 💡 Solution - **A new initial state machine state `initializing` has been introduced to lookup all privileges for the known signal types**. - **This state triggers either**: 1. `emptyState` --> when the user has no authorized signal types 2. `main` --> old normal flow if the user has at least one authorized type <img width="1239" height="527" alt="Screenshot 2025-07-30 at 12 20 37" src="https://github.com/user-attachments/assets/75f96cc4-bbe2-4295-9ff6-6ab85b85e9ba" /> --- - **The `Types` drop down is hidden if the user has only 1 authorized type** <img width="747" height="111" alt="Screenshot 2025-07-30 at 13 24 22" src="https://github.com/user-attachments/assets/a6107275-57d7-44f6-ac88-069800c3e58d" /> --- - **The header message is updated to reflect the authorized signal types** <img width="839" height="126" alt="Screenshot 2025-07-30 at 13 25 00" src="https://github.com/user-attachments/assets/a56bdb76-6c5e-4bf7-8467-07f77c9b6362" /> --- - **The user ends on an empty state page when no authorized types are available (Warning message udpated to be generic and not only about logs)** <img width="1721" height="836" alt="Screenshot 2025-07-30 at 12 21 03" src="https://github.com/user-attachments/assets/62d3ed5f-3527-4f11-9436-46815f7303e6" /> ## 🎥 Demo https://github.com/user-attachments/assets/05db6626-b4d9-4903-b398-a674562dc6de (cherry picked from commit 96fd2e5) # Conflicts: # x-pack/platform/plugins/private/translations/translations/de-DE.json
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…9947) Fixes elastic#229939 ## Summary The Dataset Quality page was initially introduced with only logs signal type. Later on we introduced the ability to select more types, ex: metrics & traces. Problem is that some places in the code were not updated to accommodate for this change and were kept under the assumption that the user will always have access to logs. This led to a blocked user flow whenever the user has access to for example metrics but not logs and this PR fixes this. ## 💡 Solution - **A new initial state machine state `initializing` has been introduced to lookup all privileges for the known signal types**. - **This state triggers either**: 1. `emptyState` --> when the user has no authorized signal types 2. `main` --> old normal flow if the user has at least one authorized type <img width="1239" height="527" alt="Screenshot 2025-07-30 at 12 20 37" src="https://github.com/user-attachments/assets/75f96cc4-bbe2-4295-9ff6-6ab85b85e9ba" /> --- - **The `Types` drop down is hidden if the user has only 1 authorized type** <img width="747" height="111" alt="Screenshot 2025-07-30 at 13 24 22" src="https://github.com/user-attachments/assets/a6107275-57d7-44f6-ac88-069800c3e58d" /> --- - **The header message is updated to reflect the authorized signal types** <img width="839" height="126" alt="Screenshot 2025-07-30 at 13 25 00" src="https://github.com/user-attachments/assets/a56bdb76-6c5e-4bf7-8467-07f77c9b6362" /> --- - **The user ends on an empty state page when no authorized types are available (Warning message udpated to be generic and not only about logs)** <img width="1721" height="836" alt="Screenshot 2025-07-30 at 12 21 03" src="https://github.com/user-attachments/assets/62d3ed5f-3527-4f11-9436-46815f7303e6" /> ## 🎥 Demo https://github.com/user-attachments/assets/05db6626-b4d9-4903-b398-a674562dc6de (cherry picked from commit 96fd2e5) # Conflicts: # x-pack/platform/plugins/private/translations/translations/de-DE.json # x-pack/platform/plugins/shared/dataset_quality/public/components/dataset_quality/filters/filters.tsx # x-pack/platform/plugins/shared/dataset_quality/public/components/dataset_quality/header.tsx # x-pack/platform/plugins/shared/dataset_quality/public/hooks/use_dataset_quality_filters.ts # x-pack/platform/plugins/shared/dataset_quality/public/state_machines/dataset_quality_controller/src/state_machine.ts # x-pack/solutions/observability/test/functional/page_objects/dataset_quality.ts # x-pack/test/dataset_quality_api_integration/tests/data_streams/stats.spec.ts # x-pack/test/dataset_quality_api_integration/tests/data_streams/types_privileges.spec.ts
…9947) Fixes elastic#229939 ## Summary The Dataset Quality page was initially introduced with only logs signal type. Later on we introduced the ability to select more types, ex: metrics & traces. Problem is that some places in the code were not updated to accommodate for this change and were kept under the assumption that the user will always have access to logs. This led to a blocked user flow whenever the user has access to for example metrics but not logs and this PR fixes this. ## 💡 Solution - **A new initial state machine state `initializing` has been introduced to lookup all privileges for the known signal types**. - **This state triggers either**: 1. `emptyState` --> when the user has no authorized signal types 2. `main` --> old normal flow if the user has at least one authorized type <img width="1239" height="527" alt="Screenshot 2025-07-30 at 12 20 37" src="https://github.com/user-attachments/assets/75f96cc4-bbe2-4295-9ff6-6ab85b85e9ba" /> --- - **The `Types` drop down is hidden if the user has only 1 authorized type** <img width="747" height="111" alt="Screenshot 2025-07-30 at 13 24 22" src="https://github.com/user-attachments/assets/a6107275-57d7-44f6-ac88-069800c3e58d" /> --- - **The header message is updated to reflect the authorized signal types** <img width="839" height="126" alt="Screenshot 2025-07-30 at 13 25 00" src="https://github.com/user-attachments/assets/a56bdb76-6c5e-4bf7-8467-07f77c9b6362" /> --- - **The user ends on an empty state page when no authorized types are available (Warning message udpated to be generic and not only about logs)** <img width="1721" height="836" alt="Screenshot 2025-07-30 at 12 21 03" src="https://github.com/user-attachments/assets/62d3ed5f-3527-4f11-9436-46815f7303e6" /> ## 🎥 Demo https://github.com/user-attachments/assets/05db6626-b4d9-4903-b398-a674562dc6de
…9947) (#230394) # Backport This will backport the following commits from `main` to `8.19`: - [[Dataset Quality] Missing logs privilege blocks user flow (#229947)](#229947) <!--- Backport version: 10.0.1 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
|
Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync. |
) (#230389) # Backport This will backport the following commits from `main` to `9.1`: - [[Dataset Quality] Missing logs privilege blocks user flow (#229947)](#229947) <!--- Backport version: 10.0.1 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport)
…9947) Fixes elastic#229939 ## Summary The Dataset Quality page was initially introduced with only logs signal type. Later on we introduced the ability to select more types, ex: metrics & traces. Problem is that some places in the code were not updated to accommodate for this change and were kept under the assumption that the user will always have access to logs. This led to a blocked user flow whenever the user has access to for example metrics but not logs and this PR fixes this. ## 💡 Solution - **A new initial state machine state `initializing` has been introduced to lookup all privileges for the known signal types**. - **This state triggers either**: 1. `emptyState` --> when the user has no authorized signal types 2. `main` --> old normal flow if the user has at least one authorized type <img width="1239" height="527" alt="Screenshot 2025-07-30 at 12 20 37" src="https://github.com/user-attachments/assets/75f96cc4-bbe2-4295-9ff6-6ab85b85e9ba" /> --- - **The `Types` drop down is hidden if the user has only 1 authorized type** <img width="747" height="111" alt="Screenshot 2025-07-30 at 13 24 22" src="https://github.com/user-attachments/assets/a6107275-57d7-44f6-ac88-069800c3e58d" /> --- - **The header message is updated to reflect the authorized signal types** <img width="839" height="126" alt="Screenshot 2025-07-30 at 13 25 00" src="https://github.com/user-attachments/assets/a56bdb76-6c5e-4bf7-8467-07f77c9b6362" /> --- - **The user ends on an empty state page when no authorized types are available (Warning message udpated to be generic and not only about logs)** <img width="1721" height="836" alt="Screenshot 2025-07-30 at 12 21 03" src="https://github.com/user-attachments/assets/62d3ed5f-3527-4f11-9436-46815f7303e6" /> ## 🎥 Demo https://github.com/user-attachments/assets/05db6626-b4d9-4903-b398-a674562dc6de
…9947) Fixes elastic#229939 ## Summary The Dataset Quality page was initially introduced with only logs signal type. Later on we introduced the ability to select more types, ex: metrics & traces. Problem is that some places in the code were not updated to accommodate for this change and were kept under the assumption that the user will always have access to logs. This led to a blocked user flow whenever the user has access to for example metrics but not logs and this PR fixes this. ## 💡 Solution - **A new initial state machine state `initializing` has been introduced to lookup all privileges for the known signal types**. - **This state triggers either**: 1. `emptyState` --> when the user has no authorized signal types 2. `main` --> old normal flow if the user has at least one authorized type <img width="1239" height="527" alt="Screenshot 2025-07-30 at 12 20 37" src="https://github.com/user-attachments/assets/75f96cc4-bbe2-4295-9ff6-6ab85b85e9ba" /> --- - **The `Types` drop down is hidden if the user has only 1 authorized type** <img width="747" height="111" alt="Screenshot 2025-07-30 at 13 24 22" src="https://github.com/user-attachments/assets/a6107275-57d7-44f6-ac88-069800c3e58d" /> --- - **The header message is updated to reflect the authorized signal types** <img width="839" height="126" alt="Screenshot 2025-07-30 at 13 25 00" src="https://github.com/user-attachments/assets/a56bdb76-6c5e-4bf7-8467-07f77c9b6362" /> --- - **The user ends on an empty state page when no authorized types are available (Warning message udpated to be generic and not only about logs)** <img width="1721" height="836" alt="Screenshot 2025-07-30 at 12 21 03" src="https://github.com/user-attachments/assets/62d3ed5f-3527-4f11-9436-46815f7303e6" /> ## 🎥 Demo https://github.com/user-attachments/assets/05db6626-b4d9-4903-b398-a674562dc6de
Fixes #229939
Summary
The Dataset Quality page was initially introduced with only logs signal type. Later on we introduced the ability to select more types, ex: metrics & traces.
Problem is that some places in the code were not updated to accommodate for this change and were kept under the assumption that the user will always have access to logs.
This led to a blocked user flow whenever the user has access to for example metrics but not logs and this PR fixes this.
💡 Solution
A new initial state machine state
initializinghas been introduced to lookup all privileges for the known signal types.This state triggers either:
emptyState--> when the user has no authorized signal typesmain--> old normal flow if the user has at least one authorized typeTypesdrop down is hidden if the user has only 1 authorized type🎥 Demo
Screen.Recording.2025-07-30.at.14.09.18.mov