Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

Commit

Permalink
Revert "fix(UI): Remove checkbox for default options sent for ack (#1…
Browse files Browse the repository at this point in the history
…1008)" (#11018)

This reverts commit 7805085.
  • Loading branch information
adr-mo authored and tuntoja committed Apr 25, 2022
1 parent 6f868b0 commit 1391348
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ import {
labelNotify,
labelNotifyHelpCaption,
labelAcknowledgeServices,
labelPersistent,
labelSticky,
} from '../../../translatedLabels';
import { Resource } from '../../../models';
import useAclQuery from '../aclQuery';
Expand Down Expand Up @@ -121,6 +123,34 @@ const DialogAcknowledge = ({
/>
</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>
</Dialog>
);
Expand Down
7 changes: 4 additions & 3 deletions www/front_src/src/Resources/Actions/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import {
labelCritical,
labelUnknown,
labelAddComment,
labelPersistent,
} from '../translatedLabels';
import useLoadResources from '../Listing/useLoadResources';
import useListing from '../Listing/useListing';
Expand Down Expand Up @@ -76,7 +77,6 @@ jest.mock('react-redux', () => ({

const mockUserContext = {
acknowledgement: {
force_active_checks: true,
persistent: true,
sticky: false,
},
Expand Down Expand Up @@ -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: {} });
Expand All @@ -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,
},
Expand Down

0 comments on commit 1391348

Please sign in to comment.