mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
[Monitoring] Capitalize the license type (#20683)
* Capitalize the license type in monitoring * Revert "Capitalize the license type in monitoring" This reverts commit38ad3a516d
. * Pass in the type capitalized * Revert "Pass in the type capitalized" This reverts commit6a05bb12f3
. * Capitalize type in license status directly so consumers do not need to worry about it
This commit is contained in:
parent
16e9a7e4a1
commit
276f08ccbb
2 changed files with 4 additions and 4 deletions
|
@ -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)
|
||||
};
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue