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. We are still loading this category, so render a "busy" signal.
*/ */
const { metadataField } = this.props; const { metadataField } = this.props;
const truncatedString = maybeTruncateString(
metadataField,
globals.categoryDisplayStringMaxLength
);
return ( return (
<div <div
style={{ style={{
@@ -130,14 +135,26 @@ class Category extends React.Component {
<input disabled checked={true} type="checkbox" /> <input disabled checked={true} type="checkbox" />
<span className="bp3-control-indicator" /> <span className="bp3-control-indicator" />
</label> </label>
<span <Tooltip
style={{ content={metadataField}
cursor: "pointer", disabled={truncatedString === null}
display: "inline-block" 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>
<div> <div>
<Button minimal loading intent="primary" /> <Button minimal loading intent="primary" />