Skip to content

Commit 572b38f

Browse files
Merge pull request #3899 from kris6673/feat-set-mailbox-rules
Add enable/disable mailbox rule actions
2 parents fcd89d4 + ae64d69 commit 572b38f

File tree

2 files changed

+64
-3
lines changed

2 files changed

+64
-3
lines changed

src/pages/email/administration/mailbox-rules/index.js

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,45 @@ import { TrashIcon } from "@heroicons/react/24/outline";
44
import { getCippTranslation } from "../../../../utils/get-cipp-translation";
55
import { getCippFormatting } from "../../../../utils/get-cipp-formatting";
66
import { CippPropertyListCard } from "../../../../components/CippCards/CippPropertyListCard";
7+
import { Block, PlayArrow, DeleteForever } from "@mui/icons-material";
78

89
const Page = () => {
910
const pageTitle = "Mailbox Rules";
1011
const actions = [
12+
{
13+
label: "Enable Mailbox Rule",
14+
type: "POST",
15+
icon: <PlayArrow />,
16+
url: "/api/ExecSetMailboxRule",
17+
data: {
18+
ruleId: "Identity",
19+
userPrincipalName: "UserPrincipalName",
20+
ruleName: "Name",
21+
Enable: true,
22+
},
23+
condition: (row) => !row.Enabled,
24+
confirmText: "Are you sure you want to enable this mailbox rule?",
25+
multiPost: false,
26+
},
27+
{
28+
label: "Disable Mailbox Rule",
29+
type: "POST",
30+
icon: <Block />,
31+
url: "/api/ExecSetMailboxRule",
32+
data: {
33+
ruleId: "Identity",
34+
userPrincipalName: "UserPrincipalName",
35+
ruleName: "Name",
36+
Disable: true,
37+
},
38+
condition: (row) => row.Enabled,
39+
confirmText: "Are you sure you want to disable this mailbox rule?",
40+
multiPost: false,
41+
},
1142
{
1243
label: "Remove Mailbox Rule",
1344
type: "POST",
14-
icon: <TrashIcon />,
45+
icon: <DeleteForever />,
1546
url: "/api/ExecRemoveMailboxRule",
1647
data: { ruleId: "Identity", userPrincipalName: "UserPrincipalName", ruleName: "Name" },
1748
confirmText: "Are you sure you want to remove this mailbox rule?",

src/pages/identity/administration/users/user/exchange.jsx

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import CippExchangeSettingsForm from "../../../../../components/CippFormPages/Ci
1818
import { useForm } from "react-hook-form";
1919
import { Alert, Button, Collapse, CircularProgress, Typography } from "@mui/material";
2020
import { CippApiResults } from "../../../../../components/CippComponents/CippApiResults";
21-
import { TrashIcon } from "@heroicons/react/24/outline";
21+
import { Block, PlayArrow, DeleteForever } from "@mui/icons-material";
2222
import { CippPropertyListCard } from "../../../../../components/CippCards/CippPropertyListCard";
2323
import { getCippTranslation } from "../../../../../utils/get-cipp-translation";
2424
import { getCippFormatting } from "../../../../../utils/get-cipp-formatting";
@@ -188,10 +188,40 @@ const Page = () => {
188188
];
189189

190190
const mailboxRuleActions = [
191+
{
192+
label: "Enable Mailbox Rule",
193+
type: "POST",
194+
icon: <PlayArrow />,
195+
url: "/api/ExecSetMailboxRule",
196+
data: {
197+
ruleId: "Identity",
198+
userPrincipalName: graphUserRequest.data?.[0]?.userPrincipalName,
199+
ruleName: "Name",
200+
Enable: true,
201+
},
202+
condition: (row) => !row.Enabled,
203+
confirmText: "Are you sure you want to enable this mailbox rule?",
204+
multiPost: false,
205+
},
206+
{
207+
label: "Disable Mailbox Rule",
208+
type: "POST",
209+
icon: <Block />,
210+
url: "/api/ExecSetMailboxRule",
211+
data: {
212+
ruleId: "Identity",
213+
userPrincipalName: graphUserRequest.data?.[0]?.userPrincipalName,
214+
ruleName: "Name",
215+
Disable: true,
216+
},
217+
condition: (row) => row.Enabled,
218+
confirmText: "Are you sure you want to disable this mailbox rule?",
219+
multiPost: false,
220+
},
191221
{
192222
label: "Remove Mailbox Rule",
193223
type: "POST",
194-
icon: <TrashIcon />,
224+
icon: <DeleteForever />,
195225
url: "/api/ExecRemoveMailboxRule",
196226
data: {
197227
ruleId: "Identity",

0 commit comments

Comments
 (0)