Skip to content

Commit b7e87e7

Browse files
Merge branch 'master' of github.com:elastic/kibana into feat/timeline-modal-layout
2 parents d155380 + b9a64ba commit b7e87e7

File tree

83 files changed

+12574
-846
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

+12574
-846
lines changed

src/core/public/doc_links/doc_links_service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ export class DocLinksService {
3939
dashboard: {
4040
guide: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/dashboard.html`,
4141
drilldowns: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/drilldowns.html`,
42-
drilldownsTriggerPicker: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/drilldowns.html#url-drilldown`,
42+
drilldownsTriggerPicker: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/drilldowns.html#url-drilldowns`,
4343
urlDrilldownTemplateSyntax: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/url_templating-language.html`,
44-
urlDrilldownVariables: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/url_templating-language.html#variables`,
44+
urlDrilldownVariables: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/url_templating-language.html#url-template-variables`,
4545
},
4646
filebeat: {
4747
base: `${ELASTIC_WEBSITE_URL}guide/en/beats/filebeat/${DOC_LINK_VERSION}`,
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the Elastic License;
4+
* you may not use this file except in compliance with the Elastic License.
5+
*/
6+
7+
import React from 'react';
8+
9+
import { FollowerIndexPauseProvider } from './follower_index_pause_provider';
10+
import { FollowerIndexResumeProvider } from './follower_index_resume_provider';
11+
import { FollowerIndexUnfollowProvider } from './follower_index_unfollow_provider';
12+
13+
export const FollowerIndexActionsProvider = (props) => {
14+
return (
15+
<FollowerIndexPauseProvider>
16+
{(pauseFollowerIndex) => (
17+
<FollowerIndexResumeProvider>
18+
{(resumeFollowerIndex) => (
19+
<FollowerIndexUnfollowProvider>
20+
{(unfollowLeaderIndex) => {
21+
const { children } = props;
22+
return children(() => ({
23+
pauseFollowerIndex,
24+
resumeFollowerIndex,
25+
unfollowLeaderIndex,
26+
}));
27+
}}
28+
</FollowerIndexUnfollowProvider>
29+
)}
30+
</FollowerIndexResumeProvider>
31+
)}
32+
</FollowerIndexPauseProvider>
33+
);
34+
};

x-pack/plugins/cross_cluster_replication/public/app/components/follower_index_pause_provider.js renamed to x-pack/plugins/cross_cluster_replication/public/app/components/follower_index_actions_providers/follower_index_pause_provider.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ import { i18n } from '@kbn/i18n';
1111
import { FormattedMessage } from '@kbn/i18n/react';
1212
import { EuiConfirmModal, EuiOverlayMask } from '@elastic/eui';
1313

14-
import { pauseFollowerIndex } from '../store/actions';
15-
import { arrify } from '../../../common/services/utils';
16-
import { areAllSettingsDefault } from '../services/follower_index_default_settings';
14+
import { pauseFollowerIndex } from '../../store/actions';
15+
import { arrify } from '../../../../common/services/utils';
16+
import { areAllSettingsDefault } from '../../services/follower_index_default_settings';
1717

1818
class FollowerIndexPauseProviderUi extends PureComponent {
1919
static propTypes = {

x-pack/plugins/cross_cluster_replication/public/app/components/follower_index_resume_provider.js renamed to x-pack/plugins/cross_cluster_replication/public/app/components/follower_index_actions_providers/follower_index_resume_provider.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ import { connect } from 'react-redux';
1010
import { i18n } from '@kbn/i18n';
1111
import { FormattedMessage } from '@kbn/i18n/react';
1212
import { EuiConfirmModal, EuiLink, EuiOverlayMask } from '@elastic/eui';
13-
import { reactRouterNavigate } from '../../../../../../src/plugins/kibana_react/public';
14-
import { routing } from '../services/routing';
15-
import { resumeFollowerIndex } from '../store/actions';
16-
import { arrify } from '../../../common/services/utils';
13+
import { reactRouterNavigate } from '../../../../../../../src/plugins/kibana_react/public';
14+
import { routing } from '../../services/routing';
15+
import { resumeFollowerIndex } from '../../store/actions';
16+
import { arrify } from '../../../../common/services/utils';
1717

1818
class FollowerIndexResumeProviderUi extends PureComponent {
1919
static propTypes = {

x-pack/plugins/cross_cluster_replication/public/app/components/follower_index_unfollow_provider.js renamed to x-pack/plugins/cross_cluster_replication/public/app/components/follower_index_actions_providers/follower_index_unfollow_provider.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ import { i18n } from '@kbn/i18n';
1111
import { FormattedMessage } from '@kbn/i18n/react';
1212
import { EuiConfirmModal, EuiOverlayMask } from '@elastic/eui';
1313

14-
import { unfollowLeaderIndex } from '../store/actions';
15-
import { arrify } from '../../../common/services/utils';
14+
import { unfollowLeaderIndex } from '../../store/actions';
15+
import { arrify } from '../../../../common/services/utils';
1616

1717
class FollowerIndexUnfollowProviderUi extends PureComponent {
1818
static propTypes = {
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the Elastic License;
4+
* you may not use this file except in compliance with the Elastic License.
5+
*/
6+
7+
export { FollowerIndexActionsProvider } from './follower_index_actions_provider';
8+
export { FollowerIndexPauseProvider } from './follower_index_pause_provider';
9+
export { FollowerIndexResumeProvider } from './follower_index_resume_provider';
10+
export { FollowerIndexUnfollowProvider } from './follower_index_unfollow_provider';

x-pack/plugins/cross_cluster_replication/public/app/components/index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@ export { AutoFollowPatternForm } from './auto_follow_pattern_form';
1212
export { AutoFollowPatternDeleteProvider } from './auto_follow_pattern_delete_provider';
1313
export { AutoFollowPatternPageTitle } from './auto_follow_pattern_page_title';
1414
export { AutoFollowPatternIndicesPreview } from './auto_follow_pattern_indices_preview';
15-
export { FollowerIndexPauseProvider } from './follower_index_pause_provider';
16-
export { FollowerIndexResumeProvider } from './follower_index_resume_provider';
17-
export { FollowerIndexUnfollowProvider } from './follower_index_unfollow_provider';
15+
export { FollowerIndexPauseProvider } from './follower_index_actions_providers';
16+
export { FollowerIndexResumeProvider } from './follower_index_actions_providers';
17+
export { FollowerIndexUnfollowProvider } from './follower_index_actions_providers';
18+
export { FollowerIndexActionsProvider } from './follower_index_actions_providers';
1819
export { FollowerIndexForm } from './follower_index_form';
1920
export { FollowerIndexPageTitle } from './follower_index_page_title';
2021
export { FormEntryRow } from './form_entry_row';

x-pack/plugins/cross_cluster_replication/public/app/sections/home/auto_follow_pattern_list/components/auto_follow_pattern_table/auto_follow_pattern_table.js

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

7-
import React, { PureComponent, Fragment } from 'react';
7+
import React, { PureComponent } from 'react';
88
import PropTypes from 'prop-types';
99
import { i18n } from '@kbn/i18n';
1010
import {
@@ -13,7 +13,6 @@ import {
1313
EuiLoadingKibana,
1414
EuiOverlayMask,
1515
EuiHealth,
16-
EuiIcon,
1716
} from '@elastic/eui';
1817
import { API_STATUS, UIM_AUTO_FOLLOW_PATTERN_SHOW_DETAILS_CLICK } from '../../../../../constants';
1918
import {
@@ -23,6 +22,33 @@ import {
2322
import { routing } from '../../../../../services/routing';
2423
import { trackUiMetric } from '../../../../../services/track_ui_metric';
2524

25+
const actionI18nTexts = {
26+
pause: i18n.translate(
27+
'xpack.crossClusterReplication.autoFollowPatternList.table.actionPauseDescription',
28+
{
29+
defaultMessage: 'Pause replication',
30+
}
31+
),
32+
resume: i18n.translate(
33+
'xpack.crossClusterReplication.autoFollowPatternList.table.actionResumeDescription',
34+
{
35+
defaultMessage: 'Resume replication',
36+
}
37+
),
38+
edit: i18n.translate(
39+
'xpack.crossClusterReplication.autoFollowPatternList.table.actionEditDescription',
40+
{
41+
defaultMessage: 'Edit auto-follow pattern',
42+
}
43+
),
44+
delete: i18n.translate(
45+
'xpack.crossClusterReplication.autoFollowPatternList.table.actionDeleteDescription',
46+
{
47+
defaultMessage: 'Delete auto-follow pattern',
48+
}
49+
),
50+
};
51+
2652
const getFilteredPatterns = (autoFollowPatterns, queryText) => {
2753
if (queryText) {
2854
const normalizedSearchText = queryText.toLowerCase();
@@ -93,7 +119,7 @@ export class AutoFollowPatternTable extends PureComponent {
93119
});
94120
};
95121

96-
getTableColumns() {
122+
getTableColumns(deleteAutoFollowPattern) {
97123
const { selectAutoFollowPattern } = this.props;
98124

99125
return [
@@ -200,88 +226,34 @@ export class AutoFollowPatternTable extends PureComponent {
200226
),
201227
actions: [
202228
{
203-
render: ({ name, active }) => {
204-
const label = active
205-
? i18n.translate(
206-
'xpack.crossClusterReplication.autoFollowPatternList.table.actionPauseDescription',
207-
{
208-
defaultMessage: 'Pause replication',
209-
}
210-
)
211-
: i18n.translate(
212-
'xpack.crossClusterReplication.autoFollowPatternList.table.actionResumeDescription',
213-
{
214-
defaultMessage: 'Resume replication',
215-
}
216-
);
217-
218-
return (
219-
<span
220-
onClick={(event) => {
221-
if (event.stopPropagation) {
222-
event.stopPropagation();
223-
}
224-
if (active) {
225-
this.props.pauseAutoFollowPattern(name);
226-
} else {
227-
this.props.resumeAutoFollowPattern(name);
228-
}
229-
}}
230-
data-test-subj={active ? 'contextMenuPauseButton' : 'contextMenuResumeButton'}
231-
>
232-
<EuiIcon
233-
aria-label={label}
234-
type={active ? 'pause' : 'play'}
235-
className="euiContextMenu__icon"
236-
/>
237-
<span>{label}</span>
238-
</span>
239-
);
240-
},
229+
name: actionI18nTexts.pause,
230+
description: actionI18nTexts.pause,
231+
icon: 'pause',
232+
onClick: (item) => this.props.pauseAutoFollowPattern(item.name),
233+
available: (item) => item.active,
234+
'data-test-subj': 'contextMenuPauseButton',
241235
},
242236
{
243-
render: ({ name }) => {
244-
const label = i18n.translate(
245-
'xpack.crossClusterReplication.autoFollowPatternList.table.actionEditDescription',
246-
{
247-
defaultMessage: 'Edit auto-follow pattern',
248-
}
249-
);
250-
251-
return (
252-
<span
253-
onClick={() => routing.navigate(routing.getAutoFollowPatternPath(name))}
254-
data-test-subj="contextMenuEditButton"
255-
>
256-
<EuiIcon aria-label={label} type="pencil" className="euiContextMenu__icon" />
257-
<span>{label}</span>
258-
</span>
259-
);
260-
},
237+
name: actionI18nTexts.resume,
238+
description: actionI18nTexts.resume,
239+
icon: 'play',
240+
onClick: (item) => this.props.resumeAutoFollowPattern(item.name),
241+
available: (item) => !item.active,
242+
'data-test-subj': 'contextMenuResumeButton',
261243
},
262244
{
263-
render: ({ name }) => {
264-
const label = i18n.translate(
265-
'xpack.crossClusterReplication.autoFollowPatternList.table.actionDeleteDescription',
266-
{
267-
defaultMessage: 'Delete auto-follow pattern',
268-
}
269-
);
270-
271-
return (
272-
<AutoFollowPatternDeleteProvider>
273-
{(deleteAutoFollowPattern) => (
274-
<span
275-
onClick={() => deleteAutoFollowPattern(name)}
276-
data-test-subj="contextMenuDeleteButton"
277-
>
278-
<EuiIcon aria-label={label} type="trash" className="euiContextMenu__icon" />
279-
<span>{label}</span>
280-
</span>
281-
)}
282-
</AutoFollowPatternDeleteProvider>
283-
);
284-
},
245+
name: actionI18nTexts.edit,
246+
description: actionI18nTexts.edit,
247+
icon: 'pencil',
248+
onClick: (item) => routing.navigate(routing.getAutoFollowPatternPath(item.name)),
249+
'data-test-subj': 'contextMenuEditButton',
250+
},
251+
{
252+
name: actionI18nTexts.delete,
253+
description: actionI18nTexts.delete,
254+
icon: 'trash',
255+
onClick: (item) => deleteAutoFollowPattern(item.name),
256+
'data-test-subj': 'contextMenuDeleteButton',
285257
},
286258
],
287259
width: '100px',
@@ -339,26 +311,30 @@ export class AutoFollowPatternTable extends PureComponent {
339311
};
340312

341313
return (
342-
<Fragment>
343-
<EuiInMemoryTable
344-
items={filteredAutoFollowPatterns}
345-
itemId="name"
346-
columns={this.getTableColumns()}
347-
search={search}
348-
pagination={pagination}
349-
sorting={sorting}
350-
selection={selection}
351-
isSelectable={true}
352-
rowProps={() => ({
353-
'data-test-subj': 'row',
354-
})}
355-
cellProps={(item, column) => ({
356-
'data-test-subj': `cell_${column.field}`,
357-
})}
358-
data-test-subj="autoFollowPatternListTable"
359-
/>
360-
{this.renderLoading()}
361-
</Fragment>
314+
<AutoFollowPatternDeleteProvider>
315+
{(deleteAutoFollowPattern) => (
316+
<>
317+
<EuiInMemoryTable
318+
items={filteredAutoFollowPatterns}
319+
itemId="name"
320+
columns={this.getTableColumns(deleteAutoFollowPattern)}
321+
search={search}
322+
pagination={pagination}
323+
sorting={sorting}
324+
selection={selection}
325+
isSelectable={true}
326+
rowProps={() => ({
327+
'data-test-subj': 'row',
328+
})}
329+
cellProps={(item, column) => ({
330+
'data-test-subj': `cell_${column.field}`,
331+
})}
332+
data-test-subj="autoFollowPatternListTable"
333+
/>
334+
{this.renderLoading()}
335+
</>
336+
)}
337+
</AutoFollowPatternDeleteProvider>
362338
);
363339
}
364340
}

0 commit comments

Comments
 (0)