Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into lens/hidden-column
Browse files Browse the repository at this point in the history
  • Loading branch information
flash1293 committed Feb 3, 2021
2 parents 46ec8ac + e108e5b commit 0ec8926
Show file tree
Hide file tree
Showing 15 changed files with 87 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,19 @@ export type GetDataFrameAnalyticsStatsResponse =
| GetDataFrameAnalyticsStatsResponseOk
| GetDataFrameAnalyticsStatsResponseError;

interface GetDataFrameAnalyticsResponse {
export interface GetDataFrameAnalyticsResponse {
count: number;
data_frame_analytics: DataFrameAnalyticsConfig[];
}

interface DeleteDataFrameAnalyticsWithIndexResponse {
export interface DeleteDataFrameAnalyticsWithIndexResponse {
acknowledged: boolean;
analyticsJobDeleted: DeleteDataFrameAnalyticsWithIndexStatus;
destIndexDeleted: DeleteDataFrameAnalyticsWithIndexStatus;
destIndexPatternDeleted: DeleteDataFrameAnalyticsWithIndexStatus;
}
interface JobsExistsResponse {

export interface JobsExistsResponse {
results: {
[jobId: string]: boolean;
};
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/ml/server/models/job_service/error_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export function isRequestTimeout(error: { name: string }) {
return error.name === REQUEST_TIMEOUT_NAME;
}

interface Results {
export interface Results {
[id: string]: {
[status: string]: any;
error?: any;
Expand Down
4 changes: 2 additions & 2 deletions x-pack/plugins/ml/server/models/job_service/groups.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ import { Job } from '../../../common/types/anomaly_detection_jobs';
import { MlJobsResponse } from '../../../common/types/job_service';
import type { MlClient } from '../../lib/ml_client';

interface Group {
export interface Group {
id: string;
jobIds: string[];
calendarIds: string[];
}

interface Results {
export interface Results {
[id: string]: {
success: boolean;
error?: any;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ interface Result {
value: Value;
}

interface ProcessedResults {
export interface ProcessedResults {
success: boolean;
results: Record<number, Result[]>;
totalResults: number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ interface Result {
values: Thing[];
}

interface ProcessedResults {
export interface ProcessedResults {
success: boolean;
results: Record<number, Result[]>;
totalResults: number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { _DOC_COUNT } from '../../../../common/constants/field_types';
import { Aggregation, Field, NewJobCaps } from '../../../../common/types/fields';
import { fieldServiceProvider } from './field_service';

interface NewJobCapsResponse {
export interface NewJobCapsResponse {
[indexPattern: string]: NewJobCaps;
}

Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/ml/server/saved_objects/checks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ interface JobStatus {
};
}

interface StatusResponse {
export interface StatusResponse {
savedObjects: {
[type in JobType]: JobSavedObjectStatus[];
};
Expand Down
34 changes: 34 additions & 0 deletions x-pack/plugins/ml/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"composite": true,
"outDir": "./target/types",
"emitDeclarationOnly": true,
"declaration": true,
"declarationMap": true
},
"include": [
"common/**/*",
"public/**/*",
"server/**/*",
"__mocks__/**/*",
"shared_imports.ts",
"../../../typings/**/*",
// have to declare *.json explicitly due to https://github.com/microsoft/TypeScript/issues/25636
"public/**/*.json",
"server/**/*.json",
],
"references": [
{ "path": "../../../src/core/tsconfig.json" },
{ "path": "../../../src/plugins/embeddable/tsconfig.json" },
{ "path": "../../../src/plugins/index_pattern_management/tsconfig.json" },
{ "path": "../cloud/tsconfig.json" },
{ "path": "../features/tsconfig.json" },
{ "path": "../file_upload/tsconfig.json" },
{ "path": "../license_management/tsconfig.json" },
{ "path": "../licensing/tsconfig.json" },
{ "path": "../maps/tsconfig.json" },
{ "path": "../security/tsconfig.json" },
{ "path": "../spaces/tsconfig.json" },
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ describe('CaseView ', () => {
jest.spyOn(routeData, 'useLocation').mockReturnValue(mockLocation);
useGetCaseUserActionsMock.mockImplementation(() => defaultUseGetCaseUserActions);
usePostPushToServiceMock.mockImplementation(() => ({ isLoading: false, postPushToService }));
useConnectorsMock.mockImplementation(() => ({ connectors: connectorsMock, isLoading: false }));
useConnectorsMock.mockImplementation(() => ({ connectors: connectorsMock, loading: false }));
useQueryAlertsMock.mockImplementation(() => ({
loading: false,
data: { hits: { hits: alertsHit } },
Expand Down Expand Up @@ -705,4 +705,38 @@ describe('CaseView ', () => {
expect(updateObject.updateValue).toEqual({ syncAlerts: false });
});
});

describe('Callouts', () => {
it('it shows the danger callout when a connector has been deleted', async () => {
useConnectorsMock.mockImplementation(() => ({ connectors: [], loading: false }));
const wrapper = mount(
<TestProviders>
<Router history={mockHistory}>
<CaseComponent {...caseProps} />
</Router>
</TestProviders>
);

await waitFor(() => {
wrapper.update();
expect(wrapper.find('.euiCallOut--danger').first().exists()).toBeTruthy();
});
});

it('it does NOT shows the danger callout when connectors are loading', async () => {
useConnectorsMock.mockImplementation(() => ({ connectors: [], loading: true }));
const wrapper = mount(
<TestProviders>
<Router history={mockHistory}>
<CaseComponent {...caseProps} />
</Router>
</TestProviders>
);

await waitFor(() => {
wrapper.update();
expect(wrapper.find('.euiCallOut--danger').first().exists()).toBeFalsy();
});
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ export const CaseComponent = React.memo<CaseProps>(
connectors,
updateCase: handleUpdateCase,
userCanCrud,
isValidConnector,
isValidConnector: isLoadingConnectors ? true : isValidConnector,
alerts,
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
const appsMenu = getService('appsMenu');
const managementMenu = getService('managementMenu');

// FAILING ES PROMOTION: https://github.com/elastic/kibana/issues/89180
describe.skip('security', () => {
describe('security', () => {
before(async () => {
await esArchiver.load('empty_kibana');
await PageObjects.common.navigateToApp('home');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
const appsMenu = getService('appsMenu');
const managementMenu = getService('managementMenu');

// FAILING ES PROMOTION: https://github.com/elastic/kibana/issues/89181
describe.skip('security', () => {
describe('security', () => {
before(async () => {
await esArchiver.load('empty_kibana');
await PageObjects.common.navigateToApp('home');
Expand Down
1 change: 1 addition & 0 deletions x-pack/test/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
{ "path": "../plugins/event_log/tsconfig.json" },
{ "path": "../plugins/licensing/tsconfig.json" },
{ "path": "../plugins/lens/tsconfig.json" },
{ "path": "../plugins/ml/tsconfig.json" },
{ "path": "../plugins/task_manager/tsconfig.json" },
{ "path": "../plugins/telemetry_collection_xpack/tsconfig.json" },
{ "path": "../plugins/triggers_actions_ui/tsconfig.json" },
Expand Down
2 changes: 2 additions & 0 deletions x-pack/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"plugins/maps/**/*",
"plugins/maps_file_upload/**/*",
"plugins/maps_legacy_licensing/**/*",
"plugins/ml/**/*",
"plugins/observability/**/*",
"plugins/reporting/**/*",
"plugins/searchprofiler/**/*",
Expand Down Expand Up @@ -118,6 +119,7 @@
{ "path": "./plugins/maps_file_upload/tsconfig.json" },
{ "path": "./plugins/maps_legacy_licensing/tsconfig.json" },
{ "path": "./plugins/maps/tsconfig.json" },
{ "path": "./plugins/ml/tsconfig.json" },
{ "path": "./plugins/observability/tsconfig.json" },
{ "path": "./plugins/painless_lab/tsconfig.json" },
{ "path": "./plugins/saved_objects_tagging/tsconfig.json" },
Expand Down
1 change: 1 addition & 0 deletions x-pack/tsconfig.refs.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
{ "path": "./plugins/maps_file_upload/tsconfig.json" },
{ "path": "./plugins/maps_legacy_licensing/tsconfig.json" },
{ "path": "./plugins/maps/tsconfig.json" },
{ "path": "./plugins/ml/tsconfig.json" },
{ "path": "./plugins/observability/tsconfig.json" },
{ "path": "./plugins/painless_lab/tsconfig.json" },
{ "path": "./plugins/reporting/tsconfig.json" },
Expand Down

0 comments on commit 0ec8926

Please sign in to comment.