Skip to content

Commit

Permalink
Merge branch 'main' into alerting/recovery-context-services-2
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine committed Feb 16, 2022
2 parents f1f1469 + 09f8eef commit 31e70c9
Show file tree
Hide file tree
Showing 134 changed files with 1,630 additions and 1,168 deletions.
2 changes: 1 addition & 1 deletion docs/apm/transactions.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ Learn more about a trace sample in the *Metadata* tab:
* User - Requires additional configuration, but allows you to see which user experienced the current transaction.

TIP: All of this data is stored in documents in Elasticsearch.
This means you can select "Actions - View sample document" to see the actual Elasticsearch document under the discover tab.
This means you can select "Actions - View transaction in Discover" to see the actual Elasticsearch document under the discover tab.

*Trace sample logs*

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,14 @@ export const DiscoverGrid = ({

if (!rowCount) {
return (
<div className="euiDataGrid__noResults">
<div
className="euiDataGrid__noResults"
data-render-complete={!isLoading}
data-shared-item=""
data-title={searchTitle}
data-description={searchDescription}
data-document-number={0}
>
<EuiText size="xs" color="subdued">
<EuiIcon type="discoverApp" size="m" color="subdued" />
<EuiSpacer size="s" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
EuiFlyout,
EuiFlyoutBody,
EuiFlyoutHeader,
EuiIconTip,
EuiTitle,
EuiButtonEmpty,
EuiText,
Expand Down Expand Up @@ -147,7 +148,8 @@ export function DiscoverGridFlyout({
</EuiHideFor>
<EuiFlexItem grow={false}>
<EuiButtonEmpty
size="xs"
size="s"
iconSize="s"
iconType="document"
flush="left"
data-test-subj="docTableRowAction"
Expand All @@ -159,19 +161,42 @@ export function DiscoverGridFlyout({
</EuiButtonEmpty>
</EuiFlexItem>
{indexPattern.isTimeBased() && indexPattern.id && (
<EuiFlexItem grow={false}>
<EuiButtonEmpty
size="xs"
iconType="documents"
flush="left"
{...surrDocsProps}
data-test-subj="docTableRowAction"
>
{i18n.translate('discover.grid.tableRow.viewSurroundingDocumentsLinkTextSimple', {
defaultMessage: 'Surrounding documents',
})}
</EuiButtonEmpty>
</EuiFlexItem>
<EuiFlexGroup alignItems="center" responsive={false} gutterSize="none">
<EuiFlexItem grow={false}>
<EuiButtonEmpty
size="s"
iconSize="s"
iconType="documents"
flush="left"
{...surrDocsProps}
data-test-subj="docTableRowAction"
>
{i18n.translate(
'discover.grid.tableRow.viewSurroundingDocumentsLinkTextSimple',
{
defaultMessage: 'Surrounding documents',
}
)}
</EuiButtonEmpty>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiIconTip
content={i18n.translate(
'discover.grid.tableRow.viewSurroundingDocumentsHover',
{
defaultMessage:
'Inspect documents that occurred before and after this document. Only pinned filters remain active in the Surrounding documents view.',
}
)}
type="questionInCircle"
color="subdued"
position="right"
iconProps={{
className: 'eui-alignTop',
}}
/>
</EuiFlexItem>
</EuiFlexGroup>
)}
{activePage !== -1 && (
<EuiFlexItem data-test-subj={`dscDocNavigationPage-${activePage}`}>
Expand Down
8 changes: 7 additions & 1 deletion src/plugins/discover/public/embeddable/saved_search_grid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,13 @@ export function DiscoverGridEmbeddable(props: DiscoverGridEmbeddableProps) {
const [expandedDoc, setExpandedDoc] = useState<ElasticSearchHit | undefined>(undefined);

return (
<EuiFlexGroup style={{ width: '100%' }} direction="column" gutterSize="xs" responsive={false}>
<EuiFlexGroup
style={{ width: '100%' }}
direction="column"
gutterSize="xs"
responsive={false}
data-test-subj="embeddedSavedSearchDocTable"
>
{props.totalHitCount !== 0 && (
<EuiFlexItem grow={false} style={{ alignSelf: 'flex-end' }}>
<TotalDocuments totalHitCount={props.totalHitCount} />
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/discover/server/ui_settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ export const getUiSettings: (docLinks: DocLinksServiceSetup) => Record<string, U
name: i18n.translate('discover.advancedSettings.disableDocumentExplorer', {
defaultMessage: 'Document Explorer or classic view',
}),
value: true,
value: false,
description: i18n.translate('discover.advancedSettings.disableDocumentExplorerDescription', {
defaultMessage:
'To use the new Document Explorer instead of the classic view, turn off this option. ' +
Expand Down
1 change: 1 addition & 0 deletions test/functional/apps/context/_date_nanos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await kibanaServer.uiSettings.update({
'context:defaultSize': `${TEST_DEFAULT_CONTEXT_SIZE}`,
'context:step': `${TEST_STEP_SIZE}`,
'doc_table:legacy': true,
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await kibanaServer.uiSettings.update({
'context:defaultSize': `${TEST_DEFAULT_CONTEXT_SIZE}`,
'context:step': `${TEST_STEP_SIZE}`,
'doc_table:legacy': true,
});
});

Expand Down
9 changes: 9 additions & 0 deletions test/functional/apps/context/_filters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,19 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const docTable = getService('docTable');
const filterBar = getService('filterBar');
const retry = getService('retry');
const kibanaServer = getService('kibanaServer');

const PageObjects = getPageObjects(['common', 'context']);

describe('context filters', function contextSize() {
before(async function () {
await kibanaServer.uiSettings.update({ 'doc_table:legacy': true });
});

after(async function () {
await kibanaServer.uiSettings.replace({});
});

beforeEach(async function () {
await PageObjects.context.navigateTo(TEST_INDEX_PATTERN, TEST_ANCHOR_ID, {
columns: TEST_COLUMN_NAMES,
Expand Down
1 change: 1 addition & 0 deletions test/functional/apps/context/_size.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await kibanaServer.uiSettings.update({
'context:defaultSize': `${TEST_DEFAULT_CONTEXT_SIZE}`,
'context:step': `${TEST_STEP_SIZE}`,
'doc_table:legacy': true,
});
await PageObjects.context.navigateTo(TEST_INDEX_PATTERN, TEST_ANCHOR_ID);
});
Expand Down
4 changes: 2 additions & 2 deletions test/functional/apps/dashboard/dashboard_time_picker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
);
await dashboardExpect.docTableFieldCount(0);
} else {
const initialRows = await dataGrid.getDocTableRows();
expect(initialRows.length).to.above(10);
const docCount = await dataGrid.getDocCount();
expect(docCount).to.above(10);

// Set to time range with no data
await PageObjects.timePicker.setAbsoluteRange(
Expand Down
2 changes: 1 addition & 1 deletion test/functional/apps/dashboard/saved_search_embeddable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const marks = $('mark')
.toArray()
.map((mark) => $(mark).text());
expect(marks.length).to.above(10);
expect(marks.length).to.above(0);
});

it('removing a filter removes highlights', async function () {
Expand Down
8 changes: 3 additions & 5 deletions test/functional/apps/discover/_discover_fields_api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ import { FtrProviderContext } from './ftr_provider_context';

export default function ({ getService, getPageObjects }: FtrProviderContext) {
const log = getService('log');
const docTable = getService('docTable');
const retry = getService('retry');
const esArchiver = getService('esArchiver');
const kibanaServer = getService('kibanaServer');
const PageObjects = getPageObjects(['common', 'discover', 'header', 'timePicker', 'settings']);
const defaultSettings = {
defaultIndex: 'logstash-*',
'discover:searchFieldsFromSource': false,
'doc_table:legacy': true,
};
describe('discover uses fields API test', function describeIndexTests() {
before(async function () {
Expand All @@ -27,13 +27,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover.json');
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional');
await kibanaServer.uiSettings.replace(defaultSettings);
log.debug('discover');
await PageObjects.common.navigateToApp('discover');
await PageObjects.timePicker.setDefaultAbsoluteRange();
});

after(async () => {
await kibanaServer.uiSettings.replace({ 'discover:searchFieldsFromSource': true });
await kibanaServer.uiSettings.replace({});
});

it('should correctly display documents', async function () {
Expand Down Expand Up @@ -61,8 +60,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
});

it('displays _source viewer in doc viewer', async function () {
await docTable.clickRowToggle({ rowIndex: 0 });

await PageObjects.discover.clickDocTableRowToggle(0);
await PageObjects.discover.isShowingDocViewer();
await PageObjects.discover.clickDocViewerTab(1);
await PageObjects.discover.expectSourceViewerToExist();
Expand Down
8 changes: 6 additions & 2 deletions test/functional/apps/discover/_errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,24 @@ import { FtrProviderContext } from '../../ftr_provider_context';

export default function ({ getService, getPageObjects }: FtrProviderContext) {
const esArchiver = getService('esArchiver');
const kibanaServer = getService('kibanaServer');
const toasts = getService('toasts');
const testSubjects = getService('testSubjects');
const PageObjects = getPageObjects(['common', 'header', 'discover', 'timePicker']);

describe('errors', function describeIndexTests() {
before(async function () {
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional');
await esArchiver.load('test/functional/fixtures/es_archiver/invalid_scripted_field');
await kibanaServer.savedObjects.clean({ types: ['search', 'index-pattern'] });
await kibanaServer.importExport.load(
'test/functional/fixtures/kbn_archiver/invalid_scripted_field'
);
await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings();
await PageObjects.common.navigateToApp('discover');
});

after(async function () {
await esArchiver.load('test/functional/fixtures/es_archiver/empty_kibana');
await kibanaServer.savedObjects.clean({ types: ['search', 'index-pattern'] });
});

describe('invalid scripted field error', () => {
Expand Down
Binary file not shown.
Loading

0 comments on commit 31e70c9

Please sign in to comment.