From 0dc0459dff14e2f62c8df8c37bcbaca6ded622ef Mon Sep 17 00:00:00 2001 From: lirazyehezkel <61656597+lirazyehezkel@users.noreply.github.com> Date: Sun, 8 May 2022 15:45:33 +0300 Subject: [PATCH] Disable tapping status when streaming is paused (#1070) --- ui-common/src/components/TrafficViewer/TrafficViewer.tsx | 2 +- ui-common/src/components/UI/StatusBar.tsx | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ui-common/src/components/TrafficViewer/TrafficViewer.tsx b/ui-common/src/components/TrafficViewer/TrafficViewer.tsx index b4a044859..a8a0e7380 100644 --- a/ui-common/src/components/TrafficViewer/TrafficViewer.tsx +++ b/ui-common/src/components/TrafficViewer/TrafficViewer.tsx @@ -240,7 +240,7 @@ export const TrafficViewer: React.FC = ({ return (
- {tappingStatus && isShowStatusBar && } + {tappingStatus && isShowStatusBar && }
{ return `${noun}${amount !== 1 ? 's' : ''}` @@ -12,20 +13,22 @@ const pluralize = (noun: string, amount: number) => { interface StatusBarProps { isDemoBannerView: boolean; + disabled?: boolean; } -export const StatusBar: React.FC = ({isDemoBannerView}) => { +export const StatusBar: React.FC = ({isDemoBannerView, disabled}) => { const tappingStatus = useRecoilValue(tappingStatusAtom); const [expandedBar, setExpandedBar] = useState(false); const {uniqueNamespaces, amountOfPods, amountOfTappedPods, amountOfUntappedPods} = useRecoilValue(tappingStatusDetails); - return
setExpandedBar(true)} onMouseLeave={() => setExpandedBar(false)} data-cy="expandedStatusBar"> + return
setExpandedBar(true)} onMouseLeave={() => setExpandedBar(false)} data-cy="expandedStatusBar">
{tappingStatus.some(pod => !pod.isTapped) && warning} + {disabled && warning} {`Tapping ${amountOfUntappedPods > 0 ? amountOfTappedPods + " / " + amountOfPods : amountOfPods} ${pluralize('pod', amountOfPods)} in ${pluralize('namespace', uniqueNamespaces.length)} ${uniqueNamespaces.join(", ")}`}
- {expandedBar &&
+ {expandedBar && !disabled &&