Skip to content

Commit

Permalink
Merge branch 'master' into event-log/query-support
Browse files Browse the repository at this point in the history
* master:
  [HomeApp] Set breadcrumbs when coming back from add data dir (elastic#62186)
  [Lens] fix error for minInterval>computedInterval for XYChart (elastic#61931)
  ci: remove AppArch label from ProBot path-labeler (elastic#62211)
  [Uptime] Optimize get latest monitor API (elastic#61820)
  [Maps] Separate layer wizards for Clusters and heatmap (elastic#60870)
  Remove polling delay (elastic#62099)
  accessibility tests for dashboard panel ( OSS)  (elastic#62055)
  rename README.md to readme, avoiding issues with case change
  [SIEM] [Detection Engine] Fixes all rules sorting (elastic#62039)
  [SIEM] CASES Bugs BC2 (elastic#62170)
  Revert "Endpoint: Add ts-node dev dependency (elastic#61884)" (elastic#62197)
  Closes elastic#60173 by turning off client caching for the main service map API call (elastic#62111)
  [SIEM] Restores the _External alert count_ widget's subtitle (elastic#62094)
  [Maps] Update ems client dependency to 7.8.0 (elastic#62181)
  [Metrics Alerts] Fix action variables, default message, and EU… (elastic#62061)
  Update CODEOWNERS with ES-UI apps, including grok debugger. (elastic#62045)
  Update ILM node attributes blacklist. (elastic#62093)
  • Loading branch information
gmmorris committed Apr 2, 2020
2 parents 1a32a00 + d0e7f98 commit 3cc9ed4
Show file tree
Hide file tree
Showing 100 changed files with 1,428 additions and 1,002 deletions.
14 changes: 10 additions & 4 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -177,17 +177,23 @@
# Elasticsearch UI
/src/plugins/console/ @elastic/es-ui
/src/plugins/es_ui_shared/ @elastic/es-ui
/x-pack/plugins/console_extensions/ @elastic/es-ui
/x-pack/legacy/plugins/cross_cluster_replication/ @elastic/es-ui
/x-pack/legacy/plugins/index_lifecycle_management/ @elastic/es-ui
/x-pack/legacy/plugins/index_management/ @elastic/es-ui
/x-pack/legacy/plugins/license_management/ @elastic/es-ui
/x-pack/plugins/remote_clusters/ @elastic/es-ui
/x-pack/legacy/plugins/rollup/ @elastic/es-ui
/x-pack/plugins/searchprofiler/ @elastic/es-ui
/x-pack/plugins/painless_lab/ @elastic/es-ui
/x-pack/legacy/plugins/snapshot_restore/ @elastic/es-ui
/x-pack/legacy/plugins/upgrade_assistant/ @elastic/es-ui
/x-pack/plugins/console_extensions/ @elastic/es-ui
/x-pack/plugins/es_ui_shared/ @elastic/es-ui
/x-pack/plugins/grokdebugger/ @elastic/es-ui
/x-pack/plugins/index_management/ @elastic/es-ui
/x-pack/plugins/license_management/ @elastic/es-ui
/x-pack/plugins/painless_lab/ @elastic/es-ui
/x-pack/plugins/remote_clusters/ @elastic/es-ui
/x-pack/plugins/rollup/ @elastic/es-ui
/x-pack/plugins/searchprofiler/ @elastic/es-ui
/x-pack/plugins/snapshot_restore/ @elastic/es-ui
/x-pack/plugins/upgrade_assistant/ @elastic/es-ui
/x-pack/plugins/watcher/ @elastic/es-ui

Expand Down
9 changes: 0 additions & 9 deletions .github/paths-labeller.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
---
- "Team:AppArch":
- "src/plugins/bfetch/**/*.*"
- "src/plugins/dashboard_embeddable_container/**/*.*"
- "src/plugins/data/**/*.*"
- "src/plugins/embeddable/**/*.*"
- "src/plugins/expressions/**/*.*"
- "src/plugins/inspector/**/*.*"
- "src/plugins/ui_actions/**/*.*"
- "src/plugins/visualizations/**/*.*"
- "Feature:Embedding":
- "src/plugins/embeddable/**/*.*"
- "src/plugins/dashboard_embeddable_container/**/*.*"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
"@elastic/apm-rum": "^4.6.0",
"@elastic/charts": "^18.1.1",
"@elastic/datemath": "5.0.3",
"@elastic/ems-client": "7.7.1",
"@elastic/ems-client": "7.8.0",
"@elastic/eui": "21.0.1",
"@elastic/filesaver": "1.1.2",
"@elastic/good": "8.1.1-kibana2",
Expand Down
File renamed without changes.
4 changes: 4 additions & 0 deletions src/plugins/home/public/application/components/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import {
EuiPageBody,
EuiScreenReaderOnly,
} from '@elastic/eui';
import { i18n } from '@kbn/i18n';

import { Welcome } from './welcome';
import { getServices } from '../kibana_services';
Expand Down Expand Up @@ -69,6 +70,9 @@ export class Home extends Component {
componentDidMount() {
this._isMounted = true;
this.fetchIsNewKibanaInstance();

const homeTitle = i18n.translate('home.breadcrumbs.homeTitle', { defaultMessage: 'Home' });
getServices().chrome.setBreadcrumbs([{ text: homeTitle }]);
}

fetchIsNewKibanaInstance = async () => {
Expand Down
3 changes: 3 additions & 0 deletions src/plugins/home/public/application/components/home.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ jest.mock('../kibana_services', () => ({
getBasePath: () => 'path',
tutorialVariables: () => ({}),
homeConfig: { disableWelcomeScreen: false },
chrome: {
setBreadcrumbs: () => {},
},
}),
}));

Expand Down
79 changes: 79 additions & 0 deletions test/accessibility/apps/dashboard_panel.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import { FtrProviderContext } from '../ftr_provider_context';

export default function({ getService, getPageObjects }: FtrProviderContext) {
const PageObjects = getPageObjects(['common', 'dashboard', 'header', 'home', 'settings']);
const a11y = getService('a11y');
const dashboardPanelActions = getService('dashboardPanelActions');
const testSubjects = getService('testSubjects');
const inspector = getService('inspector');

describe('Dashboard Panel', () => {
before(async () => {
await PageObjects.common.navigateToUrl('home', 'tutorial_directory/sampleData');
await PageObjects.home.addSampleDataSet('flights');
await PageObjects.common.navigateToApp('dashboard');
await testSubjects.click('dashboardListingTitleLink-[Flights]-Global-Flight-Dashboard');
});

it('dashboard panel open ', async () => {
const header = await dashboardPanelActions.getPanelHeading('[Flights] Airline Carrier');
await dashboardPanelActions.toggleContextMenu(header);
await a11y.testAppSnapshot();
// doing this again will close the Context Menu, so that next snapshot can start clean.
await dashboardPanelActions.toggleContextMenu(header);
});

it('dashboard panel inspect', async () => {
await dashboardPanelActions.openInspectorByTitle('[Flights] Airline Carrier');
await a11y.testAppSnapshot();
});

it('dashboard panel inspector view chooser ', async () => {
await testSubjects.click('inspectorViewChooser');
await a11y.testAppSnapshot();
await testSubjects.click('inspectorViewChooser');
});

it('dashboard panel inspector request statistics ', async () => {
await inspector.openInspectorRequestsView();
await a11y.testAppSnapshot();
});

it('dashboard panel inspector request', async () => {
await testSubjects.click('inspectorRequestDetailRequest');
await a11y.testAppSnapshot();
});

it('dashboard panel inspector response', async () => {
await testSubjects.click('inspectorRequestDetailResponse');
await a11y.testAppSnapshot();
await inspector.close();
});

it('dashboard panel full screen', async () => {
const header = await dashboardPanelActions.getPanelHeading('[Flights] Airline Carrier');
await dashboardPanelActions.toggleContextMenu(header);
await testSubjects.click('embeddablePanelAction-togglePanel');
await a11y.testAppSnapshot();
});
});
}
1 change: 1 addition & 0 deletions test/accessibility/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export default async function({ readConfigFile }: FtrConfigProviderContext) {
testFiles: [
require.resolve('./apps/discover'),
require.resolve('./apps/dashboard'),
require.resolve('./apps/dashboard_panel'),
require.resolve('./apps/visualize'),
require.resolve('./apps/management'),
require.resolve('./apps/console'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export function ServiceMap({ serviceName }: ServiceMapProps) {
const { start, end, environment } = urlParams;
if (start && end) {
return callApmApi({
isCachable: false,
pathname: '/api/apm/service-map',
params: {
query: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export function ServicePage({ newConfig, setNewConfig, onClickNext }: Props) {
callApmApi => {
return callApmApi({
pathname: '/api/apm/settings/agent-configuration/services',
forceCache: true
isCachable: true
});
},
[],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export function useDynamicIndexPattern(
callApmApi => {
return callApmApi({
pathname: '/api/apm/index_pattern/dynamic',
forceCache: true,
isCachable: true,
params: {
query: {
processorEvent
Expand Down
40 changes: 40 additions & 0 deletions x-pack/legacy/plugins/apm/public/services/__test__/callApi.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,46 @@ describe('callApi', () => {

expect(http.get).toHaveBeenCalledTimes(1);
});

it('should not return cached response with `isCachable: false` option', async () => {
await callApi(http, {
isCachable: false,
pathname: `/api/kibana`,
query: { start: '2010', end: '2011' }
});
await callApi(http, {
isCachable: false,
pathname: `/api/kibana`,
query: { start: '2010', end: '2011' }
});
await callApi(http, {
isCachable: false,
pathname: `/api/kibana`,
query: { start: '2010', end: '2011' }
});

expect(http.get).toHaveBeenCalledTimes(3);
});

it('should return cached response with `isCachable: true` option', async () => {
await callApi(http, {
isCachable: true,
pathname: `/api/kibana`,
query: { end: '2030' }
});
await callApi(http, {
isCachable: true,
pathname: `/api/kibana`,
query: { end: '2030' }
});
await callApi(http, {
isCachable: true,
pathname: `/api/kibana`,
query: { end: '2030' }
});

expect(http.get).toHaveBeenCalledTimes(1);
});
});
});
});
6 changes: 3 additions & 3 deletions x-pack/legacy/plugins/apm/public/services/rest/callApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { HttpSetup, HttpFetchOptions } from 'kibana/public';

export type FetchOptions = Omit<HttpFetchOptions, 'body'> & {
pathname: string;
forceCache?: boolean;
isCachable?: boolean;
method?: string;
body?: any;
};
Expand Down Expand Up @@ -74,8 +74,8 @@ export async function callApi<T = void>(
// only cache items that has a time range with `start` and `end` params,
// and where `end` is not a timestamp in the future
function isCachable(fetchOptions: FetchOptions) {
if (fetchOptions.forceCache) {
return true;
if (fetchOptions.isCachable !== undefined) {
return fetchOptions.isCachable;
}

if (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ export const NODE_ATTRS_KEYS_TO_IGNORE: string[] = [
'ml.enabled',
'ml.machine_memory',
'ml.max_open_jobs',
'testattr',
// Used by ML to identify nodes that have transform enabled:
// https://github.com/elastic/elasticsearch/pull/52712/files#diff-225cc2c1291b4c60a8c3412a619094e1R147
'transform.node',
'xpack.installed',
];
Loading

0 comments on commit 3cc9ed4

Please sign in to comment.