Commit 13913483 authored by Adrien Morais-Mestre's avatar Adrien Morais-Mestre Committed by Thomas Untoja
Browse files

Revert "fix(UI): Remove checkbox for default options sent for ack (#11008)" (#11018)

This reverts commit 7805085f.
parent 6f868b05
...@@ -20,6 +20,8 @@ import { ...@@ -20,6 +20,8 @@ import {
labelNotify, labelNotify,
labelNotifyHelpCaption, labelNotifyHelpCaption,
labelAcknowledgeServices, labelAcknowledgeServices,
labelPersistent,
labelSticky,
} from '../../../translatedLabels'; } from '../../../translatedLabels';
import { Resource } from '../../../models'; import { Resource } from '../../../models';
import useAclQuery from '../aclQuery'; import useAclQuery from '../aclQuery';
...@@ -121,6 +123,34 @@ const DialogAcknowledge = ({ ...@@ -121,6 +123,34 @@ const DialogAcknowledge = ({
/> />
</Grid> </Grid>
)} )}
<Grid item>
<FormControlLabel
control={
<Checkbox
checked={values.persistent}
color="primary"
inputProps={{ 'aria-label': t(labelPersistent) }}
size="small"
onChange={handleChange('persistent')}
/>
}
label={t(labelPersistent) as string}
/>
</Grid>
<Grid item>
<FormControlLabel
control={
<Checkbox
checked={values.isSticky}
color="primary"
inputProps={{ 'aria-label': t(labelSticky) }}
size="small"
onChange={handleChange('isSticky')}
/>
}
label={t(labelSticky) as string}
/>
</Grid>
</Grid> </Grid>
</Dialog> </Dialog>
); );
......
...@@ -46,6 +46,7 @@ import { ...@@ -46,6 +46,7 @@ import {
labelCritical, labelCritical,
labelUnknown, labelUnknown,
labelAddComment, labelAddComment,
labelPersistent,
} from '../translatedLabels'; } from '../translatedLabels';
import useLoadResources from '../Listing/useLoadResources'; import useLoadResources from '../Listing/useLoadResources';
import useListing from '../Listing/useListing'; import useListing from '../Listing/useListing';
...@@ -76,7 +77,6 @@ jest.mock('react-redux', () => ({ ...@@ -76,7 +77,6 @@ jest.mock('react-redux', () => ({
const mockUserContext = { const mockUserContext = {
acknowledgement: { acknowledgement: {
force_active_checks: true,
persistent: true, persistent: true,
sticky: false, sticky: false,
}, },
...@@ -285,8 +285,10 @@ describe(Actions, () => { ...@@ -285,8 +285,10 @@ describe(Actions, () => {
fireEvent.click(getByText(labelAcknowledge)); fireEvent.click(getByText(labelAcknowledge));
const notifyCheckbox = await findByLabelText(labelNotify); const notifyCheckbox = await findByLabelText(labelNotify);
const persistentCheckbox = await findByLabelText(labelPersistent);
fireEvent.click(notifyCheckbox); fireEvent.click(notifyCheckbox);
fireEvent.click(persistentCheckbox);
fireEvent.click(getByLabelText(labelAcknowledgeServices)); fireEvent.click(getByLabelText(labelAcknowledgeServices));
mockedAxios.get.mockResolvedValueOnce({ data: {} }); mockedAxios.get.mockResolvedValueOnce({ data: {} });
...@@ -300,9 +302,8 @@ describe(Actions, () => { ...@@ -300,9 +302,8 @@ describe(Actions, () => {
{ {
acknowledgement: { acknowledgement: {
comment: labelAcknowledgedByAdmin, comment: labelAcknowledgedByAdmin,
force_active_checks: true,
is_notify_contacts: true, is_notify_contacts: true,
is_persistent_comment: true, is_persistent_comment: false,
is_sticky: false, is_sticky: false,
with_services: true, with_services: true,
}, },
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment