From bb85312b9f0935b4d1ef1424a95a0dddd6779a05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=2E=20Mert=20Y=C4=B1ld=C4=B1ran?= Date: Wed, 17 Nov 2021 15:02:23 +0300 Subject: [PATCH] Don't omit the key-value pair if the value is `false` in `EntryTableSection` (#478) --- ui/src/components/EntryDetailed/EntrySections.tsx | 2 +- ui/src/components/UI/FancyTextDisplay.tsx | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/ui/src/components/EntryDetailed/EntrySections.tsx b/ui/src/components/EntryDetailed/EntrySections.tsx index b702b4db1..0e0f8942d 100644 --- a/ui/src/components/EntryDetailed/EntrySections.tsx +++ b/ui/src/components/EntryDetailed/EntrySections.tsx @@ -15,7 +15,7 @@ interface EntryViewLineProps { } const EntryViewLine: React.FC = ({label, value, updateQuery, selector, overrideQueryValue}) => { - return (label && value && + return (label && { diff --git a/ui/src/components/UI/FancyTextDisplay.tsx b/ui/src/components/UI/FancyTextDisplay.tsx index 91f10f4bf..148e0d6bd 100644 --- a/ui/src/components/UI/FancyTextDisplay.tsx +++ b/ui/src/components/UI/FancyTextDisplay.tsx @@ -17,7 +17,6 @@ interface Props { const FancyTextDisplay: React.FC = ({text, className, isPossibleToCopy = true, applyTextEllipsis = true, flipped = false, useTooltip= false, displayIconOnMouseOver = false, buttonOnly = false}) => { const [showCopiedNotification, setCopied] = useState(false); const [showTooltip, setShowTooltip] = useState(false); - const displayText = text || ''; const onCopy = () => { setCopied(true) @@ -33,12 +32,12 @@ const FancyTextDisplay: React.FC = ({text, className, isPossibleToCopy = return () => clearTimeout(timer); }, [showCopiedNotification]); - const textElement = {displayText}; + const textElement = {text}; - const copyButton = isPossibleToCopy && displayText ? + const copyButton = isPossibleToCopy && text ? Duplicate full value {showCopiedNotification && Copied} @@ -48,14 +47,14 @@ const FancyTextDisplay: React.FC = ({text, className, isPossibleToCopy = return (

setShowTooltip(true)} onMouseLeave={ e => setShowTooltip(false)} > {!buttonOnly && flipped && textElement} {copyButton} {!buttonOnly && !flipped && textElement} - {useTooltip && showTooltip && {displayText}} + {useTooltip && showTooltip && {text}}

); };