From 01d8838235e3463f68259b082871cf7d08a0605b Mon Sep 17 00:00:00 2001 From: Luciano Gorza Date: Fri, 20 Oct 2023 17:32:21 -0300 Subject: [PATCH] Adjust ui components --- plugins/main/public/components/settings/about/appInfo.tsx | 4 +++- .../__snapshots__/updates-notification.test.tsx.snap | 2 -- .../components/apis-update-status/table/columns/index.tsx | 2 +- .../public/components/updates-notification.tsx | 5 +++-- plugins/wazuh-check-updates/translations/en-US.json | 2 +- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/plugins/main/public/components/settings/about/appInfo.tsx b/plugins/main/public/components/settings/about/appInfo.tsx index 2c8a9855c2..e896b8a57c 100644 --- a/plugins/main/public/components/settings/about/appInfo.tsx +++ b/plugins/main/public/components/settings/about/appInfo.tsx @@ -25,7 +25,9 @@ export const SettingsAboutAppInfo = ({ appInfo }: SettingsAboutAppInfoProps) => const { ApisUpdateStatus } = getWazuhCheckUpdatesPlugin(); const showVersionWarning = !!apisAvailableUpdates?.find( - (apiAvailableUpdates) => apiAvailableUpdates.version !== appInfo['app-version'] + (apiAvailableUpdates) => + apiAvailableUpdates.current_version && + apiAvailableUpdates.current_version.replace('v', '') !== appInfo['app-version'] ); return ( diff --git a/plugins/wazuh-check-updates/public/components/__snapshots__/updates-notification.test.tsx.snap b/plugins/wazuh-check-updates/public/components/__snapshots__/updates-notification.test.tsx.snap index d69c187531..d7f3e04108 100644 --- a/plugins/wazuh-check-updates/public/components/__snapshots__/updates-notification.test.tsx.snap +++ b/plugins/wazuh-check-updates/public/components/__snapshots__/updates-notification.test.tsx.snap @@ -6,8 +6,6 @@ exports[`UpdatesNotification component should return null when there are no avai exports[`UpdatesNotification component should return null when user already dismissed the notifications for available updates 1`] = `
`; -exports[`UpdatesNotification component should return null when user close notification 1`] = `
`; - exports[`UpdatesNotification component should return null when user dismissed notifications for future 1`] = `
`; exports[`UpdatesNotification component should return the nofication component 1`] = `
`; diff --git a/plugins/wazuh-check-updates/public/components/apis-update-status/table/columns/index.tsx b/plugins/wazuh-check-updates/public/components/apis-update-status/table/columns/index.tsx index 570fe5db0c..166002fa9d 100644 --- a/plugins/wazuh-check-updates/public/components/apis-update-status/table/columns/index.tsx +++ b/plugins/wazuh-check-updates/public/components/apis-update-status/table/columns/index.tsx @@ -65,7 +65,7 @@ export const getApisUpdateStatusColumns = () => { name, width: '200px', render: (lastUpdate: Update, api: ApiAvailableUpdates) => - api.status !== API_UPDATES_STATUS.ERROR && lastUpdate ? ( + api.status !== API_UPDATES_STATUS.ERROR && lastUpdate?.tag ? ( ) : null, }); diff --git a/plugins/wazuh-check-updates/public/components/updates-notification.tsx b/plugins/wazuh-check-updates/public/components/updates-notification.tsx index 37643f8120..abf4983add 100644 --- a/plugins/wazuh-check-updates/public/components/updates-notification.tsx +++ b/plugins/wazuh-check-updates/public/components/updates-notification.tsx @@ -94,6 +94,7 @@ export const UpdatesNotification = () => { { /> - handleOnClose()}> + handleOnClose()}> diff --git a/plugins/wazuh-check-updates/translations/en-US.json b/plugins/wazuh-check-updates/translations/en-US.json index ca84a400f2..c2b2e497ca 100644 --- a/plugins/wazuh-check-updates/translations/en-US.json +++ b/plugins/wazuh-check-updates/translations/en-US.json @@ -79,7 +79,7 @@ "wazuhCheckUpdates.updatesNotification.message": "New release is available!", "wazuhCheckUpdates.updatesNotification.linkText": "Go to the about page for details", "wazuhCheckUpdates.updatesNotification.dismissCheckText": "Disable updates notifications", - "wazuhCheckUpdates.updatesNotification.closeButtonText": "Close", + "wazuhCheckUpdates.updatesNotification.closeButtonText": "Dismiss", "wazuhCheckUpdates.apisUpdateStatus.upToDate": "Up to date", "wazuhCheckUpdates.apisUpdateStatus.availableUpdates": "Available updates", "wazuhCheckUpdates.apisUpdateStatus.error": "Error checking updates",