Skip to content

Commit b6e21af

Browse files
Merge branch '7.8' into backport/7.8/pr-66015
2 parents 0b96b3c + 7b3fff1 commit b6e21af

48 files changed

Lines changed: 572 additions & 212 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/visualize/tsvb.asciidoc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,3 +122,17 @@ Edit the source for the Markdown visualization.
122122
. To insert the mustache template variable into the editor, click the variable name.
123123
+
124124
The http://mustache.github.io/mustache.5.html[mustache syntax] uses the Handlebar.js processor, which is an extended version of the Mustache template language.
125+
126+
[float]
127+
[[tsvb-style-markdown]]
128+
==== Style Markdown text
129+
130+
Style your Markdown visualization using http://lesscss.org/features/[less syntax].
131+
132+
. Select *Markdown*.
133+
134+
. Select *Panel options*.
135+
136+
. Enter styling rules in *Custom CSS* section
137+
+
138+
Less in TSVB does not support custom plugins or inline JavaScript.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@
208208
"leaflet-responsive-popup": "0.6.4",
209209
"leaflet-vega": "^0.8.6",
210210
"leaflet.heat": "0.2.0",
211-
"less": "^2.7.3",
211+
"less": "npm:@elastic/less@2.7.3-kibana",
212212
"less-loader": "5.0.0",
213213
"lodash": "npm:@elastic/lodash@3.10.1-kibana4",
214214
"lodash.clonedeep": "^4.5.0",

packages/kbn-es/src/utils/native_realm.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ exports.NativeRealm = class NativeRealm {
7676
}
7777

7878
const reservedUsers = await this.getReservedUsers();
79+
if (!reservedUsers || reservedUsers.length < 1) {
80+
throw new Error('no reserved users found, unable to set native realm passwords');
81+
}
82+
7983
await Promise.all(
8084
reservedUsers.map(async user => {
8185
await this.setPassword(user, options[`password.${user}`]);

src/plugins/console/public/styles/_app.scss

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
// TODO: Move all of the styles here (should be modularised by, e.g., CSS-in-JS or CSS modules).
22
@import '@elastic/eui/src/components/header/variables';
33

4+
// This value is calculated to static value using SCSS because calc in calc has issues in IE11
5+
$headerHeightOffset: $euiHeaderHeightCompensation * 2;
6+
47
#consoleRoot {
5-
height: calc(100vh - calc(#{$euiHeaderChildSize} * 2));
8+
height: calc(100vh - #{$headerHeightOffset});
69
display: flex;
710
flex: 1 1 auto;
811
// Make sure the editor actions don't create scrollbars on this container

src/plugins/vis_type_timeseries/public/application/components/panel_config/markdown.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class MarkdownPanelConfigUi extends Component {
6464
const lessSrc = `#markdown-${model.id} {
6565
${value}
6666
}`;
67-
lessC.render(lessSrc, { compress: true }, (e, output) => {
67+
lessC.render(lessSrc, { compress: true, javascriptEnabled: false }, (e, output) => {
6868
const parts = { markdown_less: value };
6969
if (output) {
7070
parts.markdown_css = output.css;

x-pack/plugins/apm/public/components/app/ServiceMap/cytoscapeOptions.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ export const getSeverityColor = (nodeSeverity: string) => {
1717
switch (nodeSeverity) {
1818
case severity.warning:
1919
return theme.euiColorVis0;
20-
case severity.minor || severity.major:
20+
case severity.minor:
21+
case severity.major:
2122
return theme.euiColorVis5;
2223
case severity.critical:
2324
return theme.euiColorVis9;

x-pack/plugins/drilldowns/public/components/drilldown_hello_bar/drilldown_hello_bar.tsx

Lines changed: 25 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -30,33 +30,30 @@ export const DrilldownHelloBar: React.FC<DrilldownHelloBarProps> = ({
3030
onHideClick = () => {},
3131
}) => {
3232
return (
33-
<EuiCallOut
34-
data-test-subj={WELCOME_MESSAGE_TEST_SUBJ}
35-
title={
36-
<EuiFlexGroup className="drdHelloBar__content">
37-
<EuiFlexItem grow={false}>
38-
<div style={{ marginLeft: '8px' }}>
39-
<EuiIcon type="help" />
40-
</div>
41-
</EuiFlexItem>
42-
<EuiFlexItem grow={true}>
43-
<EuiText size={'s'}>
44-
<EuiTextColor color="subdued">{txtHelpText}</EuiTextColor>
45-
</EuiText>
46-
{docsLink && (
47-
<>
48-
<EuiSpacer size={'xs'} />
49-
<EuiLink href={docsLink}>{txtViewDocsLinkLabel}</EuiLink>
50-
</>
51-
)}
52-
</EuiFlexItem>
53-
<EuiFlexItem grow={false}>
54-
<EuiButtonEmpty size="xs" onClick={onHideClick}>
55-
{txtHideHelpButtonLabel}
56-
</EuiButtonEmpty>
57-
</EuiFlexItem>
58-
</EuiFlexGroup>
59-
}
60-
/>
33+
<EuiCallOut data-test-subj={WELCOME_MESSAGE_TEST_SUBJ}>
34+
<EuiFlexGroup>
35+
<EuiFlexItem grow={false}>
36+
<div style={{ marginLeft: '8px' }}>
37+
<EuiIcon type="help" />
38+
</div>
39+
</EuiFlexItem>
40+
<EuiFlexItem grow={1}>
41+
<EuiText size={'s'}>
42+
<EuiTextColor color="subdued">{txtHelpText}</EuiTextColor>
43+
</EuiText>
44+
{docsLink && (
45+
<>
46+
<EuiSpacer size={'xs'} />
47+
<EuiLink href={docsLink}>{txtViewDocsLinkLabel}</EuiLink>
48+
</>
49+
)}
50+
</EuiFlexItem>
51+
<EuiFlexItem grow={false}>
52+
<EuiButtonEmpty size="xs" onClick={onHideClick}>
53+
{txtHideHelpButtonLabel}
54+
</EuiButtonEmpty>
55+
</EuiFlexItem>
56+
</EuiFlexGroup>
57+
</EuiCallOut>
6158
);
6259
};

x-pack/plugins/infra/public/alerting/metric_threshold/components/expression.tsx

Lines changed: 48 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ export const Expressions: React.FC<Props> = props => {
7171
fetch: alertsContext.http.fetch,
7272
toastWarning: alertsContext.toastNotifications.addWarning,
7373
});
74+
7475
const [timeSize, setTimeSize] = useState<number | undefined>(1);
7576
const [timeUnit, setTimeUnit] = useState<TimeUnit>('m');
7677
const derivedIndexPattern = useMemo(() => createDerivedIndexPattern('metrics'), [
@@ -166,52 +167,57 @@ export const Expressions: React.FC<Props> = props => {
166167
[alertParams.criteria, setAlertParams]
167168
);
168169

169-
useEffect(() => {
170+
const preFillAlertCriteria = useCallback(() => {
170171
const md = alertsContext.metadata;
171-
if (md) {
172-
if (md.currentOptions?.metrics) {
173-
setAlertParams(
174-
'criteria',
175-
md.currentOptions.metrics.map(metric => ({
176-
metric: metric.field,
177-
comparator: Comparator.GT,
178-
threshold: [],
179-
timeSize,
180-
timeUnit,
181-
aggType: metric.aggregation,
182-
}))
183-
);
184-
} else {
185-
setAlertParams('criteria', [defaultExpression]);
186-
}
172+
if (md && md.currentOptions?.metrics) {
173+
setAlertParams(
174+
'criteria',
175+
md.currentOptions.metrics.map(metric => ({
176+
metric: metric.field,
177+
comparator: Comparator.GT,
178+
threshold: [],
179+
timeSize,
180+
timeUnit,
181+
aggType: metric.aggregation,
182+
}))
183+
);
184+
} else {
185+
setAlertParams('criteria', [defaultExpression]);
186+
}
187+
}, [alertsContext.metadata, setAlertParams, timeSize, timeUnit]);
187188

188-
if (md.currentOptions) {
189-
if (md.currentOptions.filterQuery) {
190-
setAlertParams('filterQueryText', md.currentOptions.filterQuery);
191-
setAlertParams(
192-
'filterQuery',
193-
convertKueryToElasticSearchQuery(md.currentOptions.filterQuery, derivedIndexPattern) ||
194-
''
195-
);
196-
} else if (md.currentOptions.groupBy && md.series) {
197-
const filter = `${md.currentOptions.groupBy}: "${md.series.id}"`;
198-
setAlertParams('filterQueryText', filter);
199-
setAlertParams(
200-
'filterQuery',
201-
convertKueryToElasticSearchQuery(filter, derivedIndexPattern) || ''
202-
);
203-
}
189+
const preFillAlertFilter = useCallback(() => {
190+
const md = alertsContext.metadata;
191+
if (md && md.currentOptions?.filterQuery) {
192+
setAlertParams('filterQueryText', md.currentOptions.filterQuery);
193+
setAlertParams(
194+
'filterQuery',
195+
convertKueryToElasticSearchQuery(md.currentOptions.filterQuery, derivedIndexPattern) || ''
196+
);
197+
} else if (md && md.currentOptions?.groupBy && md.series) {
198+
const filter = `${md.currentOptions?.groupBy}: "${md.series.id}"`;
199+
setAlertParams('filterQueryText', filter);
200+
setAlertParams(
201+
'filterQuery',
202+
convertKueryToElasticSearchQuery(filter, derivedIndexPattern) || ''
203+
);
204+
}
205+
}, [alertsContext.metadata, derivedIndexPattern, setAlertParams]);
204206

205-
setAlertParams('groupBy', md.currentOptions.groupBy);
206-
}
207-
setAlertParams('sourceId', source?.id);
207+
useEffect(() => {
208+
if (alertParams.criteria && alertParams.criteria.length) {
209+
setTimeSize(alertParams.criteria[0].timeSize);
210+
setTimeUnit(alertParams.criteria[0].timeUnit);
208211
} else {
209-
if (!alertParams.criteria) {
210-
setAlertParams('criteria', [defaultExpression]);
211-
}
212-
if (!alertParams.sourceId) {
213-
setAlertParams('sourceId', source?.id || 'default');
214-
}
212+
preFillAlertCriteria();
213+
}
214+
215+
if (!alertParams.filterQuery) {
216+
preFillAlertFilter();
217+
}
218+
219+
if (!alertParams.sourceId) {
220+
setAlertParams('sourceId', source?.id || 'default');
215221
}
216222
}, [alertsContext.metadata, defaultExpression, source]); // eslint-disable-line react-hooks/exhaustive-deps
217223

x-pack/plugins/infra/server/lib/alerting/common/utils.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ export const oneOfLiterals = (arrayOfLiterals: Readonly<string[]>) =>
1313
});
1414

1515
export const validateIsStringElasticsearchJSONFilter = (value: string) => {
16+
if (value === '') {
17+
// Allow clearing the filter.
18+
return;
19+
}
20+
1621
const errorMessage = 'filterQuery must be a valid Elasticsearch filter expressed in JSON';
1722
try {
1823
const parsedValue = JSON.parse(value);

x-pack/plugins/ml/common/util/job_utils.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ export function mlFunctionToESAggregation(functionName: string): string | null;
4444

4545
export function isModelPlotEnabled(job: Job, detectorIndex: number, entityFields: any[]): boolean;
4646

47+
export function isModelPlotChartableForDetector(job: Job, detectorIndex: number): boolean;
48+
4749
export function getSafeAggregationName(fieldName: string, index: number): string;
4850

4951
export function getLatestDataOrBucketTimestamp(

0 commit comments

Comments
 (0)