-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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] Hide insight components when license is incorrect or there are no configured connectors #181519
[Obs AI Assistant] Hide insight components when license is incorrect or there are no configured connectors #181519
Conversation
…or there are no configured connectors
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
} = useKibana(); | ||
|
||
const license = useObservable<ILicense | null>(licensing.license$); | ||
const hasEnterpriseLicense = license?.hasAtLeast('enterprise'); | ||
if (isEmpty(connectors.connectors) || !hasEnterpriseLicense) { |
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.
should we do this in the consumer component? this might create some weird margins if the consumer component renders it in a flex item
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.
I initially added the checks outside the component together with the isEnabled
flag. However, that made the component async, so the consumer would have to await
the component.
What alternatives do you see?
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.
Ah... You mean, every consumer should be responsible for doing the check?
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.
I could add a helper to make that easier though.
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.
Hmmm I see your point. We can add an useAvailability()
hook that takes care of the licensing. we already have a useGenAIConnectors()
so maybe we can combine those two. Or we can leave it for now, do you have a screenshot of how this looks in the places where we use contextual insights?
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.
💚 Build Succeeded
Metrics [docs]Module Count
Async chunks
To update your PR or re-run it, just comment with: |
…or there are no configured connectors (elastic#181519) Closes elastic#181435 (cherry picked from commit 67a2eb5)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…orrect or there are no configured connectors (#181519) (#181545) # Backport This will backport the following commits from `main` to `8.14`: - [[Obs AI Assistant] Hide insight components when license is incorrect or there are no configured connectors (#181519)](#181519) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Søren Louv-Jansen","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-04-24T10:36:41Z","message":"[Obs AI Assistant] Hide insight components when license is incorrect or there are no configured connectors (#181519)\n\nCloses https://github.com/elastic/kibana/issues/181435","sha":"67a2eb54c98678b546b08bf6f810f44bd31e1055","branchLabelMapping":{"^v8.15.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Obs AI Assistant","v8.14.0","v8.15.0"],"title":"[Obs AI Assistant] Hide insight components when license is incorrect or there are no configured connectors","number":181519,"url":"https://github.com/elastic/kibana/pull/181519","mergeCommit":{"message":"[Obs AI Assistant] Hide insight components when license is incorrect or there are no configured connectors (#181519)\n\nCloses https://github.com/elastic/kibana/issues/181435","sha":"67a2eb54c98678b546b08bf6f810f44bd31e1055"}},"sourceBranch":"main","suggestedTargetBranches":["8.14"],"targetPullRequestStates":[{"branch":"8.14","label":"v8.14.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.15.0","branchLabelMappingKey":"^v8.15.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/181519","number":181519,"mergeCommit":{"message":"[Obs AI Assistant] Hide insight components when license is incorrect or there are no configured connectors (#181519)\n\nCloses https://github.com/elastic/kibana/issues/181435","sha":"67a2eb54c98678b546b08bf6f810f44bd31e1055"}}]}] BACKPORT--> Co-authored-by: Søren Louv-Jansen <[email protected]>
…or there are no configured connectors (elastic#181519) Closes elastic#181435
Closes #181435