Skip to content

Add enable/disable mailbox rule actions #3899

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 32 additions & 1 deletion src/pages/email/administration/mailbox-rules/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,45 @@ import { TrashIcon } from "@heroicons/react/24/outline";
import { getCippTranslation } from "../../../../utils/get-cipp-translation";
import { getCippFormatting } from "../../../../utils/get-cipp-formatting";
import { CippPropertyListCard } from "../../../../components/CippCards/CippPropertyListCard";
import { Block, PlayArrow, DeleteForever } from "@mui/icons-material";

const Page = () => {
const pageTitle = "Mailbox Rules";
const actions = [
{
label: "Enable Mailbox Rule",
type: "POST",
icon: <PlayArrow />,
url: "/api/ExecSetMailboxRule",
data: {
ruleId: "Identity",
userPrincipalName: "UserPrincipalName",
ruleName: "Name",
Enable: true,
},
condition: (row) => !row.Enabled,
confirmText: "Are you sure you want to enable this mailbox rule?",
multiPost: false,
},
{
label: "Disable Mailbox Rule",
type: "POST",
icon: <Block />,
url: "/api/ExecSetMailboxRule",
data: {
ruleId: "Identity",
userPrincipalName: "UserPrincipalName",
ruleName: "Name",
Disable: true,
},
condition: (row) => row.Enabled,
confirmText: "Are you sure you want to disable this mailbox rule?",
multiPost: false,
},
{
label: "Remove Mailbox Rule",
type: "POST",
icon: <TrashIcon />,
icon: <DeleteForever />,
url: "/api/ExecRemoveMailboxRule",
data: { ruleId: "Identity", userPrincipalName: "UserPrincipalName", ruleName: "Name" },
confirmText: "Are you sure you want to remove this mailbox rule?",
Expand Down
34 changes: 32 additions & 2 deletions src/pages/identity/administration/users/user/exchange.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import CippExchangeSettingsForm from "../../../../../components/CippFormPages/Ci
import { useForm } from "react-hook-form";
import { Alert, Button, Collapse, CircularProgress, Typography } from "@mui/material";
import { CippApiResults } from "../../../../../components/CippComponents/CippApiResults";
import { TrashIcon } from "@heroicons/react/24/outline";
import { Block, PlayArrow, DeleteForever } from "@mui/icons-material";
import { CippPropertyListCard } from "../../../../../components/CippCards/CippPropertyListCard";
import { getCippTranslation } from "../../../../../utils/get-cipp-translation";
import { getCippFormatting } from "../../../../../utils/get-cipp-formatting";
Expand Down Expand Up @@ -188,10 +188,40 @@ const Page = () => {
];

const mailboxRuleActions = [
{
label: "Enable Mailbox Rule",
type: "POST",
icon: <PlayArrow />,
url: "/api/ExecSetMailboxRule",
data: {
ruleId: "Identity",
userPrincipalName: graphUserRequest.data?.[0]?.userPrincipalName,
ruleName: "Name",
Enable: true,
},
condition: (row) => !row.Enabled,
confirmText: "Are you sure you want to enable this mailbox rule?",
multiPost: false,
},
{
label: "Disable Mailbox Rule",
type: "POST",
icon: <Block />,
url: "/api/ExecSetMailboxRule",
data: {
ruleId: "Identity",
userPrincipalName: graphUserRequest.data?.[0]?.userPrincipalName,
ruleName: "Name",
Disable: true,
},
condition: (row) => row.Enabled,
confirmText: "Are you sure you want to disable this mailbox rule?",
multiPost: false,
},
{
label: "Remove Mailbox Rule",
type: "POST",
icon: <TrashIcon />,
icon: <DeleteForever />,
url: "/api/ExecRemoveMailboxRule",
data: {
ruleId: "Identity",
Expand Down
Loading