Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into reporting/client-…
Browse files Browse the repository at this point in the history
…np-migration
  • Loading branch information
Joel Griffith committed Mar 13, 2020
2 parents d3d668c + 526972e commit 61e86ab
Show file tree
Hide file tree
Showing 28 changed files with 291 additions and 271 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
/.es
.DS_Store
.node_binaries
.native_modules
node_modules
!/src/dev/npm/integration_tests/__fixtures__/fixture1/node_modules
!/src/dev/notice/__fixtures__/node_modules
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,6 @@
"pug": "^2.0.4",
"query-string": "5.1.1",
"raw-loader": "3.1.0",
"re2": "1.10.5",
"react": "^16.12.0",
"react-color": "^2.13.8",
"react-dom": "^16.12.0",
Expand Down
2 changes: 0 additions & 2 deletions src/dev/build/build_distributables.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ import {
InstallDependenciesTask,
BuildKibanaPlatformPluginsTask,
OptimizeBuildTask,
PatchNativeModulesTask,
RemovePackageJsonDepsTask,
RemoveWorkspacesTask,
TranspileBabelTask,
Expand Down Expand Up @@ -133,7 +132,6 @@ export async function buildDistributables(options) {
* directories and perform platform-specific steps
*/
await run(CreateArchivesSourcesTask);
await run(PatchNativeModulesTask);
await run(CleanExtraBinScriptsTask);
await run(CleanExtraBrowsersTask);
await run(CleanNodeBuildsTask);
Expand Down
1 change: 0 additions & 1 deletion src/dev/build/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,5 @@ export {
compress,
isFileAccessible,
} from './fs';
export { download } from './download';
export { scanDelete } from './scan_delete';
export { scanCopy } from './scan_copy';
1 change: 0 additions & 1 deletion src/dev/build/tasks/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ export * from './nodejs_modules';
export * from './notice_file_task';
export * from './optimize_task';
export * from './os_packages';
export * from './patch_native_modules_task';
export * from './transpile_babel_task';
export * from './transpile_scss_task';
export * from './verify_env_task';
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import expect from '@kbn/expect';

import * as NodeShasumsNS from '../node_shasums';
import * as NodeDownloadInfoNS from '../node_download_info';
import * as DownloadNS from '../../../lib/download'; // sinon can't stub '../../../lib' properly
import * as DownloadNS from '../download';
import { DownloadNodeBuildsTask } from '../download_node_builds_task';

describe('src/dev/build/tasks/nodejs/download_node_builds_task', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import chalk from 'chalk';
import { createHash } from 'crypto';
import Axios from 'axios';

import { mkdirp } from './fs';
import { mkdirp } from '../../lib';

function tryUnlink(path) {
try {
Expand Down
2 changes: 1 addition & 1 deletion src/dev/build/tasks/nodejs/download_node_builds_task.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import { download } from '../../lib';
import { download } from './download';
import { getNodeShasums } from './node_shasums';
import { getNodeDownloadInfo } from './node_download_info';

Expand Down
85 changes: 0 additions & 85 deletions src/dev/build/tasks/patch_native_modules_task.js

This file was deleted.

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 @@ -217,6 +217,7 @@ export class Table extends PureComponent {
icon: 'pencil',
onClick: editField,
type: 'icon',
'data-test-subj': 'editFieldFormat',
},
],
width: '40px',
Expand Down
5 changes: 1 addition & 4 deletions src/plugins/timelion/server/series_functions/label.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,7 @@ export default new Chainable('label', {
const config = args.byName;
return alter(args, function(eachSeries) {
if (config.regex) {
// not using a standard `import` so that if there's an issue with the re2 native module
// that it doesn't prevent Kibana from starting up and we only have an issue using Timelion labels
const RE2 = require('re2');
eachSeries.label = eachSeries.label.replace(new RE2(config.regex), config.label);
eachSeries.label = eachSeries.label.replace(new RegExp(config.regex), config.label);
} else {
eachSeries.label = config.label;
}
Expand Down
31 changes: 27 additions & 4 deletions test/accessibility/apps/management.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,28 @@ import { FtrProviderContext } from '../ftr_provider_context';

export default function({ getService, getPageObjects }: FtrProviderContext) {
const PageObjects = getPageObjects(['common', 'settings']);

const esArchiver = getService('esArchiver');
const kibanaServer = getService('kibanaServer');
const testSubjects = getService('testSubjects');
const a11y = getService('a11y');

// describe('Management', () => {
// before(async () => {
// await esArchiver.loadIfNeeded('logstash_functional');
// await kibanaServer.uiSettings.update({
// defaultIndex: 'logstash-*',
// });
// await PageObjects.common.navigateToApp('settings');
// });

describe('Management', () => {
before(async () => {
await PageObjects.common.navigateToApp('settings');
await esArchiver.load('discover');
await esArchiver.loadIfNeeded('logstash_functional');
await kibanaServer.uiSettings.update({
defaultIndex: 'logstash-*',
});
await PageObjects.settings.navigateTo();
});

it('main view', async () => {
Expand All @@ -50,8 +65,16 @@ export default function({ getService, getPageObjects }: FtrProviderContext) {
await a11y.testAppSnapshot();
});

it('Saved objects view', async () => {
await PageObjects.settings.clickKibanaSavedObjects();
// index patterns page
it('Navigate back to logstash index page', async () => {
await PageObjects.settings.clickKibanaIndexPatterns();
await PageObjects.settings.clickIndexPatternLogstash();
await a11y.testAppSnapshot();
});

// Issue: https://github.com/elastic/kibana/issues/60030
it.skip('Edit field type', async () => {
await PageObjects.settings.clickEditFieldFormat();
await a11y.testAppSnapshot();
});

Expand Down
4 changes: 4 additions & 0 deletions test/functional/page_objects/settings_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,10 @@ export function SettingsPageProvider({ getService, getPageObjects }: FtrProvider
await testSubjects.click('importSavedObjectsConfirmBtn');
}

async clickEditFieldFormat() {
await testSubjects.click('editFieldFormat');
}

async associateIndexPattern(oldIndexPatternId: string, newIndexPatternTitle: string) {
await find.clickByCssSelector(
`select[data-test-subj="managementChangeIndexSelection-${oldIndexPatternId}"] >
Expand Down
25 changes: 0 additions & 25 deletions x-pack/legacy/plugins/maps/public/layers/fields/ems_file_field.js

This file was deleted.

41 changes: 41 additions & 0 deletions x-pack/legacy/plugins/maps/public/layers/fields/ems_file_field.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* 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 { FIELD_ORIGIN } from '../../../common/constants';
import { IField, AbstractField } from './field';
import { IVectorSource } from '../sources/vector_source';
import { IEmsFileSource } from '../sources/ems_file_source/ems_file_source';

export class EMSFileField extends AbstractField implements IField {
private readonly _source: IEmsFileSource;

constructor({
fieldName,
source,
origin,
}: {
fieldName: string;
source: IEmsFileSource;
origin: FIELD_ORIGIN;
}) {
super({ fieldName, origin });
this._source = source;
}

getSource(): IVectorSource {
return this._source;
}

async getLabel(): Promise<string> {
const emsFileLayer = await this._source.getEMSFileLayer();
// TODO remove any and @ts-ignore when emsFileLayer type defined
// @ts-ignore
const emsFields: any[] = emsFileLayer.getFieldsInLanguage();
// Map EMS field name to language specific label
const emsField = emsFields.find(field => field.name === this.getName());
return emsField ? emsField.description : this.getName();
}
}
21 changes: 6 additions & 15 deletions x-pack/legacy/plugins/maps/public/layers/fields/es_agg_field.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { IField } from './field';
import { AggDescriptor } from '../../../common/descriptor_types';
import { IESAggSource } from '../sources/es_agg_source';
import { IVectorSource } from '../sources/vector_source';
// @ts-ignore
import { ESDocField } from './es_doc_field';
import { AGG_TYPE, FIELD_ORIGIN } from '../../../common/constants';
import { isMetricCountable } from '../util/is_metric_countable';
Expand All @@ -24,13 +23,11 @@ export interface IESAggField extends IField {
}

export class ESAggField implements IESAggField {
static type = 'ES_AGG';

private _source: IESAggSource;
private _origin: FIELD_ORIGIN;
private _label?: string;
private _aggType: AGG_TYPE;
private _esDocField?: unknown;
private _esDocField?: IField | undefined;

constructor({
label,
Expand All @@ -42,7 +39,7 @@ export class ESAggField implements IESAggField {
label?: string;
source: IESAggSource;
aggType: AGG_TYPE;
esDocField?: unknown;
esDocField?: IField;
origin: FIELD_ORIGIN;
}) {
this._source = source;
Expand Down Expand Up @@ -87,8 +84,6 @@ export class ESAggField implements IESAggField {
}

_getESDocFieldName(): string {
// TODO remove when esDocField is typed
// @ts-ignore
return this._esDocField ? this._esDocField.getName() : '';
}

Expand Down Expand Up @@ -127,15 +122,11 @@ export class ESAggField implements IESAggField {
}

async getOrdinalFieldMetaRequest(): Promise<unknown> {
// TODO remove when esDocField is typed
// @ts-ignore
return this._esDocField.getOrdinalFieldMetaRequest();
return this._esDocField ? this._esDocField.getOrdinalFieldMetaRequest() : null;
}

async getCategoricalFieldMetaRequest(): Promise<unknown> {
// TODO remove when esDocField is typed
// @ts-ignore
return this._esDocField.getCategoricalFieldMetaRequest();
return this._esDocField ? this._esDocField.getCategoricalFieldMetaRequest() : null;
}
}

Expand All @@ -147,8 +138,8 @@ export function esAggFieldsFactory(
const aggField = new ESAggField({
label: aggDescriptor.label,
esDocField: aggDescriptor.field
? new ESDocField({ fieldName: aggDescriptor.field, source })
: null,
? new ESDocField({ fieldName: aggDescriptor.field, source, origin })
: undefined,
aggType: aggDescriptor.type,
source,
origin,
Expand Down
Loading

0 comments on commit 61e86ab

Please sign in to comment.