Skip to content

Fixed Mailbox Rule offCanvas erroring when attempting to open #4351

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
Jun 26, 2025
Merged
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
87 changes: 68 additions & 19 deletions src/pages/identity/administration/users/user/exchange.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -669,13 +669,15 @@ const Page = () => {
type: "POST",
icon: <PlayArrow />,
url: "/api/ExecSetMailboxRule",
data: {
ruleId: "Identity",
userPrincipalName: graphUserRequest.data?.[0]?.userPrincipalName,
ruleName: "Name",
Enable: true,
customDataformatter: (row, action, formData) => {
return {
ruleId: row?.Identity,
userPrincipalName: graphUserRequest.data?.[0]?.userPrincipalName,
ruleName: row?.Name,
Enable: true,
};
},
condition: (row) => !row.Enabled,
condition: (row) => row && !row.Enabled,
confirmText: "Are you sure you want to enable this mailbox rule?",
multiPost: false,
},
Expand All @@ -684,13 +686,15 @@ const Page = () => {
type: "POST",
icon: <Block />,
url: "/api/ExecSetMailboxRule",
data: {
ruleId: "Identity",
userPrincipalName: graphUserRequest.data?.[0]?.userPrincipalName,
ruleName: "Name",
Disable: true,
customDataformatter: (row, action, formData) => {
return {
ruleId: row?.Identity,
userPrincipalName: graphUserRequest.data?.[0]?.userPrincipalName,
ruleName: row?.Name,
Disable: true,
};
},
condition: (row) => row.Enabled,
condition: (row) => row && row.Enabled,
confirmText: "Are you sure you want to disable this mailbox rule?",
multiPost: false,
},
Expand All @@ -699,10 +703,12 @@ const Page = () => {
type: "POST",
icon: <Delete />,
url: "/api/ExecRemoveMailboxRule",
data: {
ruleId: "Identity",
ruleName: "Name",
userPrincipalName: graphUserRequest.data?.[0]?.userPrincipalName,
customDataformatter: (row, action, formData) => {
return {
ruleId: row?.Identity,
ruleName: row?.Name,
userPrincipalName: graphUserRequest.data?.[0]?.userPrincipalName,
};
},
confirmText: "Are you sure you want to remove this mailbox rule?",
multiPost: false,
Expand Down Expand Up @@ -754,7 +760,50 @@ const Page = () => {
cardSx={{ p: 0, m: -2 }}
title="Rule Details"
propertyItems={properties}
actionItems={mailboxRuleActions}
actionItems={[
{
label: "Enable Mailbox Rule",
type: "POST",
icon: <PlayArrow />,
url: "/api/ExecSetMailboxRule",
data: {
ruleId: data?.Identity,
userPrincipalName: graphUserRequest.data?.[0]?.userPrincipalName,
ruleName: data?.Name,
Enable: true,
},
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: data?.Identity,
userPrincipalName: graphUserRequest.data?.[0]?.userPrincipalName,
ruleName: data?.Name,
Disable: true,
},
confirmText: "Are you sure you want to disable this mailbox rule?",
multiPost: false,
},
{
label: "Remove Mailbox Rule",
type: "POST",
icon: <Delete />,
url: "/api/ExecRemoveMailboxRule",
data: {
ruleId: data?.Identity,
ruleName: data?.Name,
userPrincipalName: graphUserRequest.data?.[0]?.userPrincipalName,
},
confirmText: "Are you sure you want to remove this mailbox rule?",
multiPost: false,
relatedQueryKeys: `MailboxRules-${userId}`,
},
]}
/>
);
},
Expand All @@ -777,7 +826,7 @@ const Page = () => {
confirmText: "Are you sure you want to make this the primary proxy address?",
multiPost: false,
relatedQueryKeys: `ListUsers-${userId}`,
condition: (row) => !row.Type === "Primary",
condition: (row) => row && row.Type !== "Primary",
},
{
label: "Remove Proxy Address",
Expand All @@ -792,7 +841,7 @@ const Page = () => {
confirmText: "Are you sure you want to remove this proxy address?",
multiPost: false,
relatedQueryKeys: `ListUsers-${userId}`,
condition: (row) => !row.Type === "Primary",
condition: (row) => row && row.Type !== "Primary",
},
];

Expand Down
Loading