Skip to content

Commit

Permalink
Merge branch 'master' into bug/uri-encode-reload-indices
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine authored Sep 3, 2020
2 parents f8fdb8a + aab8d3c commit be89276
Show file tree
Hide file tree
Showing 13 changed files with 29 additions and 116 deletions.
15 changes: 13 additions & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,19 @@ x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json @elastic/kib
/x-pack/test/functional_with_es_ssl/fixtures/plugins/alerts/ @elastic/kibana-alerting-services

# Enterprise Search
/x-pack/plugins/enterprise_search/ @elastic/app-search-frontend @elastic/workplace-search-frontend
/x-pack/test/functional_enterprise_search/ @elastic/app-search-frontend @elastic/workplace-search-frontend
# Shared
/x-pack/plugins/enterprise_search/ @elastic/enterprise-search-frontend
/x-pack/test/functional_enterprise_search/ @elastic/enterprise-search-frontend
# App Search
/x-pack/plugins/enterprise_search/public/applications/app_search @elastic/app-search-frontend
/x-pack/plugins/enterprise_search/server/routes/app_search @elastic/app-search-frontend
/x-pack/plugins/enterprise_search/server/collectors/app_search @elastic/app-search-frontend
/x-pack/plugins/enterprise_search/server/saved_objects/app_search @elastic/app-search-frontend
# Workplace Search
/x-pack/plugins/enterprise_search/public/applications/workplace_search @elastic/workplace-search-frontend
/x-pack/plugins/enterprise_search/server/routes/workplace_search @elastic/workplace-search-frontend
/x-pack/plugins/enterprise_search/server/collectors/workplace_search @elastic/workplace-search-frontend
/x-pack/plugins/enterprise_search/server/saved_objects/workplace_search @elastic/workplace-search-frontend

# Elasticsearch UI
/src/plugins/dev_tools/ @elastic/es-ui
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,5 @@ export declare class IndexPattern implements IIndexPattern
| [refreshFields()](./kibana-plugin-plugins-data-public.indexpattern.refreshfields.md) | | |
| [removeScriptedField(fieldName)](./kibana-plugin-plugins-data-public.indexpattern.removescriptedfield.md) | | |
| [save(saveAttempts)](./kibana-plugin-plugins-data-public.indexpattern.save.md) | | |
| [toJSON()](./kibana-plugin-plugins-data-public.indexpattern.tojson.md) | | |
| [toSpec()](./kibana-plugin-plugins-data-public.indexpattern.tospec.md) | | |
| [toString()](./kibana-plugin-plugins-data-public.indexpattern.tostring.md) | | |

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,6 @@ describe('IndexPattern', () => {
expect(indexPattern).toHaveProperty('getNonScriptedFields');
expect(indexPattern).toHaveProperty('addScriptedField');
expect(indexPattern).toHaveProperty('removeScriptedField');
expect(indexPattern).toHaveProperty('toString');
expect(indexPattern).toHaveProperty('toJSON');
expect(indexPattern).toHaveProperty('save');

// properties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -650,12 +650,4 @@ export class IndexPattern implements IIndexPattern {
});
});
}

toJSON() {
return this.id;
}

toString() {
return '' + this.toJSON();
}
}
4 changes: 0 additions & 4 deletions src/plugins/data/public/public.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1022,12 +1022,8 @@ export class IndexPattern implements IIndexPattern {
// (undocumented)
title: string;
// (undocumented)
toJSON(): string | undefined;
// (undocumented)
toSpec(): IndexPatternSpec;
// (undocumented)
toString(): string;
// (undocumented)
type: string | undefined;
// (undocumented)
typeMeta?: IndexPatternTypeMeta;
Expand Down
66 changes: 10 additions & 56 deletions x-pack/plugins/lists/common/schemas/common/schemas.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import {
EsDataTypeRangeTerm,
EsDataTypeSingle,
EsDataTypeUnion,
ExceptionListTypeEnum,
OperatorEnum,
Type,
esDataTypeGeoPoint,
esDataTypeGeoPointRange,
Expand All @@ -25,60 +27,10 @@ import {
esDataTypeUnion,
exceptionListType,
operator,
operator_type as operatorType,
type,
} from './schemas';

describe('Common schemas', () => {
describe('operatorType', () => {
test('it should validate for "match"', () => {
const payload = 'match';
const decoded = operatorType.decode(payload);
const message = pipe(decoded, foldLeftRight);

expect(getPaths(left(message.errors))).toEqual([]);
expect(message.schema).toEqual(payload);
});

test('it should validate for "match_any"', () => {
const payload = 'match_any';
const decoded = operatorType.decode(payload);
const message = pipe(decoded, foldLeftRight);

expect(getPaths(left(message.errors))).toEqual([]);
expect(message.schema).toEqual(payload);
});

test('it should validate for "list"', () => {
const payload = 'list';
const decoded = operatorType.decode(payload);
const message = pipe(decoded, foldLeftRight);

expect(getPaths(left(message.errors))).toEqual([]);
expect(message.schema).toEqual(payload);
});

test('it should validate for "exists"', () => {
const payload = 'exists';
const decoded = operatorType.decode(payload);
const message = pipe(decoded, foldLeftRight);

expect(getPaths(left(message.errors))).toEqual([]);
expect(message.schema).toEqual(payload);
});

test('it should contain 4 keys', () => {
// Might seem like a weird test, but its meant to
// ensure that if operatorType is updated, you
// also update the OperatorTypeEnum, a workaround
// for io-ts not yet supporting enums
// https://github.com/gcanti/io-ts/issues/67
const keys = Object.keys(operatorType.keys);

expect(keys.length).toEqual(4);
});
});

describe('operator', () => {
test('it should validate for "included"', () => {
const payload = 'included';
Expand All @@ -98,15 +50,16 @@ describe('Common schemas', () => {
expect(message.schema).toEqual(payload);
});

test('it should contain 2 keys', () => {
test('it should contain same amount of keys as enum', () => {
// Might seem like a weird test, but its meant to
// ensure that if operator is updated, you
// also update the operatorEnum, a workaround
// for io-ts not yet supporting enums
// https://github.com/gcanti/io-ts/issues/67
const keys = Object.keys(operator.keys);
const keys = Object.keys(operator.keys).sort().join(',').toLowerCase();
const enumKeys = Object.keys(OperatorEnum).sort().join(',').toLowerCase();

expect(keys.length).toEqual(2);
expect(keys).toEqual(enumKeys);
});
});

Expand All @@ -129,15 +82,16 @@ describe('Common schemas', () => {
expect(message.schema).toEqual(payload);
});

test('it should contain 2 keys', () => {
test('it should contain same amount of keys as enum', () => {
// Might seem like a weird test, but its meant to
// ensure that if exceptionListType is updated, you
// also update the ExceptionListTypeEnum, a workaround
// for io-ts not yet supporting enums
// https://github.com/gcanti/io-ts/issues/67
const keys = Object.keys(exceptionListType.keys);
const keys = Object.keys(exceptionListType.keys).sort().join(',').toLowerCase();
const enumKeys = Object.keys(ExceptionListTypeEnum).sort().join(',').toLowerCase();

expect(keys.length).toEqual(2);
expect(keys).toEqual(enumKeys);
});
});

Expand Down
7 changes: 0 additions & 7 deletions x-pack/plugins/lists/common/schemas/common/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,13 +282,6 @@ export enum OperatorEnum {
EXCLUDED = 'excluded',
}

export const operator_type = t.keyof({
exists: null,
list: null,
match: null,
match_any: null,
});
export type OperatorType = t.TypeOf<typeof operator_type>;
export enum OperatorTypeEnum {
NESTED = 'nested',
MATCH = 'match',
Expand Down
1 change: 0 additions & 1 deletion x-pack/plugins/lists/common/shared_exports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ export {
NamespaceType,
Operator,
OperatorEnum,
OperatorType,
OperatorTypeEnum,
ExceptionListTypeEnum,
comment,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ import { EuiSpacer, EuiText, EuiTitle, EuiFlexGroup } from '@elastic/eui';
import { IndexPattern } from '../../../../../../../../../src/plugins/data/public';
import { CreateJobLinkCard } from '../../../../components/create_job_link_card';
import { DataRecognizer } from '../../../../components/data_recognizer';
import { getBasePath } from '../../../../util/dependency_cache';

interface Props {
indexPattern: IndexPattern;
}

export const ActionsPanel: FC<Props> = ({ indexPattern }) => {
const [recognizerResultsCount, setRecognizerResultsCount] = useState(0);
const basePath = getBasePath();

const recognizerResults = {
count: 0,
Expand All @@ -31,7 +33,7 @@ export const ActionsPanel: FC<Props> = ({ indexPattern }) => {
function openAdvancedJobWizard() {
// TODO - pass the search string to the advanced job page as well as the index pattern
// (add in with new advanced job wizard?)
window.open(`#/jobs/new_job/advanced?index=${indexPattern}`, '_self');
window.open(`${basePath.get()}/app/ml/jobs/new_job/advanced?index=${indexPattern.id}`, '_self');
}

// Note we use display:none for the DataRecognizer section as it needs to be
Expand Down Expand Up @@ -86,7 +88,7 @@ export const ActionsPanel: FC<Props> = ({ indexPattern }) => {
'Use the full range of options to create a job for more advanced use cases',
})}
onClick={openAdvancedJobWizard}
href={`#/jobs/new_job/advanced?index=${indexPattern}`}
href={`${basePath.get()}/app/ml/jobs/new_job/advanced?index=${indexPattern.id}`}
data-test-subj="mlDataVisualizerCreateAdvancedJobCard"
/>
</div>
Expand Down
1 change: 0 additions & 1 deletion x-pack/plugins/security_solution/common/shared_imports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ export {
NamespaceType,
Operator,
OperatorEnum,
OperatorType,
OperatorTypeEnum,
ExceptionListTypeEnum,
exceptionListItemSchema,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ export default function ({ getService }: FtrProviderContext) {
const reportingAPI = getService('reportingAPI');
const usageAPI = getService('usageAPI');

describe('Usage', () => {
// FAILING: https://github.com/elastic/kibana/issues/76581
describe.skip('Usage', () => {
before(async () => {
await esArchiver.load(OSS_KIBANA_ARCHIVE_PATH);
await esArchiver.load(OSS_DATA_ARCHIVE_PATH);
Expand Down

0 comments on commit be89276

Please sign in to comment.