Skip to content

Commit

Permalink
[Monitoring] Capitalize the license type (elastic#20683)
Browse files Browse the repository at this point in the history
* Capitalize the license type in monitoring

* Revert "Capitalize the license type in monitoring"

This reverts commit 38ad3a5.

* Pass in the type capitalized

* Revert "Pass in the type capitalized"

This reverts commit 6a05bb1.

* Capitalize type in license status directly so consumers do not need to worry about it
  • Loading branch information
chrisronline committed Jul 13, 2018
1 parent 38c4438 commit 7b5952b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 ? (
Expand All @@ -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>
Expand Down

0 comments on commit 7b5952b

Please sign in to comment.