mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
[Serverless/Logstash] Hide suggestion to revisit roles or enable Stack Monitoring (#189480)
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
c0fa819927
commit
4a63054366
6 changed files with 19 additions and 7 deletions
|
@ -254,7 +254,6 @@ class PipelineListUi extends React.Component {
|
|||
{
|
||||
numSuccesses,
|
||||
numPipelinesSelected,
|
||||
numPipelinesSelected,
|
||||
}
|
||||
),
|
||||
text,
|
||||
|
@ -288,7 +287,7 @@ class PipelineListUi extends React.Component {
|
|||
onSelectionChange = (selection) => this.setState({ selection });
|
||||
|
||||
render() {
|
||||
const { clonePipeline, createPipeline, isReadOnly, openPipeline } = this.props;
|
||||
const { clonePipeline, createPipeline, isReadOnly, openPipeline, isServerless } = this.props;
|
||||
const { isSelectable, message, pipelines, selection, showConfirmDeleteModal } = this.state;
|
||||
return (
|
||||
<EuiPageSection data-test-subj="pipelineList">
|
||||
|
@ -326,8 +325,8 @@ class PipelineListUi extends React.Component {
|
|||
showConfirmDeleteModal={showConfirmDeleteModal}
|
||||
/>
|
||||
<InfoAlerts
|
||||
showAddRoleAlert={this.state.showAddRoleAlert}
|
||||
showEnableMonitoringAlert={this.state.showEnableMonitoringAlert}
|
||||
showAddRoleAlert={!isServerless && this.state.showAddRoleAlert}
|
||||
showEnableMonitoringAlert={!isServerless && this.state.showEnableMonitoringAlert}
|
||||
/>
|
||||
</EuiPageSection>
|
||||
);
|
||||
|
|
|
@ -35,6 +35,7 @@ describe('PipelineList component', () => {
|
|||
isClusterInfoAvailable: getIsClusterInfoAvailable(true),
|
||||
deleteSelectedPipelines: getDeleteSelectedPipelines(true),
|
||||
},
|
||||
isServerless: false,
|
||||
isReadOnly: false,
|
||||
licenseService: {
|
||||
checkValidity: () => Promise.resolve(),
|
||||
|
|
|
@ -32,7 +32,8 @@ export const renderApp = async (
|
|||
core: CoreStart,
|
||||
{ history, element, setBreadcrumbs }: ManagementAppMountParams,
|
||||
isMonitoringEnabled: boolean,
|
||||
licenseService$: Observable<any>
|
||||
licenseService$: Observable<any>,
|
||||
isServerless: boolean
|
||||
) => {
|
||||
const logstashLicenseService = await licenseService$.pipe(first()).toPromise();
|
||||
const clusterService = new ClusterService(core.http);
|
||||
|
@ -52,6 +53,7 @@ export const renderApp = async (
|
|||
return (
|
||||
<PipelineList
|
||||
clusterService={clusterService}
|
||||
isServerless={isServerless}
|
||||
isReadOnly={logstashLicenseService.isReadOnly}
|
||||
isForbidden={true}
|
||||
isLoading={false}
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import type { PluginInitializerContext } from '@kbn/core-plugins-browser';
|
||||
import { LogstashPlugin } from './plugin';
|
||||
|
||||
export const plugin = () => new LogstashPlugin();
|
||||
export const plugin = (initializerContext: PluginInitializerContext) =>
|
||||
new LogstashPlugin(initializerContext);
|
||||
|
|
|
@ -16,6 +16,7 @@ import { ManagementSetup } from '@kbn/management-plugin/public';
|
|||
import { LicensingPluginSetup } from '@kbn/licensing-plugin/public';
|
||||
|
||||
// @ts-ignore
|
||||
import type { PluginInitializerContext } from '@kbn/core-plugins-browser';
|
||||
import { LogstashLicenseService } from './services';
|
||||
|
||||
interface SetupDeps {
|
||||
|
@ -26,9 +27,14 @@ interface SetupDeps {
|
|||
}
|
||||
|
||||
export class LogstashPlugin implements Plugin<void, void, SetupDeps> {
|
||||
private readonly isServerless: boolean;
|
||||
private licenseSubscription?: Subscription;
|
||||
private capabilities$ = new Subject<Capabilities>();
|
||||
|
||||
constructor(initializerContext: PluginInitializerContext) {
|
||||
this.isServerless = initializerContext.env.packageInfo.buildFlavor === 'serverless';
|
||||
}
|
||||
|
||||
public setup(core: CoreSetup, plugins: SetupDeps) {
|
||||
const logstashLicense$ = plugins.licensing.license$.pipe(
|
||||
map((license) => new LogstashLicenseService(license))
|
||||
|
@ -54,7 +60,8 @@ export class LogstashPlugin implements Plugin<void, void, SetupDeps> {
|
|||
coreStart,
|
||||
params,
|
||||
isMonitoringEnabled,
|
||||
logstashLicense$
|
||||
logstashLicense$,
|
||||
this.isServerless
|
||||
);
|
||||
|
||||
return () => {
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
"@kbn/shared-ux-router",
|
||||
"@kbn/code-editor",
|
||||
"@kbn/react-kibana-context-render",
|
||||
"@kbn/core-plugins-browser",
|
||||
],
|
||||
"exclude": [
|
||||
"target/**/*",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue