Skip to content

Commit

Permalink
remove fragments
Browse files Browse the repository at this point in the history
  • Loading branch information
thompsongl committed Feb 16, 2021
1 parent 15ba9f9 commit 4a9ca06
Show file tree
Hide file tree
Showing 4 changed files with 199 additions and 207 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,45 +61,43 @@ class AutoFollowPatternDeleteProviderUi extends PureComponent {
);

return (
<>
{/* eslint-disable-next-line jsx-a11y/mouse-events-have-key-events */}
<EuiConfirmModal
title={title}
onCancel={this.closeConfirmModal}
onConfirm={this.onConfirm}
cancelButtonText={i18n.translate(
'xpack.crossClusterReplication.deleteAutoFollowPattern.confirmModal.cancelButtonText',
{
defaultMessage: 'Cancel',
}
)}
buttonColor="danger"
confirmButtonText={i18n.translate(
'xpack.crossClusterReplication.deleteAutoFollowPattern.confirmModal.confirmButtonText',
{
defaultMessage: 'Remove',
}
)}
onMouseOver={this.onMouseOverModal}
data-test-subj="deleteAutoFollowPatternConfirmation"
>
{!isSingle && (
<Fragment>
<p>
<FormattedMessage
id="xpack.crossClusterReplication.deleteAutoFollowPattern.confirmModal.multipleDeletionDescription"
defaultMessage="You are about to remove these auto-follow patterns:"
/>
</p>
<ul>
{ids.map((id) => (
<li key={id}>{id}</li>
))}
</ul>
</Fragment>
)}
</EuiConfirmModal>
</>
// eslint-disable-next-line jsx-a11y/mouse-events-have-key-events
<EuiConfirmModal
title={title}
onCancel={this.closeConfirmModal}
onConfirm={this.onConfirm}
cancelButtonText={i18n.translate(
'xpack.crossClusterReplication.deleteAutoFollowPattern.confirmModal.cancelButtonText',
{
defaultMessage: 'Cancel',
}
)}
buttonColor="danger"
confirmButtonText={i18n.translate(
'xpack.crossClusterReplication.deleteAutoFollowPattern.confirmModal.confirmButtonText',
{
defaultMessage: 'Remove',
}
)}
onMouseOver={this.onMouseOverModal}
data-test-subj="deleteAutoFollowPatternConfirmation"
>
{!isSingle && (
<Fragment>
<p>
<FormattedMessage
id="xpack.crossClusterReplication.deleteAutoFollowPattern.confirmModal.multipleDeletionDescription"
defaultMessage="You are about to remove these auto-follow patterns:"
/>
</p>
<ul>
{ids.map((id) => (
<li key={id}>{id}</li>
))}
</ul>
</Fragment>
)}
</EuiConfirmModal>
);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,64 +69,62 @@ class FollowerIndexPauseProviderUi extends PureComponent {
const hasCustomSettings = indices.some((index) => !areAllSettingsDefault(index));

return (
<>
{/* eslint-disable-next-line jsx-a11y/mouse-events-have-key-events */}
<EuiConfirmModal
title={title}
onCancel={this.closeConfirmModal}
onConfirm={this.onConfirm}
cancelButtonText={i18n.translate(
'xpack.crossClusterReplication.pauseFollowerIndex.confirmModal.cancelButtonText',
{
defaultMessage: 'Cancel',
}
)}
buttonColor={hasCustomSettings ? 'danger' : 'primary'}
confirmButtonText={i18n.translate(
'xpack.crossClusterReplication.pauseFollowerIndex.confirmModal.confirmButtonText',
{
defaultMessage: 'Pause replication',
}
)}
onMouseOver={this.onMouseOverModal}
data-test-subj="pauseReplicationConfirmation"
>
{hasCustomSettings && (
<p>
{isSingle ? (
<FormattedMessage
id="xpack.crossClusterReplication.pauseFollowerIndex.confirmModal.singlePauseDescriptionWithSettingWarning"
defaultMessage="Pausing replication to this follower index clears its custom
// eslint-disable-next-line jsx-a11y/mouse-events-have-key-events
<EuiConfirmModal
title={title}
onCancel={this.closeConfirmModal}
onConfirm={this.onConfirm}
cancelButtonText={i18n.translate(
'xpack.crossClusterReplication.pauseFollowerIndex.confirmModal.cancelButtonText',
{
defaultMessage: 'Cancel',
}
)}
buttonColor={hasCustomSettings ? 'danger' : 'primary'}
confirmButtonText={i18n.translate(
'xpack.crossClusterReplication.pauseFollowerIndex.confirmModal.confirmButtonText',
{
defaultMessage: 'Pause replication',
}
)}
onMouseOver={this.onMouseOverModal}
data-test-subj="pauseReplicationConfirmation"
>
{hasCustomSettings && (
<p>
{isSingle ? (
<FormattedMessage
id="xpack.crossClusterReplication.pauseFollowerIndex.confirmModal.singlePauseDescriptionWithSettingWarning"
defaultMessage="Pausing replication to this follower index clears its custom
advanced settings."
/>
) : (
<FormattedMessage
id="xpack.crossClusterReplication.pauseFollowerIndex.confirmModal.multiplePauseDescriptionWithSettingWarning"
defaultMessage="Pausing replication to a follower index clears its custom
/>
) : (
<FormattedMessage
id="xpack.crossClusterReplication.pauseFollowerIndex.confirmModal.multiplePauseDescriptionWithSettingWarning"
defaultMessage="Pausing replication to a follower index clears its custom
advanced settings."
/>
)}
/>
)}
</p>
)}

{!isSingle && (
<Fragment>
<p>
<FormattedMessage
id="xpack.crossClusterReplication.pauseFollowerIndex.confirmModal.multiplePauseDescription"
defaultMessage="Replication will pause on these follower indices:"
/>
</p>
)}

{!isSingle && (
<Fragment>
<p>
<FormattedMessage
id="xpack.crossClusterReplication.pauseFollowerIndex.confirmModal.multiplePauseDescription"
defaultMessage="Replication will pause on these follower indices:"
/>
</p>

<ul>
{indices.map((index) => (
<li key={index.name}>{index.name}</li>
))}
</ul>
</Fragment>
)}
</EuiConfirmModal>
</>

<ul>
{indices.map((index) => (
<li key={index.name}>{index.name}</li>
))}
</ul>
</Fragment>
)}
</EuiConfirmModal>
);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,77 +68,75 @@ class FollowerIndexResumeProviderUi extends PureComponent {
);

return (
<>
{/* eslint-disable-next-line jsx-a11y/mouse-events-have-key-events */}
<EuiConfirmModal
title={title}
onCancel={this.closeConfirmModal}
onConfirm={this.onConfirm}
cancelButtonText={i18n.translate(
'xpack.crossClusterReplication.resumeFollowerIndex.confirmModal.cancelButtonText',
{
defaultMessage: 'Cancel',
}
)}
buttonColor="primary"
confirmButtonText={i18n.translate(
'xpack.crossClusterReplication.resumeFollowerIndex.confirmModal.confirmButtonText',
{
defaultMessage: 'Resume replication',
}
)}
onMouseOver={this.onMouseOverModal}
data-test-subj="resumeReplicationConfirmation"
>
{isSingle ? (
// eslint-disable-next-line jsx-a11y/mouse-events-have-key-events
<EuiConfirmModal
title={title}
onCancel={this.closeConfirmModal}
onConfirm={this.onConfirm}
cancelButtonText={i18n.translate(
'xpack.crossClusterReplication.resumeFollowerIndex.confirmModal.cancelButtonText',
{
defaultMessage: 'Cancel',
}
)}
buttonColor="primary"
confirmButtonText={i18n.translate(
'xpack.crossClusterReplication.resumeFollowerIndex.confirmModal.confirmButtonText',
{
defaultMessage: 'Resume replication',
}
)}
onMouseOver={this.onMouseOverModal}
data-test-subj="resumeReplicationConfirmation"
>
{isSingle ? (
<p>
<FormattedMessage
id="xpack.crossClusterReplication.resumeFollowerIndex.confirmModal.singleResumeDescription"
defaultMessage="Replication resumes using the default advanced settings. To use
custom advanced settings, {editLink}."
values={{
editLink: (
<EuiLink
{...reactRouterNavigate(
routing._reactRouter.history,
routing.getFollowerIndexPath(ids[0])
)}
data-test-subj="editLink"
>
<FormattedMessage
id="xpack.crossClusterReplication.resumeFollowerIndex.confirmModal.singleResumeEditLink"
defaultMessage="edit the follower index"
/>
</EuiLink>
),
}}
/>
</p>
) : (
<Fragment>
<p>
<FormattedMessage
id="xpack.crossClusterReplication.resumeFollowerIndex.confirmModal.singleResumeDescription"
defaultMessage="Replication resumes using the default advanced settings. To use
custom advanced settings, {editLink}."
values={{
editLink: (
<EuiLink
{...reactRouterNavigate(
routing._reactRouter.history,
routing.getFollowerIndexPath(ids[0])
)}
data-test-subj="editLink"
>
<FormattedMessage
id="xpack.crossClusterReplication.resumeFollowerIndex.confirmModal.singleResumeEditLink"
defaultMessage="edit the follower index"
/>
</EuiLink>
),
}}
id="xpack.crossClusterReplication.resumeFollowerIndex.confirmModal.multipleResumeDescriptionWithSettingWarning"
defaultMessage="Replication resumes using the default advanced settings."
/>
</p>
) : (
<Fragment>
<p>
<FormattedMessage
id="xpack.crossClusterReplication.resumeFollowerIndex.confirmModal.multipleResumeDescriptionWithSettingWarning"
defaultMessage="Replication resumes using the default advanced settings."
/>
</p>

<p>
<FormattedMessage
id="xpack.crossClusterReplication.resumeFollowerIndex.confirmModal.multipleResumeDescription"
defaultMessage="Replication will resume on these follower indices:"
/>
</p>
<p>
<FormattedMessage
id="xpack.crossClusterReplication.resumeFollowerIndex.confirmModal.multipleResumeDescription"
defaultMessage="Replication will resume on these follower indices:"
/>
</p>

<ul>
{ids.map((id) => (
<li key={id}>{id}</li>
))}
</ul>
</Fragment>
)}
</EuiConfirmModal>
</>
<ul>
{ids.map((id) => (
<li key={id}>{id}</li>
))}
</ul>
</Fragment>
)}
</EuiConfirmModal>
);
};

Expand Down
Loading

0 comments on commit 4a9ca06

Please sign in to comment.