Update loc pattern

This commit is contained in:
Chris Roberson 2019-01-15 16:32:54 -05:00
parent f2ee66c902
commit cc99fe8a8a

View file

@ -22,7 +22,6 @@ import { toastNotifications } from 'ui/notify';
import { EuiMonitoringTable } from 'plugins/monitoring/components/table'; import { EuiMonitoringTable } from 'plugins/monitoring/components/table';
import { Tooltip } from 'plugins/monitoring/components/tooltip'; import { Tooltip } from 'plugins/monitoring/components/tooltip';
import { AlertsIndicator } from 'plugins/monitoring/components/cluster/listing/alerts_indicator'; import { AlertsIndicator } from 'plugins/monitoring/components/cluster/listing/alerts_indicator';
import { I18nProvider, FormattedMessage } from '@kbn/i18n/react';
import { i18n } from '@kbn/i18n'; import { i18n } from '@kbn/i18n';
import { UNLINKED_DEPLOYMENT_CLUSTER_UUID } from '../../../../common/constants'; import { UNLINKED_DEPLOYMENT_CLUSTER_UUID } from '../../../../common/constants';
@ -272,36 +271,32 @@ const licenseWarning = (scope, { title, text }) => {
const handleClickIncompatibleLicense = (scope, clusterName) => { const handleClickIncompatibleLicense = (scope, clusterName) => {
licenseWarning(scope, { licenseWarning(scope, {
title: ( title: i18n.translate('xpack.monitoring.cluster.listing.incompatibleLicense.warningMessageTitle', {
<FormattedMessage defaultMessage: 'You can\'t view the {clusterName} cluster'
id="xpack.monitoring.cluster.listing.incompatibleLicense.warningMessageTitle" }, {
defaultMessage="You can't view the {clusterName} cluster" values: { clusterName: '"' + clusterName + '"' }
values={{ clusterName: '"' + clusterName + '"' }} }),
/>
),
text: ( text: (
<Fragment> <Fragment>
<p> <p>
<FormattedMessage {i18n.translate('xpack.monitoring.cluster.listing.incompatibleLicense.noMultiClusterSupportMessage', {
id="xpack.monitoring.cluster.listing.incompatibleLicense.noMultiClusterSupportMessage" defaultMessage: 'The Basic license does not support multi-cluster monitoring.'
defaultMessage="The Basic license does not support multi-cluster monitoring." })}
/>
</p> </p>
<p> <p>
<FormattedMessage {i18n.translate('xpack.monitoring.cluster.listing.incompatibleLicense.infoMessage', {
id="xpack.monitoring.cluster.listing.incompatibleLicense.infoMessage" defaultMessage: 'Need to monitor multiple clusters? {getLicenseInfoLink} to enjoy multi-cluster monitoring.'
defaultMessage="Need to monitor multiple clusters? {getLicenseInfoLink} to enjoy multi-cluster monitoring." }, {
values={{ values: {
getLicenseInfoLink: ( getLicenseInfoLink: (
<a href="https://www.elastic.co/subscriptions/xpack" target="_blank"> <a href="https://www.elastic.co/subscriptions/xpack" target="_blank">
<FormattedMessage {i18n.translate('xpack.monitoring.cluster.listing.incompatibleLicense.getLicenseLinkLabel', {
id="xpack.monitoring.cluster.listing.incompatibleLicense.getLicenseLinkLabel" defaultMessage: 'Get a license with full functionality'
defaultMessage="Get a license with full functionality" })}
/>
</a> </a>
) )
}} }
/> })}
</p> </p>
</Fragment> </Fragment>
), ),
@ -312,44 +307,41 @@ const handleClickInvalidLicense = (scope, clusterName) => {
const licensingPath = `${chrome.getBasePath()}/app/kibana#/management/elasticsearch/license_management/home`; const licensingPath = `${chrome.getBasePath()}/app/kibana#/management/elasticsearch/license_management/home`;
licenseWarning(scope, { licenseWarning(scope, {
title: ( title: i18n.translate('xpack.monitoring.cluster.listing.invalidLicense.warningMessageTitle', {
<FormattedMessage defaultMessage: 'You can\'t view the {clusterName} cluster'
id="xpack.monitoring.cluster.listing.invalidLicense.warningMessageTitle" }, {
defaultMessage="You can't view the {clusterName} cluster" values: {
values={{ clusterName: '"' + clusterName + '"' }} clusterName: '"' + clusterName + '"'
/> }
), }),
text: ( text: (
<Fragment> <Fragment>
<p> <p>
<FormattedMessage {i18n.translate('xpack.monitoring.cluster.listing.invalidLicense.invalidInfoMessage', {
id="xpack.monitoring.cluster.listing.invalidLicense.invalidInfoMessage" defaultMessage: 'The license information is invalid.'
defaultMessage="The license information is invalid." })}
/>
</p> </p>
<p> <p>
<FormattedMessage {i18n.translate('xpack.monitoring.cluster.listing.invalidLicense.infoMessage', {
id="xpack.monitoring.cluster.listing.invalidLicense.infoMessage" defaultMessage: 'Need a license? {getBasicLicenseLink} or {getLicenseInfoLink} to enjoy multi-cluster monitoring.'
defaultMessage="Need a license? {getBasicLicenseLink} or {getLicenseInfoLink} to enjoy multi-cluster monitoring." }, {
values={{ values: {
getBasicLicenseLink: ( getBasicLicenseLink: (
<a href={licensingPath}> <a href={licensingPath}>
<FormattedMessage {i18n.translate('xpack.monitoring.cluster.listing.invalidLicense.getBasicLicenseLinkLabel', {
id="xpack.monitoring.cluster.listing.invalidLicense.getBasicLicenseLinkLabel" defaultMessage: 'Get a free Basic license'
defaultMessage="Get a free Basic license" })}
/>
</a> </a>
), ),
getLicenseInfoLink: ( getLicenseInfoLink: (
<a href="https://www.elastic.co/subscriptions/xpack" target="_blank"> <a href="https://www.elastic.co/subscriptions/xpack" target="_blank">
<FormattedMessage {i18n.translate('xpack.monitoring.cluster.listing.invalidLicense.getLicenseLinkLabel', {
id="xpack.monitoring.cluster.listing.invalidLicense.getLicenseLinkLabel" defaultMessage: 'get a license with full functionality'
defaultMessage="get a license with full functionality" })}
/>
</a> </a>
) )
}} }
/> })}
</p> </p>
</Fragment> </Fragment>
), ),
@ -383,16 +375,14 @@ export class Listing extends Component {
onClick={() => changeCluster(UNLINKED_DEPLOYMENT_CLUSTER_UUID)} onClick={() => changeCluster(UNLINKED_DEPLOYMENT_CLUSTER_UUID)}
data-test-subj="unlinkedDeploymentLink" data-test-subj="unlinkedDeploymentLink"
> >
<FormattedMessage {i18n.translate('xpack.monitoring.cluster.listing.unlinkedDeploymentCallOutLink', {
id="xpack.monitoring.cluster.listing.unlinkedDeploymentCallOutLink" defaultMessage: 'View these instances.'
defaultMessage="View these instances." })}
/>
</EuiLink> </EuiLink>
&nbsp; &nbsp;
<FormattedMessage {i18n.translate('xpack.monitoring.cluster.listing.unlinkedDeploymentCallOutText', {
id="xpack.monitoring.cluster.listing.unlinkedDeploymentCallOutText" defaultMessage: 'Or, click Unlinked Cluster in the table below'
defaultMessage="Or, click Unlinked Cluster in the table below" })}
/>
</p> </p>
<p> <p>
<EuiLink onClick={() => { <EuiLink onClick={() => {
@ -402,10 +392,9 @@ export class Listing extends Component {
> >
<EuiIcon type="cross"/> <EuiIcon type="cross"/>
&nbsp; &nbsp;
<FormattedMessage {i18n.translate('xpack.monitoring.cluster.listing.unlinkedDeploymentCallOutDismiss', {
id="xpack.monitoring.cluster.listing.unlinkedDeploymentCallOutDismiss" defaultMessage: 'Dismiss'
defaultMessage="Dismiss" })}
/>
</EuiLink> </EuiLink>
</p> </p>
</EuiCallOut> </EuiCallOut>
@ -423,45 +412,43 @@ export class Listing extends Component {
const hasUnlinkedDeployment = !!clusters.find(cluster => cluster.cluster_uuid === UNLINKED_DEPLOYMENT_CLUSTER_UUID); const hasUnlinkedDeployment = !!clusters.find(cluster => cluster.cluster_uuid === UNLINKED_DEPLOYMENT_CLUSTER_UUID);
return ( return (
<I18nProvider> <EuiPage>
<EuiPage> <EuiPageBody>
<EuiPageBody> <EuiPageContent>
<EuiPageContent> {hasUnlinkedDeployment ? this.renderUnlinkedDeployment(_changeCluster, angular.storage) : null}
{hasUnlinkedDeployment ? this.renderUnlinkedDeployment(_changeCluster, angular.storage) : null} <EuiMonitoringTable
<EuiMonitoringTable className="clusterTable"
className="clusterTable" rows={clusters}
rows={clusters} columns={getColumns(
columns={getColumns( angular.showLicenseExpiration,
angular.showLicenseExpiration, _changeCluster,
_changeCluster, _handleClickIncompatibleLicense,
_handleClickIncompatibleLicense, _handleClickInvalidLicense
_handleClickInvalidLicense )}
)} rowProps={item => {
rowProps={item => { return {
return { 'data-test-subj': `clusterRow_${item.cluster_uuid}`
'data-test-subj': `clusterRow_${item.cluster_uuid}` };
}; }}
}} sorting={{
sorting={{ ...sorting,
...sorting, sort: {
sort: { ...sorting.sort,
...sorting.sort, field: 'cluster_name'
field: 'cluster_name' }
} }}
}} pagination={pagination}
pagination={pagination} search={{
search={{ box: {
box: { incremental: true,
incremental: true, placeholder: angular.scope.filterText
placeholder: angular.scope.filterText },
}, }}
}} onTableChange={onTableChange}
onTableChange={onTableChange} />
/> </EuiPageContent>
</EuiPageContent> </EuiPageBody>
</EuiPageBody> </EuiPage>
</EuiPage>
</I18nProvider>
); );
} }
} }