Skip to content

Commit

Permalink
Merge pull request #3428 from JohnDuprey/dev
Browse files Browse the repository at this point in the history
more actions for mailboxes
  • Loading branch information
JohnDuprey authored Jan 22, 2025
2 parents 2119fd5 + b39e2a3 commit 5f9e55f
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 3 deletions.
48 changes: 45 additions & 3 deletions src/pages/email/administration/mailboxes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,18 @@ import { Layout as DashboardLayout } from "/src/layouts/index.js";
import { CippTablePage } from "/src/components/CippComponents/CippTablePage.jsx";
import Link from "next/link";
import { Button } from "@mui/material";
import { Row } from "jspdf-autotable";

import {
Archive,
MailOutline,
Person,
Room,
Visibility,
VisibilityOff,
PhonelinkLock,
Key,
} from "@mui/icons-material";
import { TrashIcon, MagnifyingGlassIcon, PlayCircleIcon } from "@heroicons/react/24/outline";

const Page = () => {
const pageTitle = "Mailboxes";
Expand All @@ -13,11 +24,13 @@ const Page = () => {
label: "Edit permissions",
link: "/identity/administration/users/user/exchange?userId=[Id]",
color: "info",
icon: <Key />,
},
{
label: "Research Compromised Account",
link: "/identity/administration/users/user/bec?userId=[UPN]",
color: "info",
icon: <MagnifyingGlassIcon />,
},
{
label: "Send MFA Push",
Expand All @@ -27,10 +40,12 @@ const Page = () => {
UserEmail: "mail",
},
confirmText: "Are you sure you want to send an MFA request?",
icon: <PhonelinkLock />,
},
{
label: "Convert to Shared Mailbox",
type: "GET",
icon: <MailOutline />,
url: "/api/ExecConvertToSharedMailbox",
data: {
ID: "UPN",
Expand All @@ -42,6 +57,7 @@ const Page = () => {
label: "Convert to User Mailbox",
type: "GET",
url: "/api/ExecConvertToSharedMailbox",
icon: <Person />,
data: {
ID: "UPN",
ConvertToUser: true,
Expand All @@ -53,42 +69,68 @@ const Page = () => {
label: "Convert to Room Mailbox",
type: "GET",
url: "/api/ExecConvertToRoomMailbox",
icon: <Room />,
data: {
ID: "UPN",
},
confirmText: "Are you sure you want to convert this mailbox to a room mailbox?",
condition: (row) => row.recipientTypeDetails !== "RoomMailbox",
},
{
//tested
label: "Enable Online Archive",
type: "GET",
icon: <Archive />,
url: "/api/ExecEnableArchive",
data: { ID: "UPN" },
confirmText: "Are you sure you want to enable the online archive for this user?",
multiPost: false,
condition: (row) => row.ArchiveGuid === "00000000-0000-0000-0000-000000000000",
},
{
label: "Hide from Global Address List",
type: "POST",
url: "/api/ExecHideFromGAL",
icon: <VisibilityOff />,
data: {
ID: "UPN",
HidefromGAL: true,
},
confirmText:
"Are you sure you want to hide this mailbox from the global address list? This will not work if the user is AD Synced.",
condition: (row) => row.HiddenFromAddressListsEnabled === false,
},
{
label: "Unhide from Global Address List",
type: "POST",
url: "/api/ExecHideFromGAL",
icon: <Visibility />,
data: {
ID: "UPN",
},
confirmText:
"Are you sure you want to unhide this mailbox from the global address list? This will not work if the user is AD Synced.",
condition: (row) => row.HiddenFromAddressListsEnabled === true,
},
{
label: "Start Managed Folder Assistant",
type: "GET",
url: "/api/ExecStartManagedFolderAssistant",
icon: <PlayCircleIcon />,
data: {
ID: "UPN",
},
confirmText: "Are you sure you want to start the managed folder assistant for this user?",
},
{
label: "Delete Mailbox",
type: "GET",
icon: <TrashIcon />, // Added
url: "/api/RemoveMailbox",
data: { ID: "UPN" },
confirmText: "Are you sure you want to delete this mailbox?",
multiPost: false,
},
];

// Define off-canvas details
Expand Down Expand Up @@ -122,11 +164,11 @@ const Page = () => {

// Simplified columns for the table
const simpleColumns = [
"UPN", // User Principal Name
"displayName", // Display Name
"recipientTypeDetails", // Recipient Type Details
"UPN", // User Principal Name
"primarySmtpAddress", // Primary Email Address
"recipientType", // Recipient Type
"recipientTypeDetails", // Recipient Type Details
"AdditionalEmailAddresses", // Additional Email Addresses
];

Expand Down
12 changes: 12 additions & 0 deletions src/pages/identity/administration/users/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,15 @@ const Page = () => {
confirmText: "Are you sure you want to convert this user to a shared mailbox?",
multiPost: false,
},
{
label: "Convert to User Mailbox",
type: "GET",
icon: <Email />,
url: "/api/ExecConvertToSharedMailbox",
data: { ID: "userPrincipalName", ConvertToUser: true },
confirmText: "Are you sure you want to convert this user to a user mailbox?",
multiPost: false,
},
{
//tested
label: "Enable Online Archive",
Expand Down Expand Up @@ -239,6 +248,7 @@ const Page = () => {
data: { ID: "id" },
confirmText: "Are you sure you want to block the sign-in for this user?",
multiPost: false,
condition: (row) => row.accountEnabled,
},
{
label: "Unblock Sign In",
Expand All @@ -248,6 +258,7 @@ const Page = () => {
data: { ID: "id", Enable: true },
confirmText: "Are you sure you want to unblock sign-in for this user?",
multiPost: false,
condition: (row) => !row.accountEnabled,
},
{
label: "Reset Password (Must Change)",
Expand Down Expand Up @@ -286,6 +297,7 @@ const Page = () => {
},
confirmText: "Are you sure you want to clear the Immutable ID for this user?",
multiPost: false,
condition: (row) => row.onPremisesSyncEnabled,
},
{
label: "Revoke all user sessions",
Expand Down

0 comments on commit 5f9e55f

Please sign in to comment.