mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
[Profiling] Space-specific feature privileges (#154734)
This commit is contained in:
parent
2f46929805
commit
2f001a2f8d
2 changed files with 31 additions and 28 deletions
|
@ -50,27 +50,30 @@ export class ProfilingPlugin implements Plugin {
|
|||
const kuerySubject = new BehaviorSubject<string>('');
|
||||
|
||||
const section$ = combineLatest([from(coreSetup.getStartServices()), kuerySubject]).pipe(
|
||||
map(([_, kuery]) => {
|
||||
const sections: NavigationSection[] = [
|
||||
{
|
||||
label: i18n.translate('xpack.profiling.navigation.sectionLabel', {
|
||||
defaultMessage: 'Universal Profiling',
|
||||
}),
|
||||
isBetaFeature: true,
|
||||
entries: links.map((link) => {
|
||||
return {
|
||||
app: 'profiling',
|
||||
label: link.title,
|
||||
path: `${link.path}?kuery=${kuery ?? ''}`,
|
||||
matchPath: (path) => {
|
||||
return path.startsWith(link.path);
|
||||
},
|
||||
};
|
||||
}),
|
||||
sortKey: 700,
|
||||
},
|
||||
];
|
||||
return sections;
|
||||
map(([[coreStart], kuery]) => {
|
||||
if (coreStart.application.capabilities.profiling.show) {
|
||||
const sections: NavigationSection[] = [
|
||||
{
|
||||
label: i18n.translate('xpack.profiling.navigation.sectionLabel', {
|
||||
defaultMessage: 'Universal Profiling',
|
||||
}),
|
||||
isBetaFeature: true,
|
||||
entries: links.map((link) => {
|
||||
return {
|
||||
app: 'profiling',
|
||||
label: link.title,
|
||||
path: `${link.path}?kuery=${kuery ?? ''}`,
|
||||
matchPath: (path) => {
|
||||
return path.startsWith(link.path);
|
||||
},
|
||||
};
|
||||
}),
|
||||
sortKey: 700,
|
||||
},
|
||||
];
|
||||
return sections;
|
||||
}
|
||||
return [];
|
||||
})
|
||||
);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue