Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
Upgrade Kibana to 7.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
yizheliu-amazon committed Mar 12, 2020
1 parent 19b341d commit a855a7a
Show file tree
Hide file tree
Showing 6 changed files with 231 additions and 106 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,33 +28,33 @@ Please see our [documentation](https://opendistro.github.io/for-elasticsearch-do
See the [Kibana contributing guide](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#setting-up-your-development-environment) for more instructions on setting up your development environment.

1. Change your node version to the version specified in `.node-version` inside the Kibana root directory.
1. Create a `kibana-extra` directory as a sibling directory to the Kibana source code directory.
1. Check out this package from version control into the `kibana-extra` directory.
1. Run `yarn kbn bootstrap` inside `kibana-extra/opendistro-elasticsearch-anomaly-detection-kibana`.
1. Create a `plugins` directory inside the Kibana source code directory, if `plugins` directory doesn't exist.
1. Check out this package from version control into the `plugins` directory.
1. Run `yarn kbn bootstrap` inside `kibana/plugins/anomaly-detection-kibana-plugin`.

Ultimately, your directory structure should look like this:

```md
.
├── kibana
├── kibana-extra
│ └── opendistro-elasticsearch-anomaly-detection-kibana
│ └──plugins
└── anomaly-detection-kibana-plugin
```


## Build

To build the plugin's distributable zip simply run `yarn build`.

Example output: `./build/opendistro-anomaly-detection-1.2.1.0.zip`
Example output: `./build/opendistro-anomaly-detection-1.4.2.0.zip`

## Run

- `yarn start`

Starts Kibana and includes this plugin. Kibana will be available on `localhost:5601`.

- `NODE_PATH=../../kibana/node_modules yarn test:jest`
- `NODE_PATH=../../node_modules yarn test:jest`

Runs the plugin tests.

Expand Down
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
{
"name": "opendistro-anomaly-detection",
"version": "1.2.1.0",
"version": "1.4.2.0",
"description": "Open Distro for Elasticsearch Anomaly Detection Kibana plugin",
"main": "index.js",
"kibana": {
"version": "7.2.1",
"version": "7.4.2",
"templateVersion": "1.0.0"
},
"scripts": {
"kbn": "node ../../kibana/scripts/kbn",
"es": "node ../../kibana/scripts/es",
"kbn": "node ../../scripts/kbn",
"es": "node ../../scripts/es",
"lint": "eslint .",
"start": "plugin-helpers start",
"test:server": "plugin-helpers test:server",
"test:browser": "plugin-helpers test:browser",
"test:jest": "../../kibana/node_modules/.bin/jest --config ./test/jest.config.js",
"test:jest": "../../node_modules/.bin/jest --config ./test/jest.config.js",
"build": "plugin-helpers build",
"release": "./tasks/release.sh"
},
Expand All @@ -30,11 +30,11 @@
"@babel/preset-env": "^7.5.5",
"@babel/preset-react": "^7.0.0",
"@babel/preset-typescript": "^7.3.3",
"@elastic/eslint-config-kibana": "link:../../kibana/packages/eslint-config-kibana",
"@elastic/eslint-import-resolver-kibana": "link:../../kibana/packages/kbn-eslint-import-resolver-kibana",
"@elastic/eslint-config-kibana": "link:../../packages/eslint-config-kibana",
"@elastic/eslint-import-resolver-kibana": "link:../../packages/kbn-eslint-import-resolver-kibana",
"@elastic/eui": "6.10.7",
"@kbn/config-schema": "link:../../kibana/packages/kbn-config-schema",
"@kbn/plugin-helpers": "link:../../kibana/packages/kbn-plugin-helpers",
"@kbn/config-schema": "link:../../packages/kbn-config-schema",
"@kbn/plugin-helpers": "link:../../packages/kbn-plugin-helpers",
"@testing-library/jest-dom": "^4.0.0",
"@testing-library/react": "^8.0.6",
"@testing-library/user-event": "^4.2.3",
Expand Down
13 changes: 8 additions & 5 deletions public/pages/PreviewDetector/containers/AdjustModel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@ export function AdjustModel(props: AdjustModelProps) {
);
}
};
const flyoutStyleTop = props.isSticky ? '111px' : `${224 - props.topOffset}px`;
const flyoutStyle = {
top: flyoutStyleTop,
borderTop: '0px',
height: `calc(100% - ${flyoutStyleTop})`,
};
return (
<Formik
initialValues={getInitialValues(props.detector)}
Expand All @@ -104,18 +110,15 @@ export function AdjustModel(props: AdjustModelProps) {
maxWidth={424}
onClose={props.onClose}
// @ts-ignore
style={{
top: props.isSticky ? '111px' : `${224 - props.topOffset}px`,
borderTop: '0px',
}}
style={flyoutStyle}
className="feature-flyout"
>
<EuiFlyoutHeader hasBorder className="flyout">
<EuiText size="s" className="preview-title" grow={false}>
<h2> Adjust model </h2>
</EuiText>
</EuiFlyoutHeader>
<EuiFlyoutBody className="flyout">
<EuiFlyoutBody style={{ overflowY: 'auto' }} className="flyout">
<FieldArray name="formikFeatures">
{({
unshift,
Expand Down
13 changes: 8 additions & 5 deletions public/pages/PreviewDetector/containers/CreateFeature.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,12 @@ export function CreateFeature(props: CreateFeatureProps) {
formikBag.setSubmitting(false);
}
};
const flyoutStyleTop = props.isSticky ? '111px' : `${224 - props.topOffset}px`;
const flyoutStyle = {
top: flyoutStyleTop,
borderTop: '0px',
height: `calc(100% - ${flyoutStyleTop})`,
};
return (
<React.Fragment>
<Formik
Expand All @@ -177,18 +183,15 @@ export function CreateFeature(props: CreateFeatureProps) {
maxWidth={424}
onClose={props.onClose}
// @ts-ignore
style={{
top: props.isSticky ? '111px' : `${224 - props.topOffset}px`,
borderTop: '0px',
}}
style={flyoutStyle}
className={'feature-flyout'}
>
<EuiFlyoutHeader hasBorder className="flyout">
<EuiTitle size="xs" className="preview-title">
<h5>{values.featureName || 'New feature'}</h5>
</EuiTitle>
</EuiFlyoutHeader>
<EuiFlyoutBody className="flyout">
<EuiFlyoutBody style={{ overflowY: 'auto' }} className="flyout">
<Field name="enabled">
{({ field, form }: FieldProps) => (
<EuiFormRow
Expand Down
14 changes: 7 additions & 7 deletions public/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { get } from 'lodash';
//@ts-ignore
import { isAngularHttpError } from 'ui/notify/lib/format_angular_http_error';
//@ts-ignore
import { getNewPlatform } from 'ui/new_platform';
import { npStart } from 'ui/new_platform';
import { ALERTING_PLUGIN_NAME } from './constants';

export const isInvalid = (name: string, form: any) =>
Expand Down Expand Up @@ -48,8 +48,8 @@ export const getErrorMessage = (err: any, defaultMessage: string) => {

export const isAlertingInstalled = (): boolean => {
const navLinks = get(
getNewPlatform(),
'start.core.chrome.navLinks',
npStart,
'core.chrome.navLinks',
undefined
);
if (navLinks) {
Expand All @@ -64,8 +64,8 @@ export const getAlertingCreateMonitorLink = (
): string => {
try {
const navLinks = get(
getNewPlatform(),
'start.core.chrome.navLinks',
npStart,
'core.chrome.navLinks',
undefined
);
return `${
Expand All @@ -81,8 +81,8 @@ export const getAlertingCreateMonitorLink = (
export const getAlertingMonitorListLink = (): string => {
try {
const navLinks = get(
getNewPlatform(),
'start.core.chrome.navLinks',
npStart,
'core.chrome.navLinks',
undefined
);
return `${navLinks.get(ALERTING_PLUGIN_NAME).url}#/monitors`;
Expand Down
Loading

0 comments on commit a855a7a

Please sign in to comment.