mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
[Obs AI Assistant] hide ai assistant menu item when in a disabled space (#188017)
Hides AI Assistant button when in a space where the AI Assistant is disabled
This commit is contained in:
parent
ee3543990b
commit
81b1705ea6
1 changed files with 22 additions and 20 deletions
|
@ -103,27 +103,29 @@ export class ObservabilityAIAssistantAppPlugin
|
|||
const appService = (this.appService = createAppService({
|
||||
pluginsStart,
|
||||
}));
|
||||
const isEnabled = appService.isEnabled();
|
||||
if (isEnabled) {
|
||||
coreStart.chrome.navControls.registerRight({
|
||||
mount: (element) => {
|
||||
ReactDOM.render(
|
||||
<SharedProviders
|
||||
coreStart={coreStart}
|
||||
pluginsStart={pluginsStart}
|
||||
service={appService}
|
||||
theme$={coreStart.theme.theme$}
|
||||
>
|
||||
<LazyNavControl />
|
||||
</SharedProviders>,
|
||||
element,
|
||||
() => {}
|
||||
);
|
||||
|
||||
coreStart.chrome.navControls.registerRight({
|
||||
mount: (element) => {
|
||||
ReactDOM.render(
|
||||
<SharedProviders
|
||||
coreStart={coreStart}
|
||||
pluginsStart={pluginsStart}
|
||||
service={appService}
|
||||
theme$={coreStart.theme.theme$}
|
||||
>
|
||||
<LazyNavControl />
|
||||
</SharedProviders>,
|
||||
element,
|
||||
() => {}
|
||||
);
|
||||
|
||||
return () => {};
|
||||
},
|
||||
// right before the user profile
|
||||
order: 1001,
|
||||
});
|
||||
return () => {};
|
||||
},
|
||||
// right before the user profile
|
||||
order: 1001,
|
||||
});
|
||||
}
|
||||
|
||||
const service = pluginsStart.observabilityAIAssistant.service;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue