From 4b280ecd6df5776ae650665e6840a3ea01b80c6d Mon Sep 17 00:00:00 2001 From: gadotroee <55343099+gadotroee@users.noreply.github.com> Date: Tue, 12 Jul 2022 18:38:39 +0300 Subject: [PATCH] Hide Response tab if there is no response (#1197) --- .../EntryDetailed/EntryViewer/AutoRepresentation.tsx | 4 ++-- .../EntryDetailed/EntryViewer/SectionsRepresentation.tsx | 4 ---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/ui-common/src/components/EntryDetailed/EntryViewer/AutoRepresentation.tsx b/ui-common/src/components/EntryDetailed/EntryViewer/AutoRepresentation.tsx index 4295b5fa5..e5d4f6e66 100644 --- a/ui-common/src/components/EntryDetailed/EntryViewer/AutoRepresentation.tsx +++ b/ui-common/src/components/EntryDetailed/EntryViewer/AutoRepresentation.tsx @@ -32,7 +32,7 @@ export const AutoRepresentation: React.FC = ({ representation, color, opene badge: null }] - if (response) { + if (response && response.length > 0) { arr.push({ tab: 'Response', badge: null @@ -71,7 +71,7 @@ export const AutoRepresentation: React.FC = ({ representation, color, opene {getOpenedTabIndex() === TabsEnum.Request && } - {response && getOpenedTabIndex() === TabsEnum.Response && + {response && response.length > 0 && getOpenedTabIndex() === TabsEnum.Response && } } diff --git a/ui-common/src/components/EntryDetailed/EntryViewer/SectionsRepresentation.tsx b/ui-common/src/components/EntryDetailed/EntryViewer/SectionsRepresentation.tsx index 2ec62f56b..135b0f7e8 100644 --- a/ui-common/src/components/EntryDetailed/EntryViewer/SectionsRepresentation.tsx +++ b/ui-common/src/components/EntryDetailed/EntryViewer/SectionsRepresentation.tsx @@ -28,10 +28,6 @@ const SectionsRepresentation: React.FC = ({ data, color }) => { } } - if (sections.length === 0) { - sections.push(
This request or response has no data.
); - } - return {sections}; }