|
| 1 | +import { |
| 2 | + EyeIcon, |
| 3 | + TrashIcon, |
| 4 | + MagnifyingGlassIcon, |
| 5 | + PlayCircleIcon, |
| 6 | +} from "@heroicons/react/24/outline"; |
| 7 | +import { |
| 8 | + Archive, |
| 9 | + MailOutline, |
| 10 | + Person, |
| 11 | + Room, |
| 12 | + Visibility, |
| 13 | + VisibilityOff, |
| 14 | + PhonelinkLock, |
| 15 | + Key, |
| 16 | + PostAdd, |
| 17 | + Add, |
| 18 | +} from "@mui/icons-material"; |
| 19 | +import { useSettings } from "/src/hooks/use-settings.js"; |
| 20 | + |
| 21 | +export const CippExchangeActions = () => { |
| 22 | + // const tenant = useSettings().currentTenant; |
| 23 | + return [ |
| 24 | + { |
| 25 | + label: "Edit permissions", |
| 26 | + link: "/identity/administration/users/user/exchange?userId=[ExternalDirectoryObjectId]", |
| 27 | + color: "info", |
| 28 | + icon: <Key />, |
| 29 | + }, |
| 30 | + { |
| 31 | + label: "Research Compromised Account", |
| 32 | + link: "/identity/administration/users/user/bec?userId=[ExternalDirectoryObjectId]", |
| 33 | + color: "info", |
| 34 | + icon: <MagnifyingGlassIcon />, |
| 35 | + }, |
| 36 | + { |
| 37 | + label: "Send MFA Push", |
| 38 | + type: "POST", |
| 39 | + url: "/api/ExecSendPush", |
| 40 | + data: { |
| 41 | + UserEmail: "UPN", |
| 42 | + }, |
| 43 | + confirmText: "Are you sure you want to send an MFA request?", |
| 44 | + icon: <PhonelinkLock />, |
| 45 | + }, |
| 46 | + { |
| 47 | + label: "Convert to User Mailbox", |
| 48 | + type: "POST", |
| 49 | + url: "/api/ExecConvertMailbox", |
| 50 | + icon: <Person />, |
| 51 | + data: { |
| 52 | + ID: "UPN", |
| 53 | + MailboxType: "!Regular", |
| 54 | + }, |
| 55 | + confirmText: "Are you sure you want to convert this mailbox to a user mailbox?", |
| 56 | + condition: (row) => row.recipientTypeDetails !== "UserMailbox", |
| 57 | + }, |
| 58 | + { |
| 59 | + label: "Convert to Shared Mailbox", |
| 60 | + type: "POST", |
| 61 | + icon: <MailOutline />, |
| 62 | + url: "/api/ExecConvertMailbox", |
| 63 | + data: { |
| 64 | + ID: "UPN", |
| 65 | + MailboxType: "!Shared", |
| 66 | + }, |
| 67 | + confirmText: "Are you sure you want to convert this mailbox to a shared mailbox?", |
| 68 | + condition: (row) => row.recipientTypeDetails !== "SharedMailbox", |
| 69 | + }, |
| 70 | + { |
| 71 | + label: "Convert to Room Mailbox", |
| 72 | + type: "POST", |
| 73 | + url: "/api/ExecConvertMailbox", |
| 74 | + icon: <Room />, |
| 75 | + data: { |
| 76 | + ID: "UPN", |
| 77 | + MailboxType: "!Room", |
| 78 | + }, |
| 79 | + confirmText: "Are you sure you want to convert this mailbox to a room mailbox?", |
| 80 | + condition: (row) => row.recipientTypeDetails !== "RoomMailbox", |
| 81 | + }, |
| 82 | + { |
| 83 | + //tested |
| 84 | + label: "Enable Online Archive", |
| 85 | + type: "POST", |
| 86 | + icon: <Archive />, |
| 87 | + url: "/api/ExecEnableArchive", |
| 88 | + data: { ID: "Id", username: "UPN" }, |
| 89 | + confirmText: "Are you sure you want to enable the online archive for this user?", |
| 90 | + multiPost: false, |
| 91 | + condition: (row) => row.ArchiveGuid === "00000000-0000-0000-0000-000000000000", |
| 92 | + }, |
| 93 | + { |
| 94 | + label: "Enable Auto-Expanding Archive", |
| 95 | + type: "POST", |
| 96 | + icon: <PostAdd />, |
| 97 | + url: "/api/ExecEnableAutoExpandingArchive", |
| 98 | + data: { ID: "Id", username: "UPN" }, |
| 99 | + confirmText: |
| 100 | + "Are you sure you want to enable auto-expanding archive for this user? The archive must already be enabled.", |
| 101 | + multiPost: false, |
| 102 | + condition: (row) => row.ArchiveGuid !== "00000000-0000-0000-0000-000000000000", |
| 103 | + }, |
| 104 | + { |
| 105 | + label: "Hide from Global Address List", |
| 106 | + type: "POST", |
| 107 | + url: "/api/ExecHideFromGAL", |
| 108 | + icon: <VisibilityOff />, |
| 109 | + data: { |
| 110 | + ID: "UPN", |
| 111 | + HidefromGAL: true, |
| 112 | + }, |
| 113 | + confirmText: |
| 114 | + "Are you sure you want to hide this mailbox from the global address list? This will not work if the user is AD Synced.", |
| 115 | + condition: (row) => row.HiddenFromAddressListsEnabled === false, |
| 116 | + }, |
| 117 | + { |
| 118 | + label: "Unhide from Global Address List", |
| 119 | + type: "POST", |
| 120 | + url: "/api/ExecHideFromGAL", |
| 121 | + icon: <Visibility />, |
| 122 | + data: { |
| 123 | + ID: "UPN", |
| 124 | + HidefromGAL: false, |
| 125 | + }, |
| 126 | + confirmText: |
| 127 | + "Are you sure you want to unhide this mailbox from the global address list? This will not work if the user is AD Synced.", |
| 128 | + condition: (row) => row.HiddenFromAddressListsEnabled === true, |
| 129 | + }, |
| 130 | + { |
| 131 | + label: "Start Managed Folder Assistant", |
| 132 | + type: "POST", |
| 133 | + url: "/api/ExecStartManagedFolderAssistant", |
| 134 | + icon: <PlayCircleIcon />, |
| 135 | + data: { |
| 136 | + ID: "ExchangeGuid", |
| 137 | + UserPrincipalName: "UPN", |
| 138 | + }, |
| 139 | + confirmText: "Are you sure you want to start the managed folder assistant for this user?", |
| 140 | + }, |
| 141 | + { |
| 142 | + label: "Delete Mailbox", |
| 143 | + type: "POST", |
| 144 | + icon: <TrashIcon />, |
| 145 | + url: "/api/RemoveUser", |
| 146 | + data: { ID: "UPN" }, |
| 147 | + confirmText: "Are you sure you want to delete this mailbox?", |
| 148 | + multiPost: false, |
| 149 | + }, |
| 150 | + { |
| 151 | + label: "Copy Sent Items to Shared Mailbox", |
| 152 | + type: "POST", |
| 153 | + url: "/api/ExecCopyForSent", |
| 154 | + data: { ID: "UPN" }, |
| 155 | + confirmText: "Are you sure you want to enable Copy Sent Items to Shared Mailbox?", |
| 156 | + icon: <MailOutline />, |
| 157 | + condition: (row) => |
| 158 | + row.MessageCopyForSentAsEnabled === false && row.recipientTypeDetails === "SharedMailbox", |
| 159 | + }, |
| 160 | + { |
| 161 | + label: "Disable Copy Sent Items to Shared Mailbox", |
| 162 | + type: "POST", |
| 163 | + url: "/api/ExecCopyForSent", |
| 164 | + data: { ID: "UPN", MessageCopyForSentAsEnabled: false }, |
| 165 | + confirmText: "Are you sure you want to disable Copy Sent Items to Shared Mailbox?", |
| 166 | + icon: <MailOutline />, |
| 167 | + condition: (row) => |
| 168 | + row.MessageCopyForSentAsEnabled === true && row.recipientTypeDetails === "SharedMailbox", |
| 169 | + }, |
| 170 | + { |
| 171 | + label: "Set mailbox locale", |
| 172 | + type: "POST", |
| 173 | + url: "/api/ExecSetMailboxLocale", |
| 174 | + data: { user: "UPN", ProhibitSendQuota: true }, |
| 175 | + confirmText: "Enter a locale, e.g. en-US", |
| 176 | + icon: <MailOutline />, |
| 177 | + fields: [ |
| 178 | + { |
| 179 | + label: "Locale", |
| 180 | + name: "locale", |
| 181 | + type: "textField", |
| 182 | + placeholder: "e.g. en-US", |
| 183 | + }, |
| 184 | + ], |
| 185 | + }, |
| 186 | + { |
| 187 | + label: "Set Send Quota", |
| 188 | + type: "POST", |
| 189 | + url: "/api/ExecSetMailboxQuota", |
| 190 | + data: { user: "UPN", ProhibitSendQuota: true }, |
| 191 | + confirmText: "Enter a quota. e.g. 1000MB, 10GB,1TB", |
| 192 | + icon: <MailOutline />, |
| 193 | + fields: [ |
| 194 | + { |
| 195 | + label: "Quota", |
| 196 | + name: "quota", |
| 197 | + type: "textField", |
| 198 | + placeholder: "e.g. 1000MB, 10GB,1TB", |
| 199 | + }, |
| 200 | + ], |
| 201 | + }, |
| 202 | + { |
| 203 | + label: "Set Send and Receive Quota", |
| 204 | + type: "POST", |
| 205 | + url: "/api/ExecSetMailboxQuota", |
| 206 | + data: { |
| 207 | + user: "UPN", |
| 208 | + ProhibitSendReceiveQuota: true, |
| 209 | + }, |
| 210 | + confirmText: "Enter a quota. e.g. 1000MB, 10GB,1TB", |
| 211 | + icon: <MailOutline />, |
| 212 | + fields: [ |
| 213 | + { |
| 214 | + label: "Quota", |
| 215 | + name: "quota", |
| 216 | + type: "textField", |
| 217 | + placeholder: "e.g. 1000MB, 10GB,1TB", |
| 218 | + }, |
| 219 | + ], |
| 220 | + }, |
| 221 | + { |
| 222 | + label: "Set Quota Warning Level", |
| 223 | + type: "POST", |
| 224 | + url: "/api/ExecSetMailboxQuota", |
| 225 | + data: { user: "UPN", IssueWarningQuota: true }, |
| 226 | + confirmText: "Enter a quota. e.g. 1000MB, 10GB,1TB", |
| 227 | + icon: <MailOutline />, |
| 228 | + fields: [ |
| 229 | + { |
| 230 | + label: "Quota", |
| 231 | + name: "quota", |
| 232 | + type: "textField", |
| 233 | + placeholder: "e.g. 1000MB, 10GB,1TB", |
| 234 | + }, |
| 235 | + ], |
| 236 | + }, |
| 237 | + ]; |
| 238 | +}; |
| 239 | + |
| 240 | +export default CippExchangeActions; |
0 commit comments