diff --git a/src/internal-packages/indexes/lib/component/usage-column.jsx b/src/internal-packages/indexes/lib/component/usage-column.jsx index c500cd0d02e..35a6cd1c8d4 100644 --- a/src/internal-packages/indexes/lib/component/usage-column.jsx +++ b/src/internal-packages/indexes/lib/component/usage-column.jsx @@ -1,5 +1,10 @@ const React = require('react'); +/** + * No usage stats constant. + */ +const NO_USAGE_STATS = 'Server versions prior to 3.2 do not support $indexStats'; + /** * Component for the usage column. */ @@ -14,6 +19,18 @@ class UsageColumn extends React.Component { super(props); } + /** + * Render the usage tooltip text. + * + * @returns {String} The tooltip. + */ + tooltip() { + if (this.props.usage) { + return `${this.props.usage} index hits since index creation or last\n server restart`; + } + return NO_USAGE_STATS; + } + /** * Render the usage column. * @@ -23,13 +40,13 @@ class UsageColumn extends React.Component { return (