From 1391348383e43c9b2e700d20a88ced2b3699c56b Mon Sep 17 00:00:00 2001 From: Adrien Morais-Mestre <31647811+adr-mo@users.noreply.github.com> Date: Mon, 25 Apr 2022 13:56:36 +0200 Subject: [PATCH] Revert "fix(UI): Remove checkbox for default options sent for ack (#11008)" (#11018) This reverts commit 7805085fcdbe19cecca9e05b99cda05e022699d6. --- .../Actions/Resource/Acknowledge/Dialog.tsx | 30 +++++++++++++++++++ .../src/Resources/Actions/index.test.tsx | 7 +++-- 2 files changed, 34 insertions(+), 3 deletions(-) diff --git a/www/front_src/src/Resources/Actions/Resource/Acknowledge/Dialog.tsx b/www/front_src/src/Resources/Actions/Resource/Acknowledge/Dialog.tsx index 6627245ae5c..f877afe0221 100644 --- a/www/front_src/src/Resources/Actions/Resource/Acknowledge/Dialog.tsx +++ b/www/front_src/src/Resources/Actions/Resource/Acknowledge/Dialog.tsx @@ -20,6 +20,8 @@ import { labelNotify, labelNotifyHelpCaption, labelAcknowledgeServices, + labelPersistent, + labelSticky, } from '../../../translatedLabels'; import { Resource } from '../../../models'; import useAclQuery from '../aclQuery'; @@ -121,6 +123,34 @@ const DialogAcknowledge = ({ /> )} + + + } + label={t(labelPersistent) as string} + /> + + + + } + label={t(labelSticky) as string} + /> + ); diff --git a/www/front_src/src/Resources/Actions/index.test.tsx b/www/front_src/src/Resources/Actions/index.test.tsx index 5d7450c9b9a..7bc24118611 100644 --- a/www/front_src/src/Resources/Actions/index.test.tsx +++ b/www/front_src/src/Resources/Actions/index.test.tsx @@ -46,6 +46,7 @@ import { labelCritical, labelUnknown, labelAddComment, + labelPersistent, } from '../translatedLabels'; import useLoadResources from '../Listing/useLoadResources'; import useListing from '../Listing/useListing'; @@ -76,7 +77,6 @@ jest.mock('react-redux', () => ({ const mockUserContext = { acknowledgement: { - force_active_checks: true, persistent: true, sticky: false, }, @@ -285,8 +285,10 @@ describe(Actions, () => { fireEvent.click(getByText(labelAcknowledge)); const notifyCheckbox = await findByLabelText(labelNotify); + const persistentCheckbox = await findByLabelText(labelPersistent); fireEvent.click(notifyCheckbox); + fireEvent.click(persistentCheckbox); fireEvent.click(getByLabelText(labelAcknowledgeServices)); mockedAxios.get.mockResolvedValueOnce({ data: {} }); @@ -300,9 +302,8 @@ describe(Actions, () => { { acknowledgement: { comment: labelAcknowledgedByAdmin, - force_active_checks: true, is_notify_contacts: true, - is_persistent_comment: true, + is_persistent_comment: false, is_sticky: false, with_services: true, },