forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added integration test for view in app
- Loading branch information
Showing
15 changed files
with
182 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Licensed to Elasticsearch B.V. under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch B.V. licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
import { registerNavigation as registerPeopleInSpaceNavigation } from './astros'; | ||
import { ALERTING_EXAMPLE_APP_ID } from '../../common/constants'; | ||
import { SanitizedAlert } from '../../../../x-pack/plugins/alerting/common'; | ||
import { PluginSetupContract as AlertingSetup } from '../../../../x-pack/plugins/alerting/public'; | ||
|
||
export function registerNavigation(alerting: AlertingSetup) { | ||
// register default navigation | ||
alerting.registerDefaultNavigation( | ||
ALERTING_EXAMPLE_APP_ID, | ||
(alert: SanitizedAlert) => `/alert/${alert.id}` | ||
); | ||
|
||
registerPeopleInSpaceNavigation(alerting); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
x-pack/test/functional_with_es_ssl/fixtures/plugins/alerts/public/application.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import { BrowserRouter as Router, Route, RouteComponentProps } from 'react-router-dom'; | ||
import { EuiPage, EuiText } from '@elastic/eui'; | ||
import { AppMountParameters, CoreStart } from '../../../../../../../src/core/public'; | ||
|
||
export interface AlertingExampleComponentParams { | ||
basename: string; | ||
} | ||
|
||
const AlertingExampleApp = (deps: AlertingExampleComponentParams) => { | ||
const { basename } = deps; | ||
return ( | ||
<Router basename={basename}> | ||
<EuiPage> | ||
<Route | ||
path={`/alert/:id`} | ||
render={(props: RouteComponentProps<{ id: string }>) => { | ||
return ( | ||
<EuiText data-test-subj="noop-title"> | ||
<h2>View Alert {props.match.params.id}</h2> | ||
</EuiText> | ||
); | ||
}} | ||
/> | ||
</EuiPage> | ||
</Router> | ||
); | ||
}; | ||
|
||
export const renderApp = ( | ||
core: CoreStart, | ||
deps: any, | ||
{ appBasePath, element }: AppMountParameters | ||
) => { | ||
ReactDOM.render(<AlertingExampleApp basename={appBasePath} {...deps} />, element); | ||
|
||
return () => ReactDOM.unmountComponentAtNode(element); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters