From 67ad07d69ad3d8805c3d42f836b0759bc0b95a4e Mon Sep 17 00:00:00 2001
From: Artem Baskal <a.baskal@adguard.com>
Date: Mon, 28 Dec 2020 16:39:15 +0300
Subject: [PATCH] client: 2451 Remove empty rules label

---
 client/src/components/Logs/Cells/ResponseCell.js | 9 ++++-----
 client/src/components/Logs/Cells/index.js        | 5 +++--
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/client/src/components/Logs/Cells/ResponseCell.js b/client/src/components/Logs/Cells/ResponseCell.js
index 026dbce1..3a3aeb60 100644
--- a/client/src/components/Logs/Cells/ResponseCell.js
+++ b/client/src/components/Logs/Cells/ResponseCell.js
@@ -51,18 +51,17 @@ const ResponseCell = ({
         })}</div>;
     };
 
-    const rulesList = getRulesToFilterList(rules, filters, whitelistFilters);
-
     const COMMON_CONTENT = {
         encryption_status: boldStatusLabel,
         install_settings_dns: upstream,
         elapsed: formattedElapsedMs,
         response_code: status,
         ...(service_name
-            ? { service_name: getServiceName(service_name) }
-            : { }
+                && { service_name: getServiceName(service_name) }
+        ),
+        ...(rules.length > 0
+                && { rule_label: getRulesToFilterList(rules, filters, whitelistFilters) }
         ),
-        rule_label: rulesList,
         response_table_header: renderResponses(response),
         original_response: renderResponses(originalResponse),
     };
diff --git a/client/src/components/Logs/Cells/index.js b/client/src/components/Logs/Cells/index.js
index 8435a617..bc1fc2ed 100644
--- a/client/src/components/Logs/Cells/index.js
+++ b/client/src/components/Logs/Cells/index.js
@@ -169,8 +169,9 @@ const Row = memo(({
             response_details: 'title',
             install_settings_dns: upstream,
             elapsed: formattedElapsedMs,
-            rule_label: rules.length > 0
-                    && getRulesToFilterList(rules, filters, whitelistFilters),
+            ...(rules.length > 0
+                    && { rule_label: getRulesToFilterList(rules, filters, whitelistFilters) }
+            ),
             response_table_header: response?.join('\n'),
             response_code: status,
             client_details: 'title',