Skip to content

Commit

Permalink
[CCR] Copy edits (#29676)
Browse files Browse the repository at this point in the history
* Use 'Resume/pause data replication' in context menu and row actions.
* Update copy of 'Update' confirm modal for a paused follower index.
* Update copy of 'Update' confirm modal for an active follower index.
* Update copy of 'Pause data replication' confirm modal.
* Update copy of 'Resume data replication' confirm modal.
* Update copy for permissions check.
* Update copy of table empty state.
* Update copy around tables.
* Update form copy.
* Update copy for RemoteClustersFormField callouts.
* Convert 'data replication' -> 'replication'.
* Update copy for Unfollow confirm modal.
* Update copy for form API error and Auto-follow Patterns table.
* Update form save button labels to be 'Create' and 'Update'.
* Move API errors to bottom of form, into same position as sync validation errors. Remove spacer from SectionError implementation.
  • Loading branch information
cjcenizal authored Feb 2, 2019
1 parent 27ff95b commit c794f42
Show file tree
Hide file tree
Showing 19 changed files with 319 additions and 198 deletions.
7 changes: 6 additions & 1 deletion src/ui/public/indices/constants/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,9 @@

import { INDEX_PATTERN_ILLEGAL_CHARACTERS_VISIBLE } from 'ui/index_patterns';

export const INDEX_ILLEGAL_CHARACTERS_VISIBLE = INDEX_PATTERN_ILLEGAL_CHARACTERS_VISIBLE.concat(',');
export const INDEX_ILLEGAL_CHARACTERS_VISIBLE = [ ...INDEX_PATTERN_ILLEGAL_CHARACTERS_VISIBLE ];

// Insert the comma into the middle, so it doesn't look as if it has grammatical meaning when
// these characters are rendered in the UI.
const insertionIndex = Math.floor(INDEX_PATTERN_ILLEGAL_CHARACTERS_VISIBLE.length / 2);
INDEX_ILLEGAL_CHARACTERS_VISIBLE.splice(insertionIndex, 0, ',');
30 changes: 18 additions & 12 deletions x-pack/plugins/cross_cluster_replication/public/app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/

import React, { Component } from 'react';
import React, { Component, Fragment } from 'react';
import PropTypes from 'prop-types';
import { Route, Switch, Redirect } from 'react-router-dom';
import chrome from 'ui/chrome';
Expand All @@ -18,6 +18,7 @@ import {
EuiFlexItem,
EuiLoadingSpinner,
EuiPageContent,
EuiSpacer,
EuiTitle,
} from '@elastic/eui';

Expand Down Expand Up @@ -160,15 +161,19 @@ export const App = injectI18n(

if (fetchPermissionError) {
return (
<SectionError
title={(
<FormattedMessage
id="xpack.crossClusterReplication.app.permissionCheckErrorTitle"
defaultMessage="Error checking permissions"
/>
)}
error={fetchPermissionError}
/>
<Fragment>
<SectionError
title={(
<FormattedMessage
id="xpack.crossClusterReplication.app.permissionCheckErrorTitle"
defaultMessage="Error checking permissions"
/>
)}
error={fetchPermissionError}
/>

<EuiSpacer size="m" />
</Fragment>
);
}

Expand All @@ -182,14 +187,15 @@ export const App = injectI18n(
<h2>
<FormattedMessage
id="xpack.crossClusterReplication.app.deniedPermissionTitle"
defaultMessage="Permission denied"
defaultMessage="You're missing cluster privileges"
/>
</h2>}
body={
<p>
<FormattedMessage
id="xpack.crossClusterReplication.app.deniedPermissionDescription"
defaultMessage="You do not have required cluster privileges ({clusterPrivileges}) for Cross Cluster Replication."
defaultMessage="To use Cross Cluster Replication, you must have {clusterPrivileges,
plural, one {this cluster privilege} other {these cluster privileges}}: {clusterPrivileges}."
values={{ clusterPrivileges: missingClusterPrivileges.join(', ') }}
/>
</p>}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export class AutoFollowPatternFormUI extends PureComponent {
apiStatus: PropTypes.string.isRequired,
currentUrl: PropTypes.string.isRequired,
remoteClusters: PropTypes.array,
saveButtonLabel: PropTypes.node,
}

constructor(props) {
Expand Down Expand Up @@ -216,9 +217,15 @@ export class AutoFollowPatternFormUI extends PureComponent {
if (apiError) {
const title = intl.formatMessage({
id: 'xpack.crossClusterReplication.autoFollowPatternForm.savingErrorTitle',
defaultMessage: 'Error creating auto-follow pattern',
defaultMessage: `Can't create auto-follow pattern`,
});
return <SectionError title={title} error={apiError} />;

return (
<Fragment>
<SectionError title={title} error={apiError} />
<EuiSpacer size="l" />
</Fragment>
);
}

return null;
Expand Down Expand Up @@ -295,20 +302,35 @@ export class AutoFollowPatternFormUI extends PureComponent {
const { remoteClusters, currentUrl } = this.props;

const errorMessages = {
noClusterFound: () => (<FormattedMessage
id="xpack.crossClusterReplication.autoFollowPatternForm.emptyRemoteClustersCallOutDescription"
defaultMessage="Auto-follow patterns capture indices on remote clusters. You must add a remote cluster."
/>),
remoteClusterNotConnectedNotEditable: () => (<FormattedMessage
id="xpack.crossClusterReplication.autoFollowPatternForm.currentRemoteClusterNotConnectedCallOutDescription"
defaultMessage="You need to connect it before editing this auto-follow pattern. Edit the remote cluster to
fix the problem."
/>),
remoteClusterDoesNotExist: () => (<FormattedMessage
id="xpack.crossClusterReplication.autoFollowPatternForm.currentRemoteClusterNotFoundCallOutDescription"
defaultMessage="It might have been removed. In order to edit this auto-follow pattern,
you need to add a remote cluster with the same name."
/>)
noClusterFound: () => (
<FormattedMessage
id="xpack.crossClusterReplication.autoFollowPatternForm.emptyRemoteClustersCallOutDescription"
defaultMessage="Auto-follow patterns capture indices on remote clusters."
/>
),
remoteClusterNotConnectedNotEditable: (name) => ({
title: (
<FormattedMessage
id="xpack.crossClusterReplication.autoFollowPatternForm.currentRemoteClusterNotConnectedCallOutTitle"
defaultMessage="Can't edit auto-follow pattern because remote cluster '{name}' is not connected"
values={{ name }}
/>
),
description: (
<FormattedMessage
id="xpack.crossClusterReplication.autoFollowPatternForm.currentRemoteClusterNotConnectedCallOutDescription"
defaultMessage="You can address this by editing the remote cluster."
/>
),
}),
remoteClusterDoesNotExist: (name) => (
<FormattedMessage
id="xpack.crossClusterReplication.autoFollowPatternForm.currentRemoteClusterNotFoundCallOutDescription"
defaultMessage="To edit this auto-follow pattern, you must add a remote cluster
named '{name}'."
values={{ name }}
/>
),
};

return (
Expand Down Expand Up @@ -379,7 +401,7 @@ export class AutoFollowPatternFormUI extends PureComponent {
<p>
<FormattedMessage
id="xpack.crossClusterReplication.autoFollowPatternForm.sectionLeaderIndexPatternsDescription2"
defaultMessage="{note} indices that already exist are not replicated."
defaultMessage="{note} Indices that already exist are not replicated."
values={{ note: (
<strong>
<FormattedMessage
Expand Down Expand Up @@ -539,7 +561,6 @@ export class AutoFollowPatternFormUI extends PureComponent {

return (
<Fragment>
<EuiSpacer size="m" />
<EuiCallOut
title={(
<FormattedMessage
Expand All @@ -550,6 +571,7 @@ export class AutoFollowPatternFormUI extends PureComponent {
color="danger"
iconType="cross"
/>
<EuiSpacer size="l" />
</Fragment>
);
};
Expand All @@ -558,7 +580,7 @@ export class AutoFollowPatternFormUI extends PureComponent {
* Form Actions
*/
const renderActions = () => {
const { apiStatus } = this.props;
const { apiStatus, saveButtonLabel } = this.props;
const { areErrorsVisible } = this.state;

if (apiStatus === API_STATUS.SAVING) {
Expand Down Expand Up @@ -592,10 +614,7 @@ export class AutoFollowPatternFormUI extends PureComponent {
fill
disabled={isSaveDisabled}
>
<FormattedMessage
id="xpack.crossClusterReplication.autoFollowPatternForm.saveButtonLabel"
defaultMessage="Save"
/>
{saveButtonLabel}
</EuiButton>
</EuiFlexItem>

Expand Down Expand Up @@ -623,7 +642,7 @@ export class AutoFollowPatternFormUI extends PureComponent {
{renderAutoFollowPatternPrefixSuffix()}
</EuiForm>
{renderFormErrorWarning()}
<EuiSpacer size="l" />
{this.renderApiErrors()}
{renderActions()}
</Fragment>
);
Expand All @@ -645,7 +664,6 @@ export class AutoFollowPatternFormUI extends PureComponent {
render() {
return (
<Fragment>
{this.renderApiErrors()}
{this.renderForm()}
{this.renderLoading()}
</Fragment>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const byteUnitsHelpText = (
<a href={byteUnitsUrl} target="_blank">
<FormattedMessage
id="xpack.crossClusterReplication.followerIndexForm.advancedSettings.byteUnitsHelpTextLinkMessage"
defaultMessage="Learn more."
defaultMessage="Learn more"
/>
</a>
) }}
Expand All @@ -33,7 +33,7 @@ const timeUnitsHelpText = (
<a href={timeUnitsUrl} target="_blank">
<FormattedMessage
id="xpack.crossClusterReplication.followerIndexForm.advancedSettings.timeUnitsHelpTextLinkMessage"
defaultMessage="Learn more."
defaultMessage="Learn more"
/>
</a>
) }}
Expand Down
Loading

0 comments on commit c794f42

Please sign in to comment.