@@ -13,17 +13,20 @@ import {
13
13
AppMountParameters ,
14
14
CoreSetup ,
15
15
CoreStart ,
16
+ DEFAULT_APP_CATEGORIES ,
17
+ DEFAULT_NAV_GROUPS ,
16
18
NotificationsSetup ,
17
19
NotificationsStart ,
18
20
Plugin ,
21
+ WorkspaceAvailability ,
19
22
} from '../../../src/core/public' ;
20
23
import {
21
24
CONTEXT_MENU_TRIGGER ,
22
25
EmbeddableSetup ,
23
26
EmbeddableStart ,
24
27
} from '../../../src/plugins/embeddable/public' ;
25
28
import { ACTION_AD } from './action/ad_dashboard_action' ;
26
- import { PLUGIN_NAME } from './utils/constants' ;
29
+ import { APP_PATH , DASHBOARD_PAGE_NAV_ID , DETECTORS_PAGE_NAV_ID , OVERVIEW_PAGE_NAV_ID , PLUGIN_NAME } from './utils/constants' ;
27
30
import { getActions } from './utils/contextMenu/getActions' ;
28
31
import { overlayAnomaliesFunction } from './expressions/overlay_anomalies' ;
29
32
import {
@@ -76,6 +79,8 @@ export class AnomalyDetectionOpenSearchDashboardsPlugin
76
79
implements Plugin < AnomalyDetectionSetupDeps , AnomalyDetectionStartDeps >
77
80
{
78
81
public setup ( core : CoreSetup , plugins : any ) {
82
+ const hideInAppSideNavBar = core . chrome . navGroup . getNavGroupEnabled ( ) ;
83
+
79
84
core . application . register ( {
80
85
id : PLUGIN_NAME ,
81
86
title : 'Anomaly Detection' ,
@@ -88,10 +93,105 @@ export class AnomalyDetectionOpenSearchDashboardsPlugin
88
93
mount : async ( params : AppMountParameters ) => {
89
94
const { renderApp } = await import ( './anomaly_detection_app' ) ;
90
95
const [ coreStart ] = await core . getStartServices ( ) ;
91
- return renderApp ( coreStart , params ) ;
96
+ return renderApp ( coreStart , params , undefined , hideInAppSideNavBar ) ;
92
97
} ,
93
98
} ) ;
94
99
100
+ // register applications with category and use case information
101
+ core . chrome . navGroup . addNavLinksToGroup ( DEFAULT_NAV_GROUPS . observability , [
102
+ {
103
+ id : PLUGIN_NAME ,
104
+ category : DEFAULT_APP_CATEGORIES . detect ,
105
+ showInAllNavGroup : true
106
+ }
107
+ ] )
108
+ core . chrome . navGroup . addNavLinksToGroup ( DEFAULT_NAV_GROUPS [ 'security-analytics' ] , [
109
+ {
110
+ id : PLUGIN_NAME ,
111
+ category : DEFAULT_APP_CATEGORIES . detect ,
112
+ showInAllNavGroup : true
113
+ }
114
+ ] )
115
+
116
+ // register sub applications as standard OSD applications with use case
117
+ if ( core . chrome . navGroup . getNavGroupEnabled ( ) ) {
118
+ core . application . register ( {
119
+ id : OVERVIEW_PAGE_NAV_ID ,
120
+ title : 'Get started' ,
121
+ order : 8040 ,
122
+ category : DEFAULT_APP_CATEGORIES . detect ,
123
+ workspaceAvailability : WorkspaceAvailability . outsideWorkspace ,
124
+ mount : async ( params : AppMountParameters ) => {
125
+ const { renderApp } = await import ( './anomaly_detection_app' ) ;
126
+ const [ coreStart ] = await core . getStartServices ( ) ;
127
+ return renderApp ( coreStart , params , APP_PATH . OVERVIEW , hideInAppSideNavBar ) ;
128
+ } ,
129
+ } ) ;
130
+ }
131
+
132
+ if ( core . chrome . navGroup . getNavGroupEnabled ( ) ) {
133
+ core . application . register ( {
134
+ id : DASHBOARD_PAGE_NAV_ID ,
135
+ title : 'Dashboard' ,
136
+ order : 8040 ,
137
+ category : DEFAULT_APP_CATEGORIES . detect ,
138
+ workspaceAvailability : WorkspaceAvailability . outsideWorkspace ,
139
+ mount : async ( params : AppMountParameters ) => {
140
+ const { renderApp } = await import ( './anomaly_detection_app' ) ;
141
+ const [ coreStart ] = await core . getStartServices ( ) ;
142
+ return renderApp ( coreStart , params , APP_PATH . DASHBOARD , hideInAppSideNavBar ) ;
143
+ } ,
144
+ } ) ;
145
+ }
146
+
147
+ if ( core . chrome . navGroup . getNavGroupEnabled ( ) ) {
148
+ core . application . register ( {
149
+ id : DETECTORS_PAGE_NAV_ID ,
150
+ title : 'Detectors' ,
151
+ order : 8040 ,
152
+ category : DEFAULT_APP_CATEGORIES . detect ,
153
+ workspaceAvailability : WorkspaceAvailability . outsideWorkspace ,
154
+ mount : async ( params : AppMountParameters ) => {
155
+ const { renderApp } = await import ( './anomaly_detection_app' ) ;
156
+ const [ coreStart ] = await core . getStartServices ( ) ;
157
+ return renderApp ( coreStart , params , APP_PATH . LIST_DETECTORS , hideInAppSideNavBar ) ;
158
+ } ,
159
+ } ) ;
160
+ }
161
+
162
+ // link the sub applications to the parent application
163
+ core . chrome . navGroup . addNavLinksToGroup (
164
+ DEFAULT_NAV_GROUPS . observability ,
165
+ [ {
166
+ id : OVERVIEW_PAGE_NAV_ID ,
167
+ parentNavLinkId : PLUGIN_NAME
168
+ } ,
169
+ {
170
+ id : DASHBOARD_PAGE_NAV_ID ,
171
+ parentNavLinkId : PLUGIN_NAME
172
+ } ,
173
+ {
174
+ id : DETECTORS_PAGE_NAV_ID ,
175
+ parentNavLinkId : PLUGIN_NAME
176
+ } ]
177
+ ) ;
178
+
179
+ core . chrome . navGroup . addNavLinksToGroup (
180
+ DEFAULT_NAV_GROUPS [ 'security-analytics' ] ,
181
+ [ {
182
+ id : OVERVIEW_PAGE_NAV_ID ,
183
+ parentNavLinkId : PLUGIN_NAME
184
+ } ,
185
+ {
186
+ id : DASHBOARD_PAGE_NAV_ID ,
187
+ parentNavLinkId : PLUGIN_NAME
188
+ } ,
189
+ {
190
+ id : DETECTORS_PAGE_NAV_ID ,
191
+ parentNavLinkId : PLUGIN_NAME
192
+ } ]
193
+ ) ;
194
+
95
195
setUISettings ( core . uiSettings ) ;
96
196
97
197
// Set the HTTP client so it can be pulled into expression fns to make
0 commit comments