From 5dba6f44b6ae0a5b6d3fd528dbfc805db21daa39 Mon Sep 17 00:00:00 2001 From: Nico Guevara <42900763+Tostti@users.noreply.github.com> Date: Wed, 30 Nov 2022 16:29:51 -0300 Subject: [PATCH] Fix display of remote protocols when there are more than one (#4917) * Modify render function to separate arrays * Update changelog --- CHANGELOG.md | 1 + .../management/configuration/utils/utils.js | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4892d17c24..f97a855fd3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ All notable changes to the Wazuh app project will be documented in this file. - Fixed an issue that caused incorrect visualization of IPv6 addresses ([#4909](https://github.com/wazuh/wazuh-kibana-app/pull/4909)). - Fixed several typos in the code, by @jctello [#4911](https://github.com/wazuh/wazuh-kibana-app/pull/4911) +- Fixed the display of more than one protocol in the Global configuration section [#4917](https://github.com/wazuh/wazuh-kibana-app/pull/4917) - Handling endpoint response was done when there is no data to show [#4918]https://github.com/wazuh/wazuh-kibana-app/pull/4918 ## Wazuh v4.4.0 - Kibana 7.10.2, 7.16.x, 7.17.x - Revision 4400 diff --git a/public/controllers/management/components/management/configuration/utils/utils.js b/public/controllers/management/components/management/configuration/utils/utils.js index ef9a6b96ce..bb7782ca54 100644 --- a/public/controllers/management/components/management/configuration/utils/utils.js +++ b/public/controllers/management/components/management/configuration/utils/utils.js @@ -103,8 +103,15 @@ export const objectWithoutProperties = obj => { * @param {any} defaultValue * @returns {function} */ -export const renderValueOrDefault = defaultValue => value => - typeof value !== 'undefined' ? value : defaultValue; +export const renderValueOrDefault = defaultValue => value => { + if (typeof value !== 'undefined') { + if (isArray(value)) { + return value.join(', '); + } + return value; + } + return defaultValue; +}; /** * Return value if isn't falsy or '-'