Pull request: fix client schedule update

Squashed commit of the following:

commit b3c6c20aa5
Merge: dfd1eff37 6dbeb5b97
Author: Ildar Kamalov <ik@adguard.com>
Date:   Tue Jan 16 13:31:45 2024 +0300

    Merge branch 'master' into ADG-7988

commit dfd1eff37f
Merge: 2de46aaf6 f7995aa02
Author: Ildar Kamalov <ik@adguard.com>
Date:   Tue Jan 16 12:42:39 2024 +0300

    Merge branch 'master' into ADG-7988

commit 2de46aaf68
Merge: ac5a23c19 1e0ff4d43
Author: Ildar Kamalov <ik@adguard.com>
Date:   Fri Jan 12 13:19:39 2024 +0300

    Merge branch 'master' into ADG-7988

commit ac5a23c199
Author: Ildar Kamalov <ik@adguard.com>
Date:   Thu Jan 11 10:28:07 2024 +0300

    fix error

commit d0103f4556
Author: Ildar Kamalov <ik@adguard.com>
Date:   Wed Jan 10 19:19:22 2024 +0300

    ADG-7988 fix client schedule update
This commit is contained in:
Ildar Kamalov 2024-01-17 10:32:19 +03:00
parent 6dbeb5b971
commit 9694f19efe
3 changed files with 4 additions and 6 deletions

View File

@ -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

View File

@ -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]));

View File

@ -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 = {