[Monitoring] Capitalize the license type (#20683)

* Capitalize the license type in monitoring

* Revert "Capitalize the license type in monitoring"

This reverts commit 38ad3a516d.

* Pass in the type capitalized

* Revert "Pass in the type capitalized"

This reverts commit 6a05bb12f3.

* Capitalize type in license status directly so consumers do not need to worry about it
This commit is contained in:
Chris Roberson 2018-07-13 16:24:57 -04:00 committed by GitHub
parent 16e9a7e4a1
commit 276f08ccbb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View file

@ -10,10 +10,9 @@ import { getLicense, getExpirationDateFormatted, isExpired } from '../../../stor
const mapStateToProps = (state) => {
const { isActive, type } = getLicense(state);
const typeTitleCase = type.charAt(0).toUpperCase() + type.substr(1).toLowerCase();
return {
status: isActive ? 'Active' : 'Inactive',
type: typeTitleCase,
type,
isExpired: isExpired(state),
expiryDate: getExpirationDateFormatted(state)
};

View file

@ -18,6 +18,7 @@ import {
export class LicenseStatus extends React.PureComponent {
render() {
const { isExpired, status, type, expiryDate } = this.props;
const typeTitleCase = type.charAt(0).toUpperCase() + type.substr(1).toLowerCase();
let icon;
let title;
let message;
@ -28,7 +29,7 @@ export class LicenseStatus extends React.PureComponent {
Your license expired on <strong>{expiryDate}</strong>
</Fragment>
);
title = `Your ${type} license has expired`;
title = `Your ${typeTitleCase} license has expired`;
} else {
icon = <EuiIcon color="success" type="checkInCircleFilled" />;
message = expiryDate ? (
@ -38,7 +39,7 @@ export class LicenseStatus extends React.PureComponent {
) : (
<Fragment>Your license will never expire.</Fragment>
);
title = `Your ${type} license is ${status.toLowerCase()}`;
title = `Your ${typeTitleCase} license is ${status.toLowerCase()}`;
}
return (
<div>