Skip to content

Commit b182503

Browse files
Merge branch '7.x' into backport/7.x/pr-48268
2 parents f2be023 + 8d265f3 commit b182503

File tree

83 files changed

+513
-781
lines changed

Some content is hidden

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

83 files changed

+513
-781
lines changed

docs/api/features/get.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ experimental[] Retrieves all {kib} features.
99
[[features-api-get-request]]
1010
==== Request
1111

12-
`/api/features/v1`
12+
`/api/features`
1313

1414
[[features-api-get-codes]]
1515
==== Response code

src/legacy/core_plugins/kibana/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,9 +329,9 @@ export default function (kibana) {
329329
}
330330
},
331331

332-
init: function (server) {
332+
init: async function (server) {
333333
// uuid
334-
manageUuid(server);
334+
await manageUuid(server);
335335
// routes
336336
searchApi(server);
337337
scriptsApi(server);

src/legacy/core_plugins/kibana/public/home/components/__snapshots__/add_data.test.js.snap

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/legacy/core_plugins/kibana/public/home/components/add_data.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const AddDataUi = ({ apmUiEnabled, isNewKibanaInstance, intl, mlEnabled }) => {
5858
const loggingData = {
5959
title: intl.formatMessage({
6060
id: 'kbn.home.addData.logging.nameTitle',
61-
defaultMessage: 'Logging',
61+
defaultMessage: 'Logs',
6262
}),
6363
description: intl.formatMessage({
6464
id: 'kbn.home.addData.logging.nameDescription',

src/legacy/core_plugins/kibana/public/home/components/tutorial_directory.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class TutorialDirectoryUi extends React.Component {
6464
id: 'logging',
6565
name: this.props.intl.formatMessage({
6666
id: 'kbn.home.tutorial.tabs.loggingTitle',
67-
defaultMessage: 'Logging',
67+
defaultMessage: 'Logs',
6868
}),
6969
},
7070
{

src/plugins/kibana_react/public/saved_objects/saved_object_save_modal.tsx

Lines changed: 45 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
* under the License.
1818
*/
1919
import {
20+
htmlIdGenerator,
2021
EuiButton,
2122
EuiButtonEmpty,
2223
EuiCallOut,
@@ -67,7 +68,10 @@ interface State {
6768
visualizationDescription: string;
6869
}
6970

71+
const generateId = htmlIdGenerator();
72+
7073
export class SavedObjectSaveModal extends React.Component<Props, State> {
74+
private warning = React.createRef<HTMLDivElement>();
7175
public readonly state = {
7276
title: this.props.title,
7377
copyOnSave: false,
@@ -79,6 +83,7 @@ export class SavedObjectSaveModal extends React.Component<Props, State> {
7983

8084
public render() {
8185
const { isTitleDuplicateConfirmed, hasTitleDuplicate, title } = this.state;
86+
const duplicateWarningId = generateId();
8287

8388
return (
8489
<EuiOverlayMask>
@@ -99,7 +104,7 @@ export class SavedObjectSaveModal extends React.Component<Props, State> {
99104
</EuiModalHeader>
100105

101106
<EuiModalBody>
102-
{this.renderDuplicateTitleCallout()}
107+
{this.renderDuplicateTitleCallout(duplicateWarningId)}
103108

104109
<EuiForm>
105110
{this.props.objectType !== VISUALIZE_EMBEDDABLE_TYPE && this.props.description && (
@@ -127,6 +132,7 @@ export class SavedObjectSaveModal extends React.Component<Props, State> {
127132
isInvalid={
128133
(!isTitleDuplicateConfirmed && hasTitleDuplicate) || title.length === 0
129134
}
135+
aria-describedby={this.state.hasTitleDuplicate ? duplicateWarningId : undefined}
130136
/>
131137
</EuiFormRow>
132138

@@ -188,6 +194,10 @@ export class SavedObjectSaveModal extends React.Component<Props, State> {
188194
isTitleDuplicateConfirmed: true,
189195
hasTitleDuplicate: true,
190196
});
197+
198+
if (this.warning.current) {
199+
this.warning.current.focus();
200+
}
191201
};
192202

193203
private saveSavedObject = async () => {
@@ -255,43 +265,46 @@ export class SavedObjectSaveModal extends React.Component<Props, State> {
255265
);
256266
};
257267

258-
private renderDuplicateTitleCallout = () => {
268+
private renderDuplicateTitleCallout = (duplicateWarningId: string) => {
259269
if (!this.state.hasTitleDuplicate) {
260270
return;
261271
}
262272

263273
return (
264274
<>
265-
<EuiCallOut
266-
title={
267-
<FormattedMessage
268-
id="kibana-react.savedObjects.saveModal.duplicateTitleLabel"
269-
defaultMessage="A {objectType} with the title '{title}' already exists"
270-
values={{ objectType: this.props.objectType, title: this.state.title }}
271-
/>
272-
}
273-
color="warning"
274-
data-test-subj="titleDupicateWarnMsg"
275-
>
276-
<p>
277-
<FormattedMessage
278-
id="kibana-react.savedObjects.saveModal.duplicateTitleDescription"
279-
defaultMessage="Clicking {confirmSaveLabel} overwrites the existing {objectType}."
280-
values={{
281-
objectType: this.props.objectType,
282-
confirmSaveLabel: (
283-
<strong>
284-
{this.props.confirmButtonLabel
285-
? this.props.confirmButtonLabel
286-
: i18n.translate('kibana-react.savedObjects.saveModal.saveButtonLabel', {
287-
defaultMessage: 'Save',
288-
})}
289-
</strong>
290-
),
291-
}}
292-
/>
293-
</p>
294-
</EuiCallOut>
275+
<div ref={this.warning} tabIndex={-1}>
276+
<EuiCallOut
277+
title={
278+
<FormattedMessage
279+
id="kibana-react.savedObjects.saveModal.duplicateTitleLabel"
280+
defaultMessage="A {objectType} with the title '{title}' already exists"
281+
values={{ objectType: this.props.objectType, title: this.state.title }}
282+
/>
283+
}
284+
color="warning"
285+
data-test-subj="titleDupicateWarnMsg"
286+
id={duplicateWarningId}
287+
>
288+
<p>
289+
<FormattedMessage
290+
id="kibana-react.savedObjects.saveModal.duplicateTitleDescription"
291+
defaultMessage="Clicking {confirmSaveLabel} overwrites the existing {objectType}."
292+
values={{
293+
objectType: this.props.objectType,
294+
confirmSaveLabel: (
295+
<strong>
296+
{this.props.confirmButtonLabel
297+
? this.props.confirmButtonLabel
298+
: i18n.translate('kibana-react.savedObjects.saveModal.saveButtonLabel', {
299+
defaultMessage: 'Save',
300+
})}
301+
</strong>
302+
),
303+
}}
304+
/>
305+
</p>
306+
</EuiCallOut>
307+
</div>
295308
<EuiSpacer />
296309
</>
297310
);

x-pack/legacy/plugins/canvas/public/components/workpad_header/control_settings/auto_refresh_controls.tsx

Lines changed: 84 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,22 @@
44
* you may not use this file except in compliance with the Elastic License.
55
*/
66

7-
import React, { Fragment, ReactNode } from 'react';
7+
import React, { ReactNode } from 'react';
88
import PropTypes from 'prop-types';
99
import {
1010
EuiFlexGroup,
11-
EuiFlexGrid,
1211
EuiFlexItem,
1312
EuiLink,
1413
EuiSpacer,
1514
EuiHorizontalRule,
1615
EuiDescriptionList,
1716
EuiDescriptionListTitle,
1817
EuiDescriptionListDescription,
19-
EuiFormLabel,
18+
EuiTitle,
2019
EuiText,
2120
EuiButtonIcon,
2221
EuiToolTip,
22+
htmlIdGenerator,
2323
} from '@elastic/eui';
2424
import { timeDuration } from '../../../lib/time_duration';
2525
import { RefreshControl } from '../refresh_control';
@@ -37,26 +37,36 @@ interface Props {
3737
}
3838

3939
interface ListGroupProps {
40+
'aria-labelledby': string;
41+
className: string;
4042
children: ReactNode;
4143
}
4244

4345
interface RefreshItemProps {
4446
duration: number;
4547
label: string;
48+
descriptionId: string;
4649
}
4750

48-
const ListGroup = ({ children }: ListGroupProps) => (
49-
<ul style={{ listStyle: 'none', margin: 0 }}>{[children]}</ul>
51+
const ListGroup = ({ children, ...rest }: ListGroupProps) => (
52+
<ul style={{ listStyle: 'none', margin: 0 }} {...rest}>
53+
{[children]}
54+
</ul>
5055
);
5156

57+
const generateId = htmlIdGenerator();
58+
5259
export const AutoRefreshControls = ({ refreshInterval, setRefresh, disableInterval }: Props) => {
53-
const RefreshItem = ({ duration, label }: RefreshItemProps) => (
60+
const RefreshItem = ({ duration, label, descriptionId }: RefreshItemProps) => (
5461
<li>
55-
<EuiLink onClick={() => setRefresh(duration)}>{label}</EuiLink>
62+
<EuiLink onClick={() => setRefresh(duration)} aria-describedby={descriptionId}>
63+
{label}
64+
</EuiLink>
5665
</li>
5766
);
5867

5968
const interval = timeDuration(refreshInterval);
69+
const intervalTitleId = generateId();
6070

6171
return (
6272
<EuiFlexGroup direction="column" justifyContent="spaceBetween">
@@ -67,11 +77,9 @@ export const AutoRefreshControls = ({ refreshInterval, setRefresh, disableInterv
6777
<EuiDescriptionListTitle>{strings.getRefreshListTitle()}</EuiDescriptionListTitle>
6878
<EuiDescriptionListDescription>
6979
{refreshInterval > 0 ? (
70-
<Fragment>
71-
<span>{timeStrings.getCycleTimeText(interval.length, interval.format)}</span>
72-
</Fragment>
80+
<>{timeStrings.getCycleTimeText(interval.length, interval.format)}</>
7381
) : (
74-
<span>{strings.getRefreshListDurationManualText()}</span>
82+
<>{strings.getRefreshListDurationManualText()}</>
7583
)}
7684
</EuiDescriptionListDescription>
7785
</EuiDescriptionList>
@@ -98,31 +106,73 @@ export const AutoRefreshControls = ({ refreshInterval, setRefresh, disableInterv
98106

99107
<EuiHorizontalRule margin="m" />
100108

101-
<EuiFormLabel>{strings.getIntervalFormLabelText()}</EuiFormLabel>
109+
<EuiTitle size="xxxs" id={intervalTitleId}>
110+
<p>{strings.getIntervalFormLabelText()}</p>
111+
</EuiTitle>
102112
<EuiSpacer size="s" />
103113
<EuiText size="s">
104-
<EuiFlexGrid gutterSize="s" columns={2}>
105-
<EuiFlexItem>
106-
<ListGroup>
107-
<RefreshItem duration={5000} label={getSecondsText(5)} />
108-
<RefreshItem duration={15000} label={getSecondsText(15)} />
109-
<RefreshItem duration={30000} label={getSecondsText(30)} />
110-
<RefreshItem duration={60000} label={getMinutesText(1)} />
111-
<RefreshItem duration={300000} label={getMinutesText(5)} />
112-
<RefreshItem duration={900000} label={getMinutesText(15)} />
113-
</ListGroup>
114-
</EuiFlexItem>
115-
<EuiFlexItem>
116-
<ListGroup>
117-
<RefreshItem duration={1800000} label={getMinutesText(30)} />
118-
<RefreshItem duration={3600000} label={getHoursText(1)} />
119-
<RefreshItem duration={7200000} label={getHoursText(2)} />
120-
<RefreshItem duration={21600000} label={getHoursText(6)} />
121-
<RefreshItem duration={43200000} label={getHoursText(12)} />
122-
<RefreshItem duration={86400000} label={getHoursText(24)} />
123-
</ListGroup>
124-
</EuiFlexItem>
125-
</EuiFlexGrid>
114+
<ListGroup aria-labelledby={intervalTitleId} className="canvasControlSettings__list">
115+
<RefreshItem
116+
duration={5000}
117+
label={getSecondsText(5)}
118+
descriptionId={intervalTitleId}
119+
/>
120+
<RefreshItem
121+
duration={15000}
122+
label={getSecondsText(15)}
123+
descriptionId={intervalTitleId}
124+
/>
125+
<RefreshItem
126+
duration={30000}
127+
label={getSecondsText(30)}
128+
descriptionId={intervalTitleId}
129+
/>
130+
<RefreshItem
131+
duration={60000}
132+
label={getMinutesText(1)}
133+
descriptionId={intervalTitleId}
134+
/>
135+
<RefreshItem
136+
duration={300000}
137+
label={getMinutesText(5)}
138+
descriptionId={intervalTitleId}
139+
/>
140+
<RefreshItem
141+
duration={900000}
142+
label={getMinutesText(15)}
143+
descriptionId={intervalTitleId}
144+
/>
145+
<RefreshItem
146+
duration={1800000}
147+
label={getMinutesText(30)}
148+
descriptionId={intervalTitleId}
149+
/>
150+
<RefreshItem
151+
duration={3600000}
152+
label={getHoursText(1)}
153+
descriptionId={intervalTitleId}
154+
/>
155+
<RefreshItem
156+
duration={7200000}
157+
label={getHoursText(2)}
158+
descriptionId={intervalTitleId}
159+
/>
160+
<RefreshItem
161+
duration={21600000}
162+
label={getHoursText(6)}
163+
descriptionId={intervalTitleId}
164+
/>
165+
<RefreshItem
166+
duration={43200000}
167+
label={getHoursText(12)}
168+
descriptionId={intervalTitleId}
169+
/>
170+
<RefreshItem
171+
duration={86400000}
172+
label={getHoursText(24)}
173+
descriptionId={intervalTitleId}
174+
/>
175+
</ListGroup>
126176
</EuiText>
127177
</EuiFlexItem>
128178

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
.canvasControlSettings__popover {
22
width: 600px;
33
}
4+
5+
.canvasControlSettings__list {
6+
columns: 2;
7+
}

0 commit comments

Comments
 (0)