Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Monitoring] Capitalize the license type #20683

Merged
merged 5 commits into from
Jul 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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