File tree Expand file tree Collapse file tree
datavisualizer/file_based/components/filebeat_config_flyout Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ import { LicenseManagementUIPluginSetup } from '../../../../../license_managemen
1515
1616interface StartPlugins {
1717 data : DataPublicPluginStart ;
18- security : SecurityPluginSetup ;
18+ security ? : SecurityPluginSetup ;
1919 licenseManagement ?: LicenseManagementUIPluginSetup ;
2020}
2121export type StartServices = CoreStart & StartPlugins ;
Original file line number Diff line number Diff line change @@ -55,9 +55,11 @@ export const FilebeatConfigFlyout: FC<Props> = ({
5555 } = useMlKibana ( ) ;
5656
5757 useEffect ( ( ) => {
58- security . authc . getCurrentUser ( ) . then ( user => {
59- setUsername ( user . username === undefined ? null : user . username ) ;
60- } ) ;
58+ if ( security !== undefined ) {
59+ security . authc . getCurrentUser ( ) . then ( user => {
60+ setUsername ( user . username === undefined ? null : user . username ) ;
61+ } ) ;
62+ }
6163 } , [ ] ) ;
6264
6365 useEffect ( ( ) => {
Original file line number Diff line number Diff line change @@ -25,8 +25,11 @@ export function initManagementSection(
2525) {
2626 const licensing = pluginsSetup . licensing . license$ . pipe ( take ( 1 ) ) ;
2727 licensing . subscribe ( license => {
28- if ( license . check ( PLUGIN_ID , MINIMUM_FULL_LICENSE ) . state === 'valid' ) {
29- const management = pluginsSetup . management ;
28+ const management = pluginsSetup . management ;
29+ if (
30+ management !== undefined &&
31+ license . check ( PLUGIN_ID , MINIMUM_FULL_LICENSE ) . state === 'valid'
32+ ) {
3033 const mlSection = management . sections . register ( {
3134 id : PLUGIN_ID ,
3235 title : i18n . translate ( 'xpack.ml.management.mlTitle' , {
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ export interface DependencyCache {
4040 savedObjectsClient : SavedObjectsClientContract | null ;
4141 application : ApplicationStart | null ;
4242 http : HttpStart | null ;
43- security : SecurityPluginSetup | null ;
43+ security : SecurityPluginSetup | undefined | null ;
4444 i18n : I18nStart | null ;
4545 urlGenerators : SharePluginStart [ 'urlGenerators' ] | null ;
4646 mlConfig : MlConfigType | null ;
Original file line number Diff line number Diff line change @@ -32,9 +32,9 @@ export interface MlStartDependencies {
3232 share : SharePluginStart ;
3333}
3434export interface MlSetupDependencies {
35- security : SecurityPluginSetup ;
35+ security ? : SecurityPluginSetup ;
3636 licensing : LicensingPluginSetup ;
37- management : ManagementSetup ;
37+ management ? : ManagementSetup ;
3838 usageCollection : UsageCollectionSetup ;
3939 licenseManagement ?: LicenseManagementUIPluginSetup ;
4040 home : HomePublicPluginSetup ;
You can’t perform that action at this time.
0 commit comments