Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Obs AI Assistant] Fix AI Assistant Settings when plugin disabled #188160

Merged
merged 6 commits into from
Jul 15, 2024

Conversation

neptunian
Copy link
Contributor

@neptunian neptunian commented Jul 11, 2024

Summary

Fixes #187977

AI Assistant settings page doesn't load when the plugin is disabled.

Changes

  • fixes not checking for object before accessing property
  • simplifies message so it makes sense for all possible states (read only, disabled in space, plugin disabled)

Testing steps

  • create a Viewer user
  • go to Stack Management -> Advanced Settings -> AI Assistant
  • page should load with message that the feature is disabled
Screenshot 2024-07-11 at 4 57 59 PM

@obltmachine
Copy link

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@neptunian
Copy link
Contributor Author

/ci

@neptunian neptunian changed the title check for disabled plugin [Obs AI Assistant] Fix AI Assistant Settings when plugin disabled Jul 12, 2024
@neptunian neptunian added bug Fixes for quality problems that affect the customer experience v8.15.0 v8.16.0 Team:Obs AI Assistant labels Jul 12, 2024
@neptunian
Copy link
Contributor Author

/ci

@neptunian neptunian marked this pull request as ready for review July 12, 2024 16:38
@neptunian neptunian requested a review from a team as a code owner July 12, 2024 16:38
@neptunian
Copy link
Contributor Author

/ci

const observabilityFeatureDisabledInSpaceMsg = i18n.translate(
'aiAssistantManagementSelection.aiAssistantSelectionPage.observabilityAi.thisFeatureIsDisabledInSpaceCallOutLabel',
{
defaultMessage: 'This feature is disabled. It can be enabled from Spaces > Features',
Copy link
Member

Choose a reason for hiding this comment

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

Should we label this is as "Stack Management > Spaces > Features"? This is the title of the breadcrumb:

CleanShot 2024-07-15 at 11 52 13@2x

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dgieselaar It was decided to keep the message simple instead of distinguishing between the states so it now only says "This feature is disabled" with the existing label.

@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Jest Integration Tests #1 / telemetry tasks telemetry-prebuilt-rule-alerts should manage runtime errors searching endpoint metrics

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
aiAssistantManagementSelection 45.4KB 45.4KB -8.0B

History

@neptunian neptunian merged commit d4ba879 into elastic:main Jul 15, 2024
19 checks passed
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jul 15, 2024
…astic#188160)

## Summary

Fixes elastic#187977

AI Assistant settings page doesn't load when the plugin is disabled.

### Changes

- fixes not checking for object before accessing property
- simplifies message so it makes sense for all possible states (read
only, disabled in space, plugin disabled)

### Testing steps
- create a Viewer user
- go to Stack Management -> Advanced Settings -> AI Assistant
- page should load with message that the feature is disabled

<img width="804" alt="Screenshot 2024-07-11 at 4 57 59 PM"
src="https://github.com/user-attachments/assets/98cf85a2-913f-43fd-a5f0-df4494faaf1f">

(cherry picked from commit d4ba879)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.15

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

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Jul 15, 2024
…led (#188160) (#188347)

# Backport

This will backport the following commits from `main` to `8.15`:
- [[Obs AI Assistant] Fix AI Assistant Settings when plugin disabled
(#188160)](#188160)

<!--- Backport version: 9.4.3 -->

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

<!--BACKPORT [{"author":{"name":"Sandra
G","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-07-15T17:58:02Z","message":"[Obs
AI Assistant] Fix AI Assistant Settings when plugin disabled
(#188160)\n\n## Summary\r\n\r\nFixes
https://github.com/elastic/kibana/issues/187977\r\n\r\nAI Assistant
settings page doesn't load when the plugin is disabled. \r\n\r\n###
Changes\r\n\r\n- fixes not checking for object before accessing
property\r\n- simplifies message so it makes sense for all possible
states (read\r\nonly, disabled in space, plugin disabled)\r\n\r\n###
Testing steps\r\n- create a Viewer user\r\n- go to Stack Management ->
Advanced Settings -> AI Assistant\r\n- page should load with message
that the feature is disabled\r\n\r\n<img width=\"804\" alt=\"Screenshot
2024-07-11 at 4 57
59 PM\"\r\nsrc=\"https://github.com/user-attachments/assets/98cf85a2-913f-43fd-a5f0-df4494faaf1f\">","sha":"d4ba87988da61dc793ba5982fa0bbc28034bf449","branchLabelMapping":{"^v8.16.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:fix","Team:Obs
AI Assistant","v8.15.0","v8.16.0"],"title":"[Obs AI Assistant] Fix AI
Assistant Settings when plugin
disabled","number":188160,"url":"https://github.com/elastic/kibana/pull/188160","mergeCommit":{"message":"[Obs
AI Assistant] Fix AI Assistant Settings when plugin disabled
(#188160)\n\n## Summary\r\n\r\nFixes
https://github.com/elastic/kibana/issues/187977\r\n\r\nAI Assistant
settings page doesn't load when the plugin is disabled. \r\n\r\n###
Changes\r\n\r\n- fixes not checking for object before accessing
property\r\n- simplifies message so it makes sense for all possible
states (read\r\nonly, disabled in space, plugin disabled)\r\n\r\n###
Testing steps\r\n- create a Viewer user\r\n- go to Stack Management ->
Advanced Settings -> AI Assistant\r\n- page should load with message
that the feature is disabled\r\n\r\n<img width=\"804\" alt=\"Screenshot
2024-07-11 at 4 57
59 PM\"\r\nsrc=\"https://github.com/user-attachments/assets/98cf85a2-913f-43fd-a5f0-df4494faaf1f\">","sha":"d4ba87988da61dc793ba5982fa0bbc28034bf449"}},"sourceBranch":"main","suggestedTargetBranches":["8.15"],"targetPullRequestStates":[{"branch":"8.15","label":"v8.15.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/188160","number":188160,"mergeCommit":{"message":"[Obs
AI Assistant] Fix AI Assistant Settings when plugin disabled
(#188160)\n\n## Summary\r\n\r\nFixes
https://github.com/elastic/kibana/issues/187977\r\n\r\nAI Assistant
settings page doesn't load when the plugin is disabled. \r\n\r\n###
Changes\r\n\r\n- fixes not checking for object before accessing
property\r\n- simplifies message so it makes sense for all possible
states (read\r\nonly, disabled in space, plugin disabled)\r\n\r\n###
Testing steps\r\n- create a Viewer user\r\n- go to Stack Management ->
Advanced Settings -> AI Assistant\r\n- page should load with message
that the feature is disabled\r\n\r\n<img width=\"804\" alt=\"Screenshot
2024-07-11 at 4 57
59 PM\"\r\nsrc=\"https://github.com/user-attachments/assets/98cf85a2-913f-43fd-a5f0-df4494faaf1f\">","sha":"d4ba87988da61dc793ba5982fa0bbc28034bf449"}}]}]
BACKPORT-->

Co-authored-by: Sandra G <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience release_note:fix Team:Obs AI Assistant v8.15.0 v8.16.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Obs AI Assistant] Settings type error when AI Assistant plugin is disabled
5 participants