Skip to content

[refactoring] Distinguish User Controls from Risk Engine in DashboardEnablementPanel #212441

Merged
machadoum merged 3 commits intoelastic:mainfrom
CAWilson94:ea-212432-variable-naming
Feb 26, 2025
Merged

[refactoring] Distinguish User Controls from Risk Engine in DashboardEnablementPanel #212441
machadoum merged 3 commits intoelastic:mainfrom
CAWilson94:ea-212432-variable-naming

Conversation

@CAWilson94
Copy link
Contributor

@CAWilson94 CAWilson94 commented Feb 25, 2025

Summary

This PR refactors naming and logic in EntityStoreEnablementModal to improve readability and better distinguish between:
1. Feature enablement state – Whether Risk Score or Entity Store is actually enabled.
2. User-selected state – Whether the user has checked the corresponding toggle.

Changes

  • Renamed disabled → canToggle to clearly represent UI interaction.
  • Renamed enablements → userSelectedEnablements to reflect user-selected toggle states, not feature enablement.
  • Refactored shouldAllowEnablement logic for clarity and correctness:
    • If riskScore is enabled, return whether the user has enabled entityStore.
    • If entityStore is enabled, return whether the user has enabled riskScore.
    • Otherwise, return true if either toggle is selected.
  • Updated corresponding tests to reflect naming and logic changes.

Testing/Validation

Manually tested the toggling behaviour still works as before and modal still shows warning, and disables the "enable" button when there are no available options selected.

Validation Video

enablementVariablesRename.mov

@CAWilson94 CAWilson94 added refactoring release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting Theme: entity_analytics Team:Entity Analytics Security Entity Analytics Team labels Feb 25, 2025
@CAWilson94 CAWilson94 self-assigned this Feb 25, 2025
@CAWilson94 CAWilson94 requested a review from a team as a code owner February 25, 2025 19:23
@CAWilson94 CAWilson94 requested a review from hop-dev February 25, 2025 19:23
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-entity-analytics (Team:Entity Analytics)

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

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

id before after diff
securitySolution 8.9MB 8.9MB +17.0B

cc @CAWilson94

Copy link
Contributor

@hop-dev hop-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I finally feel like I understand! :D Thanks for this! 🚀

@machadoum machadoum added v9.0.0 backport:version Backport to applied version labels v8.17.0 v8.18.0 v8.19.0 and removed backport:skip This PR does not require backporting labels Feb 26, 2025
@machadoum machadoum merged commit 874cee2 into elastic:main Feb 26, 2025
20 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.17, 8.18, 8.x, 9.0

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

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Feb 26, 2025
…EnablementPanel (elastic#212441)

## Summary
This PR refactors naming and logic in EntityStoreEnablementModal to
improve readability and better distinguish between:
1. Feature enablement state – Whether Risk Score or Entity Store is
actually enabled.
2. User-selected state – Whether the user has checked the corresponding
toggle.

#### Changes

- Renamed disabled → canToggle to clearly represent UI interaction.
- Renamed enablements → userSelectedEnablements to reflect user-selected
toggle states, not feature enablement.
- Refactored shouldAllowEnablement logic for clarity and correctness:
- If riskScore is enabled, return whether the user has enabled
entityStore.
- If entityStore is enabled, return whether the user has enabled
riskScore.
     - Otherwise, return true if either toggle is selected.
- Updated corresponding tests to reflect naming and logic changes.

## Testing/Validation
Manually tested the toggling behaviour still works as before and modal
still shows warning, and disables the "enable" button when there are no
available options selected.

### Validation Video

https://github.com/user-attachments/assets/0f2a3f59-e2a0-4c8b-a350-70a9573a8566
(cherry picked from commit 874cee2)
@kibanamachine
Copy link
Contributor

💔 Some backports could not be created

Status Branch Result
8.17 Backport failed because of merge conflicts

You might need to backport the following PRs to 8.17:
- [Bug][Assistant API] - chat/complete endpoint is not persisting the model response to the chosen conversation ID (#11783) (#212122)
8.18
8.x Backport failed because of merge conflicts
9.0 Backport failed because of merge conflicts

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

Manual backport

To create the backport manually run:

node scripts/backport --pr 212441

Questions ?

Please refer to the Backport tool documentation

CAWilson94 added a commit to CAWilson94/kibana that referenced this pull request Feb 26, 2025
…EnablementPanel (elastic#212441)

This PR refactors naming and logic in EntityStoreEnablementModal to
improve readability and better distinguish between:
1. Feature enablement state – Whether Risk Score or Entity Store is
actually enabled.
2. User-selected state – Whether the user has checked the corresponding
toggle.

- Renamed disabled → canToggle to clearly represent UI interaction.
- Renamed enablements → userSelectedEnablements to reflect user-selected
toggle states, not feature enablement.
- Refactored shouldAllowEnablement logic for clarity and correctness:
- If riskScore is enabled, return whether the user has enabled
entityStore.
- If entityStore is enabled, return whether the user has enabled
riskScore.
     - Otherwise, return true if either toggle is selected.
- Updated corresponding tests to reflect naming and logic changes.
Manually tested the toggling behaviour still works as before and modal
still shows warning, and disables the "enable" button when there are no
available options selected.

https://github.com/user-attachments/assets/0f2a3f59-e2a0-4c8b-a350-70a9573a8566
(cherry picked from commit 874cee2)
CAWilson94 added a commit to CAWilson94/kibana that referenced this pull request Feb 26, 2025
…EnablementPanel (elastic#212441)

This PR refactors naming and logic in EntityStoreEnablementModal to
improve readability and better distinguish between:
1. Feature enablement state – Whether Risk Score or Entity Store is
actually enabled.
2. User-selected state – Whether the user has checked the corresponding
toggle.

- Renamed disabled → canToggle to clearly represent UI interaction.
- Renamed enablements → userSelectedEnablements to reflect user-selected
toggle states, not feature enablement.
- Refactored shouldAllowEnablement logic for clarity and correctness:
- If riskScore is enabled, return whether the user has enabled
entityStore.
- If entityStore is enabled, return whether the user has enabled
riskScore.
     - Otherwise, return true if either toggle is selected.
- Updated corresponding tests to reflect naming and logic changes.
Manually tested the toggling behaviour still works as before and modal
still shows warning, and disables the "enable" button when there are no
available options selected.

https://github.com/user-attachments/assets/0f2a3f59-e2a0-4c8b-a350-70a9573a8566
(cherry picked from commit 874cee2)
@CAWilson94
Copy link
Contributor Author

💔 Some backports could not be created

Status Branch Result
9.0
8.x
8.17 Conflict resolution was aborted by the user

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

Manual backport

To create the backport manually run:

node scripts/backport --pr 212441

Questions ?

Please refer to the Backport tool documentation

CAWilson94 added a commit to CAWilson94/kibana that referenced this pull request Feb 26, 2025
…EnablementPanel (elastic#212441)

This PR refactors naming and logic in EntityStoreEnablementModal to
improve readability and better distinguish between:
1. Feature enablement state – Whether Risk Score or Entity Store is
actually enabled.
2. User-selected state – Whether the user has checked the corresponding
toggle.

- Renamed disabled → canToggle to clearly represent UI interaction.
- Renamed enablements → userSelectedEnablements to reflect user-selected
toggle states, not feature enablement.
- Refactored shouldAllowEnablement logic for clarity and correctness:
- If riskScore is enabled, return whether the user has enabled
entityStore.
- If entityStore is enabled, return whether the user has enabled
riskScore.
     - Otherwise, return true if either toggle is selected.
- Updated corresponding tests to reflect naming and logic changes.
Manually tested the toggling behaviour still works as before and modal
still shows warning, and disables the "enable" button when there are no
available options selected.

https://github.com/user-attachments/assets/0f2a3f59-e2a0-4c8b-a350-70a9573a8566
(cherry picked from commit 874cee2)
CAWilson94 added a commit to CAWilson94/kibana that referenced this pull request Feb 26, 2025
…EnablementPanel (elastic#212441)

## Summary
This PR refactors naming and logic in EntityStoreEnablementModal to
improve readability and better distinguish between:
1. Feature enablement state – Whether Risk Score or Entity Store is
actually enabled.
2. User-selected state – Whether the user has checked the corresponding
toggle.

#### Changes

- Renamed disabled → canToggle to clearly represent UI interaction.
- Renamed enablements → userSelectedEnablements to reflect user-selected
toggle states, not feature enablement.
- Refactored shouldAllowEnablement logic for clarity and correctness:
- If riskScore is enabled, return whether the user has enabled
entityStore.
- If entityStore is enabled, return whether the user has enabled
riskScore.
     - Otherwise, return true if either toggle is selected.
- Updated corresponding tests to reflect naming and logic changes.

## Testing/Validation
Manually tested the toggling behaviour still works as before and modal
still shows warning, and disables the "enable" button when there are no
available options selected.

### Validation Video

https://github.com/user-attachments/assets/0f2a3f59-e2a0-4c8b-a350-70a9573a8566
@CAWilson94
Copy link
Contributor Author

💚 All backports created successfully

Status Branch Result
8.17

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

Questions ?

Please refer to the Backport tool documentation

JoseLuisGJ pushed a commit to JoseLuisGJ/kibana that referenced this pull request Feb 27, 2025
…EnablementPanel (elastic#212441)

## Summary
This PR refactors naming and logic in EntityStoreEnablementModal to
improve readability and better distinguish between:
1. Feature enablement state – Whether Risk Score or Entity Store is
actually enabled.
2. User-selected state – Whether the user has checked the corresponding
toggle.

#### Changes

- Renamed disabled → canToggle to clearly represent UI interaction.
- Renamed enablements → userSelectedEnablements to reflect user-selected
toggle states, not feature enablement.
- Refactored shouldAllowEnablement logic for clarity and correctness:
- If riskScore is enabled, return whether the user has enabled
entityStore.
- If entityStore is enabled, return whether the user has enabled
riskScore.
     - Otherwise, return true if either toggle is selected.
- Updated corresponding tests to reflect naming and logic changes.

## Testing/Validation
Manually tested the toggling behaviour still works as before and modal
still shows warning, and disables the "enable" button when there are no
available options selected.

### Validation Video


https://github.com/user-attachments/assets/0f2a3f59-e2a0-4c8b-a350-70a9573a8566
kibanamachine added a commit that referenced this pull request Feb 27, 2025
…shboardEnablementPanel (#212441) (#212519)

# Backport

This will backport the following commits from `main` to `8.18`:
- [[refactoring] Distinguish User Controls from Risk Engine in
DashboardEnablementPanel
(#212441)](#212441)

<!--- Backport version: 9.6.6 -->

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

<!--BACKPORT [{"author":{"name":"Charlotte Alexandra
Wilson","email":"CAWilson94@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-02-26T13:29:21Z","message":"[refactoring]
Distinguish User Controls from Risk Engine in DashboardEnablementPanel
(#212441)\n\n## Summary\nThis PR refactors naming and logic in
EntityStoreEnablementModal to\nimprove readability and better
distinguish between:\n1. Feature enablement state – Whether Risk Score
or Entity Store is\nactually enabled.\n2. User-selected state – Whether
the user has checked the corresponding\ntoggle.\n\n#### Changes\n\n-
Renamed disabled → canToggle to clearly represent UI interaction.\n-
Renamed enablements → userSelectedEnablements to reflect
user-selected\ntoggle states, not feature enablement.\n- Refactored
shouldAllowEnablement logic for clarity and correctness:\n- If riskScore
is enabled, return whether the user has enabled\nentityStore.\n- If
entityStore is enabled, return whether the user has
enabled\nriskScore.\n - Otherwise, return true if either toggle is
selected.\n- Updated corresponding tests to reflect naming and logic
changes.\n\n## Testing/Validation\nManually tested the toggling
behaviour still works as before and modal\nstill shows warning, and
disables the \"enable\" button when there are no\navailable options
selected.\n\n### Validation
Video\n\n\nhttps://github.com/user-attachments/assets/0f2a3f59-e2a0-4c8b-a350-70a9573a8566","sha":"874cee2c575efe75ede0702ac243855abe008a69","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["refactoring","release_note:skip","v9.0.0","Theme:
entity_analytics","Team:Entity
Analytics","backport:version","v8.17.0","v8.18.0","v9.1.0","v8.19.0"],"title":"[refactoring]
Distinguish User Controls from Risk Engine in DashboardEnablementPanel
","number":212441,"url":"https://github.com/elastic/kibana/pull/212441","mergeCommit":{"message":"[refactoring]
Distinguish User Controls from Risk Engine in DashboardEnablementPanel
(#212441)\n\n## Summary\nThis PR refactors naming and logic in
EntityStoreEnablementModal to\nimprove readability and better
distinguish between:\n1. Feature enablement state – Whether Risk Score
or Entity Store is\nactually enabled.\n2. User-selected state – Whether
the user has checked the corresponding\ntoggle.\n\n#### Changes\n\n-
Renamed disabled → canToggle to clearly represent UI interaction.\n-
Renamed enablements → userSelectedEnablements to reflect
user-selected\ntoggle states, not feature enablement.\n- Refactored
shouldAllowEnablement logic for clarity and correctness:\n- If riskScore
is enabled, return whether the user has enabled\nentityStore.\n- If
entityStore is enabled, return whether the user has
enabled\nriskScore.\n - Otherwise, return true if either toggle is
selected.\n- Updated corresponding tests to reflect naming and logic
changes.\n\n## Testing/Validation\nManually tested the toggling
behaviour still works as before and modal\nstill shows warning, and
disables the \"enable\" button when there are no\navailable options
selected.\n\n### Validation
Video\n\n\nhttps://github.com/user-attachments/assets/0f2a3f59-e2a0-4c8b-a350-70a9573a8566","sha":"874cee2c575efe75ede0702ac243855abe008a69"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","8.17","8.18","8.x"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.17","label":"v8.17.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/212441","number":212441,"mergeCommit":{"message":"[refactoring]
Distinguish User Controls from Risk Engine in DashboardEnablementPanel
(#212441)\n\n## Summary\nThis PR refactors naming and logic in
EntityStoreEnablementModal to\nimprove readability and better
distinguish between:\n1. Feature enablement state – Whether Risk Score
or Entity Store is\nactually enabled.\n2. User-selected state – Whether
the user has checked the corresponding\ntoggle.\n\n#### Changes\n\n-
Renamed disabled → canToggle to clearly represent UI interaction.\n-
Renamed enablements → userSelectedEnablements to reflect
user-selected\ntoggle states, not feature enablement.\n- Refactored
shouldAllowEnablement logic for clarity and correctness:\n- If riskScore
is enabled, return whether the user has enabled\nentityStore.\n- If
entityStore is enabled, return whether the user has
enabled\nriskScore.\n - Otherwise, return true if either toggle is
selected.\n- Updated corresponding tests to reflect naming and logic
changes.\n\n## Testing/Validation\nManually tested the toggling
behaviour still works as before and modal\nstill shows warning, and
disables the \"enable\" button when there are no\navailable options
selected.\n\n### Validation
Video\n\n\nhttps://github.com/user-attachments/assets/0f2a3f59-e2a0-4c8b-a350-70a9573a8566","sha":"874cee2c575efe75ede0702ac243855abe008a69"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Charlotte Alexandra Wilson <CAWilson94@users.noreply.github.com>
CAWilson94 added a commit that referenced this pull request Feb 27, 2025
…hboardEnablementPanel (#212441) (#212556)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[refactoring] Distinguish User Controls from Risk Engine in
DashboardEnablementPanel
(#212441)](#212441)

<!--- Backport version: 9.6.6 -->

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

<!--BACKPORT [{"author":{"name":"Charlotte Alexandra
Wilson","email":"CAWilson94@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-02-26T13:29:21Z","message":"[refactoring]
Distinguish User Controls from Risk Engine in DashboardEnablementPanel
(#212441)\n\n## Summary\nThis PR refactors naming and logic in
EntityStoreEnablementModal to\nimprove readability and better
distinguish between:\n1. Feature enablement state – Whether Risk Score
or Entity Store is\nactually enabled.\n2. User-selected state – Whether
the user has checked the corresponding\ntoggle.\n\n#### Changes\n\n-
Renamed disabled → canToggle to clearly represent UI interaction.\n-
Renamed enablements → userSelectedEnablements to reflect
user-selected\ntoggle states, not feature enablement.\n- Refactored
shouldAllowEnablement logic for clarity and correctness:\n- If riskScore
is enabled, return whether the user has enabled\nentityStore.\n- If
entityStore is enabled, return whether the user has
enabled\nriskScore.\n - Otherwise, return true if either toggle is
selected.\n- Updated corresponding tests to reflect naming and logic
changes.\n\n## Testing/Validation\nManually tested the toggling
behaviour still works as before and modal\nstill shows warning, and
disables the \"enable\" button when there are no\navailable options
selected.\n\n### Validation
Video\n\n\nhttps://github.com/user-attachments/assets/0f2a3f59-e2a0-4c8b-a350-70a9573a8566","sha":"874cee2c575efe75ede0702ac243855abe008a69","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["refactoring","release_note:skip","v9.0.0","Theme:
entity_analytics","Team:Entity
Analytics","backport:version","v8.17.0","v8.18.0","v9.1.0","v8.19.0"],"title":"[refactoring]
Distinguish User Controls from Risk Engine in DashboardEnablementPanel
","number":212441,"url":"https://github.com/elastic/kibana/pull/212441","mergeCommit":{"message":"[refactoring]
Distinguish User Controls from Risk Engine in DashboardEnablementPanel
(#212441)\n\n## Summary\nThis PR refactors naming and logic in
EntityStoreEnablementModal to\nimprove readability and better
distinguish between:\n1. Feature enablement state – Whether Risk Score
or Entity Store is\nactually enabled.\n2. User-selected state – Whether
the user has checked the corresponding\ntoggle.\n\n#### Changes\n\n-
Renamed disabled → canToggle to clearly represent UI interaction.\n-
Renamed enablements → userSelectedEnablements to reflect
user-selected\ntoggle states, not feature enablement.\n- Refactored
shouldAllowEnablement logic for clarity and correctness:\n- If riskScore
is enabled, return whether the user has enabled\nentityStore.\n- If
entityStore is enabled, return whether the user has
enabled\nriskScore.\n - Otherwise, return true if either toggle is
selected.\n- Updated corresponding tests to reflect naming and logic
changes.\n\n## Testing/Validation\nManually tested the toggling
behaviour still works as before and modal\nstill shows warning, and
disables the \"enable\" button when there are no\navailable options
selected.\n\n### Validation
Video\n\n\nhttps://github.com/user-attachments/assets/0f2a3f59-e2a0-4c8b-a350-70a9573a8566","sha":"874cee2c575efe75ede0702ac243855abe008a69"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","8.17","8.x"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.17","label":"v8.17.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/212519","number":212519,"state":"OPEN"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/212441","number":212441,"mergeCommit":{"message":"[refactoring]
Distinguish User Controls from Risk Engine in DashboardEnablementPanel
(#212441)\n\n## Summary\nThis PR refactors naming and logic in
EntityStoreEnablementModal to\nimprove readability and better
distinguish between:\n1. Feature enablement state – Whether Risk Score
or Entity Store is\nactually enabled.\n2. User-selected state – Whether
the user has checked the corresponding\ntoggle.\n\n#### Changes\n\n-
Renamed disabled → canToggle to clearly represent UI interaction.\n-
Renamed enablements → userSelectedEnablements to reflect
user-selected\ntoggle states, not feature enablement.\n- Refactored
shouldAllowEnablement logic for clarity and correctness:\n- If riskScore
is enabled, return whether the user has enabled\nentityStore.\n- If
entityStore is enabled, return whether the user has
enabled\nriskScore.\n - Otherwise, return true if either toggle is
selected.\n- Updated corresponding tests to reflect naming and logic
changes.\n\n## Testing/Validation\nManually tested the toggling
behaviour still works as before and modal\nstill shows warning, and
disables the \"enable\" button when there are no\navailable options
selected.\n\n### Validation
Video\n\n\nhttps://github.com/user-attachments/assets/0f2a3f59-e2a0-4c8b-a350-70a9573a8566","sha":"874cee2c575efe75ede0702ac243855abe008a69"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
CAWilson94 added a commit that referenced this pull request Feb 27, 2025
…hboardEnablementPanel (#212441) (#212554)

# Backport

This will backport the following commits from `main` to `9.0`:
- [[refactoring] Distinguish User Controls from Risk Engine in
DashboardEnablementPanel
(#212441)](#212441)

<!--- Backport version: 9.6.6 -->

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

<!--BACKPORT [{"author":{"name":"Charlotte Alexandra
Wilson","email":"CAWilson94@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-02-26T13:29:21Z","message":"[refactoring]
Distinguish User Controls from Risk Engine in DashboardEnablementPanel
(#212441)\n\n## Summary\nThis PR refactors naming and logic in
EntityStoreEnablementModal to\nimprove readability and better
distinguish between:\n1. Feature enablement state – Whether Risk Score
or Entity Store is\nactually enabled.\n2. User-selected state – Whether
the user has checked the corresponding\ntoggle.\n\n#### Changes\n\n-
Renamed disabled → canToggle to clearly represent UI interaction.\n-
Renamed enablements → userSelectedEnablements to reflect
user-selected\ntoggle states, not feature enablement.\n- Refactored
shouldAllowEnablement logic for clarity and correctness:\n- If riskScore
is enabled, return whether the user has enabled\nentityStore.\n- If
entityStore is enabled, return whether the user has
enabled\nriskScore.\n - Otherwise, return true if either toggle is
selected.\n- Updated corresponding tests to reflect naming and logic
changes.\n\n## Testing/Validation\nManually tested the toggling
behaviour still works as before and modal\nstill shows warning, and
disables the \"enable\" button when there are no\navailable options
selected.\n\n### Validation
Video\n\n\nhttps://github.com/user-attachments/assets/0f2a3f59-e2a0-4c8b-a350-70a9573a8566","sha":"874cee2c575efe75ede0702ac243855abe008a69","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["refactoring","release_note:skip","v9.0.0","Theme:
entity_analytics","Team:Entity
Analytics","backport:version","v8.17.0","v8.18.0","v9.1.0","v8.19.0"],"title":"[refactoring]
Distinguish User Controls from Risk Engine in DashboardEnablementPanel
","number":212441,"url":"https://github.com/elastic/kibana/pull/212441","mergeCommit":{"message":"[refactoring]
Distinguish User Controls from Risk Engine in DashboardEnablementPanel
(#212441)\n\n## Summary\nThis PR refactors naming and logic in
EntityStoreEnablementModal to\nimprove readability and better
distinguish between:\n1. Feature enablement state – Whether Risk Score
or Entity Store is\nactually enabled.\n2. User-selected state – Whether
the user has checked the corresponding\ntoggle.\n\n#### Changes\n\n-
Renamed disabled → canToggle to clearly represent UI interaction.\n-
Renamed enablements → userSelectedEnablements to reflect
user-selected\ntoggle states, not feature enablement.\n- Refactored
shouldAllowEnablement logic for clarity and correctness:\n- If riskScore
is enabled, return whether the user has enabled\nentityStore.\n- If
entityStore is enabled, return whether the user has
enabled\nriskScore.\n - Otherwise, return true if either toggle is
selected.\n- Updated corresponding tests to reflect naming and logic
changes.\n\n## Testing/Validation\nManually tested the toggling
behaviour still works as before and modal\nstill shows warning, and
disables the \"enable\" button when there are no\navailable options
selected.\n\n### Validation
Video\n\n\nhttps://github.com/user-attachments/assets/0f2a3f59-e2a0-4c8b-a350-70a9573a8566","sha":"874cee2c575efe75ede0702ac243855abe008a69"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","8.17","8.x"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.17","label":"v8.17.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/212519","number":212519,"state":"OPEN"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/212441","number":212441,"mergeCommit":{"message":"[refactoring]
Distinguish User Controls from Risk Engine in DashboardEnablementPanel
(#212441)\n\n## Summary\nThis PR refactors naming and logic in
EntityStoreEnablementModal to\nimprove readability and better
distinguish between:\n1. Feature enablement state – Whether Risk Score
or Entity Store is\nactually enabled.\n2. User-selected state – Whether
the user has checked the corresponding\ntoggle.\n\n#### Changes\n\n-
Renamed disabled → canToggle to clearly represent UI interaction.\n-
Renamed enablements → userSelectedEnablements to reflect
user-selected\ntoggle states, not feature enablement.\n- Refactored
shouldAllowEnablement logic for clarity and correctness:\n- If riskScore
is enabled, return whether the user has enabled\nentityStore.\n- If
entityStore is enabled, return whether the user has
enabled\nriskScore.\n - Otherwise, return true if either toggle is
selected.\n- Updated corresponding tests to reflect naming and logic
changes.\n\n## Testing/Validation\nManually tested the toggling
behaviour still works as before and modal\nstill shows warning, and
disables the \"enable\" button when there are no\navailable options
selected.\n\n### Validation
Video\n\n\nhttps://github.com/user-attachments/assets/0f2a3f59-e2a0-4c8b-a350-70a9573a8566","sha":"874cee2c575efe75ede0702ac243855abe008a69"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
CAWilson94 added a commit that referenced this pull request Feb 27, 2025
…shboardEnablementPanel (#212441) (#212561)

# Backport

This will backport the following commits from `main` to `8.17`:
- [[refactoring] Distinguish User Controls from Risk Engine in
DashboardEnablementPanel
(#212441)](#212441)

<!--- Backport version: 9.6.6 -->

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

<!--BACKPORT [{"author":{"name":"Charlotte Alexandra
Wilson","email":"CAWilson94@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-02-26T13:29:21Z","message":"[refactoring]
Distinguish User Controls from Risk Engine in DashboardEnablementPanel
(#212441)\n\n## Summary\nThis PR refactors naming and logic in
EntityStoreEnablementModal to\nimprove readability and better
distinguish between:\n1. Feature enablement state – Whether Risk Score
or Entity Store is\nactually enabled.\n2. User-selected state – Whether
the user has checked the corresponding\ntoggle.\n\n#### Changes\n\n-
Renamed disabled → canToggle to clearly represent UI interaction.\n-
Renamed enablements → userSelectedEnablements to reflect
user-selected\ntoggle states, not feature enablement.\n- Refactored
shouldAllowEnablement logic for clarity and correctness:\n- If riskScore
is enabled, return whether the user has enabled\nentityStore.\n- If
entityStore is enabled, return whether the user has
enabled\nriskScore.\n - Otherwise, return true if either toggle is
selected.\n- Updated corresponding tests to reflect naming and logic
changes.\n\n## Testing/Validation\nManually tested the toggling
behaviour still works as before and modal\nstill shows warning, and
disables the \"enable\" button when there are no\navailable options
selected.\n\n### Validation
Video\n\n\nhttps://github.com/user-attachments/assets/0f2a3f59-e2a0-4c8b-a350-70a9573a8566","sha":"874cee2c575efe75ede0702ac243855abe008a69","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["refactoring","release_note:skip","v9.0.0","Theme:
entity_analytics","Team:Entity
Analytics","backport:version","v8.17.0","v8.18.0","v9.1.0","v8.19.0"],"title":"[refactoring]
Distinguish User Controls from Risk Engine in DashboardEnablementPanel
","number":212441,"url":"https://github.com/elastic/kibana/pull/212441","mergeCommit":{"message":"[refactoring]
Distinguish User Controls from Risk Engine in DashboardEnablementPanel
(#212441)\n\n## Summary\nThis PR refactors naming and logic in
EntityStoreEnablementModal to\nimprove readability and better
distinguish between:\n1. Feature enablement state – Whether Risk Score
or Entity Store is\nactually enabled.\n2. User-selected state – Whether
the user has checked the corresponding\ntoggle.\n\n#### Changes\n\n-
Renamed disabled → canToggle to clearly represent UI interaction.\n-
Renamed enablements → userSelectedEnablements to reflect
user-selected\ntoggle states, not feature enablement.\n- Refactored
shouldAllowEnablement logic for clarity and correctness:\n- If riskScore
is enabled, return whether the user has enabled\nentityStore.\n- If
entityStore is enabled, return whether the user has
enabled\nriskScore.\n - Otherwise, return true if either toggle is
selected.\n- Updated corresponding tests to reflect naming and logic
changes.\n\n## Testing/Validation\nManually tested the toggling
behaviour still works as before and modal\nstill shows warning, and
disables the \"enable\" button when there are no\navailable options
selected.\n\n### Validation
Video\n\n\nhttps://github.com/user-attachments/assets/0f2a3f59-e2a0-4c8b-a350-70a9573a8566","sha":"874cee2c575efe75ede0702ac243855abe008a69"}},"sourceBranch":"main","suggestedTargetBranches":["8.17"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/212554","number":212554,"state":"OPEN"},{"branch":"8.17","label":"v8.17.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/212519","number":212519,"state":"OPEN"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/212441","number":212441,"mergeCommit":{"message":"[refactoring]
Distinguish User Controls from Risk Engine in DashboardEnablementPanel
(#212441)\n\n## Summary\nThis PR refactors naming and logic in
EntityStoreEnablementModal to\nimprove readability and better
distinguish between:\n1. Feature enablement state – Whether Risk Score
or Entity Store is\nactually enabled.\n2. User-selected state – Whether
the user has checked the corresponding\ntoggle.\n\n#### Changes\n\n-
Renamed disabled → canToggle to clearly represent UI interaction.\n-
Renamed enablements → userSelectedEnablements to reflect
user-selected\ntoggle states, not feature enablement.\n- Refactored
shouldAllowEnablement logic for clarity and correctness:\n- If riskScore
is enabled, return whether the user has enabled\nentityStore.\n- If
entityStore is enabled, return whether the user has
enabled\nriskScore.\n - Otherwise, return true if either toggle is
selected.\n- Updated corresponding tests to reflect naming and logic
changes.\n\n## Testing/Validation\nManually tested the toggling
behaviour still works as before and modal\nstill shows warning, and
disables the \"enable\" button when there are no\navailable options
selected.\n\n### Validation
Video\n\n\nhttps://github.com/user-attachments/assets/0f2a3f59-e2a0-4c8b-a350-70a9573a8566","sha":"874cee2c575efe75ede0702ac243855abe008a69"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/212556","number":212556,"state":"OPEN"}]}]
BACKPORT-->
SoniaSanzV pushed a commit to SoniaSanzV/kibana that referenced this pull request Mar 4, 2025
…hboardEnablementPanel (elastic#212441) (elastic#212556)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[refactoring] Distinguish User Controls from Risk Engine in
DashboardEnablementPanel
(elastic#212441)](elastic#212441)

<!--- Backport version: 9.6.6 -->

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

<!--BACKPORT [{"author":{"name":"Charlotte Alexandra
Wilson","email":"CAWilson94@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-02-26T13:29:21Z","message":"[refactoring]
Distinguish User Controls from Risk Engine in DashboardEnablementPanel
(elastic#212441)\n\n## Summary\nThis PR refactors naming and logic in
EntityStoreEnablementModal to\nimprove readability and better
distinguish between:\n1. Feature enablement state – Whether Risk Score
or Entity Store is\nactually enabled.\n2. User-selected state – Whether
the user has checked the corresponding\ntoggle.\n\n#### Changes\n\n-
Renamed disabled → canToggle to clearly represent UI interaction.\n-
Renamed enablements → userSelectedEnablements to reflect
user-selected\ntoggle states, not feature enablement.\n- Refactored
shouldAllowEnablement logic for clarity and correctness:\n- If riskScore
is enabled, return whether the user has enabled\nentityStore.\n- If
entityStore is enabled, return whether the user has
enabled\nriskScore.\n - Otherwise, return true if either toggle is
selected.\n- Updated corresponding tests to reflect naming and logic
changes.\n\n## Testing/Validation\nManually tested the toggling
behaviour still works as before and modal\nstill shows warning, and
disables the \"enable\" button when there are no\navailable options
selected.\n\n### Validation
Video\n\n\nhttps://github.com/user-attachments/assets/0f2a3f59-e2a0-4c8b-a350-70a9573a8566","sha":"874cee2c575efe75ede0702ac243855abe008a69","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["refactoring","release_note:skip","v9.0.0","Theme:
entity_analytics","Team:Entity
Analytics","backport:version","v8.17.0","v8.18.0","v9.1.0","v8.19.0"],"title":"[refactoring]
Distinguish User Controls from Risk Engine in DashboardEnablementPanel
","number":212441,"url":"https://github.com/elastic/kibana/pull/212441","mergeCommit":{"message":"[refactoring]
Distinguish User Controls from Risk Engine in DashboardEnablementPanel
(elastic#212441)\n\n## Summary\nThis PR refactors naming and logic in
EntityStoreEnablementModal to\nimprove readability and better
distinguish between:\n1. Feature enablement state – Whether Risk Score
or Entity Store is\nactually enabled.\n2. User-selected state – Whether
the user has checked the corresponding\ntoggle.\n\n#### Changes\n\n-
Renamed disabled → canToggle to clearly represent UI interaction.\n-
Renamed enablements → userSelectedEnablements to reflect
user-selected\ntoggle states, not feature enablement.\n- Refactored
shouldAllowEnablement logic for clarity and correctness:\n- If riskScore
is enabled, return whether the user has enabled\nentityStore.\n- If
entityStore is enabled, return whether the user has
enabled\nriskScore.\n - Otherwise, return true if either toggle is
selected.\n- Updated corresponding tests to reflect naming and logic
changes.\n\n## Testing/Validation\nManually tested the toggling
behaviour still works as before and modal\nstill shows warning, and
disables the \"enable\" button when there are no\navailable options
selected.\n\n### Validation
Video\n\n\nhttps://github.com/user-attachments/assets/0f2a3f59-e2a0-4c8b-a350-70a9573a8566","sha":"874cee2c575efe75ede0702ac243855abe008a69"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","8.17","8.x"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.17","label":"v8.17.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/212519","number":212519,"state":"OPEN"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/212441","number":212441,"mergeCommit":{"message":"[refactoring]
Distinguish User Controls from Risk Engine in DashboardEnablementPanel
(elastic#212441)\n\n## Summary\nThis PR refactors naming and logic in
EntityStoreEnablementModal to\nimprove readability and better
distinguish between:\n1. Feature enablement state – Whether Risk Score
or Entity Store is\nactually enabled.\n2. User-selected state – Whether
the user has checked the corresponding\ntoggle.\n\n#### Changes\n\n-
Renamed disabled → canToggle to clearly represent UI interaction.\n-
Renamed enablements → userSelectedEnablements to reflect
user-selected\ntoggle states, not feature enablement.\n- Refactored
shouldAllowEnablement logic for clarity and correctness:\n- If riskScore
is enabled, return whether the user has enabled\nentityStore.\n- If
entityStore is enabled, return whether the user has
enabled\nriskScore.\n - Otherwise, return true if either toggle is
selected.\n- Updated corresponding tests to reflect naming and logic
changes.\n\n## Testing/Validation\nManually tested the toggling
behaviour still works as before and modal\nstill shows warning, and
disables the \"enable\" button when there are no\navailable options
selected.\n\n### Validation
Video\n\n\nhttps://github.com/user-attachments/assets/0f2a3f59-e2a0-4c8b-a350-70a9573a8566","sha":"874cee2c575efe75ede0702ac243855abe008a69"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
CAWilson94 added a commit to CAWilson94/kibana that referenced this pull request Mar 22, 2025
…EnablementPanel (elastic#212441)

## Summary
This PR refactors naming and logic in EntityStoreEnablementModal to
improve readability and better distinguish between:
1. Feature enablement state – Whether Risk Score or Entity Store is
actually enabled.
2. User-selected state – Whether the user has checked the corresponding
toggle.

#### Changes

- Renamed disabled → canToggle to clearly represent UI interaction.
- Renamed enablements → userSelectedEnablements to reflect user-selected
toggle states, not feature enablement.
- Refactored shouldAllowEnablement logic for clarity and correctness:
- If riskScore is enabled, return whether the user has enabled
entityStore.
- If entityStore is enabled, return whether the user has enabled
riskScore.
     - Otherwise, return true if either toggle is selected.
- Updated corresponding tests to reflect naming and logic changes.

## Testing/Validation
Manually tested the toggling behaviour still works as before and modal
still shows warning, and disables the "enable" button when there are no
available options selected.

### Validation Video


https://github.com/user-attachments/assets/0f2a3f59-e2a0-4c8b-a350-70a9573a8566
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 refactoring release_note:skip Skip the PR/issue when compiling release notes Team:Entity Analytics Security Entity Analytics Team Theme: entity_analytics v8.17.0 v8.17.3 v8.18.0 v8.19.0 v9.0.0 v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants