From 9694f19efe7e3aa8ea37cd074adcf808fe3f2e63 Mon Sep 17 00:00:00 2001 From: Ildar Kamalov Date: Wed, 17 Jan 2024 10:32:19 +0300 Subject: [PATCH] Pull request: fix client schedule update Squashed commit of the following: commit b3c6c20aa5196053754e73db613c1c459ef9236b Merge: dfd1eff37 6dbeb5b97 Author: Ildar Kamalov Date: Tue Jan 16 13:31:45 2024 +0300 Merge branch 'master' into ADG-7988 commit dfd1eff37f5f2c02f2053bffbec4cc2e524429c3 Merge: 2de46aaf6 f7995aa02 Author: Ildar Kamalov Date: Tue Jan 16 12:42:39 2024 +0300 Merge branch 'master' into ADG-7988 commit 2de46aaf6834389fa71806089663e72479f72717 Merge: ac5a23c19 1e0ff4d43 Author: Ildar Kamalov Date: Fri Jan 12 13:19:39 2024 +0300 Merge branch 'master' into ADG-7988 commit ac5a23c199cee65150029a307f9398e5022dd62f Author: Ildar Kamalov Date: Thu Jan 11 10:28:07 2024 +0300 fix error commit d0103f4556a39b7c285f216f7453178439b92165 Author: Ildar Kamalov Date: Wed Jan 10 19:19:22 2024 +0300 ADG-7988 fix client schedule update --- CHANGELOG.md | 1 + .../src/components/Filters/Services/ScheduleForm/index.js | 7 ++----- client/src/components/Settings/Clients/Form.js | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cdd34a4c..dbc875db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -71,6 +71,7 @@ In this release, the schema version has changed from 27 to 28. ### Fixed +- Schedule display in the client settings after creating or updating. - Zero value in `querylog.size_memory` disables logging ([#6570]). - Non-anonymized IP addresses on the dashboard ([#6584]). - Maximum cache TTL requirement when editing minimum cache TTL in the Web UI diff --git a/client/src/components/Filters/Services/ScheduleForm/index.js b/client/src/components/Filters/Services/ScheduleForm/index.js index f7bf605b..e2de3c41 100644 --- a/client/src/components/Filters/Services/ScheduleForm/index.js +++ b/client/src/components/Filters/Services/ScheduleForm/index.js @@ -1,4 +1,4 @@ -import React, { useState, useMemo } from 'react'; +import React, { useState } from 'react'; import { useTranslation } from 'react-i18next'; import PropTypes from 'prop-types'; import cn from 'classnames'; @@ -21,10 +21,7 @@ export const ScheduleForm = ({ const onModalOpen = () => setModalOpen(true); const onModalClose = () => setModalOpen(false); - const filteredScheduleKeys = useMemo(() => ( - schedule ? Object.keys(schedule).filter((v) => v !== 'time_zone') : [] - ), [schedule]); - + const filteredScheduleKeys = schedule ? Object.keys(schedule).filter((v) => v !== 'time_zone') : []; const scheduleMap = new Map(); filteredScheduleKeys.forEach((day) => scheduleMap.set(day, schedule[day])); diff --git a/client/src/components/Settings/Clients/Form.js b/client/src/components/Settings/Clients/Form.js index ba4ec4b3..8989ae6c 100644 --- a/client/src/components/Settings/Clients/Form.js +++ b/client/src/components/Settings/Clients/Form.js @@ -162,7 +162,7 @@ let Form = (props) => { const [activeTabLabel, setActiveTabLabel] = useState('settings'); const handleScheduleSubmit = (values) => { - change('blocked_services_schedule', values); + change('blocked_services_schedule', { ...values }); }; const tabs = {