diff --git a/src/components/CippCards/CippBannerListCard.jsx b/src/components/CippCards/CippBannerListCard.jsx
index 41d3609a1756..a0bab7612a02 100644
--- a/src/components/CippCards/CippBannerListCard.jsx
+++ b/src/components/CippCards/CippBannerListCard.jsx
@@ -13,6 +13,7 @@ import {
} from "@mui/material";
import ChevronDownIcon from "@heroicons/react/24/outline/ChevronDownIcon";
import { CippPropertyListCard } from "./CippPropertyListCard";
+import { CippDataTable } from "../CippTable/CippDataTable";
export const CippBannerListCard = (props) => {
const { items = [], isCollapsible = false, isFetching = false, ...other } = props;
@@ -113,17 +114,19 @@ export const CippBannerListCard = (props) => {
{/* Right Side: Status and Expand Icon */}
-
-
- {item.statusText}
-
+ {item?.statusText && (
+
+
+ {item.statusText}
+
+ )}
{isCollapsible && (
handleExpand(item.id)}>
{
{isCollapsible && (
-
+ {item?.propertyItems?.length > 0 && (
+
+ )}
+ {item?.table && }
)}
diff --git a/src/components/CippComponents/CippUserActions.jsx b/src/components/CippComponents/CippUserActions.jsx
new file mode 100644
index 000000000000..fe532d259f4b
--- /dev/null
+++ b/src/components/CippComponents/CippUserActions.jsx
@@ -0,0 +1,317 @@
+import { EyeIcon, MagnifyingGlassIcon, TrashIcon } from "@heroicons/react/24/outline";
+import {
+ Archive,
+ Block,
+ Clear,
+ CloudDone,
+ Edit,
+ Email,
+ ForwardToInbox,
+ GroupAdd,
+ LockOpen,
+ LockPerson,
+ LockReset,
+ MeetingRoom,
+ NoMeetingRoom,
+ Password,
+ PersonOff,
+ PhonelinkLock,
+ PhonelinkSetup,
+ Shortcut,
+} from "@mui/icons-material";
+import { useSettings } from "/src/hooks/use-settings.js";
+
+export const CippUserActions = () => {
+ const tenant = useSettings().currentTenant;
+ return [
+ {
+ //tested
+ label: "View User",
+ link: "/identity/administration/users/user?userId=[id]",
+ multiPost: false,
+ icon: ,
+ color: "success",
+ },
+ {
+ //tested
+ label: "Edit User",
+ link: "/identity/administration/users/user/edit?userId=[id]",
+ icon: ,
+ color: "success",
+ target: "_self",
+ },
+ {
+ //tested
+ label: "Research Compromised Account",
+ type: "GET",
+ icon: ,
+ link: "/identity/administration/users/user/bec?userId=[id]",
+ confirmText: "Are you sure you want to research this compromised account?",
+ multiPost: false,
+ },
+ {
+ //tested
+
+ label: "Create Temporary Access Password",
+ type: "GET",
+ icon: ,
+ url: "/api/ExecCreateTAP",
+ data: { ID: "userPrincipalName" },
+ confirmText: "Are you sure you want to create a Temporary Access Password?",
+ multiPost: false,
+ },
+ {
+ //tested
+ label: "Re-require MFA registration",
+ type: "GET",
+ icon: ,
+ url: "/api/ExecResetMFA",
+ data: { ID: "userPrincipalName" },
+ confirmText: "Are you sure you want to reset MFA for this user?",
+ multiPost: false,
+ },
+ {
+ //tested
+ label: "Send MFA Push",
+ type: "POST",
+ icon: ,
+ url: "/api/ExecSendPush",
+ data: { UserEmail: "userPrincipalName" },
+ confirmText: "Are you sure you want to send an MFA request?",
+ multiPost: false,
+ },
+ {
+ //tested
+ label: "Set Per-User MFA",
+ type: "POST",
+ icon: ,
+ url: "/api/ExecPerUserMFA",
+ data: { userId: "userPrincipalName" },
+ fields: [
+ {
+ type: "autoComplete",
+ name: "State",
+ label: "State",
+ options: [
+ { label: "Enforced", value: "Enforced" },
+ { label: "Enabled", value: "Enabled" },
+ { label: "Disabled", value: "Disabled" },
+ ],
+ multiple: false,
+ },
+ ],
+ confirmText: "Are you sure you want to set per-user MFA for these users?",
+ multiPost: false,
+ },
+ {
+ //tested
+ label: "Convert to Shared Mailbox",
+ type: "GET",
+ icon: ,
+ url: "/api/ExecConvertToSharedMailbox",
+ data: { ID: "userPrincipalName" },
+ confirmText: "Are you sure you want to convert this user to a shared mailbox?",
+ multiPost: false,
+ },
+ {
+ label: "Convert to User Mailbox",
+ type: "GET",
+ icon: ,
+ 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",
+ type: "GET",
+ icon: ,
+ url: "/api/ExecEnableArchive",
+ data: { ID: "userPrincipalName" },
+ confirmText: "Are you sure you want to enable the online archive for this user?",
+ multiPost: false,
+ },
+ {
+ //tested
+ label: "Set Out of Office",
+ type: "POST",
+ icon: ,
+ url: "/api/ExecSetOoO",
+ data: {
+ userId: "userPrincipalName",
+ AutoReplyState: { value: "Enabled" },
+ tenantFilter: "Tenant",
+ },
+ fields: [{ type: "richText", name: "input", label: "Out of Office Message" }],
+ confirmText: "Are you sure you want to set the out of office?",
+ multiPost: false,
+ },
+
+ {
+ label: "Disable Out of Office",
+ type: "POST",
+ icon: ,
+ url: "/api/ExecSetOoO",
+ data: { user: "userPrincipalName", AutoReplyState: "Disabled" },
+ confirmText: "Are you sure you want to disable the out of office?",
+ multiPost: false,
+ },
+ {
+ label: "Add to Group",
+ type: "POST",
+ icon: ,
+ url: "/api/EditGroup",
+ data: { addMember: "userPrincipalName" },
+ fields: [
+ {
+ type: "autoComplete",
+ name: "groupId",
+ label: "Select a group to add the user to",
+ multiple: false,
+ creatable: false,
+ api: {
+ url: "/api/ListGroups",
+ labelField: "displayName",
+ valueField: "id",
+ addedField: {
+ groupType: "calculatedGroupType",
+ groupName: "displayName",
+ },
+ queryKey: `groups-${tenant}`,
+ },
+ },
+ ],
+ confirmText: "Are you sure you want to add the user to this group?",
+ },
+ {
+ label: "Disable Email Forwarding",
+ type: "POST",
+ url: "/api/ExecEmailForward",
+ icon: ,
+ data: {
+ username: "userPrincipalName",
+ userid: "userPrincipalName",
+ ForwardOption: "!disabled",
+ },
+ confirmText: "Are you sure you want to disable forwarding of this user's emails?",
+ multiPost: false,
+ },
+ {
+ label: "Pre-provision OneDrive",
+ type: "POST",
+ icon: ,
+ url: "/api/ExecOneDriveProvision",
+ data: { UserPrincipalName: "userPrincipalName" },
+ confirmText: "Are you sure you want to pre-provision OneDrive for this user?",
+ multiPost: false,
+ },
+ {
+ label: "Add OneDrive Shortcut",
+ type: "POST",
+ icon: ,
+ url: "/api/ExecOneDriveShortCut",
+ data: {
+ username: "userPrincipalName",
+ userid: "id",
+ },
+ fields: [
+ {
+ type: "autoComplete",
+ name: "siteUrl",
+ label: "Select a Site",
+ multiple: false,
+ creatable: false,
+ api: {
+ url: "/api/ListSites",
+ data: { type: "SharePointSiteUsage", URLOnly: true },
+ labelField: "webUrl",
+ valueField: "webUrl",
+ queryKey: `sharepointSites-${tenant}`,
+ },
+ },
+ ],
+ confirmText: "Select a SharePoint site to create a shortcut for:",
+ multiPost: false,
+ },
+ {
+ label: "Block Sign In",
+ type: "GET",
+ icon: ,
+ url: "/api/ExecDisableUser",
+ 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",
+ type: "GET",
+ icon: ,
+ url: "/api/ExecDisableUser",
+ 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)",
+ type: "GET",
+ icon: ,
+ url: "/api/ExecResetPass",
+ data: {
+ MustChange: true,
+ ID: "userPrincipalName",
+ displayName: "displayName",
+ },
+ confirmText:
+ "Are you sure you want to reset the password for this user? The user must change their password at next logon.",
+ multiPost: false,
+ },
+ {
+ label: "Reset Password",
+ type: "GET",
+ icon: ,
+ url: "/api/ExecResetPass",
+ data: {
+ MustChange: false,
+ ID: "userPrincipalName",
+ displayName: "displayName",
+ },
+ confirmText: "Are you sure you want to reset the password for this user?",
+ multiPost: false,
+ },
+ {
+ label: "Clear Immutable ID",
+ type: "GET",
+ icon: ,
+ url: "/api/ExecClrImmId",
+ data: {
+ ID: "id",
+ },
+ 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",
+ type: "GET",
+ icon: ,
+ url: "/api/ExecRevokeSessions",
+ data: { ID: "id", Username: "userPrincipalName" },
+ confirmText: "Are you sure you want to revoke all sessions for this user?",
+ multiPost: false,
+ },
+ {
+ label: "Delete User",
+ type: "GET",
+ icon: ,
+ url: "/api/RemoveUser",
+ data: { ID: "id" },
+ confirmText: "Are you sure you want to delete this user?",
+ multiPost: false,
+ },
+ ];
+};
+
+export default CippUserActions;
diff --git a/src/components/CippTable/CippDataTable.js b/src/components/CippTable/CippDataTable.js
index 0eb40ee4d575..6d59e6f372d6 100644
--- a/src/components/CippTable/CippDataTable.js
+++ b/src/components/CippTable/CippDataTable.js
@@ -46,6 +46,7 @@ export const CippDataTable = (props) => {
cardButton,
offCanvas = false,
noCard = false,
+ hideTitle = false,
refreshFunction,
incorrectDataMessage = "Data not in correct format",
onChange,
@@ -298,8 +299,12 @@ export const CippDataTable = (props) => {
) : (
// Render the table inside a Card
-
-
+ {cardButton || !hideTitle ? (
+ <>
+
+
+ >
+ ) : null}
{!Array.isArray(usedData) && usedData ? (
diff --git a/src/pages/email/administration/mailboxes/index.js b/src/pages/email/administration/mailboxes/index.js
index 146b7463a85a..d468d4fef10e 100644
--- a/src/pages/email/administration/mailboxes/index.js
+++ b/src/pages/email/administration/mailboxes/index.js
@@ -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";
@@ -13,11 +24,13 @@ const Page = () => {
label: "Edit permissions",
link: "/identity/administration/users/user/exchange?userId=[Id]",
color: "info",
+ icon: ,
},
{
label: "Research Compromised Account",
link: "/identity/administration/users/user/bec?userId=[UPN]",
color: "info",
+ icon: ,
},
{
label: "Send MFA Push",
@@ -27,10 +40,12 @@ const Page = () => {
UserEmail: "mail",
},
confirmText: "Are you sure you want to send an MFA request?",
+ icon: ,
},
{
label: "Convert to Shared Mailbox",
type: "GET",
+ icon: ,
url: "/api/ExecConvertToSharedMailbox",
data: {
ID: "UPN",
@@ -42,6 +57,7 @@ const Page = () => {
label: "Convert to User Mailbox",
type: "GET",
url: "/api/ExecConvertToSharedMailbox",
+ icon: ,
data: {
ID: "UPN",
ConvertToUser: true,
@@ -53,42 +69,68 @@ const Page = () => {
label: "Convert to Room Mailbox",
type: "GET",
url: "/api/ExecConvertToRoomMailbox",
+ icon: ,
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: ,
+ 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: ,
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: ,
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: ,
data: {
ID: "UPN",
},
confirmText: "Are you sure you want to start the managed folder assistant for this user?",
},
+ {
+ label: "Delete Mailbox",
+ type: "GET",
+ icon: , // Added
+ url: "/api/RemoveMailbox",
+ data: { ID: "UPN" },
+ confirmText: "Are you sure you want to delete this mailbox?",
+ multiPost: false,
+ },
];
// Define off-canvas details
@@ -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
];
diff --git a/src/pages/identity/administration/groups/index.js b/src/pages/identity/administration/groups/index.js
index dd174b573769..1fb57be03d1e 100644
--- a/src/pages/identity/administration/groups/index.js
+++ b/src/pages/identity/administration/groups/index.js
@@ -2,7 +2,8 @@ import { Button } from "@mui/material";
import { CippTablePage } from "/src/components/CippComponents/CippTablePage.jsx";
import { Layout as DashboardLayout } from "/src/layouts/index.js";
import Link from "next/link";
-import { EyeIcon } from "@heroicons/react/24/outline";
+import { EyeIcon, LockClosedIcon, LockOpenIcon, PencilIcon, TrashIcon } from "@heroicons/react/24/outline";
+import { LockOpen, Visibility, VisibilityOff } from "@mui/icons-material";
const Page = () => {
const pageTitle = "Groups";
@@ -12,13 +13,14 @@ const Page = () => {
label: "Edit Group",
link: "/identity/administration/groups/edit?groupId=[id]",
multiPost: false,
- icon: ,
+ icon: ,
color: "success",
},
{
label: "Hide from Global Address List",
type: "GET",
url: "/api/ExecGroupsHideFromGAL",
+ icon: ,
data: {
TenantFilter: "TenantFilter",
ID: "mail",
@@ -33,6 +35,7 @@ const Page = () => {
label: "Unhide from Global Address List",
type: "GET",
url: "/api/ExecGroupsHideFromGAL",
+ icon: ,
data: {
TenantFilter: "TenantFilter",
ID: "mail",
@@ -46,6 +49,7 @@ const Page = () => {
label: "Only allow messages from people inside the organisation",
type: "GET",
url: "/api/ExecGroupsDeliveryManagement",
+ icon: ,
data: {
TenantFilter: "TenantFilter",
ID: "mail",
@@ -59,6 +63,7 @@ const Page = () => {
{
label: "Allow messages from people inside and outside the organisation",
type: "GET",
+ icon: ,
url: "/api/ExecGroupsDeliveryManagement",
data: {
TenantFilter: "TenantFilter",
@@ -73,6 +78,7 @@ const Page = () => {
label: "Delete Group",
type: "GET",
url: "/api/ExecGroupsDelete",
+ icon: ,
data: {
ID: "id",
GroupType: "calculatedGroupType",
@@ -105,7 +111,17 @@ const Page = () => {
>
}
- apiUrl="/api/ListGroups"
+ apiUrl="/api/ListGraphRequest"
+ apiData={{
+ Endpoint: "groups",
+ $select:
+ "id,createdDateTime,displayName,description,mail,mailEnabled,mailNickname,resourceProvisioningOptions,securityEnabled,visibility,organizationId,onPremisesSamAccountName,membershipRule,grouptypes,onPremisesSyncEnabled,resourceProvisioningOptions,userPrincipalName,assignedLicenses",
+ $count: true,
+ $orderby: "displayName",
+ $top: 999,
+ manualPagination: true,
+ }}
+ apiDataKey="Results"
actions={actions}
offCanvas={offCanvas}
simpleColumns={[
@@ -115,6 +131,7 @@ const Page = () => {
"mailEnabled",
"mailNickname",
"calculatedGroupType",
+ "assignedLicenses",
"visibility",
"onPremisesSamAccountName",
"membershipRule",
diff --git a/src/pages/identity/administration/users/index.js b/src/pages/identity/administration/users/index.js
index 0c3c6c773375..c03a62bb56cd 100644
--- a/src/pages/identity/administration/users/index.js
+++ b/src/pages/identity/administration/users/index.js
@@ -1,312 +1,14 @@
-import { EyeIcon, MagnifyingGlassIcon, TrashIcon } from "@heroicons/react/24/outline";
import { CippTablePage } from "/src/components/CippComponents/CippTablePage.jsx";
import { Layout as DashboardLayout } from "/src/layouts/index.js";
-import {
- Archive,
- Block,
- Clear,
- CloudDone,
- Edit,
- Email,
- ForwardToInbox,
- GroupAdd,
- LockOpen,
- LockPerson,
- LockReset,
- MeetingRoom,
- NoMeetingRoom,
- Password,
- PersonOff,
- PhonelinkLock,
- PhonelinkSetup,
- Shortcut,
-} from "@mui/icons-material";
import { Button } from "@mui/material";
import Link from "next/link";
import { useSettings } from "/src/hooks/use-settings.js";
+import { CippUserActions } from "/src/components/CippComponents/CippUserActions.jsx";
const Page = () => {
const pageTitle = "Users";
const tenant = useSettings().currentTenant;
- const actions = [
- {
- //tested
- label: "View User",
- link: "/identity/administration/users/user?userId=[id]",
- multiPost: false,
- icon: ,
- color: "success",
- },
- {
- //tested
- label: "Edit User",
- link: "/identity/administration/users/user/edit?userId=[id]",
- icon: ,
- color: "success",
- target: "_self",
- },
- {
- //tested
- label: "Research Compromised Account",
- type: "GET",
- icon: ,
- link: "/identity/administration/users/user/bec?userId=[id]",
- confirmText: "Are you sure you want to research this compromised account?",
- multiPost: false,
- },
- {
- //tested
-
- label: "Create Temporary Access Password",
- type: "GET",
- icon: ,
- url: "/api/ExecCreateTAP",
- data: { ID: "userPrincipalName" },
- confirmText: "Are you sure you want to create a Temporary Access Password?",
- multiPost: false,
- },
- {
- //tested
- label: "Re-require MFA registration",
- type: "GET",
- icon: ,
- url: "/api/ExecResetMFA",
- data: { ID: "userPrincipalName" },
- confirmText: "Are you sure you want to reset MFA for this user?",
- multiPost: false,
- },
- {
- //tested
- label: "Send MFA Push",
- type: "POST",
- icon: ,
- url: "/api/ExecSendPush",
- data: { UserEmail: "userPrincipalName" },
- confirmText: "Are you sure you want to send an MFA request?",
- multiPost: false,
- },
- {
- //tested
- label: "Set Per-User MFA",
- type: "POST",
- icon: ,
- url: "/api/ExecPerUserMFA",
- data: { userId: "userPrincipalName" },
- fields: [
- {
- type: "autoComplete",
- name: "State",
- label: "State",
- options: [
- { label: "Enforced", value: "Enforced" },
- { label: "Enabled", value: "Enabled" },
- { label: "Disabled", value: "Disabled" },
- ],
- multiple: false,
- },
- ],
- confirmText: "Are you sure you want to set per-user MFA for these users?",
- multiPost: false,
- },
- {
- //tested
- label: "Convert to Shared Mailbox",
- type: "GET",
- icon: ,
- url: "/api/ExecConvertToSharedMailbox",
- data: { ID: "userPrincipalName" },
- confirmText: "Are you sure you want to convert this user to a shared mailbox?",
- multiPost: false,
- },
- {
- //tested
- label: "Enable Online Archive",
- type: "GET",
- icon: ,
- url: "/api/ExecEnableArchive",
- data: { ID: "userPrincipalName" },
- confirmText: "Are you sure you want to enable the online archive for this user?",
- multiPost: false,
- },
- {
- //tested
- label: "Set Out of Office",
- type: "POST",
- icon: ,
- url: "/api/ExecSetOoO",
- data: {
- userId: "userPrincipalName",
- AutoReplyState: { value: "Enabled" },
- tenantFilter: "Tenant",
- },
- fields: [{ type: "richText", name: "input", label: "Out of Office Message" }],
- confirmText: "Are you sure you want to set the out of office?",
- multiPost: false,
- },
-
- {
- label: "Disable Out of Office",
- type: "POST",
- icon: ,
- url: "/api/ExecSetOoO",
- data: { user: "userPrincipalName", AutoReplyState: "Disabled" },
- confirmText: "Are you sure you want to disable the out of office?",
- multiPost: false,
- },
- {
- label: "Add to Group",
- type: "POST",
- icon: ,
- url: "/api/EditGroup",
- data: { addMember: "userPrincipalName" },
- fields: [
- {
- type: "autoComplete",
- name: "groupId",
- label: "Select a group to add the user to",
- multiple: false,
- creatable: false,
- api: {
- url: "/api/ListGroups",
- labelField: "displayName",
- valueField: "id",
- addedField: {
- groupType: "calculatedGroupType",
- groupName: "displayName",
- },
- queryKey: `groups-${tenant}`,
- },
- },
- ],
- confirmText: "Are you sure you want to add the user to this group?",
- },
- {
- label: "Disable Email Forwarding",
- type: "POST",
- url: "/api/ExecEmailForward",
- icon: ,
- data: {
- username: "userPrincipalName",
- userid: "userPrincipalName",
- ForwardOption: "!disabled",
- },
- confirmText: "Are you sure you want to disable forwarding of this user's emails?",
- multiPost: false,
- },
- {
- label: "Pre-provision OneDrive",
- type: "POST",
- icon: ,
- url: "/api/ExecOneDriveProvision",
- data: { UserPrincipalName: "userPrincipalName" },
- confirmText: "Are you sure you want to pre-provision OneDrive for this user?",
- multiPost: false,
- },
- {
- label: "Add OneDrive Shortcut",
- type: "POST",
- icon: ,
- url: "/api/ExecOneDriveShortCut",
- data: {
- username: "userPrincipalName",
- userid: "id",
- },
- fields: [
- {
- type: "autoComplete",
- name: "siteUrl",
- label: "Select a Site",
- multiple: false,
- creatable: false,
- api: {
- url: "/api/ListSites",
- data: { type: "SharePointSiteUsage", URLOnly: true },
- labelField: "webUrl",
- valueField: "webUrl",
- queryKey: `sharepointSites-${tenant}`,
- },
- },
- ],
- confirmText: "Select a SharePoint site to create a shortcut for:",
- multiPost: false,
- },
- {
- label: "Block Sign In",
- type: "GET",
- icon: ,
- url: "/api/ExecDisableUser",
- data: { ID: "id" },
- confirmText: "Are you sure you want to block the sign-in for this user?",
- multiPost: false,
- },
- {
- label: "Unblock Sign In",
- type: "GET",
- icon: ,
- url: "/api/ExecDisableUser",
- data: { ID: "id", Enable: true },
- confirmText: "Are you sure you want to unblock sign-in for this user?",
- multiPost: false,
- },
- {
- label: "Reset Password (Must Change)",
- type: "GET",
- icon: ,
- url: "/api/ExecResetPass",
- data: {
- MustChange: true,
- ID: "userPrincipalName",
- displayName: "displayName",
- },
- confirmText:
- "Are you sure you want to reset the password for this user? The user must change their password at next logon.",
- multiPost: false,
- },
- {
- label: "Reset Password",
- type: "GET",
- icon: ,
- url: "/api/ExecResetPass",
- data: {
- MustChange: false,
- ID: "userPrincipalName",
- displayName: "displayName",
- },
- confirmText: "Are you sure you want to reset the password for this user?",
- multiPost: false,
- },
- {
- label: "Clear Immutable ID",
- type: "GET",
- icon: ,
- url: "/api/ExecClrImmId",
- data: {
- ID: "id",
- },
- confirmText: "Are you sure you want to clear the Immutable ID for this user?",
- multiPost: false,
- },
- {
- label: "Revoke all user sessions",
- type: "GET",
- icon: ,
- url: "/api/ExecRevokeSessions",
- data: { ID: "id", Username: "userPrincipalName" },
- confirmText: "Are you sure you want to revoke all sessions for this user?",
- multiPost: false,
- },
- {
- label: "Delete User",
- type: "GET",
- icon: ,
- url: "/api/RemoveUser",
- data: { ID: "id" },
- confirmText: "Are you sure you want to delete this user?",
- multiPost: false,
- },
- ];
-
const offCanvas = {
extendedInfoFields: [
"createdDateTime", // Created Date (UTC)
@@ -324,7 +26,7 @@ const Page = () => {
"id", // Unique ID
"otherMails", // Alternate Email Addresses
],
- actions: actions,
+ actions: CippUserActions(),
};
return (
@@ -354,7 +56,7 @@ const Page = () => {
$top: 999,
}}
apiDataKey="Results"
- actions={actions}
+ actions={CippUserActions()}
offCanvas={offCanvas}
simpleColumns={[
"accountEnabled",
diff --git a/src/pages/identity/administration/users/user/index.jsx b/src/pages/identity/administration/users/user/index.jsx
index 4f0b2bb22ae5..3ed348320120 100644
--- a/src/pages/identity/administration/users/user/index.jsx
+++ b/src/pages/identity/administration/users/user/index.jsx
@@ -4,7 +4,7 @@ import { useRouter } from "next/router";
import { ApiGetCall } from "/src/api/ApiCall";
import CippFormSkeleton from "/src/components/CippFormPages/CippFormSkeleton";
import CalendarIcon from "@heroicons/react/24/outline/CalendarIcon";
-import { Check, Mail } from "@mui/icons-material";
+import { AdminPanelSettings, Check, Group, Mail } from "@mui/icons-material";
import { HeaderedTabbedLayout } from "../../../../../layouts/HeaderedTabbedLayout";
import tabOptions from "./tabOptions";
import { CippCopyToClipBoard } from "../../../../../components/CippComponents/CippCopyToClipboard";
@@ -17,27 +17,7 @@ import { CippTimeAgo } from "../../../../../components/CippComponents/CippTimeAg
import { useEffect, useState } from "react";
import { usePopover } from "../../../../../hooks/use-popover";
import { useDialog } from "../../../../../hooks/use-dialog";
-import { EyeIcon, MagnifyingGlassIcon, TrashIcon } from "@heroicons/react/24/outline";
-import {
- Archive,
- Block,
- Clear,
- CloudDone,
- Edit,
- Email,
- ForwardToInbox,
- GroupAdd,
- LockOpen,
- LockPerson,
- LockReset,
- MeetingRoom,
- NoMeetingRoom,
- Password,
- PersonOff,
- PhonelinkLock,
- PhonelinkSetup,
- Shortcut,
-} from "@mui/icons-material";
+import CippUserActions from "/src/components/CippComponents/CippUserActions";
const Page = () => {
const popover = usePopover();
@@ -51,12 +31,23 @@ const Page = () => {
setWaiting(true);
}
}, [userId]);
+
const userRequest = ApiGetCall({
url: `/api/ListUsers?UserId=${userId}&tenantFilter=${userSettingsDefaults.currentTenant}`,
queryKey: `ListUsers-${userId}`,
waiting: waiting,
});
+ const userMemberOf = ApiGetCall({
+ url: "/api/ListGraphRequest",
+ data: {
+ Endpoint: `/users/${userId}/memberOf`,
+ tenantFilter: userSettingsDefaults.currentTenant,
+ $top: 99,
+ },
+ queryKey: `UserMemberOf-${userId}`,
+ });
+
const MFARequest = ApiGetCall({
url: "/api/ListGraphRequest",
data: {
@@ -356,288 +347,60 @@ const Page = () => {
},
];
}
- const actions = [
- {
- //tested
- label: "View User",
- link: "/identity/administration/users/user?userId=[id]",
- multiPost: false,
- icon: ,
- color: "success",
- },
- {
- //tested
- label: "Edit User",
- link: "/identity/administration/users/user/edit?userId=[id]",
- icon: ,
- color: "success",
- target: "_self",
- },
- {
- //tested
- label: "Research Compromised Account",
- type: "GET",
- icon: ,
- link: "/identity/administration/users/user/bec?userId=[id]",
- confirmText: "Are you sure you want to research this compromised account?",
- multiPost: false,
- },
- {
- //tested
- label: "Create Temporary Access Password",
- type: "GET",
- icon: ,
- url: "/api/ExecCreateTAP",
- data: { ID: "userPrincipalName" },
- confirmText: "Are you sure you want to create a Temporary Access Password?",
- multiPost: false,
- },
- {
- //tested
- label: "Rerequire MFA registration",
- type: "GET",
- icon: ,
- url: "/api/ExecResetMFA",
- data: { ID: "userPrincipalName" },
- confirmText: "Are you sure you want to reset MFA for this user?",
- multiPost: false,
- },
- {
- //tested
- label: "Send MFA Push",
- type: "POST",
- icon: ,
- url: "/api/ExecSendPush",
- data: { UserEmail: "userPrincipalName" },
- confirmText: "Are you sure you want to send an MFA request?",
- multiPost: false,
- },
- {
- //tested
- label: "Set Per-User MFA",
- type: "POST",
- icon: ,
- url: "/api/ExecPerUserMFA",
- data: { userId: "userPrincipalName" },
- fields: [
+ const groupMembershipItems = userMemberOf.isSuccess
+ ? [
{
- type: "autoComplete",
- name: "State",
- label: "State",
- options: [
- { label: "Enforced", value: "Enforced" },
- { label: "Enabled", value: "Enabled" },
- { label: "Disabled", value: "Disabled" },
- ],
- multiple: false,
+ id: 1,
+ cardLabelBox: {
+ cardLabelBoxHeader: ,
+ },
+ text: "Group Memberships",
+ subtext: "List of groups the user is a member of",
+ table: {
+ title: "Group Memberships",
+ hideTitle: true,
+ actions: [
+ {
+ label: "Edit Group",
+ link: "/identity/administration/groups/edit?groupId=[id]",
+ },
+ ],
+ data: userMemberOf?.data?.Results.filter(
+ (item) => item?.["@odata.type"] === "#microsoft.graph.group"
+ ),
+ simpleColumns: ["displayName", "groupTypes", "securityEnabled", "mailEnabled"],
+ },
},
- ],
- confirmText: "Are you sure you want to set per-user MFA for these users?",
- multiPost: false,
- },
- {
- //tested
- label: "Convert to Shared Mailbox",
- type: "GET",
- icon: ,
- url: "/api/ExecConvertToSharedMailbox",
- data: { ID: "userPrincipalName" },
- confirmText: "Are you sure you want to convert this user to a shared mailbox?",
- multiPost: false,
- },
- {
- //tested
- label: "Enable Online Archive",
- type: "GET",
- icon: ,
- url: "/api/ExecEnableArchive",
- data: { ID: "userPrincipalName" },
- confirmText: "Are you sure you want to enable the online archive for this user?",
- multiPost: false,
- },
- {
- //tested
- label: "Set Out of Office",
- type: "POST",
- icon: ,
- url: "/api/ExecSetOoO",
- data: {
- userId: "userPrincipalName",
- AutoReplyState: { value: "Enabled" },
- },
- fields: [{ type: "richText", name: "input", label: "Out of Office Message" }],
- confirmText: "Are you sure you want to set the out of office?",
- multiPost: false,
- },
+ ]
+ : [];
- {
- label: "Disable Out of Office",
- type: "POST",
- icon: ,
- url: "/api/ExecSetOoO",
- data: { user: "userPrincipalName", AutoReplyState: "Disabled" },
- confirmText: "Are you sure you want to disable the out of office?",
- multiPost: false,
- },
- {
- label: "Add to Group",
- type: "POST",
- icon: ,
- url: "/api/EditGroup",
- data: { addMember: "userPrincipalName" },
- fields: [
+ const roleMembershipItems = userMemberOf.isSuccess
+ ? [
{
- type: "autoComplete",
- name: "groupId",
- label: "Select a group to add the user to",
- multiple: false,
- creatable: false,
- api: {
- url: "/api/ListGroups",
- labelField: "displayName",
- valueField: "id",
- addedField: {
- groupType: "calculatedGroupType",
- groupName: "displayName",
- },
- queryKey: `groups-${userSettingsDefaults.currentTenant}}`,
+ id: 1,
+ cardLabelBox: {
+ cardLabelBoxHeader: ,
},
- },
- ],
- confirmText: "Are you sure you want to add the user to this group?",
- },
- {
- label: "Disable Email Forwarding",
- type: "POST",
- url: "/api/ExecEmailForward",
- icon: ,
- data: {
- username: "userPrincipalName",
- userid: "userPrincipalName",
- ForwardOption: "!disabled",
- },
- confirmText: "Are you sure you want to disable forwarding of this user's emails?",
- multiPost: false,
- },
- {
- label: "Pre-provision OneDrive",
- type: "POST",
- icon: ,
- url: "/api/ExecOneDriveProvision",
- data: { UserPrincipalName: "userPrincipalName" },
- confirmText: "Are you sure you want to pre-provision OneDrive for this user?",
- multiPost: false,
- },
- {
- label: "Add OneDrive Shortcut",
- type: "POST",
- icon: ,
- url: "/api/ExecOneDriveShortCut",
- data: {
- username: "userPrincipalName",
- userid: "id",
- },
- fields: [
- {
- type: "autoComplete",
- name: "siteUrl",
- label: "Select a Site",
- multiple: false,
- creatable: false,
- api: {
- url: "/api/ListSites",
- data: { type: "SharePointSiteUsage", URLOnly: true },
- labelField: "webUrl",
- valueField: "webUrl",
- queryKey: `sharepointSites-${userSettingsDefaults.currentTenant}}`,
+ text: "Roles",
+ subtext: "List of roles the user is a member of",
+ table: {
+ title: "Role Memberships",
+ hideTitle: true,
+ data: userMemberOf?.data?.Results.filter(
+ (item) => item?.["@odata.type"] === "#microsoft.graph.directoryRole"
+ ),
+ simpleColumns: ["displayName", "description"],
},
},
- ],
- confirmText: "Select a SharePoint site to create a shortcut for:",
- multiPost: false,
- },
- {
- label: "Block Sign In",
- type: "GET",
- icon: ,
- url: "/api/ExecDisableUser",
- data: { ID: "id" },
- confirmText: "Are you sure you want to block the sign-in for this user?",
- multiPost: false,
- },
- {
- label: "Unblock Sign In",
- type: "GET",
- icon: ,
- url: "/api/ExecDisableUser",
- data: { ID: "id", Enable: true },
- confirmText: "Are you sure you want to unblock sign-in for this user?",
- multiPost: false,
- },
- {
- label: "Reset Password (Must Change)",
- type: "GET",
- icon: ,
- url: "/api/ExecResetPass",
- data: {
- MustChange: true,
- ID: "userPrincipalName",
- displayName: "displayName",
- },
- confirmText:
- "Are you sure you want to reset the password for this user? The user must change their password at next logon.",
- multiPost: false,
- },
- {
- label: "Reset Password",
- type: "GET",
- icon: ,
- url: "/api/ExecResetPass",
- data: {
- MustChange: false,
- ID: "userPrincipalName",
- displayName: "displayName",
- },
- confirmText: "Are you sure you want to reset the password for this user?",
- multiPost: false,
- },
- {
- label: "Clear Immutable ID",
- type: "GET",
- icon: ,
- url: "/api/ExecClrImmId",
- data: {
- ID: "id",
- },
- confirmText: "Are you sure you want to clear the Immutable ID for this user?",
- multiPost: false,
- },
- {
- label: "Revoke all user sessions",
- type: "GET",
- icon: ,
- url: "/api/ExecRevokeSessions",
- data: { ID: "id", Username: "userPrincipalName" },
- confirmText: "Are you sure you want to revoke all sessions for this user?",
- multiPost: false,
- },
- {
- label: "Delete User",
- type: "GET",
- icon: ,
- url: "/api/RemoveUser",
- data: { ID: "id" },
- confirmText: "Are you sure you want to delete this user?",
- multiPost: false,
- },
- ];
+ ]
+ : [];
return (
{
items={mfaDevicesItems}
isCollapsible={mfaDevicesItems.length > 0 ? true : false}
/>
+ Memberships
+ 0 ? true : false}
+ />
+ 0 ? true : false}
+ />
diff --git a/src/pages/index.js b/src/pages/index.js
index 27edd71fbb1e..0c60b06fe5a2 100644
--- a/src/pages/index.js
+++ b/src/pages/index.js
@@ -259,7 +259,7 @@ const Page = () => {
label: "",
value: domain.name,
}))}
- cardButton={
+ actionButton={
organization.data?.verifiedDomains?.length > 3 && (