add truncation to loading (#1320)

This commit is contained in:
Severiano Badajoz
2020-03-30 15:48:52 -07:00
committed by GitHub
parent d4ec976aaa
commit 033727632c
+23 -6
View File
@@ -106,6 +106,11 @@ class Category extends React.Component {
We are still loading this category, so render a "busy" signal.
*/
const { metadataField } = this.props;
const truncatedString = maybeTruncateString(
metadataField,
globals.categoryDisplayStringMaxLength
);
return (
<div
style={{
@@ -130,14 +135,26 @@ class Category extends React.Component {
<input disabled checked={true} type="checkbox" />
<span className="bp3-control-indicator" />
</label>
<span
style={{
cursor: "pointer",
display: "inline-block"
<Tooltip
content={metadataField}
disabled={truncatedString === null}
hoverOpenDelay={globals.tooltipHoverOpenDelayQuick}
position={Position.LEFT}
usePortal
modifiers={{
preventOverflow: { enabled: false },
hide: { enabled: false }
}}
>
{metadataField}
</span>
<span
style={{
cursor: "pointer",
display: "inline-block"
}}
>
{truncatedString || metadataField}
</span>
</Tooltip>
</div>
<div>
<Button minimal loading intent="primary" />