Skip to content

Commit

Permalink
Merge branch 'master' of github.com:elastic/kibana into spaces/remove…
Browse files Browse the repository at this point in the history
…-legacy-plugin
  • Loading branch information
legrego committed Sep 17, 2020
2 parents 5cf4614 + 9c90c14 commit d8a9bae
Show file tree
Hide file tree
Showing 127 changed files with 7,602 additions and 2,009 deletions.
4 changes: 1 addition & 3 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@

# Security
/src/core/server/csp/ @elastic/kibana-security @elastic/kibana-platform
/x-pack/legacy/plugins/security/ @elastic/kibana-security
/x-pack/plugins/spaces/ @elastic/kibana-security
/x-pack/plugins/encrypted_saved_objects/ @elastic/kibana-security
/x-pack/plugins/security/ @elastic/kibana-security
Expand Down Expand Up @@ -286,7 +285,6 @@ x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json @elastic/kib
/src/plugins/dashboard/**/*.scss @elastic/kibana-core-ui-designers
/x-pack/plugins/canvas/**/*.scss @elastic/kibana-core-ui-designers
/src/legacy/core_plugins/kibana/public/home/**/*.scss @elastic/kibana-core-ui-designers
/x-pack/legacy/plugins/security/**/*.scss @elastic/kibana-core-ui-designers
/x-pack/legacy/plugins/spaces/**/*.scss @elastic/kibana-core-ui-designers
/x-pack/plugins/spaces/**/*.scss @elastic/kibana-core-ui-designers
/x-pack/plugins/security/**/*.scss @elastic/kibana-core-ui-designers
Expand All @@ -296,7 +294,7 @@ x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json @elastic/kib
/x-pack/plugins/infra/**/*.scss @elastic/observability-design
/x-pack/plugins/ingest_manager/**/*.scss @elastic/observability-design
/x-pack/plugins/observability/**/*.scss @elastic/observability-design
/x-pack/plugins/monitoring/**/*.scss @elastic/observability-design
/x-pack/plugins/monitoring/**/*.scss @elastic/observability-design

# Ent. Search design
/x-pack/plugins/enterprise_search/**/*.scss @elastic/ent-search-design
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -546,13 +546,16 @@ export class QueryStringInputUI extends Component<Props, State> {
this.updateSuggestions.cancel();
this.componentIsUnmounting = true;
window.removeEventListener('resize', this.handleAutoHeight);
window.removeEventListener('scroll', this.handleListUpdate);
window.removeEventListener('scroll', this.handleListUpdate, { capture: true });
}

handleListUpdate = () =>
this.setState({
handleListUpdate = () => {
if (this.componentIsUnmounting) return;

return this.setState({
queryBarRect: this.queryBarInputDivRefInstance.current?.getBoundingClientRect(),
});
};

handleAutoHeight = () => {
if (this.inputRef !== null && document.activeElement === this.inputRef) {
Expand Down
9 changes: 8 additions & 1 deletion src/plugins/telemetry/server/routes/telemetry_opt_in.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {
StatsGetterConfig,
TelemetryCollectionManagerPluginSetup,
} from 'src/plugins/telemetry_collection_manager/server';
import { SavedObjectsErrorHelpers } from '../../../../core/server';
import { getTelemetryAllowChangingOptInStatus } from '../../common/telemetry_config';
import { sendTelemetryOptInStatus } from './telemetry_opt_in_stats';

Expand Down Expand Up @@ -109,7 +110,13 @@ export function registerTelemetryOptInRoutes({
});
}

await updateTelemetrySavedObject(context.core.savedObjects.client, attributes);
try {
await updateTelemetrySavedObject(context.core.savedObjects.client, attributes);
} catch (e) {
if (SavedObjectsErrorHelpers.isForbiddenError(e)) {
return res.forbidden();
}
}
return res.ok({ body: optInStatus });
}
);
Expand Down
10 changes: 5 additions & 5 deletions src/plugins/vis_type_timeseries/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { PluginInitializerContext, PluginConfigDescriptor } from 'src/core/serve
import { VisTypeTimeseriesConfig, config as configSchema } from './config';
import { VisTypeTimeseriesPlugin } from './plugin';

export { VisTypeTimeseriesSetup, Framework } from './plugin';
export { VisTypeTimeseriesSetup } from './plugin';

export const config: PluginConfigDescriptor<VisTypeTimeseriesConfig> = {
deprecations: ({ unused, renameFromRoot }) => [
Expand All @@ -39,10 +39,10 @@ export const config: PluginConfigDescriptor<VisTypeTimeseriesConfig> = {

export { ValidationTelemetryServiceSetup } from './validation_telemetry';

// @ts-ignore
export { AbstractSearchStrategy } from './lib/search_strategies/strategies/abstract_search_strategy';
// @ts-ignore
export { AbstractSearchRequest } from './lib/search_strategies/search_requests/abstract_request';
export {
AbstractSearchStrategy,
ReqFacade,
} from './lib/search_strategies/strategies/abstract_search_strategy';
// @ts-ignore
export { DefaultSearchCapabilities } from './lib/search_strategies/default_search_capabilities';

Expand Down
17 changes: 1 addition & 16 deletions src/plugins/vis_type_timeseries/server/lib/get_fields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export async function getFields(
// level object passed from here. The layers should be refactored fully at some point, but for now
// this works and we are still using the New Platform services for these vis data portions.
const reqFacade: ReqFacade = {
requestContext,
...request,
framework,
payload: {},
Expand All @@ -48,22 +49,6 @@ export async function getFields(
},
getUiSettingsService: () => requestContext.core.uiSettings.client,
getSavedObjectsClient: () => requestContext.core.savedObjects.client,
server: {
plugins: {
elasticsearch: {
getCluster: () => {
return {
callWithRequest: async (req: any, endpoint: string, params: any) => {
return await requestContext.core.elasticsearch.legacy.client.callAsCurrentUser(
endpoint,
params
);
},
};
},
},
},
},
getEsShardTimeout: async () => {
return await framework.globalConfig$
.pipe(
Expand Down
19 changes: 2 additions & 17 deletions src/plugins/vis_type_timeseries/server/lib/get_vis_data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { FakeRequest, RequestHandlerContext } from 'kibana/server';
import _ from 'lodash';
import { first, map } from 'rxjs/operators';
import { getPanelData } from './vis_data/get_panel_data';
import { Framework } from '../index';
import { Framework } from '../plugin';
import { ReqFacade } from './search_strategies/strategies/abstract_search_strategy';

interface GetVisDataResponse {
Expand Down Expand Up @@ -65,28 +65,13 @@ export function getVisData(
// level object passed from here. The layers should be refactored fully at some point, but for now
// this works and we are still using the New Platform services for these vis data portions.
const reqFacade: ReqFacade = {
requestContext,
...request,
framework,
pre: {},
payload: request.body,
getUiSettingsService: () => requestContext.core.uiSettings.client,
getSavedObjectsClient: () => requestContext.core.savedObjects.client,
server: {
plugins: {
elasticsearch: {
getCluster: () => {
return {
callWithRequest: async (req: any, endpoint: string, params: any) => {
return await requestContext.core.elasticsearch.legacy.client.callAsCurrentUser(
endpoint,
params
);
},
};
},
},
},
},
getEsShardTimeout: async () => {
return await framework.globalConfig$
.pipe(
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit d8a9bae

Please sign in to comment.