Skip to content

Commit

Permalink
Merge branch 'main' into fix_exception_flyout_scroll
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine authored Aug 3, 2022
2 parents e794b65 + 871cd98 commit a42bb3f
Show file tree
Hide file tree
Showing 38 changed files with 693 additions and 195 deletions.
2 changes: 1 addition & 1 deletion fleet_packages.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@
},
{
"name": "synthetics",
"version": "0.9.4"
"version": "0.10.1"
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,8 @@ export function filebeatEnableInstructions(moduleName: string) {
}),
commands: ['./filebeat modules enable ' + moduleName],
textPost: i18n.translate('home.tutorials.common.filebeatEnableInstructions.osxTextPost', {
defaultMessage: 'Modify the settings in the `modules.d/{moduleName}.yml` file.',
defaultMessage:
'Modify the settings in the `modules.d/{moduleName}.yml` file. You must enable at least one fileset.',
values: { moduleName },
}),
},
Expand All @@ -411,7 +412,7 @@ export function filebeatEnableInstructions(moduleName: string) {
commands: ['sudo filebeat modules enable ' + moduleName],
textPost: i18n.translate('home.tutorials.common.filebeatEnableInstructions.debTextPost', {
defaultMessage:
'Modify the settings in the `/etc/filebeat/modules.d/{moduleName}.yml` file.',
'Modify the settings in the `/etc/filebeat/modules.d/{moduleName}.yml` file. You must enable at least one fileset.',
values: { moduleName },
}),
},
Expand All @@ -423,7 +424,7 @@ export function filebeatEnableInstructions(moduleName: string) {
commands: ['sudo filebeat modules enable ' + moduleName],
textPost: i18n.translate('home.tutorials.common.filebeatEnableInstructions.rpmTextPost', {
defaultMessage:
'Modify the settings in the `/etc/filebeat/modules.d/{moduleName}.yml` file.',
'Modify the settings in the `/etc/filebeat/modules.d/{moduleName}.yml` file. You must enable at least one fileset.',
values: { moduleName },
}),
},
Expand All @@ -438,7 +439,8 @@ export function filebeatEnableInstructions(moduleName: string) {
}),
commands: ['filebeat.exe modules enable ' + moduleName],
textPost: i18n.translate('home.tutorials.common.filebeatEnableInstructions.windowsTextPost', {
defaultMessage: 'Modify the settings in the `modules.d/{moduleName}.yml` file.',
defaultMessage:
'Modify the settings in the `modules.d/{moduleName}.yml` file. You must enable at least one fileset.',
values: { moduleName },
}),
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ describe('SavedObjectsFinder', () => {
name: 'Search',
getIconForSavedObject: () => 'search' as IconType,
showSavedObject: () => true,
defaultSearchField: 'name',
},
];

Expand All @@ -73,7 +74,7 @@ describe('SavedObjectsFinder', () => {
search: undefined,
page: 1,
perPage: 10,
searchFields: ['title^3', 'description'],
searchFields: ['title^3', 'description', 'name'],
defaultSearchOperator: 'AND',
});
});
Expand Down Expand Up @@ -228,7 +229,7 @@ describe('SavedObjectsFinder', () => {
search: 'abc*',
page: 1,
perPage: 10,
searchFields: ['title^3', 'description'],
searchFields: ['title^3', 'description', 'name'],
defaultSearchOperator: 'AND',
});
});
Expand Down
10 changes: 9 additions & 1 deletion src/plugins/saved_objects/public/finder/saved_object_finder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export interface SavedObjectMetaData<T = unknown> {
showSavedObject?(savedObject: SimpleSavedObject<T>): boolean;
getSavedObjectSubType?(savedObject: SimpleSavedObject<T>): string;
includeFields?: string[];
defaultSearchField?: string;
}

interface FinderAttributes {
Expand Down Expand Up @@ -125,14 +126,21 @@ class SavedObjectFinderUi extends React.Component<
.map((metaData) => metaData.includeFields || [])
.reduce((allFields, currentFields) => allFields.concat(currentFields), ['title', 'name']);

const additionalSearchFields = Object.values(metaDataMap).reduce<string[]>((col, item) => {
if (item.defaultSearchField) {
col.push(item.defaultSearchField);
}
return col;
}, []);

const perPage = this.props.uiSettings.get(LISTING_LIMIT_SETTING);
const resp = await this.props.savedObjects.client.find<FinderAttributes>({
type: Object.keys(metaDataMap),
fields: [...new Set(fields)],
search: query ? `${query}*` : undefined,
page: 1,
perPage,
searchFields: ['title^3', 'description'],
searchFields: ['title^3', 'description', ...additionalSearchFields],
defaultSearchOperator: 'AND',
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ export class SearchSelection extends React.Component<SearchSelectionProps> {
defaultMessage: 'Data view',
}
),
defaultSearchField: 'name',
},
]}
fixedPageSize={this.fixedPageSize}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,12 @@
import { synthtrace } from '../../../../synthtrace';
import { opbeans } from '../../../fixtures/synthtrace/opbeans';

const settingsPath = '/app/management/kibana/settings';
const serviceOverviewPath = '/app/apm/services/opbeans-python/overview';

const start = '2021-10-10T00:00:00.000Z';
const end = '2021-10-10T00:15:00.000Z';

describe.skip('Infrastracture feature flag', () => {
const infraToggle =
'[data-test-subj="advancedSetting-editField-observability:enableInfrastructureView"]';

describe('Infrastracture feature flag', () => {
before(async () => {
await synthtrace.index(
opbeans({
Expand All @@ -31,17 +27,14 @@ describe.skip('Infrastracture feature flag', () => {
await synthtrace.clean();
});

beforeEach(() => {
cy.loginAsEditorUser();
});

describe('when infrastracture feature is enabled', () => {
it('shows the flag as enabled in kibana advanced settings', () => {
cy.visit(settingsPath);

cy.get(infraToggle)
.should('have.attr', 'aria-checked')
.and('equal', 'true');
beforeEach(() => {
cy.loginAsEditorUser().then(() => {
// enables infrastructure view feature on advanced settings
cy.updateAdvancedSettings({
'observability:enableInfrastructureView': true,
});
});
});

it('shows infrastructure tab in service overview page', () => {
Expand All @@ -51,15 +44,13 @@ describe.skip('Infrastracture feature flag', () => {
});

describe('when infrastracture feature is disabled', () => {
it('shows the flag as disabled in kibana advanced settings', () => {
cy.visit(settingsPath);
cy.get(infraToggle).click();
cy.contains('Save changes').should('not.be.disabled');
cy.contains('Save changes').click();

cy.get(infraToggle)
.should('have.attr', 'aria-checked')
.and('equal', 'false');
beforeEach(() => {
cy.loginAsEditorUser().then(() => {
// enables infrastructure view feature on advanced settings
cy.updateAdvancedSettings({
'observability:enableInfrastructureView': false,
});
});
});

it('hides infrastructure tab in service overview page', () => {
Expand Down
1 change: 1 addition & 0 deletions x-pack/plugins/fleet/common/types/models/epm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,7 @@ export type PackageAssetReference = Pick<SavedObjectReference, 'id'> & {

export interface IndexTemplateMappings {
properties: any;
dynamic_templates?: any;
}

// This is an index template v2, see https://github.com/elastic/elasticsearch/issues/53101
Expand Down

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 @@ -18,7 +18,7 @@ import pRetry from 'p-retry';
const BEFORE_SETUP_TIMEOUT = 30 * 60 * 1000; // 30 minutes;

const DOCKER_START_TIMEOUT = 5 * 60 * 1000; // 5 minutes
const DOCKER_IMAGE = `docker.elastic.co/package-registry/distribution:93ffe45d8c4ae11365bc70b1038643121049b9fe`;
const DOCKER_IMAGE = `docker.elastic.co/package-registry/distribution:433d99a96f3289c5013ae35826877adf408eb9c9`;

function firstWithTimeout(source$: Rx.Observable<any>, errorMsg: string, ms = 30 * 1000) {
return Rx.race(
Expand Down

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 @@ -5,7 +5,7 @@
* 2.0.
*/

import { merge } from 'lodash';
import { merge, concat, uniqBy, omit } from 'lodash';
import Boom from '@hapi/boom';
import type { ElasticsearchClient, Logger } from '@kbn/core/server';

Expand Down Expand Up @@ -241,6 +241,15 @@ function buildComponentTemplates(params: {

const templateSettings = merge(defaultSettings, indexTemplateSettings);

const indexTemplateMappings = registryElasticsearch?.['index_template.mappings'] ?? {};

const mappingsProperties = merge(mappings.properties, indexTemplateMappings.properties ?? {});

const mappingsDynamicTemplates = uniqBy(
concat(mappings.dynamic_templates ?? [], indexTemplateMappings.dynamic_templates ?? []),
(dynampingTemplate) => Object.keys(dynampingTemplate)[0]
);

templatesMap[packageTemplateName] = {
template: {
settings: {
Expand All @@ -256,7 +265,11 @@ function buildComponentTemplates(params: {
},
},
},
mappings: merge(mappings, registryElasticsearch?.['index_template.mappings'] ?? {}),
mappings: {
properties: mappingsProperties,
dynamic_templates: mappingsDynamicTemplates.length ? mappingsDynamicTemplates : undefined,
...omit(indexTemplateMappings, 'properties', 'dynamic_templates'),
},
},
_meta,
};
Expand Down
Loading

0 comments on commit a42bb3f

Please sign in to comment.