Skip to content

Commit

Permalink
[NP migration] Shim ILM (elastic#56068)
Browse files Browse the repository at this point in the history
- Move UI metric constants into public directory.
- Convert server-side code to TS, largely with use of any.
- Remove unused sendPut method from API service.
- Update http error handling to consume NP http service errors.
- Refactor DI pattern of Index Mangement extensions to require various NP service dependencies.
- Inject NP http service into Index Management extensions. Remove dependency upon Angular's $http.
  • Loading branch information
cjcenizal committed Feb 6, 2020
1 parent 0b32cd8 commit d3fb1f1
Show file tree
Hide file tree
Showing 151 changed files with 1,191 additions and 860 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,19 @@
import React from 'react';
import moment from 'moment-timezone';
import { Provider } from 'react-redux';
import { fetchedPolicies, fetchedNodes } from '../../public/store/actions';
import { indexLifecycleManagementStore } from '../../public/store';
import { mountWithIntl } from '../../../../../test_utils/enzyme_helpers';
import { EditPolicy } from '../../public/sections/edit_policy';
// axios has a $http like interface so using it to simulate $http
import axios from 'axios';
import axiosXhrAdapter from 'axios/lib/adapters/xhr';
import { setHttpClient } from '../../public/services/api';
setHttpClient(axios.create({ adapter: axiosXhrAdapter }));
import sinon from 'sinon';
import { findTestSubject } from '@elastic/eui/lib/test';

import { mountWithIntl } from '../../../../../test_utils/enzyme_helpers';
import { fetchedPolicies, fetchedNodes } from '../../public/np_ready/application/store/actions';
import { indexLifecycleManagementStore } from '../../public/np_ready/application/store';
import { EditPolicy } from '../../public/np_ready/application/sections/edit_policy';
import { init as initHttp } from '../../public/np_ready/application/services/http';
import { init as initUiMetric } from '../../public/np_ready/application/services/ui_metric';
import { init as initNotification } from '../../public/np_ready/application/services/notification';
import {
positiveNumbersAboveZeroErrorMessage,
positiveNumberRequiredMessage,
Expand All @@ -31,7 +33,13 @@ import {
policyNameMustBeDifferentErrorMessage,
policyNameAlreadyUsedErrorMessage,
maximumDocumentsRequiredMessage,
} from '../../public/store/selectors/lifecycle';
} from '../../public/np_ready/application/store/selectors/lifecycle';

initHttp(axios.create({ adapter: axiosXhrAdapter }), path => path);
initUiMetric(() => () => {});
initNotification({
addDanger: () => {},
});

jest.mock('ui/new_platform');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,24 @@
import moment from 'moment-timezone';
import React from 'react';
import { Provider } from 'react-redux';
import { fetchedPolicies } from '../../public/store/actions';
import { indexLifecycleManagementStore } from '../../public/store';
import { mountWithIntl } from '../../../../../test_utils/enzyme_helpers';
import { PolicyTable } from '../../public/sections/policy_table';
import { findTestSubject, takeMountedSnapshot } from '@elastic/eui/lib/test';
// axios has a $http like interface so using it to simulate $http
import axios from 'axios';
import axiosXhrAdapter from 'axios/lib/adapters/xhr';
import { setHttpClient } from '../../public/services/api';
setHttpClient(axios.create({ adapter: axiosXhrAdapter }));
import sinon from 'sinon';
import { findTestSubject, takeMountedSnapshot } from '@elastic/eui/lib/test';

import { mountWithIntl } from '../../../../../test_utils/enzyme_helpers';
import { fetchedPolicies } from '../../public/np_ready/application/store/actions';
import { indexLifecycleManagementStore } from '../../public/np_ready/application/store';
import { PolicyTable } from '../../public/np_ready/application/sections/policy_table';
import { init as initHttp } from '../../public/np_ready/application/services/http';
import { init as initUiMetric } from '../../public/np_ready/application/services/ui_metric';

initHttp(axios.create({ adapter: axiosXhrAdapter }), path => path);
initUiMetric(() => () => {});

jest.mock('ui/new_platform');

let server = null;

let store = null;
Expand Down
Loading

0 comments on commit d3fb1f1

Please sign in to comment.