Skip to content

Commit

Permalink
Merge branch 'main' into rulesConnectorsA11yTest
Browse files Browse the repository at this point in the history
  • Loading branch information
bhavyarm authored Nov 16, 2022
2 parents 09d6c16 + 2b143da commit 8f5c830
Show file tree
Hide file tree
Showing 53 changed files with 995 additions and 209 deletions.
7 changes: 3 additions & 4 deletions docs/user/alerting/alerting-troubleshooting.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,11 @@ The result of this HTTP request (and printed to stdout by https://github.com/pmu
[[alerting-error-banners]]
=== Look for error banners

The *Rule Management* and *Rule Details* pages contain an error banner, which helps to identify the errors for the rules:
[role="screenshot"]
image::images/rules-management-health.png[Rule management page with the errors banner]
The **{stack-manage-app}** > *{rules-ui}* page contains an error banner that
helps to identify the errors for the rules:

[role="screenshot"]
image::images/rules-details-health.png[Rule details page with the errors banner]
image::images/rules-management-health.png[Rule management page with the errors banner]

[float]
[[task-manager-diagnostics]]
Expand Down
Binary file removed docs/user/alerting/images/rules-details-health.png
Binary file not shown.
Binary file modified docs/user/alerting/images/rules-management-health.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion examples/field_formats_example/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig.json",
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "./target",
"skipLibCheck": true
Expand Down
2 changes: 1 addition & 1 deletion examples/files_example/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig.json",
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "./target/types"
},
Expand Down
2 changes: 1 addition & 1 deletion examples/hello_world/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig.json",
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "./target/types"
},
Expand Down
2 changes: 1 addition & 1 deletion examples/partial_results_example/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig.json",
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "./target",
"skipLibCheck": true
Expand Down
4 changes: 4 additions & 0 deletions src/dev/typescript/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,4 +174,8 @@ export class Project {
? [this.tsConfigPath, ...this.baseProject.getConfigPaths()]
: [this.tsConfigPath];
}

public getProjectsDeep(): Project[] {
return this.baseProject ? [this, ...this.baseProject.getProjectsDeep()] : [this];
}
}
20 changes: 20 additions & 0 deletions src/dev/typescript/run_check_ts_projects_cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { run } from '@kbn/dev-cli-runner';
import { asyncMapWithLimit } from '@kbn/std';
import { createFailError } from '@kbn/dev-cli-errors';
import { getRepoFiles } from '@kbn/get-repo-files';
import { REPO_ROOT } from '@kbn/utils';
import globby from 'globby';

import { File } from '../file';
Expand All @@ -37,6 +38,25 @@ export async function runCheckTsProjectsCli() {
const stats = new Stats();
let failed = false;

const everyProjectDeep = new Set(PROJECTS.flatMap((p) => p.getProjectsDeep()));
for (const proj of everyProjectDeep) {
const [, ...baseConfigRels] = proj.getConfigPaths().map((p) => Path.relative(REPO_ROOT, p));
const configRel = Path.relative(REPO_ROOT, proj.tsConfigPath);

if (baseConfigRels[0] === 'tsconfig.json') {
failed = true;
log.error(
`[${configRel}]: This tsconfig extends the root tsconfig.json file and shouldn't. The root tsconfig.json file is not a valid base config, you probably want to point to the tsconfig.base.json file.`
);
}
if (configRel !== 'tsconfig.base.json' && !baseConfigRels.includes('tsconfig.base.json')) {
failed = true;
log.error(
`[${configRel}]: This tsconfig does not extend the tsconfig.base.json file either directly or indirectly. The TS config setup for the repo expects every tsconfig file to extend this base config file.`
);
}
}

const pathsAndProjects = await asyncMapWithLimit(PROJECTS, 5, async (proj) => {
const paths = await globby(proj.getIncludePatterns(), {
ignore: proj.getExcludePatterns(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ export function IconPopover({
ownFocus={false}
button={
<StyledButtonIcon
display="fill"
color="ghost"
color="text"
onClick={onClick}
iconType={icon.type}
iconSize={icon.size ?? 'l'}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import { EuiSelectOption } from '@elastic/eui';
import { i18n } from '@kbn/i18n';

import { languageToText } from '../../utils/language_to_text';

export const NEW_INDEX_TEMPLATE_TYPES: { [key: string]: string } = {
api: i18n.translate('xpack.enterpriseSearch.content.newIndex.types.api', {
defaultMessage: 'API endpoint',
Expand Down Expand Up @@ -45,142 +47,67 @@ export const UNIVERSAL_LANGUAGE_VALUE = '';

export const SUPPORTED_LANGUAGES: EuiSelectOption[] = [
{
text: languageToText(UNIVERSAL_LANGUAGE_VALUE),
value: UNIVERSAL_LANGUAGE_VALUE,
text: i18n.translate(
'xpack.enterpriseSearch.content.newIndex.supportedLanguages.universalDropDownOptionLabel',
{
defaultMessage: 'Universal',
}
),
},
{
text: '—',
disabled: true,
text: '—',
},
{
text: languageToText('zh'),
value: 'zh',
text: i18n.translate(
'xpack.enterpriseSearch.content.newIndex.supportedLanguages.chineseDropDownOptionLabel',
{
defaultMessage: 'Chinese',
}
),
},
{
text: languageToText('da'),
value: 'da',
text: i18n.translate(
'xpack.enterpriseSearch.content.newIndex.supportedLanguages.danishDropDownOptionLabel',
{
defaultMessage: 'Danish',
}
),
},
{
text: languageToText('nl'),
value: 'nl',
text: i18n.translate(
'xpack.enterpriseSearch.content.newIndex.supportedLanguages.dutchDropDownOptionLabel',
{
defaultMessage: 'Dutch',
}
),
},
{
text: languageToText('en'),
value: 'en',
text: i18n.translate(
'xpack.enterpriseSearch.content.newIndex.supportedLanguages.englishDropDownOptionLabel',
{
defaultMessage: 'English',
}
),
},
{
text: languageToText('fr'),
value: 'fr',
text: i18n.translate(
'xpack.enterpriseSearch.content.newIndex.supportedLanguages.frenchDropDownOptionLabel',
{
defaultMessage: 'French',
}
),
},
{
text: languageToText('de'),
value: 'de',
text: i18n.translate(
'xpack.enterpriseSearch.content.newIndex.supportedLanguages.germanDropDownOptionLabel',
{
defaultMessage: 'German',
}
),
},
{
text: languageToText('it'),
value: 'it',
text: i18n.translate(
'xpack.enterpriseSearch.content.newIndex.supportedLanguages.italianDropDownOptionLabel',
{
defaultMessage: 'Italian',
}
),
},
{
text: languageToText('ja'),
value: 'ja',
text: i18n.translate(
'xpack.enterpriseSearch.content.newIndex.supportedLanguages.japaneseDropDownOptionLabel',
{
defaultMessage: 'Japanese',
}
),
},
{
text: languageToText('ko'),
value: 'ko',
text: i18n.translate(
'xpack.enterpriseSearch.content.newIndex.supportedLanguages.koreanDropDownOptionLabel',
{
defaultMessage: 'Korean',
}
),
},
{
text: languageToText('pt'),
value: 'pt',
text: i18n.translate(
'xpack.enterpriseSearch.content.newIndex.supportedLanguages.portugueseDropDownOptionLabel',
{
defaultMessage: 'Portuguese',
}
),
},
{
text: languageToText('pt-br'),
value: 'pt-br',
text: i18n.translate(
'xpack.enterpriseSearch.content.newIndex.supportedLanguages.portugueseBrazilDropDownOptionLabel',
{
defaultMessage: 'Portuguese (Brazil)',
}
),
},
{
text: languageToText('ru'),
value: 'ru',
text: i18n.translate(
'xpack.enterpriseSearch.content.newIndex.supportedLanguages.russianDropDownOptionLabel',
{
defaultMessage: 'Russian',
}
),
},
{
text: languageToText('es'),
value: 'es',
text: i18n.translate(
'xpack.enterpriseSearch.content.newIndex.supportedLanguages.spanishDropDownOptionLabel',
{
defaultMessage: 'Spanish',
}
),
},
{
text: languageToText('th'),
value: 'th',
text: i18n.translate(
'xpack.enterpriseSearch.content.newIndex.supportedLanguages.thaiDropDownOptionLabel',
{
defaultMessage: 'Thai',
}
),
},
];
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import { i18n } from '@kbn/i18n';

import { isConnectorIndex } from '../../utils/indices';

import { languageToText } from '../../utils/language_to_text';

import { ConnectorOverviewPanels } from './connector/connector_overview_panels';
import { NATIVE_CONNECTORS } from './connector/constants';
import { NameAndDescriptionStats } from './name_and_description_stats';
Expand Down Expand Up @@ -71,11 +73,7 @@ export const ConnectorTotalStats: React.FC = () => {
}
),
isLoading: hideStats,
title:
indexData.connector.language ??
i18n.translate('xpack.enterpriseSearch.content.searchIndex.totalStats.noneLabel', {
defaultMessage: 'None',
}),
title: languageToText(indexData.connector.language ?? ''),
},
];

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import { i18n } from '@kbn/i18n';

export const UNIVERSAL_LANGUAGE_VALUE = '';

export const languageToTextMap: Record<string, string | undefined> = {
[UNIVERSAL_LANGUAGE_VALUE]: i18n.translate(
'xpack.enterpriseSearch.content.supportedLanguages.universalLabel',
{
defaultMessage: 'Universal',
}
),
da: i18n.translate('xpack.enterpriseSearch.content.supportedLanguages.danishLabel', {
defaultMessage: 'Danish',
}),
de: i18n.translate('xpack.enterpriseSearch.content.supportedLanguages.germanLabel', {
defaultMessage: 'German',
}),
en: i18n.translate('xpack.enterpriseSearch.content.supportedLanguages.englishLabel', {
defaultMessage: 'English',
}),
es: i18n.translate('xpack.enterpriseSearch.content.supportedLanguages.spanishLabel', {
defaultMessage: 'Spanish',
}),

fr: i18n.translate('xpack.enterpriseSearch.content.supportedLanguages.frenchLabel', {
defaultMessage: 'French',
}),

it: i18n.translate('xpack.enterpriseSearch.content.supportedLanguages.italianLabel', {
defaultMessage: 'Italian',
}),
ja: i18n.translate('xpack.enterpriseSearch.content.supportedLanguages.japaneseLabel', {
defaultMessage: 'Japanese',
}),
ko: i18n.translate('xpack.enterpriseSearch.content.supportedLanguages.koreanLabel', {
defaultMessage: 'Korean',
}),

nl: i18n.translate('xpack.enterpriseSearch.content.supportedLanguages.dutchLabel', {
defaultMessage: 'Dutch',
}),
pt: i18n.translate('xpack.enterpriseSearch.content.supportedLanguages.portugueseLabel', {
defaultMessage: 'Portuguese',
}),
'pt-br': i18n.translate(
'xpack.enterpriseSearch.content.supportedLanguages.portugueseBrazilLabel',
{
defaultMessage: 'Portuguese (Brazil)',
}
),
ru: i18n.translate('xpack.enterpriseSearch.content.supportedLanguages.russianLabel', {
defaultMessage: 'Russian',
}),
th: i18n.translate('xpack.enterpriseSearch.content.supportedLanguages.thaiLabel', {
defaultMessage: 'Thai',
}),
zh: i18n.translate('xpack.enterpriseSearch.content.supportedLanguages.chineseLabel', {
defaultMessage: 'Chinese',
}),
};

export function languageToText(input: string): string {
return languageToTextMap[input] ?? input;
}
9 changes: 9 additions & 0 deletions x-pack/plugins/fleet/common/constants/file_storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,12 @@
// found in `common/services/file_storage`
export const FILE_STORAGE_METADATA_INDEX_PATTERN = '.fleet-files-*';
export const FILE_STORAGE_DATA_INDEX_PATTERN = '.fleet-file-data-*';

// which integrations support file upload and the name to use for the file upload index
export const FILE_STORAGE_INTEGRATION_INDEX_NAMES: Readonly<Record<string, string>> = {
elastic_agent: 'agent',
endpoint: 'endpoint',
};
export const FILE_STORAGE_INTEGRATION_NAMES: Readonly<string[]> = Object.keys(
FILE_STORAGE_INTEGRATION_INDEX_NAMES
);
2 changes: 1 addition & 1 deletion x-pack/plugins/fleet/common/experimental_features.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const allowedExperimentalValues = Object.freeze({
createPackagePolicyMultiPageLayout: true,
packageVerification: true,
showDevtoolsRequest: true,
showRequestDiagnostics: false,
diagnosticFileUploadEnabled: false,
});

type ExperimentalConfigKeys = Array<keyof ExperimentalFeatures>;
Expand Down
Loading

0 comments on commit 8f5c830

Please sign in to comment.